├── .build.ci.sh ├── .ci ├── github │ ├── Singularity │ └── setup-github-runner.sh └── gitlab │ └── setup-gitlab-runner.sh ├── .github └── workflows │ └── main.yml ├── .gitignore ├── .gitlab-ci.yml ├── .travis.yml ├── Analysis ├── CMakeLists.txt ├── DumpEvent │ ├── CMakeLists.txt │ └── src │ │ ├── DumpMCParticleAlg.cpp │ │ ├── DumpMCParticleAlg.h │ │ ├── DumpSimHitAlg.cpp │ │ ├── DumpTrackAlg.cpp │ │ └── DumpTrackAlg.h ├── TotalInvMass │ ├── CMakeLists.txt │ └── src │ │ ├── TotalInvMass.cc │ │ └── TotalInvMass.hh └── TrackInspect │ ├── CMakeLists.txt │ └── src │ ├── TrackInspectAlg.cpp │ └── TrackInspectAlg.h ├── CMakeLists.txt ├── Detector ├── CMakeLists.txt ├── DetCEPCv4 │ ├── CMakeLists.txt │ ├── compact │ │ ├── Beampipe_o1_v01_01.xml │ │ ├── CepCBeamPipe_v01_01.xml │ │ ├── CepC_v4-onlyECAL.xml │ │ ├── CepC_v4-onlyTracker.xml │ │ ├── CepC_v4-onlyTrackerECAL.xml │ │ ├── CepC_v4-onlyVXD.xml │ │ ├── CepC_v4-patch-BeamECRing.xml │ │ ├── CepC_v4.xml │ │ ├── FullDetGear.xml │ │ ├── LumiCal.xml │ │ ├── README.md │ │ ├── SEcal05_siw_Barrel.xml │ │ ├── SEcal05_siw_ECRing_01.xml │ │ ├── SEcal05_siw_ECRing_02.xml │ │ ├── SEcal05_siw_Endcaps.xml │ │ ├── SHcalRpc01_Barrel_01.xml │ │ ├── SHcalRpc01_EndcapRing_01.xml │ │ ├── SHcalRpc01_Endcaps_01.xml │ │ ├── SServices00.xml │ │ ├── Yoke05_Barrel.xml │ │ ├── Yoke05_Endcaps.xml │ │ ├── basic_defs.xml │ │ ├── coil03.xml │ │ ├── detector_types.xml │ │ ├── display.xml │ │ ├── ecal_defs.xml │ │ ├── elements.xml │ │ ├── envelope_defs.xml │ │ ├── fcal_defs.xml │ │ ├── ftd_cepc_01.xml │ │ ├── ftd_cepc_02.xml │ │ ├── ftd_simple_staggered_02.xml │ │ ├── hcal_defs.xml │ │ ├── limits.xml │ │ ├── materials.xml │ │ ├── misc_defs.xml │ │ ├── services_defs.xml │ │ ├── set_simple_planar_sensors_01.xml │ │ ├── sit_simple_pixel_sensors_01.xml │ │ ├── sit_simple_pixel_sensors_02.xml │ │ ├── sit_simple_planar_sensors_01.xml │ │ ├── top_defs.xml │ │ ├── top_defs_CepC_v04.xml │ │ ├── tpc10_01.xml │ │ ├── tracker_defs.xml │ │ ├── tube_defs.xml │ │ ├── vxd07_01.xml │ │ ├── vxd07_02.xml │ │ └── yoke_defs.xml │ └── src │ │ ├── calorimeter │ │ ├── SEcal05_Barrel.cpp │ │ ├── SEcal05_ECRing.cpp │ │ ├── SEcal05_Endcaps.cpp │ │ ├── SEcal05_Helpers.cpp │ │ ├── SEcal05_Helpers.h │ │ ├── SHcalRpc01_Barrel.cpp │ │ ├── SHcalRpc01_EndcapRing.cpp │ │ ├── SHcalRpc01_Endcaps.cpp │ │ ├── SHcalRpc02_Barrel.cpp │ │ ├── SHcalSc04_Barrel_v04.cpp │ │ ├── SHcalSc04_Endcaps_v01.cpp │ │ ├── Yoke05_Barrel.cpp │ │ └── Yoke05_Endcaps.cpp │ │ ├── include │ │ ├── FieldMapBrBz.h │ │ ├── FieldMapXYZ.h │ │ ├── LcgeoExceptions.h │ │ ├── XMLHandlerDB.h │ │ └── lcgeo.h │ │ ├── other │ │ ├── BoxSupport_o1_v01_geo.cpp │ │ ├── SCoil02_geo.cpp │ │ └── TubeSupport_o1_v01_geo.cpp │ │ └── tracker │ │ ├── FTD_Simple_Staggered.h │ │ ├── FTD_Simple_Staggered_geo.cpp │ │ ├── FTD_cepc_geo.cpp │ │ ├── SET_Simple_Planar_geo.cpp │ │ ├── SIT_Simple_Pixel_geo.cpp │ │ ├── SIT_Simple_Planar_geo.cpp │ │ ├── TPC10_geo.cpp │ │ └── VXD04_geo.cpp ├── DetCRD │ ├── CMakeLists.txt │ ├── compact │ │ ├── CRD_common_v01 │ │ │ ├── Beampipe_v01_01.xml │ │ │ ├── Beampipe_v01_02.xml │ │ │ ├── Coil_Simple_v01_01.xml │ │ │ ├── DC_Simple_v01_03.xml │ │ │ ├── DC_Simple_v01_05.xml │ │ │ ├── DC_Stero_v01_01.xml │ │ │ ├── DC_Straight_v01_01.xml │ │ │ ├── DC_Straight_v01_02.xml │ │ │ ├── Ecal_Crystal_Barrel_v01_01.xml │ │ │ ├── Ecal_Rotated_Crystal_v01_01.xml │ │ │ ├── FTD_SimpleStaggered_v01_01.xml │ │ │ ├── FTD_SimpleStaggered_v01_02.xml │ │ │ ├── FTD_SkewRing_v01_01.xml │ │ │ ├── FTD_SkewRing_v01_02.xml │ │ │ ├── FTD_SkewRing_v01_03.xml │ │ │ ├── Hcal_Rpc_Barrel_v01_01.xml │ │ │ ├── Hcal_Rpc_Endcaps_v01_01.xml │ │ │ ├── SET_SimplePixel_v01_01.xml │ │ │ ├── SET_SimplePlanar_v01_01.xml │ │ │ ├── SET_SimplePlanar_v01_02.xml │ │ │ ├── SHcalSc04_Barrel_v04_01.xml │ │ │ ├── SHcalSc04_Endcaps_v01_01.xml │ │ │ ├── SIT_SimplePixel_v01_01.xml │ │ │ ├── SIT_SimplePixel_v01_02.xml │ │ │ ├── SIT_SimplePlanar_v01_01.xml │ │ │ ├── VXD_StaggeredLadder_v01_01.xml │ │ │ ├── VXD_v01_01.xml │ │ │ ├── VXD_v01_02.xml │ │ │ ├── VXD_v01_03.xml │ │ │ ├── Yoke_Barrel_v01_01.xml │ │ │ ├── Yoke_Endcaps_v01_01.xml │ │ │ └── materials.xml │ │ ├── CRD_o1_v01 │ │ │ ├── Br.csv │ │ │ ├── Bz.csv │ │ │ ├── CRD_Dimensions_v01_01.xml │ │ │ ├── CRD_o1_v01-onlyTracker-non.xml │ │ │ ├── CRD_o1_v01-onlyTracker.xml │ │ │ └── CRD_o1_v01.xml │ │ ├── CRD_o1_v02 │ │ │ ├── CRD_Dimensions_v01_02.xml │ │ │ ├── CRD_o1_v02-onlyEcalB.xml │ │ │ ├── CRD_o1_v02-onlyTracker.xml │ │ │ └── CRD_o1_v02.xml │ │ ├── CRD_o1_v03 │ │ │ ├── CRD_Dimensions_v01_03.xml │ │ │ ├── CRD_o1_v03-onlyTracker.xml │ │ │ ├── CRD_o1_v03-onlyVXD.xml │ │ │ └── CRD_o1_v03.xml │ │ ├── CRD_o1_v04 │ │ │ ├── CRD_Dimensions_v01_04.xml │ │ │ ├── CRD_o1_v04-onlyTracker.xml │ │ │ └── CRD_o1_v04.xml │ │ ├── README.md │ │ ├── Standalone │ │ │ ├── Dimensions_v01_01.xml │ │ │ ├── Standalone-EcalRotCrystal.xml │ │ │ └── Standalone-SHcalSc04.xml │ │ ├── elements.xml │ │ └── materials.xml │ ├── scripts │ │ ├── CRD-Sim.py │ │ ├── CRD_VXD_MOST2-sim.py │ │ ├── CRD_o1_v01-SimRec.py │ │ ├── CRD_o1_v02-SimRec.py │ │ └── Standalone-Sim-RotCrystal.py │ └── src │ │ ├── Calorimeter │ │ ├── CRDEcal.cpp │ │ ├── CRDEcal_v01.cpp │ │ ├── RotatedCrystalCalorimeter_v01_geo.cpp │ │ └── RotatedPolyhedraBarrelCalorimeter_v01_geo.cpp │ │ ├── Other │ │ ├── CRDBeamPipe_v01_geo.cpp │ │ └── OtherDetectorHelpers.h │ │ └── Tracker │ │ ├── SiTrackerSkewRing_v01_geo.cpp │ │ └── SiTrackerStaggeredLadder_v01_geo.cpp ├── DetDriftChamber │ ├── CMakeLists.txt │ ├── compact │ │ ├── det.xml │ │ ├── det_stero.xml │ │ ├── elements.xml │ │ └── materials.xml │ └── src │ │ └── driftchamber │ │ └── DriftChamber.cpp ├── DetEcalMatrix │ ├── CMakeLists.txt │ ├── compact │ │ ├── det.xml │ │ ├── elements.xml │ │ └── materials.xml │ └── src │ │ └── calorimeter │ │ └── EcalMatrix.cpp ├── DetInterface │ ├── CMakeLists.txt │ └── include │ │ └── DetInterface │ │ └── IGeomSvc.h ├── DetSegmentation │ ├── CMakeLists.txt │ ├── include │ │ └── DetSegmentation │ │ │ └── GridDriftChamber.h │ └── src │ │ ├── GridDriftChamber.cpp │ │ └── plugins │ │ └── SegmentationFactories.cpp ├── GeomSvc │ ├── CMakeLists.txt │ └── src │ │ ├── GeomSvc.cpp │ │ └── GeomSvc.h ├── Identifier │ ├── CMakeLists.txt │ └── include │ │ └── Identifier │ │ └── CEPCConf.h └── MagneticFieldMap │ ├── CMakeLists.txt │ └── src │ ├── FieldMapFileProvider.cpp │ ├── FieldMapFileProvider.h │ ├── GenericBFieldMapBrBz.cpp │ ├── GenericBFieldMapBrBz.h │ ├── GenericBFieldMapBrBzFactory.cpp │ └── IFieldMapProvider.h ├── Digitisers ├── CMakeLists.txt ├── DCHDigi │ ├── CMakeLists.txt │ └── src │ │ ├── DCHDigiAlg.cpp │ │ └── DCHDigiAlg.h ├── G2CDArbor │ ├── CMakeLists.txt │ └── src │ │ ├── G2CDArborAlg.cpp │ │ ├── G2CDArborAlg.h │ │ └── cellIDDecoder.h ├── SimHitMerge │ ├── CMakeLists.txt │ └── src │ │ ├── SimHitMergeAlg.cpp │ │ └── SimHitMergeAlg.h └── SimpleDigi │ ├── CMakeLists.txt │ └── src │ ├── CylinderDigiAlg.cpp │ ├── CylinderDigiAlg.h │ ├── PlanarDigiAlg.cpp │ ├── PlanarDigiAlg.h │ ├── TPCDigiAlg.cpp │ ├── TPCDigiAlg.h │ ├── voxel.cpp │ └── voxel.h ├── Dockerfile ├── Examples ├── CMakeLists.txt ├── include │ └── Examples │ │ └── IFirstSvc.h ├── options │ ├── LCIO_read.py │ ├── LCIO_read_G2CD.py │ ├── LCIO_read_pan.py │ ├── detsim_tracker.py │ ├── dump_simhit.py │ ├── dumpid.py │ ├── edm4hep_read.py │ ├── edm4hep_write.py │ ├── gen_write.py │ ├── helloalg.py │ ├── plcio_read.py │ ├── plcio_write.py │ ├── secondalg.py │ ├── sim-rec-trackerecal.py │ ├── tracker_analysis.py │ ├── tut_analysis_TotalInvMass.py │ ├── tut_detsim.py │ ├── tut_detsim_G2CD.py │ ├── tut_detsim_SDT.py │ ├── tut_detsim_SDT_Heed.py │ ├── tut_detsim_digi_SDT.py │ ├── tut_detsim_digi_fit_DC.py │ ├── tut_detsim_digi_truthTracker_SDT.py │ ├── tut_detsim_digi_truthTracker_SDT_dedx.py │ ├── tut_detsim_pan_matrix.py │ ├── tut_detsim_pandora.py │ └── vis.mac └── src │ ├── DumpIDAlg │ ├── DumpIDAlg.cpp │ └── DumpIDAlg.h │ ├── Edm4hepTest │ ├── Edm4hepReadAlg.cpp │ ├── Edm4hepReadAlg.h │ ├── Edm4hepReadDCAlg.cpp │ ├── Edm4hepReadDCAlg.h │ ├── Edm4hepWriteAlg.cpp │ └── Edm4hepWriteAlg.h │ ├── FirstSvc │ ├── FirstSvc.cpp │ └── FirstSvc.h │ ├── HelloWorld │ ├── HelloAlg.cpp │ └── HelloAlg.h │ ├── PlcioTest │ ├── PlcioReadAlg.cpp │ ├── PlcioReadAlg.h │ ├── PlcioWriteAlg.cpp │ └── PlcioWriteAlg.h │ └── SecondAlg │ ├── SecondAlg.cpp │ └── SecondAlg.h ├── Generator ├── CMakeLists.txt └── src │ ├── BeamBackgroundFileParserV0.cpp │ ├── BeamBackgroundFileParserV0.h │ ├── GenAlgo.cpp │ ├── GenAlgo.h │ ├── GenEvent.cpp │ ├── GenEvent.h │ ├── GenPrinter.cpp │ ├── GenPrinter.h │ ├── GenReader.cpp │ ├── GenReader.h │ ├── GtBeamBackgroundTool.cpp │ ├── GtBeamBackgroundTool.h │ ├── GtGunTool.cpp │ ├── GtGunTool.h │ ├── GuineaPigPairsFileParser.cpp │ ├── GuineaPigPairsFileParser.h │ ├── HepMCRdr.cpp │ ├── HepMCRdr.h │ ├── HepevtRdr.cpp │ ├── HepevtRdr.h │ ├── IBeamBackgroundFileParser.h │ ├── IGenTool.cpp │ ├── IGenTool.h │ ├── LCAscHepRdr.cc │ ├── LCAscHepRdr.h │ ├── SLCIORdr.cpp │ ├── SLCIORdr.h │ ├── StdHepRdr.cpp │ └── StdHepRdr.h ├── README.md ├── Reconstruction ├── CMakeLists.txt ├── DCHDedx │ ├── CMakeLists.txt │ └── src │ │ ├── RecDCHDedxAlg.cpp │ │ └── RecDCHDedxAlg.h ├── Digi_Calo │ ├── CMakeLists.txt │ └── src │ │ ├── CaloDigiAlg.cpp │ │ └── CaloDigiAlg.h ├── PFA │ ├── Arbor │ │ ├── CMakeLists.txt │ │ └── src │ │ │ ├── Arbor.cc │ │ │ ├── Arbor.h │ │ │ ├── ArborHit.cc │ │ │ ├── ArborHit.h │ │ │ ├── ArborTool.cc │ │ │ ├── ArborTool.h │ │ │ ├── ArborToolLCIO.cc │ │ │ ├── ArborToolLCIO.hh │ │ │ ├── BushConnect.cc │ │ │ ├── BushConnect.hh │ │ │ ├── ClusterAna.cc │ │ │ ├── ClusterAna.hh │ │ │ ├── DetectorPos.cc │ │ │ ├── DetectorPos.hh │ │ │ ├── HelixClassD.cc │ │ │ ├── HelixClassD.hh │ │ │ ├── KDTreeLinkerAlgoT.h │ │ │ ├── KDTreeLinkerToolsT.h │ │ │ ├── MarlinArbor.cc │ │ │ ├── MarlinArbor.hh │ │ │ └── cellIDDecoder.h │ ├── CMakeLists.txt │ └── Pandora │ │ ├── CMakeLists.txt │ │ ├── GaudiPandora │ │ ├── CMakeLists.txt │ │ ├── include │ │ │ ├── CaloHitCreator.h │ │ │ ├── GeometryCreator.h │ │ │ ├── MCParticleCreator.h │ │ │ ├── PandoraPFAlg.h │ │ │ ├── PfoCreator.h │ │ │ ├── TrackCreator.h │ │ │ ├── Utility.h │ │ │ └── cellIDDecoder.h │ │ └── src │ │ │ ├── CaloHitCreator.cpp │ │ │ ├── GeometryCreator.cpp │ │ │ ├── MCParticleCreator.cpp │ │ │ ├── PandoraPFAlg.cpp │ │ │ ├── PfoCreator.cpp │ │ │ ├── TrackCreator.cpp │ │ │ └── Utility.cpp │ │ ├── MatrixPandora │ │ ├── CMakeLists.txt │ │ ├── include │ │ │ ├── CaloHitCreator.h │ │ │ ├── GeometryCreator.h │ │ │ ├── MCParticleCreator.h │ │ │ ├── PandoraMatrixAlg.h │ │ │ ├── PfoCreator.h │ │ │ ├── TrackCreator.h │ │ │ ├── Utility.h │ │ │ └── cellIDDecoder.h │ │ └── src │ │ │ ├── CaloHitCreator.cpp │ │ │ ├── GeometryCreator.cpp │ │ │ ├── MCParticleCreator.cpp │ │ │ ├── PandoraMatrixAlg.cpp │ │ │ ├── PfoCreator.cpp │ │ │ ├── TrackCreator.cpp │ │ │ └── Utility.cpp │ │ ├── PandoraLikelihoodData9EBin.xml │ │ └── PandoraSettingsDefault.xml ├── RecAssociationMaker │ ├── CMakeLists.txt │ └── src │ │ ├── TrackParticleRelationAlg.cpp │ │ └── TrackParticleRelationAlg.h ├── RecGenfitAlg │ ├── CMakeLists.txt │ ├── README.md │ └── src │ │ ├── GenfitField.cpp │ │ ├── GenfitField.h │ │ ├── GenfitFitter.cpp │ │ ├── GenfitFitter.h │ │ ├── GenfitHit.cpp │ │ ├── GenfitHit.h │ │ ├── GenfitMaterialInterface.cpp │ │ ├── GenfitMaterialInterface.h │ │ ├── GenfitTrack.cpp │ │ ├── GenfitTrack.h │ │ ├── GenfitUnit.h │ │ ├── LSFitting.cpp │ │ ├── LSFitting.h │ │ ├── PlanarMeasurementSDT.cpp │ │ ├── PlanarMeasurementSDT.h │ │ ├── RecGenfitAlgDC.cpp │ │ ├── RecGenfitAlgDC.h │ │ ├── RecGenfitAlgSDT.cpp │ │ ├── RecGenfitAlgSDT.h │ │ ├── WireMeasurementDC.cpp │ │ └── WireMeasurementDC.h ├── SiliconTracking │ ├── CMakeLists.txt │ └── src │ │ ├── ForwardTrackingAlg.cpp │ │ ├── ForwardTrackingAlg.h │ │ ├── SiliconTrackingAlg.cpp │ │ ├── SiliconTrackingAlg.h │ │ ├── SpacePointBuilderAlg.cpp │ │ ├── SpacePointBuilderAlg.h │ │ ├── TrackSubsetAlg.cpp │ │ └── TrackSubsetAlg.h └── Tracking │ ├── CMakeLists.txt │ ├── include │ └── Tracking │ │ ├── ITrackFitterTool.h │ │ └── TrackingHelper.h │ └── src │ ├── Clupatra │ ├── ClupatraAlg.cpp │ ├── ClupatraAlg.h │ ├── NNClusterer.h │ ├── RuntimeMap.h │ ├── clupatra_new.cpp │ └── clupatra_new.h │ ├── FitterTool │ ├── KalTestTool.cpp │ └── KalTestTool.h │ ├── FullLDCTracking │ ├── FullLDCTrackingAlg.cpp │ └── FullLDCTrackingAlg.h │ └── TruthTracker │ ├── TruthTrackerAlg.cpp │ └── TruthTrackerAlg.h ├── Service ├── CMakeLists.txt ├── EventSeeder │ ├── CMakeLists.txt │ ├── README.md │ ├── include │ │ └── EventSeeder │ │ │ └── IEventSeeder.h │ └── src │ │ ├── MarlinEvtSeeder.cpp │ │ ├── MarlinEvtSeeder.h │ │ └── jenkinsHash.h ├── GearSvc │ ├── CMakeLists.txt │ ├── include │ │ └── GearSvc │ │ │ └── IGearSvc.h │ └── src │ │ ├── GearSvc.cpp │ │ └── GearSvc.h └── TrackSystemSvc │ ├── CMakeLists.txt │ ├── include │ └── TrackSystemSvc │ │ ├── ConfigFlags.h │ │ ├── HelixFit.h │ │ ├── HelixTrack.h │ │ ├── IMarlinTrack.h │ │ ├── IMarlinTrkSystem.h │ │ ├── ITrackSystemSvc.h │ │ ├── LCIOTrackPropagators.h │ │ └── MarlinTrkUtils.h │ └── src │ ├── HelixFit.cc │ ├── HelixTrack.cc │ ├── IMarlinTrack.cc │ ├── IMarlinTrkSystem.cc │ ├── LCIOTrackPropagators.cc │ ├── MarlinKalTest.cc │ ├── MarlinKalTest.h │ ├── MarlinKalTestTrack.cc │ ├── MarlinKalTestTrack.h │ ├── MarlinTrkUtils.cc │ ├── TrackSystemSvc.cpp │ └── TrackSystemSvc.h ├── Simulation ├── CMakeLists.txt ├── DetSimAna │ ├── CMakeLists.txt │ └── src │ │ ├── Edm4hepWriterAnaElemTool.cpp │ │ ├── Edm4hepWriterAnaElemTool.h │ │ ├── ExampleAnaElemTool.cpp │ │ └── ExampleAnaElemTool.h ├── DetSimCore │ ├── CMakeLists.txt │ └── src │ │ ├── ActionInitialization.cpp │ │ ├── ActionInitialization.h │ │ ├── DetSimAlg.cpp │ │ ├── DetSimAlg.h │ │ ├── DetSimSvc.cpp │ │ ├── DetSimSvc.h │ │ ├── DetectorConstruction.cpp │ │ ├── DetectorConstruction.h │ │ ├── EventAction.cpp │ │ ├── EventAction.h │ │ ├── G4PrimaryCnvTool.cpp │ │ ├── G4PrimaryCnvTool.h │ │ ├── PrimaryGeneratorAction.cpp │ │ ├── PrimaryGeneratorAction.h │ │ ├── RunAction.cpp │ │ ├── RunAction.h │ │ ├── SteppingAction.cpp │ │ ├── SteppingAction.h │ │ ├── TrackingAction.cpp │ │ └── TrackingAction.h ├── DetSimDedx │ ├── CMakeLists.txt │ └── src │ │ ├── BetheBlochEquationDedxSimTool.cpp │ │ ├── BetheBlochEquationDedxSimTool.h │ │ ├── DummyDedxSimTool.cpp │ │ ├── DummyDedxSimTool.h │ │ ├── GFDndxSimTool.cpp │ │ ├── GFDndxSimTool.h │ │ ├── TrackHeedSimTool.cpp │ │ └── TrackHeedSimTool.h ├── DetSimFastModel │ ├── CMakeLists.txt │ └── src │ │ ├── DummyFastSimG4Model.cpp │ │ ├── DummyFastSimG4Model.h │ │ ├── DummyFastSimG4Tool.cpp │ │ ├── DummyFastSimG4Tool.h │ │ ├── EcalFastSimG4Model.cpp │ │ ├── EcalFastSimG4Model.h │ │ ├── EcalFastSimG4Tool.cpp │ │ └── EcalFastSimG4Tool.h ├── DetSimGeom │ ├── CMakeLists.txt │ └── src │ │ ├── AnExampleDetElemTool.cpp │ │ ├── AnExampleDetElemTool.h │ │ ├── WorldDetElemTool.cpp │ │ └── WorldDetElemTool.h ├── DetSimInterface │ ├── CMakeLists.txt │ ├── include │ │ └── DetSimInterface │ │ │ ├── CommonUserEventInfo.hh │ │ │ ├── CommonUserTrackInfo.hh │ │ │ ├── IAnaElemTool.h │ │ │ ├── IDedxSimTool.h │ │ │ ├── IDetElemTool.h │ │ │ ├── IDetSimSvc.h │ │ │ ├── IFastSimG4Tool.h │ │ │ ├── IG4PrimaryCnvTool.h │ │ │ └── ISensDetTool.h │ └── src │ │ ├── CommonUserEventInfo.cc │ │ ├── CommonUserTrackInfo.cc │ │ └── IDetSimSvc.cpp └── DetSimSD │ ├── CMakeLists.txt │ ├── include │ └── DetSimSD │ │ ├── CaloSensitiveDetector.h │ │ ├── DDG4SensitiveDetector.h │ │ └── Geant4Hits.h │ └── src │ ├── CaloSensitiveDetector.cpp │ ├── CalorimeterSensDetTool.cpp │ ├── CalorimeterSensDetTool.h │ ├── DDG4SensitiveDetector.cpp │ ├── DriftChamberSensDetTool.cpp │ ├── DriftChamberSensDetTool.h │ ├── DriftChamberSensitiveDetector.cpp │ ├── DriftChamberSensitiveDetector.h │ ├── Geant4Hits.cpp │ ├── GenericTrackerSensDetTool.cpp │ ├── GenericTrackerSensDetTool.h │ ├── GenericTrackerSensitiveDetector.cpp │ ├── GenericTrackerSensitiveDetector.h │ ├── TimeProjectionChamberSensDetTool.cpp │ ├── TimeProjectionChamberSensDetTool.h │ ├── TimeProjectionChamberSensitiveDetector.cpp │ ├── TimeProjectionChamberSensitiveDetector.h │ ├── TrackerCombineSensitiveDetector.cpp │ └── TrackerCombineSensitiveDetector.h ├── Utilities ├── CMakeLists.txt ├── DataHelper │ ├── CMakeLists.txt │ ├── include │ │ └── DataHelper │ │ │ ├── CaloHitExtended.h │ │ │ ├── Circle.h │ │ │ ├── ClusterExtended.h │ │ │ ├── ClusterShapes.h │ │ │ ├── GroupTracks.h │ │ │ ├── HelixClass.h │ │ │ ├── LCCylinder.h │ │ │ ├── LCGeometryTypes.h │ │ │ ├── LCLine3D.h │ │ │ ├── LCPlane3D.h │ │ │ ├── LineClass.h │ │ │ ├── Navigation.h │ │ │ ├── SimpleHelix.h │ │ │ ├── TrackExtended.h │ │ │ ├── TrackHelper.h │ │ │ ├── TrackHitPair.h │ │ │ ├── TrackerHitExtended.h │ │ │ ├── TrackerHitHelper.h │ │ │ └── Trajectory.h │ └── src │ │ ├── CaloHitExtended.cc │ │ ├── Circle.cc │ │ ├── ClusterExtended.cc │ │ ├── ClusterShapes.cc │ │ ├── GroupTracks.cc │ │ ├── HelixClass.cc │ │ ├── LCCylinder.cc │ │ ├── LCLine3D.cc │ │ ├── LCPlane3D.cc │ │ ├── LineClass.cc │ │ ├── Navigation.cpp │ │ ├── SimpleHelix.cc │ │ ├── TrackExtended.cc │ │ ├── TrackHelper.cc │ │ ├── TrackHitPair.cc │ │ ├── TrackerHitExtended.cc │ │ └── TrackerHitHelper.cpp ├── KalDet │ ├── CMakeLists.txt │ ├── include │ │ └── kaldet │ │ │ ├── EXEventGen.h │ │ │ ├── EXTPCHit.h │ │ │ ├── EXTPCKalDetector.h │ │ │ ├── EXTPCMeasLayer.h │ │ │ ├── EXVKalDetector.h │ │ │ ├── EXVMeasLayer.h │ │ │ ├── GearTPCCylinderHit.h │ │ │ ├── GearTPCCylinderMeasLayer.h │ │ │ ├── GearTPCHit.h │ │ │ ├── GearTPCKalDetector.h │ │ │ ├── GearTPCMeasLayer.h │ │ │ ├── ILDConeMeasLayer.h │ │ │ ├── ILDCylinderHit.h │ │ │ ├── ILDCylinderMeasLayer.h │ │ │ ├── ILDDiscMeasLayer.h │ │ │ ├── ILDFTDDiscBasedKalDetector.h │ │ │ ├── ILDFTDKalDetector.h │ │ │ ├── ILDMeasurementSurfaceStoreFiller.h │ │ │ ├── ILDParallelPlanarMeasLayer.h │ │ │ ├── ILDParallelPlanarStripMeasLayer.h │ │ │ ├── ILDPlanarHit.h │ │ │ ├── ILDPlanarMeasLayer.h │ │ │ ├── ILDPlanarStripHit.h │ │ │ ├── ILDPolygonBarrelMeasLayer.h │ │ │ ├── ILDRotatedTrapMeaslayer.h │ │ │ ├── ILDSETKalDetector.h │ │ │ ├── ILDSITCylinderKalDetector.h │ │ │ ├── ILDSITKalDetector.h │ │ │ ├── ILDSegmentedDiscMeasLayer.h │ │ │ ├── ILDSegmentedDiscStripMeasLayer.h │ │ │ ├── ILDSupportKalDetector.h │ │ │ ├── ILDTPCKalDetector.h │ │ │ ├── ILDVMeasLayer.h │ │ │ ├── ILDVTrackHit.h │ │ │ ├── ILDVXDKalDetector.h │ │ │ ├── LCTPCKalDetector.h │ │ │ └── MaterialDataBase.h │ └── src │ │ ├── gen │ │ ├── EXEventGen.cxx │ │ ├── EXEventGen.h │ │ └── LinkDef.h │ │ ├── ild │ │ ├── common │ │ │ ├── ILDConeMeasLayer.cc │ │ │ ├── ILDConeMeasLayer.h │ │ │ ├── ILDCylinderHit.cc │ │ │ ├── ILDCylinderHit.h │ │ │ ├── ILDCylinderMeasLayer.cc │ │ │ ├── ILDCylinderMeasLayer.h │ │ │ ├── ILDDiscMeasLayer.cc │ │ │ ├── ILDDiscMeasLayer.h │ │ │ ├── ILDMeasurementSurfaceStoreFiller.cc │ │ │ ├── ILDMeasurementSurfaceStoreFiller.h │ │ │ ├── ILDParallelPlanarMeasLayer.cc │ │ │ ├── ILDParallelPlanarMeasLayer.h │ │ │ ├── ILDParallelPlanarStripMeasLayer.cc │ │ │ ├── ILDParallelPlanarStripMeasLayer.h │ │ │ ├── ILDPlanarHit.cc │ │ │ ├── ILDPlanarHit.h │ │ │ ├── ILDPlanarMeasLayer.cc │ │ │ ├── ILDPlanarMeasLayer.h │ │ │ ├── ILDPlanarStripHit.cc │ │ │ ├── ILDPlanarStripHit.h │ │ │ ├── ILDPolygonBarrelMeasLayer.cc │ │ │ ├── ILDPolygonBarrelMeasLayer.h │ │ │ ├── ILDRotatedTrapMeaslayer.cc │ │ │ ├── ILDRotatedTrapMeaslayer.h │ │ │ ├── ILDSegmentedDiscMeasLayer.cc │ │ │ ├── ILDSegmentedDiscMeasLayer.h │ │ │ ├── ILDSegmentedDiscStripMeasLayer.cc │ │ │ ├── ILDSegmentedDiscStripMeasLayer.h │ │ │ ├── ILDVMeasLayer.cc │ │ │ ├── ILDVMeasLayer.h │ │ │ ├── ILDVTrackHit.h │ │ │ ├── MaterialDataBase.cc │ │ │ └── MaterialDataBase.h │ │ ├── ftd │ │ │ ├── ILDFTDDiscBasedKalDetector.cc │ │ │ ├── ILDFTDDiscBasedKalDetector.h │ │ │ ├── ILDFTDKalDetector.cc │ │ │ └── ILDFTDKalDetector.h │ │ ├── lctpc │ │ │ ├── LCTPCKalDetector.cc │ │ │ └── LCTPCKalDetector.h │ │ ├── set │ │ │ ├── ILDSETKalDetector.cc │ │ │ └── ILDSETKalDetector.h │ │ ├── sit │ │ │ ├── ILDSITCylinderKalDetector.cc │ │ │ ├── ILDSITCylinderKalDetector.h │ │ │ ├── ILDSITKalDetector.cc │ │ │ └── ILDSITKalDetector.h │ │ ├── support │ │ │ ├── ILDSupportKalDetector.cc │ │ │ └── ILDSupportKalDetector.h │ │ ├── tpc │ │ │ ├── ILDTPCKalDetector.cc │ │ │ └── ILDTPCKalDetector.h │ │ └── vxd │ │ │ ├── ILDVXDKalDetector.cc │ │ │ └── ILDVXDKalDetector.h │ │ ├── kern │ │ ├── EXVKalDetector.cxx │ │ ├── EXVKalDetector.h │ │ ├── EXVMeasLayer.cxx │ │ ├── EXVMeasLayer.h │ │ └── LinkDef.h │ │ ├── lctpc │ │ ├── doc │ │ │ ├── Doxyfile_html │ │ │ ├── Doxyfile_latex │ │ │ ├── GearTPC_mainpage.h │ │ │ └── Readme │ │ └── gearTPC │ │ │ ├── EXTPCHit.cxx │ │ │ ├── EXTPCHit.h │ │ │ ├── EXTPCKalDetector.cxx │ │ │ ├── EXTPCKalDetector.h │ │ │ ├── EXTPCMeasLayer.cxx │ │ │ ├── EXTPCMeasLayer.h │ │ │ ├── GearTPCCylinderHit.cxx │ │ │ ├── GearTPCCylinderHit.h │ │ │ ├── GearTPCCylinderMeasLayer.cxx │ │ │ ├── GearTPCCylinderMeasLayer.h │ │ │ ├── GearTPCHit.cxx │ │ │ ├── GearTPCHit.h │ │ │ ├── GearTPCKalDetector.cxx │ │ │ ├── GearTPCKalDetector.h │ │ │ ├── GearTPCMeasLayer.cxx │ │ │ ├── GearTPCMeasLayer.h │ │ │ └── LinkDef.h │ │ └── othertpc │ │ └── toytpc │ │ ├── EXTPCHit.cxx │ │ ├── EXTPCHit.h │ │ ├── EXTPCKalDetector.cxx │ │ ├── EXTPCKalDetector.h │ │ ├── EXTPCMeasLayer.cxx │ │ ├── EXTPCMeasLayer.h │ │ ├── Imakefile │ │ └── LinkDef.h ├── KalTest │ ├── CMakeLists.txt │ ├── include │ │ └── kaltest │ │ │ ├── KalTrackDim.h │ │ │ ├── TAttDrawable.h │ │ │ ├── TAttElement.h │ │ │ ├── TAttLockable.h │ │ │ ├── TCircle.h │ │ │ ├── TCutCone.h │ │ │ ├── TCylinder.h │ │ │ ├── THelicalTrack.h │ │ │ ├── THype.h │ │ │ ├── TKalDetCradle.h │ │ │ ├── TKalFilterCond.h │ │ │ ├── TKalMatrix.h │ │ │ ├── TKalTrack.h │ │ │ ├── TKalTrackSite.h │ │ │ ├── TKalTrackState.h │ │ │ ├── TPlane.h │ │ │ ├── TStraightTrack.h │ │ │ ├── TTube.h │ │ │ ├── TVCurve.h │ │ │ ├── TVKalDetector.h │ │ │ ├── TVKalSite.h │ │ │ ├── TVKalState.h │ │ │ ├── TVKalSystem.h │ │ │ ├── TVMeasLayer.h │ │ │ ├── TVSolid.h │ │ │ ├── TVSurface.h │ │ │ ├── TVTrack.h │ │ │ └── TVTrackHit.h │ └── src │ │ ├── geomlib │ │ ├── Imakefile │ │ ├── LinkDef.h │ │ ├── TCircle.cxx │ │ ├── TCircle.h │ │ ├── TCutCone.cxx │ │ ├── TCutCone.h │ │ ├── TCylinder.cxx │ │ ├── TCylinder.h │ │ ├── THelicalTrack.cxx │ │ ├── THelicalTrack.h │ │ ├── THype.cxx │ │ ├── THype.h │ │ ├── TPlane.cxx │ │ ├── TPlane.h │ │ ├── TStraightTrack.cxx │ │ ├── TStraightTrack.h │ │ ├── TTube.cxx │ │ ├── TTube.h │ │ ├── TVCurve.cxx │ │ ├── TVCurve.h │ │ ├── TVSolid.cxx │ │ ├── TVSolid.h │ │ ├── TVSurface.cxx │ │ ├── TVSurface.h │ │ ├── TVTrack.cxx │ │ └── TVTrack.h │ │ ├── kallib │ │ ├── Imakefile │ │ ├── LinkDef.h │ │ ├── TKalMatrix.cxx │ │ ├── TKalMatrix.h │ │ ├── TVKalSite.cxx │ │ ├── TVKalSite.h │ │ ├── TVKalState.cxx │ │ ├── TVKalState.h │ │ ├── TVKalSystem.cxx │ │ └── TVKalSystem.h │ │ ├── kaltracklib │ │ ├── Imakefile │ │ ├── KalTrackDim.h │ │ ├── LinkDef.h │ │ ├── TKalDetCradle.cxx │ │ ├── TKalDetCradle.h │ │ ├── TKalFilterCond.cxx │ │ ├── TKalFilterCond.h │ │ ├── TKalTrack.cxx │ │ ├── TKalTrack.h │ │ ├── TKalTrackSite.cxx │ │ ├── TKalTrackSite.h │ │ ├── TKalTrackState.cxx │ │ ├── TKalTrackState.h │ │ ├── TVKalDetector.cxx │ │ ├── TVKalDetector.h │ │ ├── TVMeasLayer.cxx │ │ ├── TVMeasLayer.h │ │ ├── TVTrackHit.cxx │ │ └── TVTrackHit.h │ │ └── utils │ │ ├── Imakefile │ │ ├── LinkDef.h │ │ ├── TAttDrawable.cxx │ │ ├── TAttDrawable.h │ │ ├── TAttElement.cxx │ │ ├── TAttElement.h │ │ ├── TAttLockable.cxx │ │ └── TAttLockable.h └── KiTrack │ ├── CMakeLists.txt │ ├── include │ ├── Criteria │ │ ├── Criteria.h │ │ └── ICriterion.h │ ├── ILDImpl │ │ ├── FTDHit01.h │ │ ├── FTDHitSimple.h │ │ ├── FTDNeighborPetalSecCon.h │ │ ├── FTDSectorConnector.h │ │ ├── FTDTrack.h │ │ ├── IFTDHit.h │ │ ├── SectorSystemFTD.h │ │ ├── SectorSystemVXD.h │ │ └── VXDHitSimple.h │ ├── KiTrack │ │ ├── Automaton.h │ │ ├── HopfieldNeuralNet.h │ │ ├── IHit.h │ │ ├── ISectorConnector.h │ │ ├── ISectorSystem.h │ │ ├── ITrack.h │ │ ├── KiTrackExceptions.h │ │ ├── Segment.h │ │ ├── SegmentBuilder.h │ │ ├── Subset.h │ │ ├── SubsetHopfieldNN.h │ │ └── SubsetSimple.h │ └── Tools │ │ ├── FTDHelixFitter.h │ │ ├── Fitter.h │ │ └── KiTrackMarlinTools.h │ └── src │ ├── Criteria │ ├── Crit2_DeltaPhi.cc │ ├── Crit2_DeltaPhi.h │ ├── Crit2_DeltaPhi_MV.cc │ ├── Crit2_DeltaPhi_MV.h │ ├── Crit2_DeltaRho.cc │ ├── Crit2_DeltaRho.h │ ├── Crit2_DeltaTheta_MV.cc │ ├── Crit2_DeltaTheta_MV.h │ ├── Crit2_Distance_MV.cc │ ├── Crit2_Distance_MV.h │ ├── Crit2_HelixWithIP.cc │ ├── Crit2_HelixWithIP.h │ ├── Crit2_RZRatio.cc │ ├── Crit2_RZRatio.h │ ├── Crit2_StraightTrackRatio.cc │ ├── Crit2_StraightTrackRatio.h │ ├── Crit3_2DAngle.cc │ ├── Crit3_2DAngle.h │ ├── Crit3_2DAngleTimesR.cc │ ├── Crit3_2DAngleTimesR.h │ ├── Crit3_3DAngle.cc │ ├── Crit3_3DAngle.h │ ├── Crit3_3DAngleTimesR.cc │ ├── Crit3_3DAngleTimesR.h │ ├── Crit3_ChangeRZRatio.cc │ ├── Crit3_ChangeRZRatio.h │ ├── Crit3_IPCircleDist.cc │ ├── Crit3_IPCircleDist.h │ ├── Crit3_IPCircleDistTimesR.cc │ ├── Crit3_IPCircleDistTimesR.h │ ├── Crit3_NoZigZag_MV.cc │ ├── Crit3_NoZigZag_MV.h │ ├── Crit3_PT.cc │ ├── Crit3_PT.h │ ├── Crit3_PT_MV.cc │ ├── Crit3_PT_MV.h │ ├── Crit4_2DAngleChange.cc │ ├── Crit4_2DAngleChange.h │ ├── Crit4_3DAngleChange.cc │ ├── Crit4_3DAngleChange.h │ ├── Crit4_3DAngleChangeNormed.cc │ ├── Crit4_3DAngleChangeNormed.h │ ├── Crit4_DistOfCircleCenters.cc │ ├── Crit4_DistOfCircleCenters.h │ ├── Crit4_DistToExtrapolation.cc │ ├── Crit4_DistToExtrapolation.h │ ├── Crit4_NoZigZag.cc │ ├── Crit4_NoZigZag.h │ ├── Crit4_PhiZRatioChange.cc │ ├── Crit4_PhiZRatioChange.h │ ├── Crit4_RChange.cc │ ├── Crit4_RChange.h │ ├── Criteria.cc │ ├── SimpleCircle.cc │ └── SimpleCircle.h │ ├── ILDImpl │ ├── FTDHit01.cc │ ├── FTDHitSimple.cc │ ├── FTDNeighborPetalSecCon.cc │ ├── FTDSectorConnector.cc │ ├── FTDTrack.cc │ ├── IMiniVector.h │ ├── IVXDHit.h │ ├── MiniVector.cc │ ├── MiniVector.h │ ├── MiniVectorHit01.cc │ ├── MiniVectorHit01.h │ ├── SectorSystemFTD.cc │ ├── SectorSystemVXD.cc │ ├── VXDHit01.cc │ ├── VXDHit01.h │ ├── VXDHitSimple.cc │ ├── VXDSectorConnector.cc │ ├── VXDSectorConnector.h │ ├── VXDTrack.cc │ └── VXDTrack.h │ ├── KiTrack │ ├── Automaton.cc │ ├── HopfieldNeuralNet.cc │ ├── IHit.cc │ ├── Segment.cc │ └── SegmentBuilder.cc │ └── Tools │ ├── FTDHelixFitter.cc │ ├── Fitter.cc │ ├── KiTrackMarlinCEDTools.h │ ├── KiTrackMarlinTools.cc │ ├── Timer.cc │ ├── Timer.h │ └── VXDHelixFitter.h ├── build-k4.sh ├── build.sh ├── cmake ├── CEPCSWConfig.cmake ├── CEPCSWDependencies.cmake ├── CEPCSWEnv.cmake ├── FindGenFit.cmake ├── FindHepMC.cmake └── FindOnnxRuntime.cmake ├── docs ├── README.md ├── _config.yml ├── _includes │ └── nav.html ├── _layouts │ └── default.html ├── quickstart.md └── tutorial.md ├── run.sh └── setup.sh /.build.ci.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # This is wrapper to run the build.sh on CI 3 | 4 | echo "LCG_RELEASE: ${LCG_RELEASE}" 5 | echo "CEPCSW_BLDTOOL: ${CEPCSW_BLDTOOL}" 6 | buildpid= 7 | logfile=mylog.txt 8 | 9 | if [ "$LCG_RELEASE" = "KEY4HEP_STACK" ]; then 10 | logfile=mylog-k4.sh 11 | ./build-k4.sh >& ${logfile} & 12 | buildpid=$! 13 | else 14 | source setup.sh 15 | ./build.sh >& ${logfile} & 16 | buildpid=$! 17 | fi 18 | 19 | while ps -p $buildpid 2>/dev/null ; do 20 | sleep 60 21 | done & 22 | echoer=$! 23 | 24 | trap 'kill $echoer' 0 25 | 26 | wait $buildpid 27 | statuspid=$? 28 | 29 | tail -n100 ${logfile} 30 | 31 | exit $statuspid 32 | -------------------------------------------------------------------------------- /.ci/github/Singularity: -------------------------------------------------------------------------------- 1 | BootStrap:docker 2 | From:centos:7 3 | 4 | %post 5 | yum install -y libicu which make redhat-lsb epel-release libglvnd-devel git mesa-libGLU-devel libXmu-devel motif-devel compat-db47 6 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | build.* 2 | build 3 | spack* 4 | ./Generator/output/ 5 | ./Generator/options/ 6 | -------------------------------------------------------------------------------- /Analysis/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | 2 | add_subdirectory(TotalInvMass) 3 | add_subdirectory(TrackInspect) 4 | add_subdirectory(DumpEvent) 5 | -------------------------------------------------------------------------------- /Analysis/DumpEvent/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | gaudi_add_module(DumpEvent 2 | SOURCES src/DumpMCParticleAlg.cpp 3 | src/DumpSimHitAlg.cpp 4 | #src/DumpHitAlg.cpp 5 | src/DumpTrackAlg.cpp 6 | #src/DumpCalorimeterAlg.cpp 7 | LINK DataHelperLib 8 | Gaudi::GaudiKernel 9 | EDM4HEP::edm4hep 10 | ${ROOT_LIBRARIES} 11 | ${CLHEP_LIBRARIES} 12 | ${DD4hep_COMPONENT_LIBRARIES} 13 | DetInterface 14 | k4FWCore::k4FWCore 15 | ) 16 | 17 | install(TARGETS DumpEvent 18 | EXPORT CEPCSWTargets 19 | RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}" COMPONENT bin 20 | LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}" COMPONENT shlib 21 | COMPONENT dev) 22 | -------------------------------------------------------------------------------- /Analysis/TotalInvMass/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | 2 | gaudi_add_module(TotalInvMass 3 | SOURCES src/TotalInvMass.cc 4 | LINK k4FWCore::k4FWCore 5 | Gaudi::GaudiKernel 6 | Gaudi::GaudiAlgLib 7 | ${CLHEP_LIBRARIES} 8 | ${GSL_LIBRARIES} 9 | ${LCIO_LIBRARIES} 10 | EDM4HEP::edm4hep EDM4HEP::edm4hepDict 11 | ${ROOT_LIBRARIES} 12 | ) 13 | 14 | target_include_directories(TotalInvMass 15 | PUBLIC ${LCIO_INCLUDE_DIRS}) 16 | 17 | install(TARGETS TotalInvMass 18 | EXPORT CEPCSWTargets 19 | RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}" COMPONENT bin 20 | LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}" COMPONENT shlib 21 | COMPONENT dev) 22 | -------------------------------------------------------------------------------- /Analysis/TrackInspect/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | 2 | # Modules 3 | gaudi_add_module(TrackInspect 4 | SOURCES src/TrackInspectAlg.cpp 5 | LINK DataHelperLib 6 | k4FWCore::k4FWCore 7 | Gaudi::GaudiKernel 8 | EDM4HEP::edm4hep 9 | k4FWCore::k4FWCore 10 | ${ROOT_LIBRARIES} 11 | ${CLHEP_LIBRARIES} 12 | ) 13 | 14 | install(TARGETS TrackInspect 15 | EXPORT CEPCSWTargets 16 | RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}" COMPONENT bin 17 | LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}" COMPONENT shlib 18 | COMPONENT dev) 19 | -------------------------------------------------------------------------------- /Detector/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | 2 | add_subdirectory(DetCEPCv4) 3 | add_subdirectory(DetCRD) 4 | add_subdirectory(DetDriftChamber) 5 | add_subdirectory(DetEcalMatrix) 6 | add_subdirectory(DetInterface) 7 | add_subdirectory(DetSegmentation) 8 | add_subdirectory(GeomSvc) 9 | add_subdirectory(Identifier) 10 | add_subdirectory(MagneticFieldMap) 11 | -------------------------------------------------------------------------------- /Detector/DetCEPCv4/compact/README.md: -------------------------------------------------------------------------------- 1 | # CEPC_v4 detector models - Overview 2 | # inplement according database models03 (MokkaC), by using lcgeo detector construction 3 | 4 | The following CEPC_v4 detector models are available in CEPCSW 5 | 6 | | Model | Description | MainTracker | Ecal | Hcal | Status | 7 | | ------------- | -----------------------------|------------ |---------|------|----------------| 8 | | CEPC_v4 | following MokkaC's version | TPC | Si-W | RPC | implementing | 9 | | ------------- | -----------------------------|-------------|---------|------|----------------| 10 | 11 | ## Details 12 | 13 | ### CEPC_v4 14 | - BeamPipe 15 | - Z from 0 to 700mm same as MokkaC's CEPC_v4 16 | - Vertex 17 | - with silicon ladders (VXD + SIT) 18 | - MainTracker 19 | - TPC 20 | - TPC_outer_radius = 1808*mm 21 | - EndcapTracker 22 | - with silicon pestals (FTDPixel + FTDStrip) 23 | - Ecal 24 | - with si-W calorimeter 25 | - Hcal 26 | - with RPC readout 27 | - creates three sets of hit collections 28 | - compact files: 29 | - only Tracker [./CEPC_v4.xml](./CEPC_v4.xml) 30 | -------------------------------------------------------------------------------- /Detector/DetCEPCv4/compact/SServices00.xml: -------------------------------------------------------------------------------- 1 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /Detector/DetCEPCv4/compact/coil03.xml: -------------------------------------------------------------------------------- 1 | 4 | 5 | 6 | 7 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | system:5,side:-2,layer:9,module:8,sensor:8,barrelside:-2 28 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /Detector/DetCEPCv4/compact/limits.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /Detector/DetCEPCv4/compact/misc_defs.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /Detector/DetCEPCv4/compact/top_defs_CepC_v04.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | all hardcoded overall dimensions which differ between large and small models 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /Detector/DetCEPCv4/compact/tracker_defs.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /Detector/DetCEPCv4/compact/yoke_defs.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /Detector/DetCEPCv4/src/include/LcgeoExceptions.h: -------------------------------------------------------------------------------- 1 | //==================================================================== 2 | // DDSim - LC simulation based on DD4hep 3 | //-------------------------------------------------------------------- 4 | // F.Gaede, DESY 5 | //==================================================================== 6 | #ifndef Exceptions_h 7 | #define Exceptions_h 8 | 9 | #include 10 | 11 | namespace lcgeo { 12 | 13 | //define some exception to throw 14 | class GeometryException : public std::exception{ 15 | 16 | protected: 17 | std::string message; 18 | GeometryException() { /*no_op*/ ; } 19 | 20 | public: 21 | GeometryException( std::string text ){ 22 | message = "GeometryException: " + text ; 23 | } 24 | virtual const char* what() const noexcept { return message.c_str() ; } 25 | }; 26 | } 27 | #endif 28 | -------------------------------------------------------------------------------- /Detector/DetCEPCv4/src/include/XMLHandlerDB.h: -------------------------------------------------------------------------------- 1 | #include "XML/XMLDetector.h" 2 | #include 3 | 4 | namespace { 5 | /** Wrapper class to replace the Database class used in Mokka to read the parameters. 6 | * Assumes parameters are stored as attributes of the corresponding xml element. 7 | */ 8 | struct XMLHandlerDB{ 9 | xml_comp_t x_det ; 10 | /** C'tor initializes the handle */ 11 | XMLHandlerDB(xml_comp_t det) : x_det(det) {} 12 | 13 | double fetchDouble( const char* _name){ return x_det.attr( dd4hep::xml::Strng_t(_name) ) ; } 14 | 15 | int fetchInt( const char* _name){ return x_det.attr( dd4hep::xml::Strng_t(_name) ) ; } 16 | 17 | std::string fetchString( const char* _name){ return x_det.attr( dd4hep::xml::Strng_t(_name) ) ;} 18 | 19 | /** allow this to be used as a 'pointer' ( as was used for Mokka Database object)*/ 20 | XMLHandlerDB* operator->() { return this ; } 21 | }; 22 | 23 | } 24 | -------------------------------------------------------------------------------- /Detector/DetCEPCv4/src/include/lcgeo.h: -------------------------------------------------------------------------------- 1 | #ifndef lcgeo_h 2 | #define lcgeo_h 3 | 4 | // file for some global configuration of lcgeo 5 | // so far only version number: 6 | 7 | // define version macros for Lcgeo 8 | #define LCGEO_MAJOR_VERSION 0 9 | #define LCGEO_MINOR_VERSION 5 10 | 11 | #define LCGEO_VERSION_GE( MAJV , MINV ) ( ( LCGEO_MAJOR_VERSION > MAJV ) || ( (LCGEO_MAJOR_VERSION==MAJV) && ( LCGEO_MINOR_VERSION >= MINV ) ) ) 12 | 13 | #define LCGEO_VERSION_GT( MAJV , MINV ) ( ( LCGEO_MAJOR_VERSION > MAJV ) || ( (LCGEO_MAJOR_VERSION==MAJV) && ( LCGEO_MINOR_VERSION > MINV ) ) ) 14 | 15 | namespace lcgeo { 16 | 17 | /// return a string with the current lcgeo version in the form vXX-YY. 18 | inline std::string versionString(){ 19 | std::string vs("vXX-YY") ; 20 | std::sprintf( &vs[0] , "v%2.2d-%2.2d", LCGEO_MAJOR_VERSION, LCGEO_MINOR_VERSION ) ; 21 | return vs ; 22 | } 23 | 24 | } 25 | 26 | #endif 27 | -------------------------------------------------------------------------------- /Detector/DetEcalMatrix/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | ############################################################################### 2 | # Package: DetEcalMatrix 3 | # Based on package: lcgeo 4 | ################################################################################ 5 | 6 | 7 | find_package(DD4hep COMPONENTS DDRec DDG4 DDParsers REQUIRED) 8 | find_package(Geant4) 9 | include(${Geant4_USE_FILE}) 10 | 11 | set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${DD4hep_ROOT}/cmake ) 12 | include( DD4hep ) 13 | 14 | find_package(ROOT COMPONENTS MathCore GenVector Geom REQUIRED) 15 | 16 | # TODO: how to handle 17 | # install(DIRECTORY ${CMAKE_CURRENT_LIST_DIR}/compact DESTINATION Detector/DetEcalMatrix) 18 | gaudi_add_module(DetEcalMatrix 19 | SOURCES src/calorimeter/EcalMatrix.cpp 20 | LINK ${DD4hep_COMPONENT_LIBRARIES} 21 | # ROOT Geant4 22 | ) 23 | 24 | set(LIBRARY_OUTPUT_PATH ${CMAKE_LIBRARY_OUTPUT_DIRECTORY}) 25 | message(STATUS "LIBRARY_OUTPUT_PATH -> ${LIBRARY_OUTPUT_PATH}") 26 | dd4hep_generate_rootmap(DetEcalMatrix) 27 | 28 | install(TARGETS DetEcalMatrix 29 | EXPORT CEPCSWTargets 30 | RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}" COMPONENT bin 31 | LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}" COMPONENT shlib 32 | COMPONENT dev) 33 | -------------------------------------------------------------------------------- /Detector/DetInterface/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | ################################################################################ 2 | # Package: DetInterface 3 | ################################################################################ 4 | 5 | gaudi_add_header_only_library(DetInterface) 6 | 7 | install(TARGETS DetInterface 8 | EXPORT CEPCSWTargets 9 | RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}" COMPONENT bin 10 | LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}" COMPONENT shlib 11 | COMPONENT dev) 12 | -------------------------------------------------------------------------------- /Detector/DetSegmentation/src/plugins/SegmentationFactories.cpp: -------------------------------------------------------------------------------- 1 | #include "DD4hep/Factories.h" 2 | #include "DD4hep/detail/SegmentationsInterna.h" 3 | 4 | namespace { 5 | template 6 | dd4hep::SegmentationObject* create_segmentation(const dd4hep::BitFieldCoder* decoder) { 7 | return new dd4hep::SegmentationWrapper(decoder); 8 | } 9 | } 10 | 11 | //#include "DetSegmentation/GridEta.h" 12 | //DECLARE_SEGMENTATION(GridEta, create_segmentation) 13 | 14 | //#include "DetSegmentation/FCCSWGridPhiEta.h" 15 | //DECLARE_SEGMENTATION(FCCSWGridPhiEta, create_segmentation) 16 | 17 | //#include "DetSegmentation/GridRPhiEta.h" 18 | //DECLARE_SEGMENTATION(GridRPhiEta, create_segmentation) 19 | 20 | #include "DetSegmentation/GridDriftChamber.h" 21 | DECLARE_SEGMENTATION(GridDriftChamber, create_segmentation) 22 | -------------------------------------------------------------------------------- /Detector/GeomSvc/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | 2 | ############################################################################## 3 | # Package: GeomSvc 4 | # Desc: implement the IGeomSvc interface. 5 | ############################################################################## 6 | 7 | gaudi_add_module(GeomSvc 8 | SOURCES src/GeomSvc.cpp 9 | LINK 10 | DetInterface 11 | ${DD4hep_COMPONENT_LIBRARIES} 12 | Gaudi::GaudiKernel 13 | ${GEAR_LIBRARIES} 14 | ${ROOT_LIBRARIES} 15 | ) 16 | 17 | target_include_directories(GeomSvc 18 | PUBLIC ${GEAR_INCLUDE_DIRS} 19 | ) 20 | 21 | install(TARGETS GeomSvc 22 | EXPORT CEPCSWTargets 23 | RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}" COMPONENT bin 24 | LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}" COMPONENT shlib 25 | COMPONENT dev) 26 | -------------------------------------------------------------------------------- /Detector/GeomSvc/src/GeomSvc.h: -------------------------------------------------------------------------------- 1 | #ifndef GeomSvc_h 2 | #define GeomSvc_h 3 | 4 | // Interface 5 | #include "DetInterface/IGeomSvc.h" 6 | 7 | // Gaudi 8 | #include "GaudiKernel/IIncidentListener.h" 9 | #include "GaudiKernel/IIncidentSvc.h" 10 | #include "GaudiKernel/Incident.h" 11 | #include "GaudiKernel/MsgStream.h" 12 | #include "GaudiKernel/Service.h" 13 | #include "GaudiKernel/ServiceHandle.h" 14 | 15 | // DD4Hep 16 | #include "DD4hep/Detector.h" 17 | 18 | #include 19 | #include 20 | #include 21 | 22 | class TGeoNode; 23 | 24 | class GeomSvc: public extends { 25 | public: 26 | GeomSvc(const std::string& name, ISvcLocator* svc); 27 | ~GeomSvc(); 28 | 29 | // Service 30 | StatusCode initialize() override; 31 | StatusCode finalize() override; 32 | 33 | // IGeomSvc 34 | dd4hep::DetElement getDD4HepGeo() override; 35 | dd4hep::Detector* lcdd() override; 36 | 37 | private: 38 | Decoder* getDecoder(const std::string& readout_name) override; 39 | 40 | private: 41 | // DD4hep XML compact file path 42 | Gaudi::Property m_dd4hep_xmls{this, "compact"}; 43 | 44 | // 45 | dd4hep::Detector* m_dd4hep_geo; 46 | }; 47 | 48 | #endif // GeomSvc_h 49 | -------------------------------------------------------------------------------- /Detector/Identifier/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | ################################################################################ 2 | # Package: Identifier 3 | ################################################################################ 4 | 5 | gaudi_add_header_only_library(Identifier) 6 | 7 | install(TARGETS Identifier 8 | EXPORT CEPCSWTargets 9 | RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}" COMPONENT bin 10 | LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}" COMPONENT shlib 11 | COMPONENT dev) 12 | -------------------------------------------------------------------------------- /Detector/MagneticFieldMap/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | ################################################################################# 2 | ##Package : MagneticFieldMap 3 | ################################################################################# 4 | 5 | gaudi_add_module(MagneticFieldMap 6 | SOURCES src/GenericBFieldMapBrBz.cpp 7 | src/GenericBFieldMapBrBzFactory.cpp 8 | src/FieldMapFileProvider.cpp 9 | LINK Gaudi::GaudiKernel 10 | ${DD4hep_COMPONENT_LIBRARIES} 11 | ${ROOT_LIBRARIES} 12 | ) 13 | 14 | set(LIBRARY_OUTPUT_PATH ${CMAKE_LIBRARY_OUTPUT_DIRECTORY}) 15 | message(STATUS "LIBRARY_OUTPUT_PATH -> ${LIBRARY_OUTPUT_PATH}") 16 | dd4hep_generate_rootmap(MagneticFieldMap) 17 | 18 | install(TARGETS MagneticFieldMap 19 | EXPORT CEPCSWTargets 20 | RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}" COMPONENT bin 21 | LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}" COMPONENT shlib 22 | COMPONENT dev) 23 | -------------------------------------------------------------------------------- /Detector/MagneticFieldMap/src/GenericBFieldMapBrBz.h: -------------------------------------------------------------------------------- 1 | #ifndef GenericBFieldMapBrBz_h 2 | #define GenericBFieldMapBrBz_h 3 | 4 | /* 5 | * GenericBFieldMapBrBz is an extension of Cartesian Field in DD4hep. 6 | * - It enables the DD4hep to access the Magnetic Service from Gaudi. 7 | * - It also enables the calculation of Br/Bz at position X. 8 | * - It will get the map from an abstract class IFieldMapProvider. 9 | * 10 | * -- Tao Lin 11 | */ 12 | 13 | #include 14 | 15 | #include "IFieldMapProvider.h" 16 | 17 | 18 | class GenericBFieldMapBrBz: public dd4hep::CartesianField::Object { 19 | public: 20 | 21 | GenericBFieldMapBrBz(); 22 | 23 | virtual void fieldComponents(const double* pos, double* field); 24 | 25 | public: 26 | // following are interfaces to configure this field map 27 | void init_provider(const std::string& provider, const std::string& url); 28 | 29 | // set unit 30 | void init_unit(double l, double b); 31 | 32 | private: 33 | 34 | IFieldMapProvider* m_provider; 35 | 36 | double m_length_unit = 0; 37 | double m_bfield_unit = 0; 38 | }; 39 | 40 | #endif 41 | 42 | -------------------------------------------------------------------------------- /Detector/MagneticFieldMap/src/IFieldMapProvider.h: -------------------------------------------------------------------------------- 1 | #ifndef IFieldMapProvider_h 2 | #define IFieldMapProvider_h 3 | 4 | /* 5 | * IFieldMapProvider will provide the B-Field at a 2D grid (r-z). 6 | * The provider will return the bin index for r/z. Then the GenericBFieldMapBrBz 7 | * will use this bin index to get the values at (r0,z0), (r1,z0), (r0,z1), (r1,z1). 8 | * The interpolation is not computated IFieldMapProvider. Please see GenericBFieldMapBrBz. 9 | * 10 | * -- Tao Lin 11 | */ 12 | 13 | class IFieldMapProvider { 14 | public: 15 | // Meta data about the map 16 | // return rn/zn is the normalized value in the bin. the value is [0,1] 17 | virtual int rBinIdx(double r, double& rn) = 0; 18 | virtual int zBinIdx(double z, double& zn) = 0; 19 | 20 | // The Br and Bz 21 | virtual void access(int rbin, int zbin, double& Br, double& Bz) = 0; 22 | 23 | }; 24 | 25 | #endif 26 | 27 | -------------------------------------------------------------------------------- /Digitisers/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | add_subdirectory(DCHDigi) 2 | add_subdirectory(G2CDArbor) 3 | add_subdirectory(SimHitMerge) 4 | add_subdirectory(SimpleDigi) 5 | -------------------------------------------------------------------------------- /Digitisers/DCHDigi/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | ## Modules 2 | gaudi_add_module(DCHDigi 3 | SOURCES src/DCHDigiAlg.cpp 4 | LINK DetInterface 5 | DetSegmentation 6 | k4FWCore::k4FWCore 7 | Gaudi::GaudiKernel 8 | Gaudi::GaudiAlgLib 9 | ${CLHEP_LIBRARIES} 10 | ${DD4hep_COMPONENT_LIBRARIES} 11 | ${ROOT_LIBRARIES} 12 | DetSegmentation 13 | EDM4HEP::edm4hep EDM4HEP::edm4hepDict 14 | ) 15 | install(TARGETS DCHDigi 16 | EXPORT CEPCSWTargets 17 | RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}" COMPONENT bin 18 | LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}" COMPONENT shlib 19 | COMPONENT dev) 20 | -------------------------------------------------------------------------------- /Digitisers/G2CDArbor/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Modules 2 | gaudi_add_module(G2CDArbor 3 | SOURCES src/G2CDArborAlg.cpp 4 | LINK k4FWCore::k4FWCore 5 | GearSvc 6 | DetInterface 7 | Gaudi::GaudiKernel 8 | Gaudi::GaudiAlgLib 9 | ${CLHEP_LIBRARIES} 10 | ${GEAR_LIBRARIES} 11 | ${GSL_LIBRARIES} 12 | ${LCIO_LIBRARIES} 13 | EDM4HEP::edm4hep EDM4HEP::edm4hepDict 14 | DD4hep::DDRec 15 | ) 16 | 17 | target_include_directories(G2CDArbor 18 | PUBLIC ${LCIO_INCLUDE_DIRS}) 19 | 20 | 21 | install(TARGETS G2CDArbor 22 | EXPORT CEPCSWTargets 23 | RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}" COMPONENT bin 24 | LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}" COMPONENT shlib 25 | COMPONENT dev) 26 | 27 | -------------------------------------------------------------------------------- /Digitisers/SimHitMerge/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | 2 | # Modules 3 | gaudi_add_module(SimHitMerge 4 | SOURCES src/SimHitMergeAlg.cpp 5 | LINK DetInterface 6 | k4FWCore::k4FWCore 7 | Gaudi::GaudiKernel 8 | Gaudi::GaudiAlgLib 9 | ${DD4hep_COMPONENT_LIBRARIES} 10 | EDM4HEP::edm4hep EDM4HEP::edm4hepDict 11 | ) 12 | 13 | install(TARGETS SimHitMerge 14 | EXPORT CEPCSWTargets 15 | RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}" COMPONENT bin 16 | LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}" COMPONENT shlib 17 | COMPONENT dev) 18 | 19 | -------------------------------------------------------------------------------- /Digitisers/SimpleDigi/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Modules 2 | gaudi_add_module(SimpleDigi 3 | SOURCES src/PlanarDigiAlg.cpp 4 | src/TPCDigiAlg.cpp 5 | src/voxel.cpp 6 | src/CylinderDigiAlg.cpp 7 | LINK GearSvc 8 | EventSeeder 9 | TrackSystemSvcLib 10 | DataHelperLib 11 | k4FWCore::k4FWCore 12 | Gaudi::GaudiKernel 13 | Gaudi::GaudiAlgLib 14 | ${CLHEP_LIBRARIES} 15 | ${GEAR_LIBRARIES} 16 | ${GSL_LIBRARIES} 17 | ${LCIO_LIBRARIES} 18 | EDM4HEP::edm4hep EDM4HEP::edm4hepDict 19 | ) 20 | 21 | install(TARGETS SimpleDigi 22 | EXPORT CEPCSWTargets 23 | RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}" COMPONENT bin 24 | LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}" COMPONENT shlib 25 | COMPONENT dev) 26 | -------------------------------------------------------------------------------- /Examples/include/Examples/IFirstSvc.h: -------------------------------------------------------------------------------- 1 | #ifndef IFirstSvc_h 2 | #define IFirstSvc_h 3 | 4 | #include "GaudiKernel/IService.h" 5 | 6 | class IFirstSvc: virtual public IInterface { 7 | public: 8 | DeclareInterfaceID(IFirstSvc, 0, 1); // major/minor version 9 | 10 | virtual void shoot() = 0; 11 | 12 | }; 13 | 14 | #endif 15 | -------------------------------------------------------------------------------- /Examples/options/edm4hep_read.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | from Gaudi.Configuration import * 4 | 5 | from Configurables import k4DataSvc 6 | dsvc = k4DataSvc("EventDataSvc", 7 | # input="test.root" 8 | input="test-detsim10.root" 9 | ) 10 | 11 | from Configurables import PodioInput 12 | podioinput = PodioInput("PodioReader", collections=[ 13 | "EventHeader", 14 | "MCParticle", 15 | "SimCalorimeterHit" 16 | ]) 17 | 18 | from Configurables import Edm4hepReadAlg 19 | alg = Edm4hepReadAlg("Edm4hepReadAlg") 20 | #alg.HeaderCol.Path = "EventHeader" 21 | #alg.MCParticleCol.Path = "MCParticle" 22 | alg.SimCalorimeterHitCol.Path = "SimCalorimeterHit" 23 | 24 | # ApplicationMgr 25 | from Configurables import ApplicationMgr 26 | ApplicationMgr( TopAlg = [podioinput, alg], 27 | EvtSel = 'NONE', 28 | EvtMax = 10, 29 | ExtSvc = [dsvc], 30 | OutputLevel=DEBUG 31 | ) 32 | -------------------------------------------------------------------------------- /Examples/options/edm4hep_write.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | from Gaudi.Configuration import * 4 | 5 | from Configurables import k4DataSvc 6 | dsvc = k4DataSvc("EventDataSvc") 7 | 8 | from Configurables import Edm4hepWriteAlg 9 | alg = Edm4hepWriteAlg("Edm4hepWriteAlg") 10 | alg.HeaderOut.Path = "EventHeader" 11 | alg.MCParticleOut.Path = "MCParticle" 12 | 13 | from Configurables import PodioOutput 14 | out = PodioOutput("out") 15 | out.filename = "test.root" 16 | out.outputCommands = ["keep *"] 17 | 18 | # ApplicationMgr 19 | from Configurables import ApplicationMgr 20 | ApplicationMgr( TopAlg = [alg, out], 21 | EvtSel = 'NONE', 22 | EvtMax = 10, 23 | ExtSvc=[dsvc], 24 | OutputLevel=DEBUG 25 | ) 26 | -------------------------------------------------------------------------------- /Examples/options/gen_write.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | from Gaudi.Configuration import * 4 | 5 | from Configurables import k4DataSvc 6 | dsvc = k4DataSvc("EventDataSvc") 7 | 8 | from Configurables import GenAlgo 9 | 10 | read = GenAlgo("read") 11 | ####################################### 12 | #support format: stdhep, slcio, hepmc # 13 | ####################################### 14 | #read.Input = "/junofs/users/wxfang/CEPC/CEPCOFF/TestExample/stdhep/nnh_e2e2.e0.p0.00001.stdhep" 15 | #read.FileFormat = "stdhep" 16 | read.Input = "/junofs/users/wxfang/CEPC/whizard_apply/ee/ee.slcio" 17 | read.FileFormat = "slcio" 18 | read.PrintEvent = True # true for printing mc info 19 | read.WriteFile = True # true for writting info to root 20 | 21 | from Configurables import PodioOutput 22 | out = PodioOutput("out") 23 | out.filename = "test.root" #name of output root file 24 | out.outputCommands = ["keep *"] 25 | 26 | # ApplicationMgr 27 | from Configurables import ApplicationMgr 28 | ApplicationMgr( TopAlg = [read, out], 29 | EvtSel = 'NONE', 30 | EvtMax = 11, 31 | ExtSvc=[dsvc], 32 | OutputLevel=DEBUG 33 | ) 34 | -------------------------------------------------------------------------------- /Examples/options/helloalg.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | from Gaudi.Configuration import * 4 | 5 | from Configurables import HelloAlg 6 | 7 | helloalg = HelloAlg("helloAlg") 8 | helloalg.MyInt = 42 9 | 10 | # ApplicationMgr 11 | from Configurables import ApplicationMgr 12 | ApplicationMgr( TopAlg = [helloalg], 13 | EvtSel = 'NONE', 14 | EvtMax = 10, 15 | ) 16 | -------------------------------------------------------------------------------- /Examples/options/plcio_read.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | from Gaudi.Configuration import * 4 | 5 | from Configurables import k4DataSvc 6 | dsvc = k4DataSvc("EventDataSvc", input="test.root") 7 | 8 | from Configurables import PlcioReadAlg 9 | alg = PlcioReadAlg("PlcioReadAlg") 10 | alg.HeaderCol.Path = "EventHeader" 11 | alg.InputCol.Path = "MCParticle" 12 | 13 | from Configurables import PodioInput 14 | podioinput = PodioInput("PodioReader", collections=[ 15 | "EventHeader", 16 | "MCParticle" 17 | ]) 18 | 19 | # ApplicationMgr 20 | from Configurables import ApplicationMgr 21 | ApplicationMgr( TopAlg = [podioinput, alg], 22 | EvtSel = 'NONE', 23 | EvtMax = 10, 24 | ExtSvc = [dsvc], 25 | OutputLevel=DEBUG 26 | ) 27 | -------------------------------------------------------------------------------- /Examples/options/plcio_write.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | from Gaudi.Configuration import * 4 | 5 | from Configurables import k4DataSvc 6 | dsvc = k4DataSvc("EventDataSvc") 7 | 8 | from Configurables import PlcioWriteAlg 9 | alg = PlcioWriteAlg("PlcioWriteAlg") 10 | alg.HeaderCol.Path = "EventHeader" 11 | alg.OutputCol.Path = "MCParticle" 12 | 13 | from Configurables import PodioOutput 14 | out = PodioOutput("out") 15 | out.filename = "test.root" 16 | out.outputCommands = ["keep *"] 17 | 18 | # ApplicationMgr 19 | from Configurables import ApplicationMgr 20 | ApplicationMgr( TopAlg = [alg, out], 21 | EvtSel = 'NONE', 22 | EvtMax = 10, 23 | ExtSvc=[dsvc], 24 | OutputLevel=DEBUG 25 | ) 26 | -------------------------------------------------------------------------------- /Examples/options/secondalg.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | from Gaudi.Configuration import * 4 | 5 | from Configurables import FirstSvc 6 | 7 | firstsvc = FirstSvc("FirstSvc") 8 | 9 | from Configurables import SecondAlg 10 | 11 | secondalg = SecondAlg("secondAlg") 12 | 13 | # ApplicationMgr 14 | from Configurables import ApplicationMgr 15 | ApplicationMgr( TopAlg = [secondalg], 16 | EvtSel = 'NONE', 17 | EvtMax = 10, 18 | ) 19 | -------------------------------------------------------------------------------- /Examples/options/vis.mac: -------------------------------------------------------------------------------- 1 | /run/initialize 2 | /vis/initialize 3 | /vis/open OGL 4 | # 5 | ####/vis/open OGLSXm 6 | ####/vis/open HepRepXML 7 | # 8 | #/vis/open DAWNFILE 9 | # 10 | # draw scene 11 | # 12 | /vis/drawVolume worlds 13 | /tracking/storeTrajectory 1 14 | /vis/scene/add/trajectories 15 | -------------------------------------------------------------------------------- /Examples/src/Edm4hepTest/Edm4hepReadDCAlg.h: -------------------------------------------------------------------------------- 1 | #ifndef TEST_EDM4HEP_READ_DC_ALG_H 2 | #define TEST_EDM4HEP_READ_DC_ALG_H 3 | 4 | #include "k4FWCore/DataHandle.h" 5 | #include "GaudiAlg/GaudiAlgorithm.h" 6 | 7 | namespace edm4hep { 8 | class EventHeaderCollection; 9 | class MCParticleCollection; 10 | class SimTrackerHitCollection; 11 | } 12 | 13 | class Edm4hepReadDCAlg : public GaudiAlgorithm 14 | { 15 | 16 | public : 17 | 18 | Edm4hepReadDCAlg(const std::string& name, ISvcLocator* svcLoc); 19 | 20 | virtual StatusCode initialize(); 21 | virtual StatusCode execute(); 22 | virtual StatusCode finalize(); 23 | 24 | private : 25 | 26 | // DataHandle m_headerCol{"EventHeader", Gaudi::DataHandle::Reader, this}; 27 | DataHandle m_mcParCol{"MCParticle", Gaudi::DataHandle::Reader, this}; 28 | DataHandle m_dcCol{"DriftChamberHitsCollection", 29 | Gaudi::DataHandle::Reader, this}; 30 | 31 | }; 32 | 33 | #endif 34 | -------------------------------------------------------------------------------- /Examples/src/Edm4hepTest/Edm4hepWriteAlg.h: -------------------------------------------------------------------------------- 1 | #ifndef TEST_EDM4HEP_WRITE_ALG_H 2 | #define TEST_EDM4HEP_WRITE_ALG_H 3 | 4 | #include "k4FWCore/DataHandle.h" 5 | #include "GaudiAlg/GaudiAlgorithm.h" 6 | 7 | namespace edm4hep { 8 | class EventHeaderCollection; 9 | class MCParticleCollection; 10 | class SimCalorimeterHitCollection; 11 | class CaloHitContributionCollection; 12 | } 13 | 14 | class Edm4hepWriteAlg : public GaudiAlgorithm 15 | { 16 | 17 | public : 18 | 19 | Edm4hepWriteAlg(const std::string& name, ISvcLocator* svcLoc); 20 | 21 | virtual StatusCode initialize(); 22 | virtual StatusCode execute(); 23 | virtual StatusCode finalize(); 24 | 25 | private : 26 | 27 | DataHandle m_headerCol{"EventHeader", Gaudi::DataHandle::Writer, this}; 28 | DataHandle m_mcParCol{"MCParticle", Gaudi::DataHandle::Writer, this}; 29 | DataHandle m_simCaloHitCol{"SimCalorimeterHit", Gaudi::DataHandle::Writer, this}; 30 | DataHandle m_caloHitContCol{"CaloHitContribution", Gaudi::DataHandle::Writer, this}; 31 | }; 32 | 33 | #endif // TEST_EDM4HEP_WRITE_ALG_H 34 | -------------------------------------------------------------------------------- /Examples/src/FirstSvc/FirstSvc.cpp: -------------------------------------------------------------------------------- 1 | #include "FirstSvc.h" 2 | 3 | DECLARE_COMPONENT(FirstSvc) 4 | 5 | StatusCode 6 | FirstSvc::initialize() { 7 | StatusCode sc = Service::initialize(); 8 | 9 | return sc; 10 | } 11 | 12 | StatusCode 13 | FirstSvc::finalize() { 14 | // clear or reset 15 | 16 | // 17 | StatusCode sc = Service::finalize(); 18 | return sc; 19 | } 20 | 21 | void 22 | FirstSvc::shoot() { 23 | msg() << "shoot it." << endmsg; 24 | 25 | } 26 | -------------------------------------------------------------------------------- /Examples/src/FirstSvc/FirstSvc.h: -------------------------------------------------------------------------------- 1 | #ifndef FirstSvc_h 2 | #define FirstSvc_h 3 | 4 | #include "Examples/IFirstSvc.h" 5 | #include 6 | 7 | class FirstSvc: public extends { 8 | public: 9 | using extends::extends; 10 | 11 | StatusCode initialize() override; 12 | StatusCode finalize() override; 13 | 14 | void shoot() override; 15 | }; 16 | 17 | #endif 18 | -------------------------------------------------------------------------------- /Examples/src/HelloWorld/HelloAlg.cpp: -------------------------------------------------------------------------------- 1 | #include "HelloAlg.h" 2 | 3 | DECLARE_COMPONENT(HelloAlg) 4 | 5 | HelloAlg::HelloAlg(const std::string& name, ISvcLocator* pSvcLocator) 6 | : Algorithm(name, pSvcLocator) { 7 | 8 | } 9 | 10 | StatusCode 11 | HelloAlg::initialize() { 12 | StatusCode sc; 13 | 14 | info() << "MyInt: " << m_int.value() << endmsg; 15 | 16 | return sc; 17 | } 18 | 19 | StatusCode 20 | HelloAlg::execute() { 21 | StatusCode sc; 22 | return sc; 23 | } 24 | 25 | StatusCode 26 | HelloAlg::finalize() { 27 | StatusCode sc; 28 | return sc; 29 | } 30 | 31 | 32 | -------------------------------------------------------------------------------- /Examples/src/HelloWorld/HelloAlg.h: -------------------------------------------------------------------------------- 1 | #ifndef HelloAlg_h 2 | #define HelloAlg_h 3 | 4 | #include 5 | #include 6 | 7 | class HelloAlg: public Algorithm { 8 | public: 9 | HelloAlg(const std::string& name, ISvcLocator* pSvcLocator); 10 | 11 | StatusCode initialize() override; 12 | StatusCode execute() override; 13 | StatusCode finalize() override; 14 | 15 | private: 16 | 17 | Gaudi::Property m_int{this, "MyInt", 42}; 18 | }; 19 | 20 | 21 | #endif 22 | -------------------------------------------------------------------------------- /Examples/src/PlcioTest/PlcioReadAlg.h: -------------------------------------------------------------------------------- 1 | #ifndef TEST_PLCIO_WRITE_ALG_H 2 | #define TEST_PLCIO_WRITE_ALG_H 3 | 4 | #include "k4FWCore/DataHandle.h" 5 | #include "GaudiAlg/GaudiAlgorithm.h" 6 | 7 | namespace plcio { 8 | class EventHeaderCollection; 9 | class MCParticleCollection; 10 | } 11 | 12 | class PlcioReadAlg : public GaudiAlgorithm 13 | { 14 | 15 | public : 16 | 17 | PlcioReadAlg(const std::string& name, ISvcLocator* svcLoc); 18 | 19 | virtual StatusCode initialize(); 20 | virtual StatusCode execute(); 21 | virtual StatusCode finalize(); 22 | 23 | private : 24 | 25 | DataHandle m_headerCol{"EventHeader", Gaudi::DataHandle::Reader, this}; 26 | DataHandle m_mcParCol{"MCParticle", Gaudi::DataHandle::Reader, this}; 27 | 28 | }; 29 | 30 | #endif // TEST_PLCIO_WRITE_ALG_H 31 | -------------------------------------------------------------------------------- /Examples/src/PlcioTest/PlcioWriteAlg.h: -------------------------------------------------------------------------------- 1 | #ifndef TEST_PLCIO_WRITE_ALG_H 2 | #define TEST_PLCIO_WRITE_ALG_H 3 | 4 | #include "k4FWCore/DataHandle.h" 5 | #include "GaudiAlg/GaudiAlgorithm.h" 6 | 7 | namespace plcio { 8 | class EventHeaderCollection; 9 | class MCParticleCollection; 10 | } 11 | 12 | class PlcioWriteAlg : public GaudiAlgorithm 13 | { 14 | 15 | public : 16 | 17 | PlcioWriteAlg(const std::string& name, ISvcLocator* svcLoc); 18 | 19 | virtual StatusCode initialize(); 20 | virtual StatusCode execute(); 21 | virtual StatusCode finalize(); 22 | 23 | private : 24 | 25 | DataHandle m_headerCol{"EventHeader", Gaudi::DataHandle::Writer, this}; 26 | DataHandle m_mcParCol{"MCParticle", Gaudi::DataHandle::Writer, this}; 27 | 28 | }; 29 | 30 | #endif // TEST_PLCIO_WRITE_ALG_H 31 | -------------------------------------------------------------------------------- /Examples/src/SecondAlg/SecondAlg.cpp: -------------------------------------------------------------------------------- 1 | #include "SecondAlg.h" 2 | 3 | DECLARE_COMPONENT(SecondAlg) 4 | 5 | SecondAlg::SecondAlg(const std::string& name, ISvcLocator* pSvcLocator) 6 | : Algorithm(name, pSvcLocator) { 7 | 8 | } 9 | 10 | StatusCode 11 | SecondAlg::initialize() { 12 | StatusCode sc; 13 | 14 | info() << "Retrieving the FirstSvc... " << endmsg; 15 | 16 | m_firstsvc = service("FirstSvc"); 17 | 18 | return sc; 19 | } 20 | 21 | StatusCode 22 | SecondAlg::execute() { 23 | StatusCode sc; 24 | 25 | m_firstsvc->shoot(); 26 | 27 | return sc; 28 | } 29 | 30 | StatusCode 31 | SecondAlg::finalize() { 32 | StatusCode sc; 33 | return sc; 34 | } 35 | 36 | 37 | -------------------------------------------------------------------------------- /Examples/src/SecondAlg/SecondAlg.h: -------------------------------------------------------------------------------- 1 | #ifndef SecondAlg_h 2 | #define SecondAlg_h 3 | 4 | #include 5 | #include 6 | 7 | #include "Examples/IFirstSvc.h" 8 | 9 | // The second algorithm shows how to invoke the services. 10 | 11 | class SecondAlg: public Algorithm { 12 | public: 13 | SecondAlg(const std::string& name, ISvcLocator* pSvcLocator); 14 | 15 | StatusCode initialize() override; 16 | StatusCode execute() override; 17 | StatusCode finalize() override; 18 | 19 | private: 20 | SmartIF m_firstsvc; 21 | }; 22 | 23 | 24 | #endif 25 | -------------------------------------------------------------------------------- /Generator/src/BeamBackgroundFileParserV0.h: -------------------------------------------------------------------------------- 1 | #ifndef BeamBackgroundFileParserV0_h 2 | #define BeamBackgroundFileParserV0_h 3 | 4 | #include "IBeamBackgroundFileParser.h" 5 | 6 | #include 7 | 8 | class BeamBackgroundFileParserV0: public IBeamBackgroundFileParser { 9 | public: 10 | BeamBackgroundFileParserV0(const std::string& filename, int pdgid, double beam_energy); 11 | 12 | bool load(IBeamBackgroundFileParser::BeamBackgroundData&); 13 | private: 14 | std::ifstream m_input; 15 | 16 | int m_pdgid; 17 | double m_beam_energy; 18 | }; 19 | 20 | #endif 21 | -------------------------------------------------------------------------------- /Generator/src/GenEvent.cpp: -------------------------------------------------------------------------------- 1 | #include "GenEvent.h" 2 | #include "edm4hep/MCParticleCollection.h"//plico 3 | 4 | // using namespace std; 5 | 6 | namespace MyHepMC{ 7 | 8 | //GenEvent::GenEvent(){ 9 | GenEvent::GenEvent(edm4hep::MCParticleCollection& mcCol) 10 | : m_mc_vec(mcCol){ 11 | 12 | m_event_id=-1; 13 | m_run_id=-1; 14 | m_time=-1; 15 | m_det_name=""; 16 | 17 | } 18 | GenEvent::~GenEvent(){} 19 | 20 | void GenEvent::SetEventHeader(long event_id_, long run_id_, float time_, const std::string& det_name_){ 21 | m_event_id = event_id_; 22 | m_run_id = run_id_; 23 | m_time = time_; 24 | m_det_name = det_name_; 25 | } 26 | /* 27 | void GenEvent::SetMCCollection(edm4hep::MCParticleCollection vec_){ 28 | m_mc_vec = vec_; 29 | } 30 | */ 31 | 32 | edm4hep::MCParticleCollection& GenEvent::getMCVec(){ 33 | return m_mc_vec; 34 | } 35 | 36 | long GenEvent::getID(){ 37 | return m_event_id; 38 | } 39 | long GenEvent::getRun() {return m_run_id;} 40 | long GenEvent::getTime() {return m_time;} 41 | std::string GenEvent::getName() {return m_det_name;} 42 | 43 | void GenEvent::ReSet(){ 44 | 45 | m_event_id=-1; 46 | m_run_id=-1; 47 | m_time=-1; 48 | m_det_name=""; 49 | m_mc_vec.clear(); 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /Generator/src/GenEvent.h: -------------------------------------------------------------------------------- 1 | #ifndef GenEvent_h 2 | #define GenEvent_h 1 3 | 4 | #include "edm4hep/MCParticleCollection.h"//plico 5 | 6 | namespace MyHepMC { 7 | 8 | class GenEvent{ 9 | public: 10 | //GenEvent(); 11 | GenEvent(edm4hep::MCParticleCollection& mcCol); 12 | ~GenEvent(); 13 | void SetEventHeader(long event_id_, long run_id_, float time_, const std::string& det_name_); 14 | //void SetMCCollection(edm4hep::MCParticleCollection vec_); 15 | long getID(); 16 | long getRun(); 17 | long getTime(); 18 | void ReSet(); 19 | std::string getName(); 20 | edm4hep::MCParticleCollection& getMCVec(); 21 | edm4hep::MCParticleCollection& m_mc_vec; 22 | //edm4hep::MCParticleCollection m_mc_vec; 23 | private: 24 | 25 | long m_event_id; 26 | long m_run_id; 27 | float m_time; 28 | std::string m_det_name; 29 | }; 30 | 31 | } 32 | #endif 33 | -------------------------------------------------------------------------------- /Generator/src/GenPrinter.h: -------------------------------------------------------------------------------- 1 | #ifndef GenPrinter_h 2 | #define GenPrinter_h 1 3 | 4 | #include 5 | #include "GenEvent.h" 6 | #include "IGenTool.h" 7 | 8 | using namespace std; 9 | 10 | class GenPrinter: public extends { 11 | public: 12 | using extends::extends; 13 | 14 | // Overriding initialize and finalize 15 | StatusCode initialize() override; 16 | StatusCode finalize() override; 17 | 18 | public: 19 | bool configure_gentool() override; 20 | bool mutate(MyHepMC::GenEvent& event) override; 21 | bool finish() override; 22 | }; 23 | 24 | #endif 25 | -------------------------------------------------------------------------------- /Generator/src/GenReader.cpp: -------------------------------------------------------------------------------- 1 | #include "GenReader.h" 2 | 3 | GenReader::~GenReader(){ 4 | } 5 | 6 | -------------------------------------------------------------------------------- /Generator/src/GenReader.h: -------------------------------------------------------------------------------- 1 | #ifndef GenReader_h 2 | #define GenReader_h 1 3 | 4 | #include "GenEvent.h" 5 | #include "IGenTool.h" 6 | 7 | using namespace std; 8 | 9 | class GenReader: virtual public IGenTool{ 10 | 11 | public: 12 | ~GenReader(); 13 | virtual bool configure_gentool()=0; 14 | virtual bool mutate(MyHepMC::GenEvent& event)=0; 15 | virtual bool finish()=0; 16 | virtual bool isEnd()=0; 17 | }; 18 | 19 | #endif 20 | -------------------------------------------------------------------------------- /Generator/src/GuineaPigPairsFileParser.h: -------------------------------------------------------------------------------- 1 | #ifndef GuineaPigPairsFileParser_h 2 | #define GuineaPigPairsFileParser_h 3 | 4 | #include "IBeamBackgroundFileParser.h" 5 | #include 6 | 7 | /* Format of Guinea-Pig Pairs: 8 | * 9 | * E vx vy vz x y z process 10 | * 11 | * Notes: 12 | * - E (GeV). If E>0, it is electron. If E<0, it is positron 13 | * - vx/vy/vz (speed of light) 14 | * - x/y/z (nm) 15 | * - process 16 | * - 0: Breit-Wheeler 17 | * - 1: Bethe-Heitler 18 | * - 2: Landau-Lifschitz 19 | * 20 | */ 21 | 22 | class GuineaPigPairsFileParser: public IBeamBackgroundFileParser { 23 | public: 24 | GuineaPigPairsFileParser(const std::string& filename); 25 | 26 | bool load(IBeamBackgroundFileParser::BeamBackgroundData&); 27 | 28 | private: 29 | std::ifstream m_input; 30 | }; 31 | 32 | #endif 33 | -------------------------------------------------------------------------------- /Generator/src/HepMCRdr.h: -------------------------------------------------------------------------------- 1 | #ifndef HepMCRdr_h 2 | #define HepMCRdr_h 1 3 | 4 | #include "GaudiKernel/AlgTool.h" 5 | 6 | #include "GenReader.h" 7 | #include "GenEvent.h" 8 | 9 | #include "HepMC/IO_GenEvent.h"//HepMC 10 | #include "HepMC/GenEvent.h" 11 | 12 | 13 | class HepMCRdr: public extends { 14 | 15 | public: 16 | using extends::extends; 17 | ~HepMCRdr(); 18 | 19 | StatusCode initialize() override; 20 | StatusCode finalize() override; 21 | 22 | bool configure_gentool(); 23 | bool mutate(MyHepMC::GenEvent& event); 24 | bool finish(); 25 | bool isEnd(); 26 | private: 27 | HepMC::IO_GenEvent *ascii_in{nullptr}; 28 | long m_total_event{-1}; 29 | long m_processed_event{-1}; 30 | 31 | // input file name 32 | Gaudi::Property m_filename{this, "Input"}; 33 | 34 | }; 35 | 36 | #endif 37 | 38 | -------------------------------------------------------------------------------- /Generator/src/HepevtRdr.h: -------------------------------------------------------------------------------- 1 | #ifndef HepevtRdr_h 2 | #define HepevtRdr_h 1 3 | 4 | #include "GaudiKernel/AlgTool.h" 5 | 6 | #include "GenReader.h" 7 | #include "GenEvent.h" 8 | 9 | #include "lcio.h" 10 | #include "EVENT/LCIO.h" 11 | #include "LCAscHepRdr.h" 12 | 13 | class HepevtRdr: public extends { 14 | 15 | public: 16 | using extends::extends; 17 | ~HepevtRdr(); 18 | 19 | StatusCode initialize() override; 20 | StatusCode finalize() override; 21 | 22 | bool configure_gentool(); 23 | bool mutate(MyHepMC::GenEvent& event); 24 | bool finish(); 25 | bool isEnd(); 26 | private: 27 | UTIL::LCAscHepRdr* m_hepevt_rdr = nullptr; 28 | long m_total_event = -1; 29 | long m_processed_event = -1; 30 | 31 | // input file name 32 | Gaudi::Property m_filename{this, "Input"}; 33 | Gaudi::Property m_format{this, "Format"}; 34 | }; 35 | 36 | #endif 37 | 38 | -------------------------------------------------------------------------------- /Generator/src/IBeamBackgroundFileParser.h: -------------------------------------------------------------------------------- 1 | #ifndef IBeamBackgroundFileParser_h 2 | #define IBeamBackgroundFileParser_h 3 | 4 | /* 5 | * Description: 6 | * This interface is used to load the beam background information, such as: 7 | * - pdgid (optional) 8 | * About the pdgid, it will be e+/e- in most cases. 9 | * - x/y/z 10 | * - t (optional) 11 | * - px/py/pz 12 | * About the time, it could be set in the GtBeamBackgroundTool. 13 | * 14 | * Author: 15 | * Tao Lin 16 | */ 17 | 18 | class IBeamBackgroundFileParser { 19 | public: 20 | // Internal used Data 21 | struct BeamBackgroundData { 22 | int pdgid; 23 | 24 | double x; // unit: mm 25 | double y; // unit: mm 26 | double z; // unit: mm 27 | double t; // unit: ns 28 | 29 | double px; // unit: GeV 30 | double py; // unit: GeV 31 | double pz; // unit: GeV 32 | double mass; // unit: GeV 33 | 34 | BeamBackgroundData() 35 | : pdgid(11), x(0), y(0), z(0), t(0), 36 | px(0), py(0), pz(0), mass(0) {} 37 | 38 | }; 39 | 40 | // return false if failed to load the data 41 | virtual bool load(BeamBackgroundData&) = 0; 42 | }; 43 | 44 | #endif 45 | -------------------------------------------------------------------------------- /Generator/src/IGenTool.cpp: -------------------------------------------------------------------------------- 1 | #include "IGenTool.h" 2 | 3 | IGenTool::~IGenTool() { 4 | 5 | } 6 | -------------------------------------------------------------------------------- /Generator/src/IGenTool.h: -------------------------------------------------------------------------------- 1 | #ifndef IGenTool_h 2 | #define IGenTool_h 1 3 | 4 | /* 5 | * IGenTool is used to mutate an event. Several tools could be used 6 | * together to create a full event. 7 | * 8 | * ChangeLog: 9 | * - 2019.11.10, Tao Lin, make the IGenTool a Gaudi tool. 10 | */ 11 | 12 | #include "GaudiKernel/IAlgTool.h" 13 | #include "GenEvent.h" 14 | 15 | 16 | class IGenTool: virtual public IAlgTool { 17 | public: 18 | virtual bool mutate(MyHepMC::GenEvent& event)=0; 19 | virtual bool finish()=0; 20 | virtual bool configure_gentool()=0; 21 | virtual ~IGenTool(); 22 | }; 23 | 24 | #endif 25 | -------------------------------------------------------------------------------- /Generator/src/LCAscHepRdr.h: -------------------------------------------------------------------------------- 1 | #ifndef UTIL_LCAscHepRdr_H 2 | #define UTIL_LCAscHepRdr_H 1 3 | 4 | #include "IMPL/LCCollectionVec.h" 5 | #include 6 | 7 | namespace UTIL{ 8 | 9 | /**Basic utility for reading a ASCII HEPEvt file and filling 10 | * a LCCollectionVec with MCParticles containing the HEPEvt 11 | * file information. 12 | * 13 | * @author Mora de Freitas 14 | * @version $Id: 15 | */ 16 | class LCAscHepRdr{ 17 | 18 | public: 19 | 20 | /** Open the HEPEvt input file in the constructer 21 | */ 22 | LCAscHepRdr(const char* evfile, int fileFormat) ; 23 | 24 | /** noop 25 | */ 26 | ~LCAscHepRdr() ; 27 | 28 | /** Read an event and return a LCCollectionVec of MCParticles. 29 | */ 30 | IMPL::LCCollectionVec * readEvent() ; 31 | 32 | private: 33 | std::ifstream inputFile; 34 | int theFileFormat; 35 | 36 | }; // class 37 | 38 | } // namespace UTIL 39 | 40 | #endif /* ifndef UTIL_LCAscHepRdr_H */ 41 | -------------------------------------------------------------------------------- /Generator/src/SLCIORdr.h: -------------------------------------------------------------------------------- 1 | #ifndef SLCIORdr_h 2 | #define SLCIORdr_h 1 3 | 4 | #include "GaudiKernel/AlgTool.h" 5 | 6 | #include "GenReader.h" 7 | #include "GenEvent.h" 8 | 9 | #include "lcio.h" 10 | #include "LCIOSTLTypes.h" 11 | #include "IOIMPL/LCFactory.h" 12 | #include "EVENT/LCIO.h" 13 | #include "EVENT/LCEvent.h" 14 | #include "EVENT/LCCollection.h" 15 | #include "IO/LCReader.h" 16 | 17 | 18 | class SLCIORdr: public extends { 19 | 20 | public: 21 | using extends::extends; 22 | 23 | ~SLCIORdr(); 24 | 25 | // Overriding initialize and finalize 26 | StatusCode initialize() override; 27 | StatusCode finalize() override; 28 | 29 | bool configure_gentool() override; 30 | bool mutate(MyHepMC::GenEvent& event) override; 31 | bool finish() override; 32 | bool isEnd() override; 33 | private: 34 | IO::LCReader* m_slcio_rdr{nullptr}; 35 | long m_total_event{-1}; 36 | long m_processed_event{-1}; 37 | 38 | // input file name 39 | Gaudi::Property m_filename{this, "Input"}; 40 | 41 | }; 42 | 43 | #endif 44 | 45 | -------------------------------------------------------------------------------- /Generator/src/StdHepRdr.h: -------------------------------------------------------------------------------- 1 | #ifndef StdHepRdr_h 2 | #define StdHepRdr_h 1 3 | 4 | #include "GaudiKernel/AlgTool.h" 5 | 6 | #include "GenReader.h" 7 | #include "GenEvent.h" 8 | 9 | #include "lcio.h" 10 | #include "EVENT/LCIO.h" 11 | #include "UTIL/LCStdHepRdrNew.h" 12 | 13 | 14 | class StdHepRdr: public extends { 15 | 16 | public: 17 | 18 | using extends::extends; 19 | 20 | ~StdHepRdr(); 21 | 22 | // Overriding initialize and finalize 23 | StatusCode initialize() override; 24 | StatusCode finalize() override; 25 | 26 | bool configure_gentool() override; 27 | bool mutate(MyHepMC::GenEvent& event) override; 28 | bool finish() override; 29 | bool isEnd() override; 30 | private: 31 | lcio::LCStdHepRdrNew* m_stdhep_rdr{nullptr}; 32 | long m_total_event{-1}; 33 | long m_processed_event{-1}; 34 | 35 | // input file name 36 | Gaudi::Property m_filename{this, "Input"}; 37 | 38 | }; 39 | 40 | #endif 41 | 42 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # [CEPCSW](https://cepc.github.io/CEPCSW/) 2 | 3 | [![Build Status](https://www.travis-ci.com/cepc/CEPCSW.svg?branch=master)](https://www.travis-ci.com/cepc/CEPCSW) 4 | [![CI](https://github.com/cepc/CEPCSW/workflows/CI/badge.svg?branch=master)](https://github.com/cepc/CEPCSW/actions) 5 | 6 | CEPC offline software prototype based on [Key4hep](https://github.com/key4hep). 7 | 8 | ## Quick start 9 | 10 | SSH to lxslc7 (CentOS 7). 11 | 12 | Before run following commands, please make sure you setup the CVMFS: 13 | 14 | ``` 15 | $ git clone git@github.com:cepc/CEPCSW.git 16 | $ cd CEPCSW 17 | $ git checkout master # branch name 18 | $ source setup.sh 19 | $ ./build.sh 20 | $ ./run.sh Examples/options/helloalg.py 21 | ``` 22 | 23 | ## Packages 24 | 25 | * Examples: For new comers and users 26 | 27 | * Detector: Geometry 28 | 29 | * Generator: Physics Generator 30 | 31 | * Simulation: Detector Simulation 32 | 33 | * Digitization: Digitization 34 | 35 | * Reconstruction: Reconstruction 36 | 37 | 38 | ## Conventions for collections 39 | Keep the collection names compatible between the prototype and the existing CEPC software. 40 | 41 | * MCParticle 42 | * VXDCollection 43 | * SITCollection 44 | * TPCCollection 45 | * SETCollection 46 | -------------------------------------------------------------------------------- /Reconstruction/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | add_subdirectory(DCHDedx) 2 | add_subdirectory(Digi_Calo) 3 | add_subdirectory(PFA) 4 | add_subdirectory(SiliconTracking) 5 | add_subdirectory(Tracking) 6 | add_subdirectory(RecGenfitAlg) 7 | add_subdirectory(RecAssociationMaker) 8 | -------------------------------------------------------------------------------- /Reconstruction/DCHDedx/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | 2 | # Modules 3 | gaudi_add_module(DCHDedx 4 | SOURCES src/RecDCHDedxAlg.cpp 5 | LINK DetSimInterface 6 | DetInterface 7 | DetSegmentation 8 | k4FWCore::k4FWCore 9 | Gaudi::GaudiAlgLib 10 | Gaudi::GaudiKernel 11 | DetSegmentation 12 | EDM4HEP::edm4hep EDM4HEP::edm4hepDict 13 | ) 14 | 15 | install(TARGETS DCHDedx 16 | EXPORT CEPCSWTargets 17 | RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}" COMPONENT bin 18 | LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}" COMPONENT shlib 19 | COMPONENT dev) 20 | -------------------------------------------------------------------------------- /Reconstruction/Digi_Calo/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | 2 | ## Modules 3 | gaudi_add_module(Digi_Calo 4 | SOURCES src/CaloDigiAlg.cpp 5 | LINK DetInterface 6 | k4FWCore::k4FWCore 7 | Gaudi::GaudiKernel 8 | Gaudi::GaudiAlgLib 9 | ${CLHEP_LIBRARIES} 10 | ${DD4hep_COMPONENT_LIBRARIES} 11 | EDM4HEP::edm4hep EDM4HEP::edm4hepDict 12 | ) 13 | install(TARGETS Digi_Calo 14 | EXPORT CEPCSWTargets 15 | RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}" COMPONENT bin 16 | LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}" COMPONENT shlib 17 | COMPONENT dev) 18 | 19 | -------------------------------------------------------------------------------- /Reconstruction/PFA/Arbor/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | 2 | # Modules 3 | gaudi_add_module(Arbor 4 | SOURCES src/Arbor.cc 5 | src/ArborHit.cc 6 | src/ArborTool.cc 7 | src/ArborToolLCIO.cc 8 | src/ClusterAna.cc 9 | src/DetectorPos.cc 10 | src/HelixClassD.cc 11 | src/MarlinArbor.cc 12 | src/BushConnect.cc 13 | LINK EventSeeder 14 | GearSvc 15 | DataHelperLib 16 | DetInterface 17 | Gaudi::GaudiKernel 18 | k4FWCore::k4FWCore 19 | ${LCContent_LIBRARIES} 20 | ${CLHEP_LIBRARIES} 21 | ${ROOT_LIBRARIES} 22 | ${LCIO_LIBRARIES} 23 | ${GEAR_LIBRARIES} 24 | ${DD4hep_COMPONENT_LIBRARIES} 25 | EDM4HEP::edm4hep EDM4HEP::edm4hepDict 26 | ) 27 | 28 | target_include_directories(Arbor 29 | PUBLIC ${LCIO_INCLUDE_DIRS} 30 | ) 31 | 32 | install(TARGETS Arbor 33 | EXPORT CEPCSWTargets 34 | RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}" COMPONENT bin 35 | LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}" COMPONENT shlib 36 | COMPONENT dev) 37 | 38 | -------------------------------------------------------------------------------- /Reconstruction/PFA/Arbor/src/Arbor.h: -------------------------------------------------------------------------------- 1 | #ifndef _Arbor_hh_ 2 | #define _Arbor_hh_ 3 | 4 | #include "ArborHit.h" 5 | #include 6 | #include 7 | #include 8 | #include "ArborTool.h" 9 | 10 | void init(); 11 | 12 | void HitsCleaning( std::vector inputHits ); 13 | 14 | void HitsClassification( linkcoll inputLinks ); 15 | 16 | void BuildInitLink(std::vector Thresholds); 17 | 18 | void LinkIteration(int time); 19 | 20 | void BranchBuilding(float SeedThreshold); 21 | 22 | branchcoll Arbor( std::vector, std::vector Thresholds ); 23 | 24 | /* 25 | int NLayer_A, NStave_A, SubD_A; 26 | int NLayer_B, NStave_B, SubD_B; 27 | float MagA, MagB, Depth_A, Depth_B, ECCorr, DisAB; 28 | int FlagTrkPS, FlagEH; 29 | int FlagPSEE, FlagHH; 30 | int FlagStaveSame; 31 | int FlagStaveDiff; 32 | TVector3 PosA, PosB, PosDiffAB, PosDiffBA, linkDir; 33 | */ 34 | 35 | #endif 36 | 37 | 38 | -------------------------------------------------------------------------------- /Reconstruction/PFA/Arbor/src/ArborHit.cc: -------------------------------------------------------------------------------- 1 | #include "ArborHit.h" 2 | #include 3 | #include 4 | 5 | ArborHit::ArborHit( TVector3 hitPos, int hitLayer, float hitTime, float depth, int stave, int subD ) 6 | { 7 | setHit( hitPos, hitLayer, hitTime, depth, stave, subD ); 8 | } 9 | 10 | void ArborHit::setHit(TVector3 hitPos, int hitLayer, float hitTime, float depth, int stave, int subD ) 11 | { 12 | m_hitTime = hitTime; 13 | m_hitLayer = hitLayer; 14 | m_hitPos = hitPos; 15 | m_subD = subD; 16 | m_stave = stave; 17 | m_depth = depth; 18 | } 19 | -------------------------------------------------------------------------------- /Reconstruction/PFA/Arbor/src/ArborHit.h: -------------------------------------------------------------------------------- 1 | #ifndef _ARBORHIT_H_ 2 | #define _ARBORHIT_H_ 3 | 4 | #include "TVector3.h" 5 | #include 6 | 7 | class ArborHit 8 | { 9 | float m_hitTime; 10 | float m_depth; 11 | int m_hitLayer; 12 | TVector3 m_hitPos; 13 | int m_subD; 14 | int m_stave; 15 | 16 | public: 17 | 18 | // ArborHit(); 19 | ArborHit( TVector3 hitPos, int hitLayer, float hitTime, float depth, int stave, int subD ); 20 | 21 | void setHit( TVector3 hitPos, int hitLayer, float hitTime, float depth, int stave, int subD ); 22 | 23 | float GetTime() 24 | { 25 | return m_hitTime; 26 | } 27 | int GetLayer() 28 | { 29 | return m_hitLayer; 30 | } 31 | TVector3 GetPosition() 32 | { 33 | return m_hitPos; 34 | } 35 | int GetSubD() 36 | { 37 | return m_subD; 38 | } 39 | int GetStave() 40 | { 41 | return m_stave; 42 | } 43 | float GetDepth() 44 | { 45 | return m_depth; 46 | } 47 | }; 48 | 49 | #endif 50 | -------------------------------------------------------------------------------- /Reconstruction/PFA/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | 2 | add_subdirectory(Arbor) 3 | add_subdirectory(Pandora) 4 | -------------------------------------------------------------------------------- /Reconstruction/PFA/Pandora/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | 2 | add_subdirectory(GaudiPandora) 3 | add_subdirectory(MatrixPandora) 4 | -------------------------------------------------------------------------------- /Reconstruction/PFA/Pandora/GaudiPandora/include/Utility.h: -------------------------------------------------------------------------------- 1 | #ifndef PanUTIL 2 | #define PanUTIL 1 3 | 4 | #include 5 | #include "DD4hep/Detector.h" 6 | #include "DD4hep/DD4hepUnits.h" 7 | #include "DD4hep/DetType.h" 8 | #include "DDRec/DetectorData.h" 9 | #include "DD4hep/DetectorSelector.h" 10 | namespace PanUtil{ 11 | std::string Convert (float number); 12 | dd4hep::rec::LayeredCalorimeterData * getExtension(unsigned int includeFlag, unsigned int excludeFlag=0) ; 13 | void line_a_b(float x1, float y1, float x2, float y2, float& a, float& b); 14 | float getPhi(float x, float y); 15 | int partition(float x, float y); 16 | int getLayer(float x, float y, float z, std::vector& layers); 17 | int getLayer_v1(float x, float y, float z, std::vector& layers); 18 | int getStave(float x, float y); 19 | double getFieldFromCompact(); 20 | std::vector getTrackingRegionExtent(); 21 | } 22 | #endif 23 | -------------------------------------------------------------------------------- /Reconstruction/PFA/Pandora/MatrixPandora/include/Utility.h: -------------------------------------------------------------------------------- 1 | #ifndef MYUTILITY 2 | #define MYUTILITY 1 3 | 4 | #include 5 | std::string Convert (float number); 6 | #endif 7 | -------------------------------------------------------------------------------- /Reconstruction/PFA/Pandora/MatrixPandora/src/Utility.cpp: -------------------------------------------------------------------------------- 1 | #include "Utility.h" 2 | 3 | std::string Convert (float number){ 4 | std::ostringstream buff; 5 | buff< 4 | #include 5 | 6 | class LSFitting{ 7 | public: 8 | void Fitting(double& fitXc, double& fitYc, double& fitRadisu); 9 | static void FCN(int &npar, double *gin, double &f, double *par, int iflag); 10 | void setWire(double x,double y); 11 | void setDrift(double driftDist); 12 | void print(); 13 | void clear(); 14 | static std::vector m_wireX; 15 | static std::vector m_wireY; 16 | static std::vector m_driftDist; 17 | }; 18 | #endif 19 | -------------------------------------------------------------------------------- /Reconstruction/SiliconTracking/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | 2 | # Modules 3 | gaudi_add_module(SiliconTracking 4 | SOURCES src/ForwardTrackingAlg.cpp 5 | src/SiliconTrackingAlg.cpp 6 | src/SpacePointBuilderAlg.cpp 7 | src/TrackSubsetAlg.cpp 8 | LINK GearSvc 9 | EventSeeder 10 | TrackingLib 11 | TrackSystemSvcLib 12 | DataHelperLib 13 | KiTrackLib 14 | Gaudi::GaudiKernel 15 | k4FWCore::k4FWCore 16 | ${GEAR_LIBRARIES} 17 | ${GSL_LIBRARIES} 18 | ${LCIO_LIBRARIES} 19 | ) 20 | install(TARGETS SiliconTracking 21 | EXPORT CEPCSWTargets 22 | RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}" COMPONENT bin 23 | LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}" COMPONENT shlib 24 | COMPONENT dev) 25 | -------------------------------------------------------------------------------- /Reconstruction/Tracking/src/Clupatra/RuntimeMap.h: -------------------------------------------------------------------------------- 1 | #ifndef CLUPATRA_RUNTIMEMAP_H 2 | #define CLUPATRA_RUNTIMEMAP_H 3 | #include 4 | 5 | template 6 | class RuntimeMap { 7 | std::map data; 8 | public: 9 | V& operator()(const U& u) { 10 | return data[u]; 11 | } 12 | void clear() { 13 | data.clear(); 14 | } 15 | }; 16 | #endif 17 | -------------------------------------------------------------------------------- /Service/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | add_subdirectory(EventSeeder) 2 | add_subdirectory(GearSvc) 3 | add_subdirectory(TrackSystemSvc) 4 | -------------------------------------------------------------------------------- /Service/EventSeeder/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | 2 | gaudi_add_header_only_library(EventSeeder) 3 | 4 | gaudi_add_module(EventSeederPlugins 5 | SOURCES src/MarlinEvtSeeder.cpp 6 | LINK EventSeeder 7 | Gaudi::GaudiKernel 8 | ) 9 | 10 | install(TARGETS EventSeeder EventSeederPlugins 11 | EXPORT CEPCSWTargets 12 | RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}" COMPONENT bin 13 | LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}" COMPONENT shlib 14 | COMPONENT dev) 15 | 16 | 17 | -------------------------------------------------------------------------------- /Service/EventSeeder/README.md: -------------------------------------------------------------------------------- 1 | # EventSeeder 2 | 3 | This package is used to provide independent pseudo-randomly generated seeds for registered algorithms on an event by event basis. 4 | 5 | Currently the only implementation, MarlinEvtSeeder, is migrated from marlin::ProcessorEventSeeder. Please refer to https://github.com/iLCSoft/Marlin 6 | -------------------------------------------------------------------------------- /Service/EventSeeder/include/EventSeeder/IEventSeeder.h: -------------------------------------------------------------------------------- 1 | #ifndef I_EVENT_SEEDER_H 2 | #define I_EVENT_SEEDER_H 3 | 4 | #include "GaudiKernel/IService.h" 5 | 6 | class Algorithm; 7 | 8 | class IEventSeeder: virtual public IService { 9 | public: 10 | DeclareInterfaceID(IEventSeeder, 0, 1); // major/minor version 11 | 12 | virtual ~IEventSeeder() = default; 13 | 14 | // Register an algorithm for the seeding service 15 | virtual void registerAlg( Algorithm* alg ) = 0; 16 | 17 | // Get the seed corelated to current event and algorithm 18 | virtual unsigned int getSeed(Algorithm* alg, int eventNumber, int runNumber) = 0; 19 | }; 20 | 21 | #endif 22 | -------------------------------------------------------------------------------- /Service/GearSvc/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | 2 | gaudi_add_header_only_library(GearSvc) 3 | 4 | gaudi_add_module(GearSvcPlugins 5 | SOURCES src/GearSvc.cpp 6 | LINK GearSvc 7 | Gaudi::GaudiKernel 8 | ${GEAR_LIBRARIES} 9 | ${DD4hep_COMPONENT_LIBRARIES} 10 | DetInterface 11 | DetSegmentation 12 | ) 13 | 14 | target_include_directories(GearSvcPlugins 15 | PUBLIC ${GEAR_INCLUDE_DIRS} 16 | ) 17 | 18 | install(TARGETS GearSvc GearSvcPlugins 19 | EXPORT CEPCSWTargets 20 | RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}" COMPONENT bin 21 | LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}" COMPONENT shlib 22 | COMPONENT dev) 23 | 24 | -------------------------------------------------------------------------------- /Service/GearSvc/include/GearSvc/IGearSvc.h: -------------------------------------------------------------------------------- 1 | #ifndef I_GEAR_SVC_H 2 | #define I_GEAR_SVC_H 3 | 4 | #include "GaudiKernel/IService.h" 5 | #include "gear/GearMgr.h" 6 | 7 | // IGearSvc is the interface between Gaudi and GEAR. 8 | 9 | class IGearSvc: virtual public IService { 10 | public: 11 | DeclareInterfaceID(IGearSvc, 0, 1); // major/minor version 12 | 13 | virtual ~IGearSvc() = default; 14 | 15 | // Get the GEAR Manager 16 | virtual gear::GearMgr* getGearMgr() = 0; 17 | 18 | }; 19 | 20 | 21 | #endif 22 | -------------------------------------------------------------------------------- /Service/GearSvc/src/GearSvc.h: -------------------------------------------------------------------------------- 1 | #ifndef GEAR_SVC_H 2 | #define GEAR_SVC_H 3 | 4 | #include "GearSvc/IGearSvc.h" 5 | #include 6 | #include "DD4hep/Detector.h" 7 | class TGeoNode; 8 | 9 | class GearSvc : public extends 10 | { 11 | public: 12 | GearSvc(const std::string& name, ISvcLocator* svc); 13 | virtual ~GearSvc(); 14 | 15 | gear::GearMgr* getGearMgr() override; 16 | 17 | StatusCode initialize() override; 18 | StatusCode finalize() override; 19 | 20 | private: 21 | StatusCode convertBeamPipe(dd4hep::DetElement& pipe); 22 | StatusCode convertVXD(dd4hep::DetElement& vxd); 23 | StatusCode convertSIT(dd4hep::DetElement& sit); 24 | StatusCode convertTPC(dd4hep::DetElement& tpc); 25 | StatusCode convertDC (dd4hep::DetElement& dc); 26 | StatusCode convertSET(dd4hep::DetElement& set); 27 | StatusCode convertFTD(dd4hep::DetElement& ftd); 28 | TGeoNode* FindNode(TGeoNode* mother, char* name); 29 | 30 | Gaudi::Property m_gearFile{this, "GearXMLFile", ""}; 31 | Gaudi::Property m_field{this, "MagneticField", 0}; 32 | 33 | gear::GearMgr* m_gearMgr; 34 | }; 35 | 36 | #endif 37 | -------------------------------------------------------------------------------- /Service/TrackSystemSvc/include/TrackSystemSvc/ITrackSystemSvc.h: -------------------------------------------------------------------------------- 1 | #ifndef ITrackSystemSvc_h 2 | #define ITrackSystemSvc_h 3 | 4 | #include "GaudiKernel/IService.h" 5 | #include "IMarlinTrkSystem.h" 6 | 7 | // ITrackSystemSvc is the interface between Gaudi and Track. 8 | 9 | class ITrackSystemSvc: virtual public IService { 10 | public: 11 | DeclareInterfaceID(ITrackSystemSvc, 0, 1); // major/minor version 12 | 13 | virtual ~ITrackSystemSvc() = default; 14 | 15 | //Get the track manager 16 | virtual MarlinTrk::IMarlinTrkSystem* getTrackSystem(void* address=0) = 0; 17 | 18 | virtual void removeTrackSystem(void* address=0) = 0; 19 | }; 20 | 21 | #endif 22 | -------------------------------------------------------------------------------- /Service/TrackSystemSvc/src/IMarlinTrkSystem.cc: -------------------------------------------------------------------------------- 1 | #include "TrackSystemSvc/IMarlinTrkSystem.h" 2 | #include 3 | 4 | namespace MarlinTrk{ 5 | 6 | void IMarlinTrkSystem::setOption(unsigned CFGOption, bool val) { 7 | _cfg.setOption( CFGOption, val ) ; 8 | } 9 | 10 | 11 | bool IMarlinTrkSystem::getOption( unsigned CFGOption) { 12 | return _cfg[ CFGOption] ; 13 | } 14 | 15 | 16 | std::string IMarlinTrkSystem::getOptions() { 17 | 18 | std::stringstream ss ; 19 | ss << _cfg ; 20 | return ss.str() ; 21 | } 22 | 23 | void IMarlinTrkSystem::registerOptions() { 24 | 25 | _cfg.registerOption( IMarlinTrkSystem::CFG::useQMS, "useMultipleScattering", true) ; 26 | _cfg.registerOption( IMarlinTrkSystem::CFG::usedEdx, "useEnergyLoss", true) ; 27 | _cfg.registerOption( IMarlinTrkSystem::CFG::useSmoothing, "useSmoothingInFit", false) ; 28 | 29 | 30 | } 31 | 32 | 33 | } 34 | -------------------------------------------------------------------------------- /Service/TrackSystemSvc/src/TrackSystemSvc.h: -------------------------------------------------------------------------------- 1 | #ifndef TrackSystemSvc_h 2 | #define TrackSystemSvc_h 3 | 4 | #include "TrackSystemSvc/ITrackSystemSvc.h" 5 | #include 6 | 7 | class TrackSystemSvc : public extends{ 8 | public: 9 | TrackSystemSvc(const std::string& name, ISvcLocator* svc); 10 | ~TrackSystemSvc(); 11 | 12 | MarlinTrk::IMarlinTrkSystem* getTrackSystem(void* address=0) override; 13 | void removeTrackSystem(void* address=0) override; 14 | 15 | StatusCode initialize() override; 16 | StatusCode finalize() override; 17 | 18 | private: 19 | std::map m_trackSystems; 20 | }; 21 | 22 | #endif 23 | -------------------------------------------------------------------------------- /Simulation/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | 2 | add_subdirectory(DetSimAna) 3 | add_subdirectory(DetSimCore) 4 | add_subdirectory(DetSimDedx) 5 | add_subdirectory(DetSimFastModel) 6 | add_subdirectory(DetSimGeom) 7 | add_subdirectory(DetSimInterface) 8 | add_subdirectory(DetSimSD) 9 | -------------------------------------------------------------------------------- /Simulation/DetSimAna/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | 2 | find_package(Geant4 REQUIRED ui_all vis_all) 3 | include(${Geant4_USE_FILE}) 4 | 5 | gaudi_add_module(DetSimAna 6 | SOURCES src/Edm4hepWriterAnaElemTool.cpp 7 | LINK DetSimInterface 8 | DetSimSDLib 9 | ${DD4hep_COMPONENT_LIBRARIES} 10 | Gaudi::GaudiKernel 11 | EDM4HEP::edm4hep EDM4HEP::edm4hepDict 12 | k4FWCore::k4FWCore 13 | ) 14 | 15 | target_include_directories(DetSimAna PUBLIC 16 | $/include 17 | $) 18 | 19 | install(TARGETS DetSimAna 20 | EXPORT CEPCSWTargets 21 | RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}" COMPONENT bin 22 | LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}" COMPONENT shlib 23 | COMPONENT dev) 24 | -------------------------------------------------------------------------------- /Simulation/DetSimCore/src/ActionInitialization.cpp: -------------------------------------------------------------------------------- 1 | #include "ActionInitialization.h" 2 | 3 | #include "RunAction.h" 4 | #include "EventAction.h" 5 | #include "TrackingAction.h" 6 | #include "SteppingAction.h" 7 | 8 | ActionInitialization::ActionInitialization(ToolHandleArray& anatools) 9 | : G4VUserActionInitialization(), 10 | m_anaelemtools(anatools) { 11 | 12 | } 13 | 14 | ActionInitialization::~ActionInitialization() { 15 | 16 | } 17 | 18 | void 19 | ActionInitialization::BuildForMaster() const { 20 | 21 | } 22 | 23 | void 24 | ActionInitialization::Build() const { 25 | 26 | 27 | RunAction* runAction = new RunAction(m_anaelemtools); 28 | SetUserAction(runAction); 29 | 30 | EventAction* eventAction = new EventAction(m_anaelemtools); 31 | SetUserAction(eventAction); 32 | 33 | TrackingAction* trackingAction = new TrackingAction(m_anaelemtools); 34 | SetUserAction(trackingAction); 35 | 36 | SteppingAction* steppingAction = new SteppingAction(m_anaelemtools); 37 | SetUserAction(steppingAction); 38 | 39 | } 40 | -------------------------------------------------------------------------------- /Simulation/DetSimCore/src/ActionInitialization.h: -------------------------------------------------------------------------------- 1 | #ifndef ActionInitialization_h 2 | #define ActionInitialization_h 3 | 4 | #include 5 | 6 | #include 7 | 8 | 9 | #include "G4VUserActionInitialization.hh" 10 | 11 | class ActionInitialization: public G4VUserActionInitialization { 12 | public: 13 | 14 | ActionInitialization(ToolHandleArray&); 15 | ~ActionInitialization(); 16 | 17 | void BuildForMaster() const override; 18 | void Build() const override; 19 | 20 | private: 21 | ToolHandleArray& m_anaelemtools; 22 | }; 23 | 24 | 25 | #endif 26 | -------------------------------------------------------------------------------- /Simulation/DetSimCore/src/DetSimSvc.h: -------------------------------------------------------------------------------- 1 | #ifndef DetSimSvc_h 2 | #define DetSimSvc_h 3 | 4 | #include "DetSimInterface/IDetSimSvc.h" 5 | #include 6 | 7 | class DetSimSvc: public extends { 8 | public: 9 | 10 | DetSimSvc(const std::string& name, ISvcLocator* svc ); 11 | ~DetSimSvc(); 12 | 13 | // Get the Run Manager 14 | G4RunManager* getRM() override; 15 | 16 | // Control the run manager directly. 17 | StatusCode initializeRM() override; 18 | StatusCode simulateEvent(int i_event) override; 19 | StatusCode finalizeRM() override; 20 | 21 | StatusCode initialize() override; 22 | StatusCode finalize() override; 23 | 24 | private: 25 | G4RunManager* m_runmgr; 26 | 27 | }; 28 | 29 | 30 | #endif 31 | -------------------------------------------------------------------------------- /Simulation/DetSimCore/src/DetectorConstruction.h: -------------------------------------------------------------------------------- 1 | #ifndef DetectorConstruction_h 2 | #define DetectorConstruction_h 3 | 4 | #include "GaudiKernel/ToolHandle.h" 5 | #include "DetSimInterface/IDetElemTool.h" 6 | #include "DetSimInterface/IFastSimG4Tool.h" 7 | 8 | #include "globals.hh" 9 | #include "G4VUserDetectorConstruction.hh" 10 | #include "G4OpticalSurface.hh" 11 | #include "G4Material.hh" 12 | 13 | // A concrete detector construction class. 14 | // The base class is Geant4's G4VUserDetectorConstruction only. 15 | // Another Gaudi tool is used to configure & create this object. 16 | 17 | class DetectorConstruction: public G4VUserDetectorConstruction { 18 | 19 | public: 20 | DetectorConstruction(ToolHandle& root_elem, 21 | ToolHandleArray& fast_simtools); 22 | ~DetectorConstruction(); 23 | public: 24 | G4VPhysicalVolume* Construct() override; 25 | void ConstructSDandField() override; 26 | 27 | private: 28 | ToolHandle& m_root_detelem; 29 | ToolHandleArray& m_fast_simtools; 30 | }; 31 | 32 | #endif 33 | -------------------------------------------------------------------------------- /Simulation/DetSimCore/src/EventAction.cpp: -------------------------------------------------------------------------------- 1 | #include "EventAction.h" 2 | 3 | EventAction::EventAction(ToolHandleArray& anatools) 4 | : G4UserEventAction(), 5 | m_anaelemtools(anatools) { 6 | 7 | } 8 | 9 | EventAction::~EventAction() { 10 | 11 | } 12 | 13 | void 14 | EventAction::BeginOfEventAction(const G4Event* anEvent) { 15 | for (auto ana: m_anaelemtools) { 16 | ana->BeginOfEventAction(anEvent); 17 | } 18 | } 19 | 20 | void 21 | EventAction::EndOfEventAction(const G4Event* anEvent) { 22 | for (auto ana: m_anaelemtools) { 23 | ana->EndOfEventAction(anEvent); 24 | } 25 | } 26 | 27 | -------------------------------------------------------------------------------- /Simulation/DetSimCore/src/EventAction.h: -------------------------------------------------------------------------------- 1 | #ifndef EventAction_h 2 | #define EventAction_h 3 | 4 | #include 5 | 6 | #include 7 | 8 | #include "G4UserEventAction.hh" 9 | 10 | class G4Event; 11 | 12 | class EventAction: public G4UserEventAction { 13 | public: 14 | 15 | EventAction(ToolHandleArray&); 16 | ~EventAction(); 17 | 18 | void BeginOfEventAction(const G4Event*) override; 19 | void EndOfEventAction(const G4Event*) override; 20 | 21 | private: 22 | ToolHandleArray& m_anaelemtools; 23 | }; 24 | 25 | #endif 26 | -------------------------------------------------------------------------------- /Simulation/DetSimCore/src/G4PrimaryCnvTool.h: -------------------------------------------------------------------------------- 1 | #ifndef G4PrimaryCnvTool_h 2 | #define G4PrimaryCnvTool_h 3 | 4 | #include "GaudiKernel/AlgTool.h" 5 | #include "DetSimInterface/IG4PrimaryCnvTool.h" 6 | #include "k4FWCore/DataHandle.h" 7 | 8 | #include "edm4hep/EventHeaderCollection.h" 9 | #include "edm4hep/MCParticleCollection.h" 10 | 11 | class G4PrimaryCnvTool: public extends { 12 | public: 13 | 14 | using extends::extends; 15 | 16 | bool mutate(G4Event* anEvent) override; 17 | 18 | private: 19 | DataHandle m_mcParCol{"MCParticleGen", Gaudi::DataHandle::Reader, this}; 20 | 21 | Gaudi::Property m_chargedgeantino_mass{this, "ChargedGeantinoMass"}; 22 | }; 23 | 24 | #endif 25 | -------------------------------------------------------------------------------- /Simulation/DetSimCore/src/PrimaryGeneratorAction.h: -------------------------------------------------------------------------------- 1 | #ifndef PrimaryGeneratorAction_h 2 | #define PrimaryGeneratorAction_h 3 | 4 | #include 5 | #include "G4VUserPrimaryGeneratorAction.hh" 6 | #include 7 | 8 | class PrimaryGeneratorAction : public G4VUserPrimaryGeneratorAction 9 | { 10 | public: 11 | PrimaryGeneratorAction(ToolHandle& cnvtool); 12 | ~PrimaryGeneratorAction(); 13 | 14 | public: 15 | void GeneratePrimaries(G4Event* anEvent); 16 | 17 | private: 18 | ToolHandle tool; 19 | }; 20 | 21 | #endif 22 | 23 | -------------------------------------------------------------------------------- /Simulation/DetSimCore/src/RunAction.cpp: -------------------------------------------------------------------------------- 1 | #include "RunAction.h" 2 | 3 | #include "G4Run.hh" 4 | 5 | RunAction::RunAction(ToolHandleArray& anatools) 6 | : G4UserRunAction(), 7 | m_anaelemtools(anatools) { 8 | 9 | } 10 | 11 | RunAction::~RunAction() { 12 | 13 | } 14 | 15 | void 16 | RunAction::BeginOfRunAction(const G4Run* aRun) 17 | { 18 | for (auto ana: m_anaelemtools) { 19 | ana->BeginOfRunAction(aRun); 20 | } 21 | 22 | } 23 | 24 | void 25 | RunAction::EndOfRunAction(const G4Run* aRun) 26 | { 27 | for (auto ana: m_anaelemtools) { 28 | ana->EndOfRunAction(aRun); 29 | } 30 | } 31 | 32 | 33 | -------------------------------------------------------------------------------- /Simulation/DetSimCore/src/RunAction.h: -------------------------------------------------------------------------------- 1 | #ifndef RunAction_h 2 | #define RunAction_h 3 | 4 | #include 5 | 6 | #include 7 | 8 | #include "G4UserRunAction.hh" 9 | 10 | class G4Run; 11 | 12 | 13 | class RunAction: public G4UserRunAction { 14 | 15 | public: 16 | RunAction(ToolHandleArray&); 17 | ~RunAction(); 18 | 19 | virtual void BeginOfRunAction(const G4Run*); 20 | virtual void EndOfRunAction(const G4Run*); 21 | private: 22 | ToolHandleArray& m_anaelemtools; 23 | 24 | }; 25 | 26 | #endif 27 | -------------------------------------------------------------------------------- /Simulation/DetSimCore/src/SteppingAction.cpp: -------------------------------------------------------------------------------- 1 | #include "SteppingAction.h" 2 | 3 | SteppingAction::SteppingAction(ToolHandleArray& anatools) 4 | : m_anaelemtools(anatools) { 5 | 6 | } 7 | 8 | SteppingAction::~SteppingAction() { 9 | 10 | } 11 | 12 | void 13 | SteppingAction::UserSteppingAction(const G4Step* aStep) { 14 | for (auto ana: m_anaelemtools) { 15 | ana->UserSteppingAction(aStep); 16 | } 17 | } 18 | 19 | -------------------------------------------------------------------------------- /Simulation/DetSimCore/src/SteppingAction.h: -------------------------------------------------------------------------------- 1 | #ifndef SteppingAction_h 2 | #define SteppingAction_h 3 | 4 | #include 5 | 6 | #include 7 | 8 | #include "G4UserSteppingAction.hh" 9 | 10 | class G4Step; 11 | 12 | class SteppingAction: public G4UserSteppingAction { 13 | 14 | public: 15 | SteppingAction(ToolHandleArray&); 16 | ~SteppingAction(); 17 | 18 | void UserSteppingAction(const G4Step*) override; 19 | 20 | private: 21 | ToolHandleArray& m_anaelemtools; 22 | }; 23 | 24 | #endif 25 | -------------------------------------------------------------------------------- /Simulation/DetSimCore/src/TrackingAction.cpp: -------------------------------------------------------------------------------- 1 | #include "TrackingAction.h" 2 | 3 | TrackingAction::TrackingAction(ToolHandleArray& anatools) 4 | : G4UserTrackingAction(), 5 | m_anaelemtools(anatools) { 6 | 7 | } 8 | 9 | TrackingAction::~TrackingAction() { 10 | 11 | } 12 | 13 | void 14 | TrackingAction::PreUserTrackingAction(const G4Track* aTrack) { 15 | for (auto ana: m_anaelemtools) { 16 | ana->PreUserTrackingAction(aTrack); 17 | } 18 | } 19 | 20 | void 21 | TrackingAction::PostUserTrackingAction(const G4Track* aTrack) { 22 | for (auto ana: m_anaelemtools) { 23 | ana->PostUserTrackingAction(aTrack); 24 | } 25 | } 26 | 27 | 28 | -------------------------------------------------------------------------------- /Simulation/DetSimCore/src/TrackingAction.h: -------------------------------------------------------------------------------- 1 | #ifndef TrackingAction_h 2 | #define TrackingAction_h 3 | 4 | #include 5 | 6 | #include 7 | 8 | #include "G4UserTrackingAction.hh" 9 | 10 | class TrackingAction: public G4UserTrackingAction { 11 | 12 | public: 13 | 14 | TrackingAction(ToolHandleArray&); 15 | ~TrackingAction(); 16 | 17 | void PreUserTrackingAction(const G4Track*); 18 | void PostUserTrackingAction(const G4Track*); 19 | 20 | private: 21 | ToolHandleArray& m_anaelemtools; 22 | 23 | }; 24 | 25 | #endif 26 | -------------------------------------------------------------------------------- /Simulation/DetSimDedx/src/BetheBlochEquationDedxSimTool.h: -------------------------------------------------------------------------------- 1 | #ifndef BetheBlochEquationDedxSimTool_h 2 | #define BetheBlochEquationDedxSimTool_h 3 | 4 | #include "DetSimInterface/IDedxSimTool.h" 5 | #include 6 | #include "edm4hep/MCParticle.h" 7 | 8 | class BetheBlochEquationDedxSimTool: public extends { 9 | public: 10 | using extends::extends; 11 | 12 | StatusCode initialize() override; 13 | StatusCode finalize() override; 14 | double dedx(const G4Step* aStep) override; 15 | double dedx(const edm4hep::MCParticle& mc) override; 16 | double dndx(double betagamma) override; 17 | 18 | private: 19 | 20 | Gaudi::Property m_material_Z{this, "material_Z", 2};//Default is Helium 21 | Gaudi::Property m_material_A{this, "material_A", 4}; 22 | Gaudi::Property m_material_density{this, "material_density", 0.000178};//g/cm^3 23 | Gaudi::Property m_scale{this, "scale", 1}; 24 | Gaudi::Property m_resolution{this, "resolution", 0}; 25 | float m_me;// Here me is the electron rest mass 26 | float m_K; // K was set as a constant. 27 | float m_I; // Mean excitation energy 28 | }; 29 | 30 | #endif 31 | -------------------------------------------------------------------------------- /Simulation/DetSimDedx/src/DummyDedxSimTool.cpp: -------------------------------------------------------------------------------- 1 | #include "DummyDedxSimTool.h" 2 | 3 | #include "G4Step.hh" 4 | 5 | DECLARE_COMPONENT(DummyDedxSimTool); 6 | 7 | StatusCode DummyDedxSimTool::initialize() { 8 | StatusCode sc; 9 | 10 | return sc; 11 | } 12 | 13 | StatusCode DummyDedxSimTool::finalize() { 14 | StatusCode sc; 15 | 16 | return sc; 17 | } 18 | 19 | double DummyDedxSimTool::dedx(const G4Step* aStep) { 20 | double result = aStep->GetTotalEnergyDeposit(); 21 | 22 | 23 | return result; 24 | } 25 | double DummyDedxSimTool::dedx(const edm4hep::MCParticle& mc) { 26 | return -1; 27 | } 28 | double DummyDedxSimTool::dndx(double betagamma) { 29 | return -1; 30 | } 31 | -------------------------------------------------------------------------------- /Simulation/DetSimDedx/src/DummyDedxSimTool.h: -------------------------------------------------------------------------------- 1 | #ifndef DummyDedxSimTool_h 2 | #define DummyDedxSimTool_h 3 | 4 | #include "GaudiKernel/AlgTool.h" 5 | #include "DetSimInterface/IDedxSimTool.h" 6 | #include "edm4hep/MCParticle.h" 7 | 8 | class DummyDedxSimTool: public extends { 9 | 10 | public: 11 | using extends::extends; 12 | 13 | /// Overriding initialize and finalize 14 | StatusCode initialize() override; 15 | StatusCode finalize() override; 16 | 17 | /// Overriding dedx tool 18 | double dedx(const G4Step* aStep) override; 19 | double dedx(const edm4hep::MCParticle& mc) override; 20 | double dndx(double betagamma) override; 21 | 22 | }; 23 | 24 | #endif 25 | -------------------------------------------------------------------------------- /Simulation/DetSimDedx/src/GFDndxSimTool.cpp: -------------------------------------------------------------------------------- 1 | #include "GFDndxSimTool.h" 2 | 3 | #include "G4Step.hh" 4 | 5 | DECLARE_COMPONENT(GFDndxSimTool); 6 | 7 | StatusCode GFDndxSimTool::initialize() { 8 | StatusCode sc; 9 | 10 | return sc; 11 | } 12 | 13 | StatusCode GFDndxSimTool::finalize() { 14 | StatusCode sc; 15 | 16 | return sc; 17 | } 18 | 19 | double GFDndxSimTool::dedx(const G4Step* aStep) { 20 | double result = aStep->GetTotalEnergyDeposit(); 21 | return result; 22 | } 23 | double GFDndxSimTool::dedx(const edm4hep::MCParticle& mc) { 24 | return -1; 25 | } 26 | double GFDndxSimTool::dndx(double betagamma) { 27 | return -999; 28 | } 29 | -------------------------------------------------------------------------------- /Simulation/DetSimDedx/src/GFDndxSimTool.h: -------------------------------------------------------------------------------- 1 | #ifndef GFDndxSimTool_h 2 | #define GFDndxSimTool_h 3 | 4 | #include "GaudiKernel/AlgTool.h" 5 | #include "DetSimInterface/IDedxSimTool.h" 6 | #include "edm4hep/MCParticle.h" 7 | 8 | class GFDndxSimTool: public extends { 9 | 10 | public: 11 | using extends::extends; 12 | 13 | /// Overriding initialize and finalize 14 | StatusCode initialize() override; 15 | StatusCode finalize() override; 16 | 17 | /// Overriding dedx tool 18 | double dedx(const G4Step* aStep) override; 19 | double dedx(const edm4hep::MCParticle& mc) override; 20 | double dndx(double betagamma) override; 21 | 22 | }; 23 | 24 | #endif 25 | -------------------------------------------------------------------------------- /Simulation/DetSimFastModel/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | 2 | find_package(Geant4 REQUIRED ui_all vis_all) 3 | include(${Geant4_USE_FILE}) 4 | 5 | 6 | gaudi_add_module(DetSimFastModel 7 | SOURCES src/DummyFastSimG4Tool.cpp 8 | src/DummyFastSimG4Model.cpp 9 | src/EcalFastSimG4Model.cpp 10 | src/EcalFastSimG4Tool.cpp 11 | LINK DetSimInterface 12 | ${DD4hep_COMPONENT_LIBRARIES} 13 | Gaudi::GaudiKernel 14 | ) 15 | 16 | -------------------------------------------------------------------------------- /Simulation/DetSimFastModel/src/DummyFastSimG4Model.cpp: -------------------------------------------------------------------------------- 1 | #include "DummyFastSimG4Model.h" 2 | 3 | #include "G4Track.hh" 4 | #include "G4FastTrack.hh" 5 | 6 | DummyFastSimG4Model::DummyFastSimG4Model(G4String aModelName, G4Region* aEnvelope) 7 | : G4VFastSimulationModel(aModelName, aEnvelope) { 8 | 9 | } 10 | 11 | DummyFastSimG4Model::~DummyFastSimG4Model() { 12 | 13 | } 14 | 15 | G4bool DummyFastSimG4Model::IsApplicable(const G4ParticleDefinition& aParticle) { 16 | return aParticle.GetPDGCharge() != 0; 17 | } 18 | 19 | G4bool DummyFastSimG4Model::ModelTrigger(const G4FastTrack& aFastTrack) { 20 | // G4cout << __FILE__ << __LINE__ << ": ModelTrigger." << G4endl; 21 | 22 | bool istrigged = false; 23 | 24 | // only select the secondaries 25 | const G4Track* track = aFastTrack.GetPrimaryTrack(); 26 | // secondaries 27 | if (track->GetParentID() != 0) { 28 | istrigged = true; 29 | } 30 | return istrigged; 31 | } 32 | 33 | void DummyFastSimG4Model::DoIt(const G4FastTrack& aFastTrack, G4FastStep& aFastStep) { 34 | // G4cout << __FILE__ << __LINE__ << ": DoIt." << G4endl; 35 | 36 | aFastStep.ProposeTrackStatus(fStopAndKill); 37 | } 38 | -------------------------------------------------------------------------------- /Simulation/DetSimFastModel/src/DummyFastSimG4Model.h: -------------------------------------------------------------------------------- 1 | #ifndef DummyFastSimG4Model_h 2 | #define DummyFastSimG4Model_h 3 | 4 | #include "G4VFastSimulationModel.hh" 5 | 6 | class DummyFastSimG4Model: public G4VFastSimulationModel { 7 | public: 8 | 9 | DummyFastSimG4Model(G4String aModelName, G4Region* aEnvelope); 10 | ~DummyFastSimG4Model(); 11 | 12 | virtual G4bool IsApplicable( const G4ParticleDefinition& aParticle ); 13 | virtual G4bool ModelTrigger( const G4FastTrack& aFastTrack ); 14 | virtual void DoIt( const G4FastTrack& aFastTrack, G4FastStep& aFastStep ); 15 | 16 | }; 17 | 18 | #endif 19 | 20 | -------------------------------------------------------------------------------- /Simulation/DetSimFastModel/src/DummyFastSimG4Tool.cpp: -------------------------------------------------------------------------------- 1 | #include "DummyFastSimG4Tool.h" 2 | 3 | #include "G4Region.hh" 4 | #include "G4RegionStore.hh" 5 | 6 | #include "G4VFastSimulationModel.hh" 7 | #include "DummyFastSimG4Model.h" 8 | 9 | DECLARE_COMPONENT(DummyFastSimG4Tool) 10 | 11 | StatusCode DummyFastSimG4Tool::initialize() { 12 | StatusCode sc; 13 | 14 | return sc; 15 | } 16 | 17 | StatusCode DummyFastSimG4Tool::finalize() { 18 | StatusCode sc; 19 | 20 | return sc; 21 | } 22 | 23 | bool DummyFastSimG4Tool::CreateFastSimulationModel() { 24 | // In this method: 25 | // * Retrieve the G4Region 26 | // * Create Model 27 | // * Associate model and region 28 | 29 | G4String model_name = "DummyFastSimG4Model"; 30 | for (auto region_name: m_regions.value()) { 31 | G4Region* aEnvelope = G4RegionStore::GetInstance()->GetRegion(region_name); 32 | if (!aEnvelope) { 33 | error() << "Failed to find G4Region '" << region_name << "'" << endmsg; 34 | return false; 35 | } 36 | 37 | DummyFastSimG4Model* model = new DummyFastSimG4Model(model_name+region_name, aEnvelope); 38 | info() << "Create Model " << model_name << " for G4Region " << region_name << endmsg; 39 | } 40 | return true; 41 | } 42 | -------------------------------------------------------------------------------- /Simulation/DetSimFastModel/src/DummyFastSimG4Tool.h: -------------------------------------------------------------------------------- 1 | #ifndef DummyFastSimG4Tool_h 2 | #define DummyFastSimG4Tool_h 3 | 4 | #include "GaudiKernel/AlgTool.h" 5 | #include "DetSimInterface/IFastSimG4Tool.h" 6 | 7 | class DummyFastSimG4Tool: public extends { 8 | public: 9 | using extends::extends; 10 | 11 | StatusCode initialize() override; 12 | StatusCode finalize() override; 13 | 14 | bool CreateFastSimulationModel() override; 15 | 16 | private: 17 | // the regions will be associated with the fast sim model 18 | Gaudi::Property> m_regions{this, "Regions"}; 19 | }; 20 | 21 | #endif 22 | -------------------------------------------------------------------------------- /Simulation/DetSimFastModel/src/EcalFastSimG4Model.h: -------------------------------------------------------------------------------- 1 | #ifndef EcalFastSimG4Model_h 2 | #define EcalFastSimG4Model_h 3 | 4 | #include "G4VFastSimulationModel.hh" 5 | 6 | class EcalFastSimG4Model: public G4VFastSimulationModel { 7 | public: 8 | 9 | EcalFastSimG4Model(G4String aModelName, G4Region* aEnvelope); 10 | ~EcalFastSimG4Model(); 11 | 12 | virtual G4bool IsApplicable( const G4ParticleDefinition& aParticle ); 13 | virtual G4bool ModelTrigger( const G4FastTrack& aFastTrack ); 14 | virtual void DoIt( const G4FastTrack& aFastTrack, G4FastStep& aFastStep ); 15 | 16 | }; 17 | 18 | #endif 19 | 20 | -------------------------------------------------------------------------------- /Simulation/DetSimFastModel/src/EcalFastSimG4Tool.cpp: -------------------------------------------------------------------------------- 1 | #include "EcalFastSimG4Tool.h" 2 | 3 | #include "G4Region.hh" 4 | #include "G4RegionStore.hh" 5 | 6 | #include "G4VFastSimulationModel.hh" 7 | #include "EcalFastSimG4Model.h" 8 | 9 | DECLARE_COMPONENT(EcalFastSimG4Tool); 10 | 11 | StatusCode EcalFastSimG4Tool::initialize() { 12 | StatusCode sc; 13 | 14 | return sc; 15 | } 16 | 17 | StatusCode EcalFastSimG4Tool::finalize() { 18 | StatusCode sc; 19 | 20 | return sc; 21 | } 22 | 23 | bool EcalFastSimG4Tool::CreateFastSimulationModel() { 24 | // In this method: 25 | // * Retrieve the G4Region 26 | // * Create Model 27 | // * Associate model and region 28 | 29 | G4String model_name = "EcalFastSimG4Model"; 30 | for (auto region_name: m_regions.value()) { 31 | G4Region* aEnvelope = G4RegionStore::GetInstance()->GetRegion(region_name); 32 | if (!aEnvelope) { 33 | error() << "Failed to find G4Region '" << region_name << "'" << endmsg; 34 | return false; 35 | } 36 | 37 | EcalFastSimG4Model* model = new EcalFastSimG4Model(model_name+region_name, aEnvelope); 38 | info() << "Create Model " << model_name << " for G4Region " << region_name << endmsg; 39 | } 40 | return true; 41 | } 42 | -------------------------------------------------------------------------------- /Simulation/DetSimFastModel/src/EcalFastSimG4Tool.h: -------------------------------------------------------------------------------- 1 | #ifndef EcalFastSimG4Tool_h 2 | #define EcalFastSimG4Tool_h 3 | 4 | #include "GaudiKernel/AlgTool.h" 5 | #include "DetSimInterface/IFastSimG4Tool.h" 6 | 7 | class EcalFastSimG4Tool: public extends { 8 | public: 9 | using extends::extends; 10 | 11 | StatusCode initialize() override; 12 | StatusCode finalize() override; 13 | 14 | bool CreateFastSimulationModel() override; 15 | 16 | private: 17 | // the regions will be associated with the fast sim model 18 | Gaudi::Property> m_regions{this, "Regions"}; 19 | }; 20 | 21 | #endif 22 | -------------------------------------------------------------------------------- /Simulation/DetSimGeom/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | 2 | find_package(Geant4 REQUIRED ui_all vis_all) 3 | include(${Geant4_USE_FILE}) 4 | 5 | gaudi_add_module(DetSimGeom 6 | SOURCES src/WorldDetElemTool.cpp 7 | src/AnExampleDetElemTool.cpp 8 | LINK DetSimInterface 9 | DetInterface 10 | ${DD4hep_COMPONENT_LIBRARIES} 11 | Gaudi::GaudiKernel 12 | ${Geant4_LIBRARIES} 13 | ) 14 | 15 | install(TARGETS DetSimGeom 16 | EXPORT CEPCSWTargets 17 | RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}" COMPONENT bin 18 | LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}" COMPONENT shlib 19 | COMPONENT dev) 20 | 21 | 22 | -------------------------------------------------------------------------------- /Simulation/DetSimGeom/src/WorldDetElemTool.h: -------------------------------------------------------------------------------- 1 | #ifndef WorldDetElemTool_h 2 | #define WorldDetElemTool_h 3 | 4 | #include "GaudiKernel/AlgTool.h" 5 | #include "DetSimInterface/IDetElemTool.h" 6 | 7 | class WorldDetElemTool: public extends { 8 | 9 | public: 10 | using extends::extends; 11 | 12 | G4LogicalVolume* getLV() override; 13 | void ConstructSDandField() override; 14 | 15 | StatusCode initialize() override; 16 | StatusCode finalize() override; 17 | 18 | private: 19 | double m_x; 20 | double m_y; 21 | double m_z; 22 | }; 23 | 24 | #endif 25 | -------------------------------------------------------------------------------- /Simulation/DetSimInterface/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | 2 | 3 | # DetSimInterface (headers only) 4 | 5 | gaudi_add_library(DetSimInterface 6 | SOURCES src/IDetSimSvc.cpp 7 | src/CommonUserEventInfo.cc 8 | src/CommonUserTrackInfo.cc 9 | LINK Gaudi::GaudiKernel 10 | ${Geant4_LIBRARIES} 11 | ) 12 | 13 | install(TARGETS DetSimInterface 14 | EXPORT CEPCSWTargets 15 | RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}" COMPONENT bin 16 | LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}" COMPONENT shlib 17 | COMPONENT dev) 18 | 19 | -------------------------------------------------------------------------------- /Simulation/DetSimInterface/include/DetSimInterface/CommonUserEventInfo.hh: -------------------------------------------------------------------------------- 1 | #ifndef CommonUserEventInfo_hh 2 | #define CommonUserEventInfo_hh 3 | 4 | /* 5 | * Description: 6 | * This class is a part of simulation framework to allow users to extend the G4Event. 7 | * 8 | * For example, when G4 converts the EDM4hep/G4 primary vertex/particle to G4 track, 9 | * the relationship between the EDM4hep track and G4 track is missing. 10 | * So a map is used as a bookkeeping. 11 | * 12 | * Author: 13 | * Tao Lin 14 | */ 15 | 16 | #include "G4VUserEventInformation.hh" 17 | #include 18 | 19 | class CommonUserEventInfo: public G4VUserEventInformation { 20 | public: 21 | 22 | CommonUserEventInfo(); 23 | virtual ~CommonUserEventInfo(); 24 | 25 | public: 26 | virtual void Print() const; 27 | 28 | // set the relationship between idx in geant4 and idx in mc particle collection. 29 | // idxG4: G4 track ID (starts from 1) 30 | // idxEdm4hep: index in MC Particle collection (starts from 0) 31 | bool setIdxG4Track2Edm4hep(int idxG4, int idxEdm4hep); 32 | int idxG4Track2Edm4hep(int idxG4) const; 33 | void dumpIdxG4Track2Edm4hep() const; 34 | 35 | private: 36 | std::map m_g4track_to_edm4hep; 37 | }; 38 | 39 | #endif 40 | -------------------------------------------------------------------------------- /Simulation/DetSimInterface/include/DetSimInterface/CommonUserTrackInfo.hh: -------------------------------------------------------------------------------- 1 | #ifndef CommonUserTrackInfo_hh 2 | #define CommonUserTrackInfo_hh 3 | 4 | /* Description: 5 | * This class is a part of simulation framework to extend the G4Track. 6 | * 7 | * Some secondaries are created due to decay. However, their G4 Track IDs are 8 | * not valid until the tracks are tracking by geant4. In order to associate 9 | * these tracks and their edm4hep MC particle, we use the track information 10 | * to record the extra track information. 11 | * 12 | * Author: 13 | * Tao Lin 14 | */ 15 | 16 | #include "G4VUserTrackInformation.hh" 17 | 18 | class CommonUserTrackInfo: public G4VUserTrackInformation { 19 | public: 20 | CommonUserTrackInfo(); 21 | ~CommonUserTrackInfo(); 22 | 23 | public: 24 | 25 | virtual void Print() const; 26 | 27 | // get the idx in the EDM4hep MC particle collection 28 | bool setIdxEdm4hep(int idxEdm4hep); 29 | int idxEdm4hep() const; 30 | 31 | private: 32 | int m_idxEdm4hep = -1; 33 | }; 34 | 35 | #endif 36 | -------------------------------------------------------------------------------- /Simulation/DetSimInterface/include/DetSimInterface/IAnaElemTool.h: -------------------------------------------------------------------------------- 1 | #ifndef IAnaElemTool_h 2 | #define IAnaElemTool_h 3 | 4 | #include "GaudiKernel/IAlgTool.h" 5 | 6 | class G4Run; 7 | class G4Event; 8 | class G4Track; 9 | class G4Step; 10 | 11 | #include "G4ClassificationOfNewTrack.hh" 12 | 13 | class IAnaElemTool : virtual public IAlgTool { 14 | public: 15 | DeclareInterfaceID(IAnaElemTool, 0, 1); 16 | 17 | virtual ~IAnaElemTool() {} 18 | 19 | // Run 20 | virtual void BeginOfRunAction(const G4Run*) {} 21 | virtual void EndOfRunAction(const G4Run*) {} 22 | 23 | // Event 24 | virtual void BeginOfEventAction(const G4Event*) {} 25 | virtual void EndOfEventAction(const G4Event*) {} 26 | 27 | // Stacking 28 | virtual G4ClassificationOfNewTrack ClassifyNewTrack(const G4Track*) {return fUrgent;} 29 | virtual void NewStage() {} 30 | virtual void PrepareNewEvent() {} 31 | 32 | // Tracking 33 | virtual void PreUserTrackingAction(const G4Track*) {} 34 | virtual void PostUserTrackingAction(const G4Track*) {} 35 | 36 | // Stepping 37 | virtual void UserSteppingAction(const G4Step*) {} 38 | 39 | }; 40 | 41 | 42 | #endif 43 | -------------------------------------------------------------------------------- /Simulation/DetSimInterface/include/DetSimInterface/IDedxSimTool.h: -------------------------------------------------------------------------------- 1 | #ifndef IDedxSimTool_h 2 | #define IDedxSimTool_h 3 | 4 | /* 5 | * Description: 6 | * IDedxSimTool is used to give a dE/dx value during simulation. 7 | * 8 | * The interface: 9 | * * dedx: predict the dE/dx according to Geant4 Step 10 | * 11 | * Author: Tao Lin 12 | */ 13 | 14 | 15 | #include "GaudiKernel/IAlgTool.h" 16 | 17 | class G4Step; 18 | namespace edm4hep{ 19 | class MCParticle; 20 | } 21 | 22 | class IDedxSimTool: virtual public IAlgTool { 23 | public: 24 | 25 | DeclareInterfaceID(IDedxSimTool, 0, 1); 26 | virtual ~IDedxSimTool() {} 27 | 28 | virtual double dedx(const G4Step* aStep) = 0; 29 | virtual double dedx(const edm4hep::MCParticle& mc) = 0; 30 | virtual double dndx(double betagamma) = 0; 31 | virtual void endOfEvent() {} 32 | 33 | }; 34 | 35 | #endif 36 | -------------------------------------------------------------------------------- /Simulation/DetSimInterface/include/DetSimInterface/IDetElemTool.h: -------------------------------------------------------------------------------- 1 | #ifndef IDetElemTool_h 2 | #define IDetElemTool_h 3 | 4 | // IDetElemTool is used to wrap the construction of G4LogicalVolume. 5 | // Please note that the placement of logical volume is fixed in the code. 6 | // If necessary, another IDetElemPosTool can be used to produce the positions 7 | // of the daughters. 8 | // IDetElemTool should represent the high level detectors/modules. 9 | 10 | #include "GaudiKernel/IAlgTool.h" 11 | 12 | class G4LogicalVolume; 13 | 14 | class IDetElemTool: virtual public IAlgTool { 15 | public: 16 | DeclareInterfaceID(IDetElemTool, 0, 1); 17 | 18 | virtual ~IDetElemTool() {} 19 | 20 | // return the constructed detector 21 | virtual G4LogicalVolume* getLV() = 0; 22 | virtual void ConstructSDandField() {} 23 | }; 24 | 25 | #endif 26 | -------------------------------------------------------------------------------- /Simulation/DetSimInterface/include/DetSimInterface/IDetSimSvc.h: -------------------------------------------------------------------------------- 1 | #ifndef IDetSimSvc_h 2 | #define IDetSimSvc_h 3 | 4 | #include "GaudiKernel/IService.h" 5 | 6 | // IDetSimSvc is the interface between Gaudi and Geant4. 7 | // All the initialization of Run Manager (RM) should be done here, including: 8 | // * Detector Construction 9 | // * Physics List 10 | // * Primary Generator Action 11 | // * User Actions 12 | // Then, the real simulation should be also done by this service via Run Manager. 13 | // 14 | // Note, to decouple the Gaudi and Geant4, we keep all these classes still derived from 15 | // the original Geant4's base classes, while using Gaudi tools to manage these objects. 16 | 17 | class G4RunManager; 18 | 19 | class IDetSimSvc: virtual public IInterface { 20 | public: 21 | DeclareInterfaceID(IDetSimSvc, 0, 1); // major/minor version 22 | 23 | virtual ~IDetSimSvc() = 0; 24 | 25 | // Get the Run Manager 26 | virtual G4RunManager* getRM() = 0; 27 | 28 | // Control the run manager directly. 29 | virtual StatusCode initializeRM() = 0; 30 | virtual StatusCode simulateEvent(int i_event) = 0; 31 | virtual StatusCode finalizeRM() = 0; 32 | 33 | }; 34 | 35 | 36 | #endif 37 | -------------------------------------------------------------------------------- /Simulation/DetSimInterface/include/DetSimInterface/IFastSimG4Tool.h: -------------------------------------------------------------------------------- 1 | #ifndef IFastSimG4Tool_h 2 | #define IFastSimG4Tool_h 3 | 4 | // IFastSimG4Tool is to associate the G4Region and Fast simulation model in G4. 5 | // It is recommended to create one fast simulation model in one tool. 6 | // -- Tao Lin , 7 Dec 2020 7 | 8 | #include "GaudiKernel/IAlgTool.h" 9 | 10 | class IFastSimG4Tool: virtual public IAlgTool { 11 | public: 12 | DeclareInterfaceID(IFastSimG4Tool, 0, 1); 13 | 14 | virtual ~IFastSimG4Tool() {} 15 | 16 | // Build the association between G4Region and G4 Fast simulation model 17 | virtual bool CreateFastSimulationModel() = 0; 18 | }; 19 | 20 | #endif 21 | -------------------------------------------------------------------------------- /Simulation/DetSimInterface/include/DetSimInterface/IG4PrimaryCnvTool.h: -------------------------------------------------------------------------------- 1 | #ifndef IG4PrimaryCnvTool_h 2 | #define IG4PrimaryCnvTool_h 3 | 4 | // IG4PrimaryCnvTool: 5 | // convert an event in other formats to an event in G4 format. 6 | // The G4Event object is managed by Geant4. 7 | 8 | #include "GaudiKernel/AlgTool.h" 9 | 10 | class G4Event; 11 | 12 | class IG4PrimaryCnvTool: virtual public IAlgTool { 13 | public: 14 | 15 | DeclareInterfaceID(IG4PrimaryCnvTool, 0, 1); 16 | 17 | virtual ~IG4PrimaryCnvTool() {}; 18 | 19 | virtual bool mutate(G4Event* anEvent) = 0; 20 | }; 21 | 22 | #endif 23 | -------------------------------------------------------------------------------- /Simulation/DetSimInterface/include/DetSimInterface/ISensDetTool.h: -------------------------------------------------------------------------------- 1 | #ifndef ISensDetTool_h 2 | #define ISensDetTool_h 3 | /* 4 | * ISensDetTool is a tool to configure and create a Geant4's sensitive detector. 5 | * After create the SD, the Geant4 will take ownership of the SD. 6 | * 7 | * This tool is used to replace the DDG4's Geant4SensitiveDetector. 8 | * It will be invoked in ConstructSDandField(). 9 | * 10 | * -- 12 June 2020, Tao Lin 11 | */ 12 | 13 | #include "GaudiKernel/IAlgTool.h" 14 | 15 | class G4VSensitiveDetector; 16 | 17 | class ISensDetTool: virtual public IAlgTool { 18 | public: 19 | 20 | DeclareInterfaceID(ISensDetTool, 0, 1); 21 | 22 | virtual ~ISensDetTool() {}; 23 | 24 | virtual G4VSensitiveDetector* createSD(const std::string& name) = 0; 25 | 26 | }; 27 | 28 | #endif 29 | -------------------------------------------------------------------------------- /Simulation/DetSimInterface/src/CommonUserTrackInfo.cc: -------------------------------------------------------------------------------- 1 | #include "DetSimInterface/CommonUserTrackInfo.hh" 2 | #include 3 | 4 | CommonUserTrackInfo::CommonUserTrackInfo() { 5 | 6 | } 7 | 8 | CommonUserTrackInfo::~CommonUserTrackInfo() { 9 | 10 | } 11 | 12 | void CommonUserTrackInfo::Print() const { 13 | 14 | } 15 | 16 | bool CommonUserTrackInfo::setIdxEdm4hep(int idxEdm4hep) { 17 | m_idxEdm4hep = idxEdm4hep; 18 | } 19 | 20 | int CommonUserTrackInfo::idxEdm4hep() const { 21 | return m_idxEdm4hep; 22 | } 23 | -------------------------------------------------------------------------------- /Simulation/DetSimInterface/src/IDetSimSvc.cpp: -------------------------------------------------------------------------------- 1 | #include "DetSimInterface/IDetSimSvc.h" 2 | 3 | IDetSimSvc::~IDetSimSvc() { 4 | 5 | } 6 | -------------------------------------------------------------------------------- /Simulation/DetSimSD/src/CalorimeterSensDetTool.h: -------------------------------------------------------------------------------- 1 | #ifndef CalorimeterSensDetTool_h 2 | #define CalorimeterSensDetTool_h 3 | 4 | /* 5 | * CalorimeterSensDetTool is used to create the Calorimeter SD. 6 | * 7 | * -- 12 June 2020, Tao Lin 8 | */ 9 | 10 | #include "GaudiKernel/AlgTool.h" 11 | #include "DetSimInterface/ISensDetTool.h" 12 | #include "DetInterface/IGeomSvc.h" 13 | 14 | class CalorimeterSensDetTool: public extends { 15 | 16 | public: 17 | 18 | using extends::extends; 19 | 20 | /// Overriding initialize and finalize 21 | StatusCode initialize() override; 22 | StatusCode finalize() override; 23 | 24 | /// Override ISensDetTool 25 | virtual G4VSensitiveDetector* createSD(const std::string& name) override; 26 | 27 | private: 28 | 29 | // in order to initialize SD, we need to get the lcdd() 30 | SmartIF m_geosvc; 31 | 32 | Gaudi::Property > m_listCalsMergeDisable{this, "CalNamesMergeDisable", {}}; 33 | Gaudi::Property > m_listCalsApplyBirks{this, "CalNamesApplyBirks", {}}; 34 | }; 35 | 36 | #endif 37 | -------------------------------------------------------------------------------- /Simulation/DetSimSD/src/DriftChamberSensDetTool.h: -------------------------------------------------------------------------------- 1 | #ifndef DriftChamberSensDetTool_h 2 | #define DriftChamberSensDetTool_h 3 | 4 | /* 5 | * DriftChamberSensDetTool is used to create Drift Chamber SD. 6 | * 7 | * It will use DedxSimTool to give the dE/dx value. 8 | * 9 | * -- 17 Sept 2020, Tao Lin 10 | */ 11 | 12 | #include "GaudiKernel/AlgTool.h" 13 | #include "GaudiKernel/ToolHandle.h" 14 | #include "DetSimInterface/ISensDetTool.h" 15 | #include "DetSimInterface/IDedxSimTool.h" 16 | #include "DetInterface/IGeomSvc.h" 17 | 18 | 19 | class DriftChamberSensDetTool: public extends { 20 | 21 | public: 22 | 23 | using extends::extends; 24 | 25 | /// Overriding initialize and finalize 26 | StatusCode initialize() override; 27 | StatusCode finalize() override; 28 | 29 | /// Override ISensDetTool 30 | virtual G4VSensitiveDetector* createSD(const std::string& name) override; 31 | 32 | private: 33 | 34 | // in order to initialize SD, we need to get the lcdd() 35 | SmartIF m_geosvc; 36 | ToolHandle m_dedx_simtool; 37 | Gaudi::Property m_dedx_sim_option{this, "DedxSimTool"}; 38 | 39 | }; 40 | 41 | #endif 42 | -------------------------------------------------------------------------------- /Simulation/DetSimSD/src/DriftChamberSensitiveDetector.h: -------------------------------------------------------------------------------- 1 | #ifndef DriftChamberSensitiveDetector_h 2 | #define DriftChamberSensitiveDetector_h 3 | 4 | /* 5 | * DriftChamberSensitiveDetector is used in Drift Chamber with dE/dx simulator. 6 | * 7 | * 19 Sept. 2020, Tao Lin 8 | */ 9 | 10 | #include "DetSimSD/DDG4SensitiveDetector.h" 11 | #include "DetSimInterface/IDedxSimTool.h" 12 | #include "GaudiKernel/ToolHandle.h" 13 | 14 | class DriftChamberSensitiveDetector: public DDG4SensitiveDetector { 15 | public: 16 | typedef dd4hep::sim::Geant4TrackerHit TrackerHit; 17 | typedef G4THitsCollection TrackerHitCollection; 18 | 19 | public: 20 | DriftChamberSensitiveDetector(const std::string& name, dd4hep::Detector& description); 21 | 22 | bool setDedxSimTool(ToolHandle); 23 | 24 | public: 25 | // Geant4 interface 26 | 27 | virtual void Initialize(G4HCofThisEvent* HCE); 28 | virtual G4bool ProcessHits(G4Step* step,G4TouchableHistory* history); 29 | virtual void EndOfEvent(G4HCofThisEvent* HCE); 30 | 31 | protected: 32 | 33 | HitCollection* m_hc; 34 | 35 | // this is passed from SensDetTool 36 | ToolHandle m_dedx_simtool; 37 | 38 | }; 39 | 40 | #endif 41 | -------------------------------------------------------------------------------- /Simulation/DetSimSD/src/GenericTrackerSensDetTool.h: -------------------------------------------------------------------------------- 1 | #ifndef GenericTrackerSensDetTool_h 2 | #define GenericTrackerSensDetTool_h 3 | 4 | /* 5 | * GenericTrackerSensDetTool is used to create Time Projection Chamber SD. 6 | */ 7 | 8 | #include "GaudiKernel/AlgTool.h" 9 | #include "GaudiKernel/ToolHandle.h" 10 | #include "DetSimInterface/ISensDetTool.h" 11 | #include "DetInterface/IGeomSvc.h" 12 | 13 | #include "DD4hep/DD4hepUnits.h" 14 | 15 | class GenericTrackerSensDetTool: public extends { 16 | 17 | public: 18 | 19 | using extends::extends; 20 | 21 | /// Overriding initialize and finalize 22 | StatusCode initialize() override; 23 | StatusCode finalize() override; 24 | 25 | /// Override ISensDetTool 26 | virtual G4VSensitiveDetector* createSD(const std::string& name) override; 27 | 28 | private: 29 | 30 | // in order to initialize SD, we need to get the lcdd() 31 | SmartIF m_geosvc; 32 | 33 | }; 34 | 35 | #endif 36 | -------------------------------------------------------------------------------- /Simulation/DetSimSD/src/GenericTrackerSensitiveDetector.h: -------------------------------------------------------------------------------- 1 | // ********************************************************* 2 | // 3 | // $Id: GenericTrackerSensitiveDetector.hh,v 1.0 2022/03/27 4 | 5 | #ifndef GenericTrackerSensitiveDetector_h 6 | #define GenericTrackerSensitiveDetector_h 7 | 8 | #include "DetSimSD/DDG4SensitiveDetector.h" 9 | #include "DDG4/Defs.h" 10 | 11 | class GenericTrackerSensitiveDetector: public DDG4SensitiveDetector { 12 | public: 13 | GenericTrackerSensitiveDetector(const std::string& name, dd4hep::Detector& description); 14 | 15 | void Initialize(G4HCofThisEvent* HCE); 16 | G4bool ProcessHits(G4Step* step, G4TouchableHistory* history); 17 | void EndOfEvent(G4HCofThisEvent* HCE); 18 | 19 | protected: 20 | 21 | HitCollection* m_hc = nullptr; 22 | 23 | }; 24 | #endif 25 | -------------------------------------------------------------------------------- /Utilities/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | add_subdirectory(DataHelper) 2 | add_subdirectory(KalTest) 3 | add_subdirectory(KalDet) 4 | add_subdirectory(KiTrack) 5 | 6 | -------------------------------------------------------------------------------- /Utilities/DataHelper/include/DataHelper/Circle.h: -------------------------------------------------------------------------------- 1 | // Circle.h: interface for the Circle class. 2 | // Circle class. 3 | // Purpose : Represent the circle object 4 | // Input : 3 different points 5 | // Process : Calcuate the radius and center 6 | // Output : Circle 7 | // 8 | // This class originally designed for representation of discretized curvature information 9 | // of sequential pointlist 10 | // KJIST CAD/CAM Ryu, Jae Hun ( ryu@geguri.kjist.ac.kr) 11 | // Last update : 1999. 7. 4 12 | 13 | 14 | #include "CLHEP/Vector/TwoVector.h" 15 | 16 | class Circle 17 | { 18 | public: 19 | double GetRadius(); 20 | CLHEP::Hep2Vector* GetCenter(); 21 | Circle(CLHEP::Hep2Vector *p1, CLHEP::Hep2Vector *p2, CLHEP::Hep2Vector *p3); // p1, p2, p3 are co-planar 22 | Circle(); 23 | virtual ~Circle(); 24 | 25 | private: 26 | double CalcCircle(CLHEP::Hep2Vector *pt1, CLHEP::Hep2Vector *pt2, CLHEP::Hep2Vector *pt3); 27 | bool IsPerpendicular(CLHEP::Hep2Vector *pt1, CLHEP::Hep2Vector *pt2, CLHEP::Hep2Vector *pt3); 28 | double m_dRadius; 29 | CLHEP::Hep2Vector m_Center; 30 | }; 31 | 32 | -------------------------------------------------------------------------------- /Utilities/DataHelper/include/DataHelper/GroupTracks.h: -------------------------------------------------------------------------------- 1 | #ifndef GROUPTRACKS_H 2 | #define GROUPTRACKS_H 1 3 | 4 | //#include "TrackExtended.h" 5 | //#include "ClusterExtended.h" 6 | #include 7 | 8 | //fg : forwar declaration needed because of circular include .... 9 | class TrackExtended; 10 | typedef std::vector TrackExtendedVec; 11 | //fg : forward .... 12 | 13 | /** 14 | * Class GroupTracks is needed to group track segments
15 | * with close helix parameters. Needed for Tracking.
16 | * * @author A. Raspereza (DESY)
17 | * @version $Id: GroupTracks.h,v 1.4 2007-09-05 09:39:49 rasp Exp $
18 | */ 19 | //class GroupTracks; 20 | 21 | //typedef std::vector GroupTracksVec; 22 | 23 | class GroupTracks { 24 | 25 | public: 26 | GroupTracks(); 27 | GroupTracks(TrackExtended * track ); 28 | ~GroupTracks(); 29 | 30 | void addTrackExtended( TrackExtended * track ); 31 | void ClearTrackExtendedVec(); 32 | TrackExtendedVec & getTrackExtendedVec(); 33 | void setEdges(float * edges); 34 | float * getEdges(); 35 | 36 | private: 37 | 38 | TrackExtendedVec _trackARVec; 39 | 40 | float _edges[2]; 41 | 42 | }; 43 | 44 | typedef std::vector GroupTracksVec; 45 | 46 | #endif 47 | -------------------------------------------------------------------------------- /Utilities/DataHelper/include/DataHelper/LCGeometryTypes.h: -------------------------------------------------------------------------------- 1 | #ifndef LCGeometryTypes_H 2 | #define LCGeometryTypes_H 1 3 | 4 | // #include "CLHEP/Geometry/Point3D.h" 5 | // #include "CLHEP/Geometry/Vector3D.h" 6 | #include "CLHEP/Geometry/Plane3D.h" 7 | #include "CLHEP/Matrix/SymMatrix.h" 8 | 9 | #include "CLHEP/Vector/ThreeVector.h" 10 | 11 | 12 | /** @file Definition of geometry types used in ILC software - currently use CHEP. 13 | * @author gaede 14 | * @version $Id: LCGeometryTypes.h,v 1.3 2006-10-11 16:03:24 tkraemer Exp $ 15 | */ 16 | 17 | //using namespace CLHEP ; 18 | 19 | 20 | // typedef HepGeom::Point3D LCPoint3D ; 21 | // typedef HepGeom::Vector3D LCVector3D ; 22 | 23 | // typedef CLHEP::Hep3Vector LCPoint3D ; 24 | typedef CLHEP::Hep3Vector LCVector3D ; 25 | 26 | 27 | typedef CLHEP::HepSymMatrix LCErrorMatrix ; 28 | 29 | // typedef HepGeom::Plane3D LCPlane3D ; 30 | 31 | typedef CLHEP::HepLorentzVector LCLorentzVector ; 32 | 33 | 34 | 35 | 36 | 37 | 38 | #endif /* ifndef LCGeometryTypes_H */ 39 | -------------------------------------------------------------------------------- /Utilities/DataHelper/include/DataHelper/LineClass.h: -------------------------------------------------------------------------------- 1 | #ifndef LINECLASS_H 2 | #define LINECLASS_H 3 | class LineClass { 4 | 5 | public: 6 | LineClass(float x0, 7 | float y0, 8 | float z0, 9 | float ax, 10 | float ay, 11 | float az); 12 | 13 | LineClass(float *x0, 14 | float *ax); 15 | 16 | ~LineClass(); 17 | 18 | float * getReferencePoint(); 19 | void setReferencePoint(float *x0); 20 | float * getDirectionalVector(); 21 | void setDirectionalVector(float *ax); 22 | float getDistanceToPoint(float * xpoint, float * pos); 23 | 24 | private: 25 | 26 | float _x0[3]; 27 | float _ax[3]; 28 | 29 | 30 | }; 31 | 32 | #endif 33 | -------------------------------------------------------------------------------- /Utilities/DataHelper/include/DataHelper/TrackHelper.h: -------------------------------------------------------------------------------- 1 | #ifndef TRACKHELPER_H 2 | #define TRACKHELPER_H 3 | #include "edm4hep/TrackState.h" 4 | #include "TMatrixDSym.h" 5 | #include "TVector3.h" 6 | 7 | namespace CEPC{ 8 | //get track position and momentum from TrackState 9 | void getPosMomFromTrackState(const edm4hep::TrackState& trackState, 10 | double Bz, TVector3& pos,TVector3& mom,double& charge, 11 | TMatrixDSym& covMatrix_6); 12 | 13 | //Set track state from position, momentum and charge 14 | void getTrackStateFromPosMom(edm4hep::TrackState& trackState,double Bz, 15 | TVector3 pos,TVector3 mom,double charge,TMatrixDSym covMatrix_6); 16 | 17 | } 18 | 19 | #endif 20 | -------------------------------------------------------------------------------- /Utilities/DataHelper/include/DataHelper/TrackHitPair.h: -------------------------------------------------------------------------------- 1 | #ifndef TRACKHITPAIR_H 2 | #define TRACKHITPAIR_H 1 3 | 4 | #include "TrackExtended.h" 5 | #include "TrackerHitExtended.h" 6 | #include 7 | 8 | class TrackHitPair; 9 | 10 | typedef std::vector TrackHitPairVec; 11 | /** 12 | * Class implementing association of TrackExtended and TrackerHitExtended objects.
13 | * @author A. Raspereza (MPI-Munich)
14 | */ 15 | 16 | class TrackHitPair { 17 | 18 | public: 19 | 20 | TrackHitPair(TrackExtended * trkExt, TrackerHitExtended * hitExt, float distance); 21 | ~TrackHitPair(); 22 | void setTrackExtended(TrackExtended * trkExt); 23 | void setTrackerHitExtended(TrackerHitExtended * hitExt); 24 | void setDistance(float distance); 25 | TrackExtended * getTrackExtended(); 26 | TrackerHitExtended * getTrackerHitExtended(); 27 | float getDistance(); 28 | 29 | 30 | private: 31 | TrackExtended * _trackExtended; 32 | TrackerHitExtended * _trackerHitExtended; 33 | float _distance; 34 | 35 | 36 | }; 37 | 38 | #endif 39 | -------------------------------------------------------------------------------- /Utilities/DataHelper/src/GroupTracks.cc: -------------------------------------------------------------------------------- 1 | #include "DataHelper/TrackExtended.h" 2 | #include "DataHelper/GroupTracks.h" 3 | 4 | GroupTracks::GroupTracks() { 5 | _trackARVec.clear(); 6 | _edges[0] = 0.0; 7 | _edges[1] = 0.0; 8 | } 9 | 10 | GroupTracks::GroupTracks( TrackExtended * track ) { 11 | _trackARVec.clear(); 12 | _trackARVec.push_back( track ); 13 | _edges[0] = 0.0; 14 | _edges[1] = 0.0; 15 | } 16 | 17 | GroupTracks::~GroupTracks() {} 18 | 19 | void GroupTracks::addTrackExtended( TrackExtended * track ) { 20 | _trackARVec.push_back( track ); 21 | } 22 | 23 | void GroupTracks::ClearTrackExtendedVec() { 24 | _trackARVec.clear(); 25 | } 26 | 27 | TrackExtendedVec & GroupTracks::getTrackExtendedVec() { 28 | return _trackARVec; 29 | } 30 | 31 | void GroupTracks::setEdges(float * edges) { 32 | 33 | _edges[0] = edges[0]; 34 | _edges[1] = edges[1]; 35 | 36 | } 37 | 38 | float * GroupTracks::getEdges() { 39 | return _edges; 40 | } 41 | -------------------------------------------------------------------------------- /Utilities/DataHelper/src/TrackHitPair.cc: -------------------------------------------------------------------------------- 1 | #include "DataHelper/TrackHitPair.h" 2 | 3 | TrackHitPair::TrackHitPair(TrackExtended * trkExt, TrackerHitExtended * hitExt, float distance) { 4 | _trackExtended = trkExt; 5 | _trackerHitExtended = hitExt; 6 | _distance = distance; 7 | } 8 | TrackHitPair::~TrackHitPair() { 9 | 10 | } 11 | 12 | void TrackHitPair::setTrackExtended(TrackExtended * trkExt) { 13 | _trackExtended = trkExt; 14 | } 15 | 16 | void TrackHitPair::setTrackerHitExtended(TrackerHitExtended * hitExt) { 17 | _trackerHitExtended = hitExt; 18 | } 19 | 20 | void TrackHitPair::setDistance(float distance) { 21 | _distance = distance; 22 | } 23 | 24 | TrackExtended * TrackHitPair::getTrackExtended() { 25 | return _trackExtended; 26 | } 27 | 28 | TrackerHitExtended * TrackHitPair::getTrackerHitExtended() { 29 | return _trackerHitExtended; 30 | } 31 | 32 | float TrackHitPair::getDistance() { 33 | return _distance; 34 | } 35 | -------------------------------------------------------------------------------- /Utilities/KalDet/include/kaldet/EXEventGen.h: -------------------------------------------------------------------------------- 1 | #ifndef __EXEVENTGEN__ 2 | #define __EXEVENTGEN__ 3 | 4 | #include "TKalDetCradle.h" 5 | #include "THelicalTrack.h" 6 | #include "TMath.h" 7 | 8 | class EXEventGen { 9 | public: 10 | EXEventGen(TKalDetCradle const &cradle, TObjArray &kalhits) 11 | : fCradlePtr(&cradle), fHitBufPtr(&kalhits) {} 12 | virtual ~EXEventGen() {} 13 | 14 | THelicalTrack GenerateHelix(Double_t pt, 15 | Double_t cosmin, 16 | Double_t cosmax, 17 | Double_t phimin=0., 18 | Double_t phimax=2*TMath::Pi(), 19 | TVector3 xv0=TVector3(0.,0.,0.)); 20 | void Swim(THelicalTrack &heltrk); 21 | 22 | static void SetT0(Double_t t0) { fgT0 = t0; } 23 | static Double_t GetT0() { return fgT0; } 24 | 25 | private: 26 | TKalDetCradle const *fCradlePtr; // pointer to detector system 27 | TObjArray *fHitBufPtr; // pointer to hit array 28 | 29 | static Double_t fgT0; // t0 30 | 31 | }; 32 | 33 | #endif 34 | -------------------------------------------------------------------------------- /Utilities/KalDet/include/kaldet/ILDCylinderHit.h: -------------------------------------------------------------------------------- 1 | #ifndef ILDCYLINDERHIT_H 2 | #define ILDCYLINDERHIT_H 3 | 4 | /** ILDCylinderHit: User defined KalTest hit class using R and Rphi coordinates, which provides coordinate vector as defined by the MeasLayer 5 | * 6 | * @author S.Aplin DESY 7 | */ 8 | 9 | #include "kaltest/KalTrackDim.h" 10 | #include "ILDVTrackHit.h" 11 | 12 | 13 | class ILDCylinderHit : public ILDVTrackHit { 14 | 15 | public: 16 | 17 | 18 | /** Constructor Taking R and Rphi coordinates and associated measurement layer, with bfield */ 19 | ILDCylinderHit(const TVMeasLayer &ms, Double_t *x, Double_t *dx, 20 | Double_t bfield, edm4hep::TrackerHit trkhit ) 21 | : ILDVTrackHit(ms, x, dx, bfield, 2, trkhit) 22 | { /* no op */ } 23 | 24 | 25 | // TVTrackHit's pure virtuals that must be implemented 26 | 27 | /** Global to Local coordinates */ 28 | virtual TKalMatrix XvToMv(const TVector3 &xv, Double_t t0) const; 29 | 30 | /** Print Debug information */ 31 | virtual void DebugPrint(Option_t *opt = "") const; 32 | 33 | 34 | private: 35 | 36 | 37 | }; 38 | #endif 39 | -------------------------------------------------------------------------------- /Utilities/KalDet/include/kaldet/ILDFTDDiscBasedKalDetector.h: -------------------------------------------------------------------------------- 1 | #ifndef __ILDFTDDISCBASEDDETECTOR__ 2 | #define __ILDFTDDISCBASEDDETECTOR__ 3 | 4 | /** Disk based version of the FTD alla LOI 5 | * 6 | * @author S.Aplin DESY 7 | */ 8 | 9 | #include "kaltest/TVKalDetector.h" 10 | 11 | class TNode; 12 | 13 | namespace gear{ 14 | class GearMgr ; 15 | } 16 | 17 | 18 | class ILDFTDDiscBasedKalDetector : public TVKalDetector { 19 | public: 20 | 21 | /** Initialize the FTD from GEAR */ 22 | ILDFTDDiscBasedKalDetector( const gear::GearMgr& gearMgr ); 23 | 24 | 25 | private: 26 | 27 | void setupGearGeom( const gear::GearMgr& gearMgr ) ; 28 | 29 | int _nDisks ; 30 | double _bZ ; 31 | 32 | struct FTD_Disk { 33 | double rInner; 34 | double rOuter; 35 | double senThickness; 36 | double supThickness; 37 | double zPos; 38 | 39 | }; 40 | std::vector _FTDgeo; 41 | 42 | }; 43 | 44 | #endif 45 | -------------------------------------------------------------------------------- /Utilities/KalDet/include/kaldet/ILDPlanarHit.h: -------------------------------------------------------------------------------- 1 | #ifndef ILDPLANARHIT_H 2 | #define ILDPLANARHIT_H 3 | 4 | /** ILDPlanarHit: User defined KalTest hit class using u and v coordinates, which provides coordinate vector as defined by the MeasLayer 5 | * 6 | * @author S.Aplin DESY 7 | */ 8 | 9 | #include "kaltest/KalTrackDim.h" 10 | 11 | #include "ILDVTrackHit.h" 12 | 13 | #define ILDPlanarHit_DIM 2 14 | 15 | class ILDPlanarHit : public ILDVTrackHit { 16 | 17 | public: 18 | 19 | /** Constructor Taking u and v coordinates and associated measurement layer, with bfield */ 20 | ILDPlanarHit(const TVMeasLayer &ms, 21 | Double_t *x, 22 | Double_t *dx, 23 | Double_t bfield, 24 | edm4hep::TrackerHit trkhit) 25 | : ILDVTrackHit(ms, x, dx, bfield, ILDPlanarHit_DIM,trkhit) 26 | { /* no op */ } 27 | 28 | // TVTrackHit's pure virtuals that must be implemented 29 | 30 | /** Global to Local coordinates */ 31 | virtual TKalMatrix XvToMv (const TVector3 &xv, Double_t t0) const; 32 | 33 | /** Print Debug information */ 34 | virtual void DebugPrint(Option_t *opt = "") const; 35 | 36 | 37 | private: 38 | 39 | 40 | }; 41 | #endif 42 | -------------------------------------------------------------------------------- /Utilities/KalDet/include/kaldet/ILDSETKalDetector.h: -------------------------------------------------------------------------------- 1 | #ifndef __ILDSETKALDETECTOR__ 2 | #define __ILDSETKALDETECTOR__ 3 | 4 | /** Ladder based SET to be used for ILD DBD studies 5 | * 6 | * @author S.Aplin DESY 7 | */ 8 | 9 | #include "kaltest/TVKalDetector.h" 10 | 11 | #include "TMath.h" 12 | 13 | class TNode; 14 | 15 | namespace gear{ 16 | class GearMgr ; 17 | } 18 | 19 | class IGeomSvc; 20 | 21 | class ILDSETKalDetector : public TVKalDetector { 22 | 23 | public: 24 | 25 | /** Initialize the SET from GEAR */ 26 | ILDSETKalDetector( const gear::GearMgr& gearMgr, IGeomSvc* geoSvc=0 ); 27 | 28 | 29 | private: 30 | 31 | void setupGearGeom( const gear::GearMgr& gearMgr ) ; 32 | void setupGearGeom( IGeomSvc* geoSvc ); 33 | 34 | int _nLayers ; 35 | double _bZ ; 36 | 37 | bool _isStripDetector; 38 | 39 | struct SET_Layer { 40 | int nLadders; 41 | int nSensorsPerLadder; 42 | double phi0; 43 | double dphi; 44 | double senRMin; 45 | double supRMin; 46 | double length; 47 | double width; 48 | double offset; 49 | double senThickness; 50 | double supThickness; 51 | double sensorLength; 52 | double stripAngle; 53 | }; 54 | std::vector _SETgeo; 55 | 56 | }; 57 | 58 | 59 | 60 | #endif 61 | -------------------------------------------------------------------------------- /Utilities/KalDet/include/kaldet/ILDSITCylinderKalDetector.h: -------------------------------------------------------------------------------- 1 | #ifndef __ILDSITCYLINDERKALDETECTOR__ 2 | #define __ILDSITCYLINDERKALDETECTOR__ 3 | 4 | /** SIT Cylinder based detector to be used for ILD DBD studies when using the old LOI base SIT 5 | * 6 | * @author S.Aplin DESY 7 | */ 8 | 9 | #include "kaltest/TVKalDetector.h" 10 | 11 | class TNode; 12 | 13 | namespace gear{ 14 | class GearMgr ; 15 | } 16 | 17 | 18 | class ILDSITCylinderKalDetector : public TVKalDetector { 19 | public: 20 | 21 | /** Initialize the TPC from GEAR */ 22 | ILDSITCylinderKalDetector( const gear::GearMgr& gearMgr ); 23 | 24 | 25 | private: 26 | 27 | void setupGearGeom( const gear::GearMgr& gearMgr ) ; 28 | 29 | unsigned int _nLayers ; 30 | double _bZ ; 31 | 32 | struct SIT_Layer { 33 | double radius; 34 | double half_length; 35 | double senThickness; 36 | double supThickness; 37 | 38 | }; 39 | std::vector _SITgeo; 40 | 41 | 42 | }; 43 | 44 | #endif 45 | -------------------------------------------------------------------------------- /Utilities/KalDet/include/kaldet/ILDSITKalDetector.h: -------------------------------------------------------------------------------- 1 | #ifndef __ILDSITKALDETECTOR__ 2 | #define __ILDSITKALDETECTOR__ 3 | 4 | /** Ladder based SIT to be used for ILD DBD studies 5 | * 6 | * @author S.Aplin DESY 7 | */ 8 | 9 | #include "kaltest/TVKalDetector.h" 10 | 11 | #include "TMath.h" 12 | 13 | class TNode; 14 | 15 | namespace gear{ 16 | class GearMgr ; 17 | } 18 | 19 | class IGeomSvc; 20 | 21 | class ILDSITKalDetector : public TVKalDetector { 22 | 23 | public: 24 | 25 | /** Initialize the SIT from GEAR */ 26 | ILDSITKalDetector( const gear::GearMgr& gearMgr, IGeomSvc* geoSvc ); 27 | 28 | 29 | private: 30 | 31 | void setupGearGeom( const gear::GearMgr& gearMgr ) ; 32 | void setupGearGeom( IGeomSvc* geoSvc ); 33 | 34 | int _nLayers ; 35 | double _bZ ; 36 | 37 | bool _isStripDetector; 38 | 39 | struct SIT_Layer { 40 | int nLadders; 41 | int nSensorsPerLadder; 42 | double phi0; 43 | double dphi; 44 | double senRMin; 45 | double supRMin; 46 | double length; 47 | double width; 48 | double offset; 49 | double senThickness; 50 | double supThickness; 51 | double sensorLength; 52 | double stripAngle; 53 | }; 54 | std::vector _SITgeo; 55 | 56 | }; 57 | 58 | 59 | 60 | #endif 61 | -------------------------------------------------------------------------------- /Utilities/KalDet/include/kaldet/ILDSupportKalDetector.h: -------------------------------------------------------------------------------- 1 | #ifndef __ILDSUPPORTDETECTOR__ 2 | #define __ILDSUPPORTDETECTOR__ 3 | 4 | /** Support Material to be used for ILD DBD studies 5 | * 6 | * @author S.Aplin DESY 7 | */ 8 | 9 | #include "kaltest/TVKalDetector.h" 10 | 11 | class TNode; 12 | 13 | namespace gear{ 14 | class GearMgr ; 15 | } 16 | class IGeomSvc; 17 | 18 | class ILDCylinderMeasLayer; 19 | 20 | class ILDSupportKalDetector : public TVKalDetector { 21 | public: 22 | 23 | /** Initialize the support structures from GEAR */ 24 | ILDSupportKalDetector( const gear::GearMgr& gearMgr, IGeomSvc* geoSvc ); 25 | 26 | /** Returns the special layer inside the Beam Pipe used for propagation to the IP */ 27 | ILDCylinderMeasLayer* getIPLayer() { return _ipLayer; } 28 | 29 | private: 30 | 31 | ILDCylinderMeasLayer* _ipLayer; 32 | 33 | std::vector _surface_names; 34 | 35 | }; 36 | 37 | #endif 38 | -------------------------------------------------------------------------------- /Utilities/KalDet/include/kaldet/ILDTPCKalDetector.h: -------------------------------------------------------------------------------- 1 | #ifndef __ILDTPCDETECTOR__ 2 | #define __ILDTPCDETECTOR__ 3 | 4 | /** TPC to be used for ILD DBD studies 5 | * 6 | * @author S.Aplin DESY 7 | */ 8 | 9 | #include "kaltest/TVKalDetector.h" 10 | 11 | class TNode; 12 | 13 | namespace gear{ 14 | class GearMgr ; 15 | } 16 | 17 | class IGeomSvc; 18 | 19 | class ILDTPCKalDetector : public TVKalDetector { 20 | public: 21 | 22 | /** Initialize the TPC from GEAR */ 23 | ILDTPCKalDetector( const gear::GearMgr& gearMgr, IGeomSvc* geoSvc=0 ); 24 | 25 | 26 | private: 27 | 28 | }; 29 | 30 | #endif 31 | -------------------------------------------------------------------------------- /Utilities/KalDet/include/kaldet/ILDVTrackHit.h: -------------------------------------------------------------------------------- 1 | #ifndef ILDVTrackHIT_H 2 | #define ILDVTrackHIT_H 3 | 4 | /** ILDVMeasLayer: Virtual hit class used by ILD[X]Hit Classes, which should provide coordinate vector as defined by the MeasLayer 5 | * 6 | * @author S.Aplin DESY 7 | */ 8 | 9 | 10 | #include "kaltest/TVTrackHit.h" 11 | 12 | #include "ILDVMeasLayer.h" 13 | 14 | #include "edm4hep/TrackerHit.h" 15 | 16 | class ILDVTrackHit : public TVTrackHit { 17 | 18 | public: 19 | 20 | /** Constructor Taking coordinates and associated measurement layer, with bfield and number of measurement dimentions*/ 21 | ILDVTrackHit(const TVMeasLayer &ms, Double_t *x, Double_t *dx, 22 | Double_t bfield , Int_t dim, edm4hep::TrackerHit trkhit) 23 | : TVTrackHit(ms, x, dx, bfield, dim), _trkhit(trkhit) 24 | { /* no op */ } 25 | 26 | edm4hep::TrackerHit getLCIOTrackerHit() const { return _trkhit; } 27 | 28 | private: 29 | 30 | edm4hep::TrackerHit _trkhit; 31 | 32 | }; 33 | #endif 34 | -------------------------------------------------------------------------------- /Utilities/KalDet/include/kaldet/LCTPCKalDetector.h: -------------------------------------------------------------------------------- 1 | #ifndef LCTPCKALDETECTOR_H 2 | #define LCTPCKALDETECTOR_H 3 | 4 | #include "kaltest/TVKalDetector.h" 5 | 6 | #include "ILDVMeasLayer.h" 7 | 8 | namespace gear{ 9 | class GearMgr ; 10 | } 11 | 12 | namespace kaldet{ 13 | 14 | /** 15 | * The LCTPC implementation for a TPC which is completely instantiated from GEAR. 16 | * 17 | */ 18 | class LCTPCKalDetector : public TVKalDetector { 19 | 20 | public: 21 | 22 | LCTPCKalDetector() {}; 23 | 24 | /** 25 | * The constructor. All information to initialise the TPC is taken from GEAR. 26 | * 27 | * The class has been copied from GearTPCKalDetector class and adopted for the use of MarlinTrk 28 | * You can find comments and necessary information in the original class 29 | * 30 | */ 31 | LCTPCKalDetector(const gear::GearMgr& gearMgr); 32 | 33 | /// The destructor. 34 | virtual ~LCTPCKalDetector(); 35 | 36 | }; 37 | 38 | }// namespace kaldet 39 | #endif //LCTPCKALDETECTOR_H 40 | -------------------------------------------------------------------------------- /Utilities/KalDet/src/gen/EXEventGen.h: -------------------------------------------------------------------------------- 1 | #ifndef __EXEVENTGEN__ 2 | #define __EXEVENTGEN__ 3 | 4 | #include "kaltest/TKalDetCradle.h" 5 | #include "kaltest/THelicalTrack.h" 6 | #include "TMath.h" 7 | 8 | class EXEventGen { 9 | public: 10 | EXEventGen(TKalDetCradle const &cradle, TObjArray &kalhits) 11 | : fCradlePtr(&cradle), fHitBufPtr(&kalhits) {} 12 | virtual ~EXEventGen() {} 13 | 14 | THelicalTrack GenerateHelix(Double_t pt, 15 | Double_t cosmin, 16 | Double_t cosmax, 17 | Double_t phimin=0., 18 | Double_t phimax=2*TMath::Pi(), 19 | TVector3 xv0=TVector3(0.,0.,0.)); 20 | void Swim(THelicalTrack &heltrk); 21 | 22 | static void SetT0(Double_t t0) { fgT0 = t0; } 23 | static Double_t GetT0() { return fgT0; } 24 | 25 | private: 26 | TKalDetCradle const *fCradlePtr; // pointer to detector system 27 | TObjArray *fHitBufPtr; // pointer to hit array 28 | 29 | static Double_t fgT0; // t0 30 | 31 | }; 32 | 33 | #endif 34 | -------------------------------------------------------------------------------- /Utilities/KalDet/src/gen/LinkDef.h: -------------------------------------------------------------------------------- 1 | #ifdef __CINT__ 2 | 3 | #pragma link off all globals; 4 | #pragma link off all classes; 5 | #pragma link off all functions; 6 | 7 | #pragma link C++ class EXEventGen+; 8 | 9 | #endif 10 | -------------------------------------------------------------------------------- /Utilities/KalDet/src/ild/common/ILDCylinderHit.h: -------------------------------------------------------------------------------- 1 | #ifndef ILDCYLINDERHIT_H 2 | #define ILDCYLINDERHIT_H 3 | 4 | /** ILDCylinderHit: User defined KalTest hit class using R and Rphi coordinates, which provides coordinate vector as defined by the MeasLayer 5 | * 6 | * @author S.Aplin DESY 7 | */ 8 | 9 | #include "kaltest/KalTrackDim.h" 10 | #include "ILDVTrackHit.h" 11 | 12 | 13 | class ILDCylinderHit : public ILDVTrackHit { 14 | 15 | public: 16 | 17 | 18 | /** Constructor Taking R and Rphi coordinates and associated measurement layer, with bfield */ 19 | ILDCylinderHit(const TVMeasLayer &ms, Double_t *x, Double_t *dx, 20 | Double_t bfield, edm4hep::TrackerHit trkhit ) 21 | : ILDVTrackHit(ms, x, dx, bfield, 2, trkhit) 22 | { /* no op */ } 23 | 24 | 25 | // TVTrackHit's pure virtuals that must be implemented 26 | 27 | /** Global to Local coordinates */ 28 | virtual TKalMatrix XvToMv(const TVector3 &xv, Double_t t0) const; 29 | 30 | /** Print Debug information */ 31 | virtual void DebugPrint(Option_t *opt = "") const; 32 | 33 | 34 | private: 35 | 36 | 37 | }; 38 | #endif 39 | -------------------------------------------------------------------------------- /Utilities/KalDet/src/ild/common/ILDPlanarHit.h: -------------------------------------------------------------------------------- 1 | #ifndef ILDPLANARHIT_H 2 | #define ILDPLANARHIT_H 3 | 4 | /** ILDPlanarHit: User defined KalTest hit class using u and v coordinates, which provides coordinate vector as defined by the MeasLayer 5 | * 6 | * @author S.Aplin DESY 7 | */ 8 | 9 | #include "kaltest/KalTrackDim.h" 10 | 11 | #include "ILDVTrackHit.h" 12 | 13 | #define ILDPlanarHit_DIM 2 14 | 15 | class ILDPlanarHit : public ILDVTrackHit { 16 | 17 | public: 18 | 19 | /** Constructor Taking u and v coordinates and associated measurement layer, with bfield */ 20 | ILDPlanarHit(const TVMeasLayer &ms, 21 | Double_t *x, 22 | Double_t *dx, 23 | Double_t bfield, 24 | edm4hep::TrackerHit trkhit) 25 | : ILDVTrackHit(ms, x, dx, bfield, ILDPlanarHit_DIM,trkhit) 26 | { /* no op */ } 27 | 28 | // TVTrackHit's pure virtuals that must be implemented 29 | 30 | /** Global to Local coordinates */ 31 | virtual TKalMatrix XvToMv (const TVector3 &xv, Double_t t0) const; 32 | 33 | /** Print Debug information */ 34 | virtual void DebugPrint(Option_t *opt = "") const; 35 | 36 | 37 | private: 38 | 39 | 40 | }; 41 | #endif 42 | -------------------------------------------------------------------------------- /Utilities/KalDet/src/ild/common/ILDVTrackHit.h: -------------------------------------------------------------------------------- 1 | #ifndef ILDVTrackHIT_H 2 | #define ILDVTrackHIT_H 3 | 4 | /** ILDVMeasLayer: Virtual hit class used by ILD[X]Hit Classes, which should provide coordinate vector as defined by the MeasLayer 5 | * 6 | * @author S.Aplin DESY 7 | */ 8 | 9 | 10 | #include "kaltest/TVTrackHit.h" 11 | 12 | #include "ILDVMeasLayer.h" 13 | 14 | #include "edm4hep/TrackerHit.h" 15 | 16 | class ILDVTrackHit : public TVTrackHit { 17 | 18 | public: 19 | 20 | /** Constructor Taking coordinates and associated measurement layer, with bfield and number of measurement dimentions*/ 21 | ILDVTrackHit(const TVMeasLayer &ms, Double_t *x, Double_t *dx, 22 | Double_t bfield , Int_t dim, edm4hep::TrackerHit trkhit) 23 | : TVTrackHit(ms, x, dx, bfield, dim), _trkhit(trkhit) 24 | { /* no op */ } 25 | 26 | edm4hep::TrackerHit getLCIOTrackerHit() const { return _trkhit; } 27 | 28 | private: 29 | 30 | edm4hep::TrackerHit _trkhit; 31 | 32 | }; 33 | #endif 34 | -------------------------------------------------------------------------------- /Utilities/KalDet/src/ild/ftd/ILDFTDDiscBasedKalDetector.h: -------------------------------------------------------------------------------- 1 | #ifndef __ILDFTDDISCBASEDDETECTOR__ 2 | #define __ILDFTDDISCBASEDDETECTOR__ 3 | 4 | /** Disk based version of the FTD alla LOI 5 | * 6 | * @author S.Aplin DESY 7 | */ 8 | 9 | #include "kaltest/TVKalDetector.h" 10 | 11 | class TNode; 12 | 13 | namespace gear{ 14 | class GearMgr ; 15 | } 16 | 17 | 18 | class ILDFTDDiscBasedKalDetector : public TVKalDetector { 19 | public: 20 | 21 | /** Initialize the FTD from GEAR */ 22 | ILDFTDDiscBasedKalDetector( const gear::GearMgr& gearMgr ); 23 | 24 | 25 | private: 26 | 27 | void setupGearGeom( const gear::GearMgr& gearMgr ) ; 28 | 29 | int _nDisks ; 30 | double _bZ ; 31 | 32 | struct FTD_Disk { 33 | double rInner; 34 | double rOuter; 35 | double senThickness; 36 | double supThickness; 37 | double zPos; 38 | 39 | }; 40 | std::vector _FTDgeo; 41 | 42 | }; 43 | 44 | #endif 45 | -------------------------------------------------------------------------------- /Utilities/KalDet/src/ild/lctpc/LCTPCKalDetector.h: -------------------------------------------------------------------------------- 1 | #ifndef LCTPCKALDETECTOR_H 2 | #define LCTPCKALDETECTOR_H 3 | 4 | #include "kaltest/TVKalDetector.h" 5 | 6 | #include "kaldet/ILDVMeasLayer.h" 7 | 8 | namespace gear{ 9 | class GearMgr ; 10 | } 11 | 12 | namespace kaldet{ 13 | 14 | /** 15 | * The LCTPC implementation for a TPC which is completely instantiated from GEAR. 16 | * 17 | */ 18 | class LCTPCKalDetector : public TVKalDetector { 19 | 20 | public: 21 | 22 | LCTPCKalDetector() {}; 23 | 24 | /** 25 | * The constructor. All information to initialise the TPC is taken from GEAR. 26 | * 27 | * The class has been copied from GearTPCKalDetector class and adopted for the use of MarlinTrk 28 | * You can find comments and necessary information in the original class 29 | * 30 | */ 31 | LCTPCKalDetector(const gear::GearMgr& gearMgr); 32 | 33 | /// The destructor. 34 | virtual ~LCTPCKalDetector(); 35 | 36 | }; 37 | 38 | }// namespace kaldet 39 | #endif //LCTPCKALDETECTOR_H 40 | -------------------------------------------------------------------------------- /Utilities/KalDet/src/ild/set/ILDSETKalDetector.h: -------------------------------------------------------------------------------- 1 | #ifndef __ILDSETKALDETECTOR__ 2 | #define __ILDSETKALDETECTOR__ 3 | 4 | /** Ladder based SET to be used for ILD DBD studies 5 | * 6 | * @author S.Aplin DESY 7 | */ 8 | 9 | #include "kaltest/TVKalDetector.h" 10 | 11 | #include "TMath.h" 12 | 13 | class TNode; 14 | 15 | namespace gear{ 16 | class GearMgr ; 17 | } 18 | 19 | 20 | class ILDSETKalDetector : public TVKalDetector { 21 | 22 | public: 23 | 24 | /** Initialize the SET from GEAR */ 25 | ILDSETKalDetector( const gear::GearMgr& gearMgr ); 26 | 27 | 28 | private: 29 | 30 | void setupGearGeom( const gear::GearMgr& gearMgr ) ; 31 | 32 | int _nLayers ; 33 | double _bZ ; 34 | 35 | bool _isStripDetector; 36 | 37 | struct SET_Layer { 38 | int nLadders; 39 | int nSensorsPerLadder; 40 | double phi0; 41 | double dphi; 42 | double senRMin; 43 | double supRMin; 44 | double length; 45 | double width; 46 | double offset; 47 | double senThickness; 48 | double supThickness; 49 | double sensorLength; 50 | double stripAngle; 51 | }; 52 | std::vector _SETgeo; 53 | 54 | }; 55 | 56 | 57 | 58 | #endif 59 | -------------------------------------------------------------------------------- /Utilities/KalDet/src/ild/sit/ILDSITCylinderKalDetector.h: -------------------------------------------------------------------------------- 1 | #ifndef __ILDSITCYLINDERKALDETECTOR__ 2 | #define __ILDSITCYLINDERKALDETECTOR__ 3 | 4 | /** SIT Cylinder based detector to be used for ILD DBD studies when using the old LOI base SIT 5 | * 6 | * @author S.Aplin DESY 7 | */ 8 | 9 | #include "kaltest/TVKalDetector.h" 10 | 11 | class TNode; 12 | 13 | namespace gear{ 14 | class GearMgr ; 15 | } 16 | 17 | 18 | class ILDSITCylinderKalDetector : public TVKalDetector { 19 | public: 20 | 21 | /** Initialize the TPC from GEAR */ 22 | ILDSITCylinderKalDetector( const gear::GearMgr& gearMgr ); 23 | 24 | 25 | private: 26 | 27 | void setupGearGeom( const gear::GearMgr& gearMgr ) ; 28 | 29 | unsigned int _nLayers ; 30 | double _bZ ; 31 | 32 | struct SIT_Layer { 33 | double radius; 34 | double half_length; 35 | double senThickness; 36 | double supThickness; 37 | 38 | }; 39 | std::vector _SITgeo; 40 | 41 | 42 | }; 43 | 44 | #endif 45 | -------------------------------------------------------------------------------- /Utilities/KalDet/src/ild/sit/ILDSITKalDetector.h: -------------------------------------------------------------------------------- 1 | #ifndef __ILDSITKALDETECTOR__ 2 | #define __ILDSITKALDETECTOR__ 3 | 4 | /** Ladder based SIT to be used for ILD DBD studies 5 | * 6 | * @author S.Aplin DESY 7 | */ 8 | 9 | #include "kaltest/TVKalDetector.h" 10 | 11 | #include "TMath.h" 12 | 13 | class TNode; 14 | 15 | namespace gear{ 16 | class GearMgr ; 17 | } 18 | 19 | class IGeomSvc; 20 | 21 | class ILDSITKalDetector : public TVKalDetector { 22 | 23 | public: 24 | 25 | /** Initialize the SIT from GEAR */ 26 | ILDSITKalDetector( const gear::GearMgr& gearMgr, IGeomSvc* geoSvc ); 27 | 28 | 29 | private: 30 | 31 | void setupGearGeom( const gear::GearMgr& gearMgr ) ; 32 | void setupGearGeom( IGeomSvc* geoSvc ); 33 | 34 | int _nLayers ; 35 | double _bZ ; 36 | 37 | bool _isStripDetector; 38 | 39 | struct SIT_Layer { 40 | int nLadders; 41 | int nSensorsPerLadder; 42 | double phi0; 43 | double dphi; 44 | double senRMin; 45 | double supRMin; 46 | double length; 47 | double width; 48 | double offset; 49 | double senThickness; 50 | double supThickness; 51 | double sensorLength; 52 | double stripAngle; 53 | }; 54 | std::vector _SITgeo; 55 | 56 | }; 57 | 58 | 59 | 60 | #endif 61 | -------------------------------------------------------------------------------- /Utilities/KalDet/src/ild/support/ILDSupportKalDetector.h: -------------------------------------------------------------------------------- 1 | #ifndef __ILDSUPPORTDETECTOR__ 2 | #define __ILDSUPPORTDETECTOR__ 3 | 4 | /** Support Material to be used for ILD DBD studies 5 | * 6 | * @author S.Aplin DESY 7 | */ 8 | 9 | #include "kaltest/TVKalDetector.h" 10 | 11 | class TNode; 12 | 13 | namespace gear{ 14 | class GearMgr ; 15 | } 16 | class IGeomSvc; 17 | 18 | class ILDCylinderMeasLayer; 19 | 20 | class ILDSupportKalDetector : public TVKalDetector { 21 | public: 22 | 23 | /** Initialize the support structures from GEAR */ 24 | ILDSupportKalDetector( const gear::GearMgr& gearMgr, IGeomSvc* geoSvc ); 25 | 26 | /** Returns the special layer inside the Beam Pipe used for propagation to the IP */ 27 | ILDCylinderMeasLayer* getIPLayer() { return _ipLayer; } 28 | 29 | private: 30 | 31 | ILDCylinderMeasLayer* _ipLayer; 32 | 33 | std::vector _surface_names; 34 | 35 | }; 36 | 37 | #endif 38 | -------------------------------------------------------------------------------- /Utilities/KalDet/src/ild/tpc/ILDTPCKalDetector.h: -------------------------------------------------------------------------------- 1 | #ifndef __ILDTPCDETECTOR__ 2 | #define __ILDTPCDETECTOR__ 3 | 4 | /** TPC to be used for ILD DBD studies 5 | * 6 | * @author S.Aplin DESY 7 | */ 8 | 9 | #include "kaltest/TVKalDetector.h" 10 | 11 | class TNode; 12 | 13 | namespace gear{ 14 | class GearMgr ; 15 | } 16 | 17 | class IGeomSvc; 18 | 19 | class ILDTPCKalDetector : public TVKalDetector { 20 | public: 21 | 22 | /** Initialize the TPC from GEAR */ 23 | ILDTPCKalDetector( const gear::GearMgr& gearMgr, IGeomSvc* geoSvc=0 ); 24 | 25 | 26 | private: 27 | 28 | }; 29 | 30 | #endif 31 | -------------------------------------------------------------------------------- /Utilities/KalDet/src/kern/EXVKalDetector.cxx: -------------------------------------------------------------------------------- 1 | //************************************************************************* 2 | //* ====================== 3 | //* EXVKalDetector Class 4 | //* ====================== 5 | //* 6 | //* (Description) 7 | //* Abstract detector class for Kalman filter 8 | //* (Requires) 9 | //* TVKalDetector 10 | //* (Provides) 11 | //* class EXVKalDetector 12 | //* (Update Recored) 13 | //* 2009/11/23 K.Ikematsu Derived from KalTest/examples/kaltest/ 14 | //* hybrid/kern/EXVKalDetector.cxx 15 | //* 2010/11/17 K.Fujii Changed unit system to (mm, nsec, T) 16 | //* from (cm, nsec, kG) 17 | //* 18 | //* $Id: EXVKalDetector.cxx,v 1.1.1.1 2009-11-24 00:13:59 ikematsu Exp $ 19 | //************************************************************************* 20 | // 21 | #include "EXVKalDetector.h" 22 | 23 | ClassImp(EXVKalDetector) 24 | 25 | EXVKalDetector::EXVKalDetector(Double_t bField, Int_t m) 26 | : TVKalDetector(m), 27 | fIsPowerOn(kTRUE), 28 | fBfield(bField) 29 | { 30 | } 31 | 32 | EXVKalDetector::~EXVKalDetector() 33 | { 34 | } 35 | -------------------------------------------------------------------------------- /Utilities/KalDet/src/kern/LinkDef.h: -------------------------------------------------------------------------------- 1 | #ifdef __CINT__ 2 | 3 | #pragma link off all globals; 4 | #pragma link off all classes; 5 | #pragma link off all functions; 6 | 7 | #pragma link C++ class EXVKalDetector+; 8 | #pragma link C++ class EXVMeasLayer+; 9 | 10 | #endif 11 | -------------------------------------------------------------------------------- /Utilities/KalDet/src/lctpc/doc/GearTPC_mainpage.h: -------------------------------------------------------------------------------- 1 | /** 2 | @mainpage 3 | 4 | GearTPCKalDetector is a KalDet implementation for the LCTPC collaboration 5 | which is flexible enough to handle multiple detector geometries 6 | without having to adapt the code. It instantiates the full KalDet geometry only from information from the Gear file. 7 | The design is flexible enough that any geometry which can be described with gear 8 | can also be treated by the Kalman detector. Currently not all parts are 9 | implemented, for instance straight pad rows / Kalman layers. In this 10 | case an error message is printed and a gear::NotImplementedException is thrown. 11 | 12 | For backward compatibility the EXTPC interface has been reimplemented using 13 | the GearTPC classes. Once all dependencies on EXTPC have been removed from 14 | MarlinTPC these compatibility classes will be removed from KalDet. 15 | */ 16 | -------------------------------------------------------------------------------- /Utilities/KalDet/src/lctpc/doc/Readme: -------------------------------------------------------------------------------- 1 | There are two different doxy-files for html and latex. For the latex version 2 | the sourcecode brower, namespace and file lists are truned of in order not to 3 | overload the document with information that is not very useful when 4 | printed. In the html version you want these features. 5 | -------------------------------------------------------------------------------- /Utilities/KalDet/src/lctpc/gearTPC/EXTPCHit.cxx: -------------------------------------------------------------------------------- 1 | #include "EXTPCHit.h" 2 | 3 | EXTPCHit::EXTPCHit(Int_t m) : kaldet::GearTPCCylinderHit(m) , fSide(0) {} 4 | 5 | EXTPCHit::EXTPCHit(const TVMeasLayer &ms, 6 | Double_t *x, 7 | Double_t *dx, 8 | Int_t side, 9 | Double_t v, 10 | const TVector3 &xx, 11 | Double_t b, 12 | Int_t m) 13 | : kaldet::GearTPCCylinderHit(ms, x, dx, xx, b, v, m), fSide(side) {} 14 | 15 | EXTPCHit::EXTPCHit(const TVMeasLayer &ms, 16 | Double_t *x, 17 | Double_t *dx, 18 | Int_t side, 19 | Double_t v, 20 | const void *hitp, 21 | Double_t b, 22 | Int_t m) 23 | : kaldet::GearTPCCylinderHit(ms, x, dx, hitp, b, v, m), fSide(side) {} 24 | 25 | EXTPCHit::~EXTPCHit() 26 | {} 27 | 28 | -------------------------------------------------------------------------------- /Utilities/KalDet/src/lctpc/gearTPC/LinkDef.h: -------------------------------------------------------------------------------- 1 | #ifdef __CINT__ 2 | 3 | #pragma link off all globals; 4 | #pragma link off all classes; 5 | #pragma link off all functions; 6 | 7 | 8 | #endif 9 | -------------------------------------------------------------------------------- /Utilities/KalDet/src/othertpc/toytpc/LinkDef.h: -------------------------------------------------------------------------------- 1 | #ifdef __CINT__ 2 | 3 | #pragma link off all globals; 4 | #pragma link off all classes; 5 | #pragma link off all functions; 6 | 7 | #pragma link C++ class EXTPCKalDetector+; 8 | #pragma link C++ class EXTPCHit+; 9 | #pragma link C++ class EXTPCMeasLayer+; 10 | 11 | #endif 12 | -------------------------------------------------------------------------------- /Utilities/KalTest/include/kaltest/KalTrackDim.h: -------------------------------------------------------------------------------- 1 | #ifndef KALDIM_H 2 | #define KALDIM_H 3 | #define kMdim 2 4 | #ifdef __NOT0__ 5 | #define kSdim 5 6 | #else 7 | #define kSdim 6 8 | #endif 9 | #endif 10 | -------------------------------------------------------------------------------- /Utilities/KalTest/include/kaltest/TAttDrawable.h: -------------------------------------------------------------------------------- 1 | #ifndef TATTDRAWABLE_H 2 | #define TATTDRAWABLE_H 3 | //************************************************************************* 4 | //* =================== 5 | //* TAttDrawable Class 6 | //* =================== 7 | //* 8 | //* (Description) 9 | //* TAttDrawable class adds drawable attribute to an object. 10 | //* (Requires) 11 | //* none 12 | //* (Provides) 13 | //* class TAttDrawable 14 | //* (Update Recored) 15 | //* 2004/11/04 K.Fujii Original very primitive version. 16 | //* 17 | //************************************************************************* 18 | // 19 | #include 20 | //_____________________________________________________________________ 21 | // ------------------------------ 22 | // Base Class for Drawale Objects 23 | // ------------------------------ 24 | // 25 | class TAttDrawable { 26 | public: 27 | TAttDrawable() {} 28 | virtual ~TAttDrawable() {} 29 | 30 | virtual void Draw(const Char_t *opt=""); 31 | virtual void Draw(Int_t /* color */, const Char_t *opt=""); 32 | private: 33 | 34 | ClassDef(TAttDrawable, 1) // Base class for drawable objects 35 | }; 36 | 37 | #endif 38 | -------------------------------------------------------------------------------- /Utilities/KalTest/include/kaltest/TKalFilterCond.h: -------------------------------------------------------------------------------- 1 | #ifndef TKALFILTERCOND_H 2 | #define TKALFILTERCOND_H 3 | //************************************************************************* 4 | //* ===================== 5 | //* TKalFilterCond Class 6 | //* ===================== 7 | //* 8 | //* (Description) 9 | //* A class to specify filter conditions used in Kalman filter. 10 | //* (Requires) 11 | //* (Provides) 12 | //* class TKalFilterCond 13 | //* (Update Recored) 14 | //* 2010/04/06 K.Fujii Original Version. 15 | //* 16 | //************************************************************************* 17 | #include "Rtypes.h" 18 | //_____________________________________________________________________ 19 | // ------------------------------ 20 | // Filter condition class 21 | // ------------------------------ 22 | 23 | class TKalTrackSite; 24 | 25 | class TKalFilterCond { 26 | public: 27 | 28 | // need virtual destructor is we have virtual functions 29 | virtual ~TKalFilterCond() {}; 30 | 31 | virtual Bool_t IsAccepted(const TKalTrackSite &site); 32 | 33 | ClassDef(TKalFilterCond,1) // Base class for detector system 34 | }; 35 | #endif 36 | -------------------------------------------------------------------------------- /Utilities/KalTest/include/kaltest/TVCurve.h: -------------------------------------------------------------------------------- 1 | #ifndef TVCURVE_H 2 | #define TVCURVE_H 3 | //************************************************************************* 4 | //* ==================== 5 | //* TVCurve Class 6 | //* ==================== 7 | //* 8 | //* (Description) 9 | //* This is the base class for various curves. 10 | //* (Requires) 11 | //* TObject; 12 | //* (Provides) 13 | //* class TVCurve 14 | //* (Update Recored) 15 | //* 2003/10/03 K.Fujii Original version. 16 | //* 17 | //************************************************************************* 18 | // 19 | #include "TObject.h" 20 | //_____________________________________________________________________ 21 | // ----------------------------------- 22 | // Base Class for any curve 23 | // ----------------------------------- 24 | 25 | class TVCurve : public TObject { 26 | public: 27 | private: 28 | 29 | ClassDef(TVCurve,1) // Base class for any curve 30 | }; 31 | 32 | #endif 33 | -------------------------------------------------------------------------------- /Utilities/KalTest/include/kaltest/TVSolid.h: -------------------------------------------------------------------------------- 1 | #ifndef TVSOLID_H 2 | #define TVSOLID_H 3 | //************************************************************************* 4 | //* ==================== 5 | //* TVSolid Class 6 | //* ==================== 7 | //* 8 | //* (Description) 9 | //* This is the base class for various solids. 10 | //* (Requires) 11 | //* TObject; 12 | //* (Provides) 13 | //* class TVSolid 14 | //* (Update Recored) 15 | //* 2003/10/03 K.Fujii Original version. 16 | //* 17 | //************************************************************************* 18 | // 19 | #include "TObject.h" 20 | //_____________________________________________________________________ 21 | // ----------------------------------- 22 | // Base Class for any solid 23 | // ----------------------------------- 24 | 25 | class TVSolid : public TObject { 26 | public: 27 | private: 28 | 29 | ClassDef(TVSolid,1) // Base class for any solid 30 | }; 31 | 32 | #endif 33 | -------------------------------------------------------------------------------- /Utilities/KalTest/src/geomlib/LinkDef.h: -------------------------------------------------------------------------------- 1 | #ifdef __CINT__ 2 | 3 | #pragma link off all globals; 4 | #pragma link off all classes; 5 | #pragma link off all functions; 6 | 7 | #pragma link C++ class TCircle+; 8 | #pragma link C++ class TCutCone+; 9 | #pragma link C++ class TCylinder+; 10 | #pragma link C++ class TPlane+; 11 | #pragma link C++ class THype+; 12 | #pragma link C++ class TTube+; 13 | #pragma link C++ class THelicalTrack+; 14 | #pragma link C++ class TStraightTrack+; 15 | #pragma link C++ class TVCurve+; 16 | #pragma link C++ class TVSolid+; 17 | #pragma link C++ class TVSurface+; 18 | #pragma link C++ class TVTrack+; 19 | 20 | #endif 21 | -------------------------------------------------------------------------------- /Utilities/KalTest/src/geomlib/TVCurve.cxx: -------------------------------------------------------------------------------- 1 | //************************************************************************* 2 | //* ==================== 3 | //* TVCurve Class 4 | //* ==================== 5 | //* 6 | //* (Description) 7 | //* This is the base class for various curves. 8 | //* (Requires) 9 | //* TObject; 10 | //* (Provides) 11 | //* class TVCurve 12 | //* (Update Recored) 13 | //* 2003/10/03 K.Fujii Original version. 14 | //* 15 | //************************************************************************* 16 | // 17 | #include "TVCurve.h" 18 | //_____________________________________________________________________ 19 | // ----------------------------------- 20 | // Base Class for any curve 21 | // ----------------------------------- 22 | ClassImp(TVCurve) 23 | -------------------------------------------------------------------------------- /Utilities/KalTest/src/geomlib/TVCurve.h: -------------------------------------------------------------------------------- 1 | #ifndef TVCURVE_H 2 | #define TVCURVE_H 3 | //************************************************************************* 4 | //* ==================== 5 | //* TVCurve Class 6 | //* ==================== 7 | //* 8 | //* (Description) 9 | //* This is the base class for various curves. 10 | //* (Requires) 11 | //* TObject; 12 | //* (Provides) 13 | //* class TVCurve 14 | //* (Update Recored) 15 | //* 2003/10/03 K.Fujii Original version. 16 | //* 17 | //************************************************************************* 18 | // 19 | #include "TObject.h" 20 | //_____________________________________________________________________ 21 | // ----------------------------------- 22 | // Base Class for any curve 23 | // ----------------------------------- 24 | 25 | class TVCurve : public TObject { 26 | public: 27 | private: 28 | 29 | ClassDef(TVCurve,1) // Base class for any curve 30 | }; 31 | 32 | #endif 33 | -------------------------------------------------------------------------------- /Utilities/KalTest/src/geomlib/TVSolid.cxx: -------------------------------------------------------------------------------- 1 | //************************************************************************* 2 | //* ==================== 3 | //* TVSolid Class 4 | //* ==================== 5 | //* 6 | //* (Description) 7 | //* This is the base class for various solids. 8 | //* (Requires) 9 | //* TObject; 10 | //* (Provides) 11 | //* class TVSolid 12 | //* (Update Recored) 13 | //* 2003/10/03 K.Fujii Original version. 14 | //* 15 | //************************************************************************* 16 | // 17 | #include "TVSolid.h" 18 | //_____________________________________________________________________ 19 | // ----------------------------------- 20 | // Base Class for any solid 21 | // ----------------------------------- 22 | 23 | ClassImp(TVSolid) 24 | -------------------------------------------------------------------------------- /Utilities/KalTest/src/geomlib/TVSolid.h: -------------------------------------------------------------------------------- 1 | #ifndef TVSOLID_H 2 | #define TVSOLID_H 3 | //************************************************************************* 4 | //* ==================== 5 | //* TVSolid Class 6 | //* ==================== 7 | //* 8 | //* (Description) 9 | //* This is the base class for various solids. 10 | //* (Requires) 11 | //* TObject; 12 | //* (Provides) 13 | //* class TVSolid 14 | //* (Update Recored) 15 | //* 2003/10/03 K.Fujii Original version. 16 | //* 17 | //************************************************************************* 18 | // 19 | #include "TObject.h" 20 | //_____________________________________________________________________ 21 | // ----------------------------------- 22 | // Base Class for any solid 23 | // ----------------------------------- 24 | 25 | class TVSolid : public TObject { 26 | public: 27 | private: 28 | 29 | ClassDef(TVSolid,1) // Base class for any solid 30 | }; 31 | 32 | #endif 33 | -------------------------------------------------------------------------------- /Utilities/KalTest/src/kallib/LinkDef.h: -------------------------------------------------------------------------------- 1 | #ifdef __CINT__ 2 | 3 | #pragma link off all globals; 4 | #pragma link off all classes; 5 | #pragma link off all functions; 6 | 7 | #pragma link C++ class TKalMatrix+; 8 | #pragma link C++ class TVKalSite+; 9 | #pragma link C++ class TVKalState+; 10 | #pragma link C++ class TVKalSystem+; 11 | 12 | #endif 13 | -------------------------------------------------------------------------------- /Utilities/KalTest/src/kaltracklib/KalTrackDim.h: -------------------------------------------------------------------------------- 1 | #ifndef KALDIM_H 2 | #define KALDIM_H 3 | #define kMdim 2 4 | #ifdef __NOT0__ 5 | #define kSdim 5 6 | #else 7 | #define kSdim 6 8 | #endif 9 | #endif 10 | -------------------------------------------------------------------------------- /Utilities/KalTest/src/kaltracklib/LinkDef.h: -------------------------------------------------------------------------------- 1 | #ifdef __CINT__ 2 | 3 | #pragma link off all globals; 4 | #pragma link off all classes; 5 | #pragma link off all functions; 6 | 7 | #pragma link C++ class TVTrackHit+; 8 | #pragma link C++ class TVMeasLayer+; 9 | #pragma link C++ class TKalTrackSite+; 10 | #pragma link C++ class TKalTrackState+; 11 | #pragma link C++ class TKalTrack+; 12 | #pragma link C++ class TKalDetCradle+; 13 | #pragma link C++ class TVKalDetector+; 14 | #pragma link C++ class TKalFilterCond+; 15 | 16 | #endif 17 | -------------------------------------------------------------------------------- /Utilities/KalTest/src/kaltracklib/TKalFilterCond.h: -------------------------------------------------------------------------------- 1 | #ifndef TKALFILTERCOND_H 2 | #define TKALFILTERCOND_H 3 | //************************************************************************* 4 | //* ===================== 5 | //* TKalFilterCond Class 6 | //* ===================== 7 | //* 8 | //* (Description) 9 | //* A class to specify filter conditions used in Kalman filter. 10 | //* (Requires) 11 | //* (Provides) 12 | //* class TKalFilterCond 13 | //* (Update Recored) 14 | //* 2010/04/06 K.Fujii Original Version. 15 | //* 16 | //************************************************************************* 17 | #include "Rtypes.h" 18 | //_____________________________________________________________________ 19 | // ------------------------------ 20 | // Filter condition class 21 | // ------------------------------ 22 | 23 | class TKalTrackSite; 24 | 25 | class TKalFilterCond { 26 | public: 27 | 28 | // need virtual destructor is we have virtual functions 29 | virtual ~TKalFilterCond() {}; 30 | 31 | virtual Bool_t IsAccepted(const TKalTrackSite &site); 32 | 33 | ClassDef(TKalFilterCond,1) // Base class for detector system 34 | }; 35 | #endif 36 | -------------------------------------------------------------------------------- /Utilities/KalTest/src/kaltracklib/TVKalDetector.cxx: -------------------------------------------------------------------------------- 1 | //************************************************************************* 2 | //* ===================== 3 | //* TVKalDetector Class 4 | //* ===================== 5 | //* 6 | //* (Description) 7 | //* Base class to hold information of detector system 8 | //* used in Kalman filter classes. 9 | //* (Requires) 10 | //* TObjArray 11 | //* (Provides) 12 | //* class TVKalDetector 13 | //* (Update Recored) 14 | //* 2003/09/30 K.Fujii Original version. 15 | //* 2005/08/14 K.Fujii Moved GetEnergyLoss() and CalcQms() to 16 | //* TVMeasLayer. 17 | //* 18 | //************************************************************************* 19 | 20 | #include "TVKalDetector.h" 21 | 22 | ClassImp(TVKalDetector) 23 | -------------------------------------------------------------------------------- /Utilities/KalTest/src/utils/LinkDef.h: -------------------------------------------------------------------------------- 1 | #ifdef __CINT__ 2 | 3 | #pragma link off all globals; 4 | #pragma link off all classes; 5 | #pragma link off all functions; 6 | 7 | #pragma link C++ class TAttDrawable+; 8 | #pragma link C++ class TAttElement+; 9 | #pragma link C++ class TAttLockable+; 10 | 11 | #endif 12 | -------------------------------------------------------------------------------- /Utilities/KalTest/src/utils/TAttDrawable.cxx: -------------------------------------------------------------------------------- 1 | //************************************************************************* 2 | //* ==================== 3 | //* TAttDrawable Class 4 | //* ==================== 5 | //* 6 | //* (Description) 7 | //* TAttDrawable class adds drawable attribute to an object. 8 | //* (Requires) 9 | //* none 10 | //* (Provides) 11 | //* class TAttDrawable 12 | //* (Update Recored) 13 | //* 2004/11/04 K.Fujii Original very primitive version. 14 | //* 15 | //************************************************************************* 16 | // 17 | #include "TAttDrawable.h" 18 | //_________________________________________________________________________ 19 | // ------------------------------- 20 | // Base Class for Drawable Objects 21 | // ------------------------------- 22 | // 23 | ClassImp(TAttDrawable) 24 | 25 | //========================================================================= 26 | //* Draw ------------------------------------------------------------------ 27 | 28 | void TAttDrawable::Draw(const Char_t *opt) 29 | { 30 | static Int_t color = 0; 31 | color++; 32 | color %= 10; 33 | Draw(color, opt); 34 | } 35 | 36 | void TAttDrawable::Draw(Int_t /* color */, const Char_t * /* opt */) 37 | { 38 | } 39 | -------------------------------------------------------------------------------- /Utilities/KalTest/src/utils/TAttDrawable.h: -------------------------------------------------------------------------------- 1 | #ifndef TATTDRAWABLE_H 2 | #define TATTDRAWABLE_H 3 | //************************************************************************* 4 | //* =================== 5 | //* TAttDrawable Class 6 | //* =================== 7 | //* 8 | //* (Description) 9 | //* TAttDrawable class adds drawable attribute to an object. 10 | //* (Requires) 11 | //* none 12 | //* (Provides) 13 | //* class TAttDrawable 14 | //* (Update Recored) 15 | //* 2004/11/04 K.Fujii Original very primitive version. 16 | //* 17 | //************************************************************************* 18 | // 19 | #include 20 | //_____________________________________________________________________ 21 | // ------------------------------ 22 | // Base Class for Drawale Objects 23 | // ------------------------------ 24 | // 25 | class TAttDrawable { 26 | public: 27 | TAttDrawable() {} 28 | virtual ~TAttDrawable() {} 29 | 30 | virtual void Draw(const Char_t *opt=""); 31 | virtual void Draw(Int_t /* color */, const Char_t *opt=""); 32 | private: 33 | 34 | ClassDef(TAttDrawable, 1) // Base class for drawable objects 35 | }; 36 | 37 | #endif 38 | -------------------------------------------------------------------------------- /Utilities/KalTest/src/utils/TAttElement.cxx: -------------------------------------------------------------------------------- 1 | //************************************************************************* 2 | //* =================== 3 | //* TAttElement Class 4 | //* =================== 5 | //* 6 | //* (Description) 7 | //* TAttElement class adds constituent attribute to an object. 8 | //* (Requires) 9 | //* none 10 | //* (Provides) 11 | //* class TAttElement 12 | //* (Update Recored) 13 | //* 2003/10/10 K.Fujii Original very primitive version. 14 | //* 15 | //************************************************************************* 16 | // 17 | #include "TAttElement.h" 18 | //_____________________________________________________________________ 19 | // -------------------------------- 20 | // Base Class for Element Objects 21 | // -------------------------------- 22 | // 23 | 24 | ClassImp(TAttElement) 25 | -------------------------------------------------------------------------------- /Utilities/KalTest/src/utils/TAttLockable.cxx: -------------------------------------------------------------------------------- 1 | //************************************************************************* 2 | //* ==================== 3 | //* TAttLockable Class 4 | //* ==================== 5 | //* 6 | //* (Description) 7 | //* TAttLockable class adds lockable attribute to an object. 8 | //* (Requires) 9 | //* none 10 | //* (Provides) 11 | //* class Lockable 12 | //* (Update Recored) 13 | //* 1999/06/05 K.Fujii Original very primitive version. 14 | //* 15 | //************************************************************************* 16 | // 17 | #include "TAttLockable.h" 18 | //_____________________________________________________________________ 19 | // ------------------------------ 20 | // Base Class for Lockale Objects 21 | // ------------------------------ 22 | // 23 | ClassImp(TAttLockable) 24 | -------------------------------------------------------------------------------- /Utilities/KiTrack/include/ILDImpl/FTDHit01.h: -------------------------------------------------------------------------------- 1 | #ifndef FTDHit01_h 2 | #define FTDHit01_h 3 | 4 | #include "ILDImpl/IFTDHit.h" 5 | 6 | namespace KiTrackMarlin{ 7 | /** A class for hits in the FTD (the 01 is just for historical reasons and may be renamed) 8 | * 9 | * - The side is according to CellID0. 10 | * - Layer is set according to CellID0 +1 (so we can use layer 0 for the IP) 11 | * - Module is set according to CellID0. 12 | * - Sensor is set according to CellID0 -1. (because currently sensors of the FTD start with 1 in the CellID0, if this changes, this has to be modified) 13 | */ 14 | class FTDHit01 : public IFTDHit{ 15 | public: 16 | 17 | FTDHit01( edm4hep::TrackerHit trackerHit , const SectorSystemFTD* const sectorSystemFTD ); 18 | }; 19 | } 20 | #endif 21 | 22 | -------------------------------------------------------------------------------- /Utilities/KiTrack/include/ILDImpl/FTDHitSimple.h: -------------------------------------------------------------------------------- 1 | #ifndef FTDHitSimple_h 2 | #define FTDHitSimple_h 3 | 4 | #include "KiTrack/IHit.h" 5 | 6 | #include "ILDImpl/SectorSystemFTD.h" 7 | 8 | 9 | 10 | namespace KiTrackMarlin{ 11 | 12 | 13 | /** A hit 14 | */ 15 | class FTDHitSimple : public IHit{ 16 | 17 | 18 | public: 19 | 20 | FTDHitSimple( float x , float y , float z , int side, unsigned layer , unsigned module, unsigned sensor, const SectorSystemFTD* const sectorSystemFTD ); 21 | 22 | 23 | 24 | virtual const ISectorSystem* getSectorSystem() const { return _sectorSystemFTD; }; 25 | 26 | virtual ~FTDHitSimple(){} 27 | 28 | private: 29 | 30 | int _side; 31 | unsigned _layer; 32 | unsigned _module; 33 | unsigned _sensor; 34 | 35 | const SectorSystemFTD* _sectorSystemFTD; 36 | 37 | void calculateSector(){ _sector = _sectorSystemFTD->getSector( _side, _layer , _module , _sensor ); } 38 | 39 | }; 40 | 41 | } 42 | 43 | 44 | #endif 45 | 46 | -------------------------------------------------------------------------------- /Utilities/KiTrack/include/ILDImpl/FTDNeighborPetalSecCon.h: -------------------------------------------------------------------------------- 1 | #ifndef FTDNeighborPetalSecCon_h 2 | #define FTDNeighborPetalSecCon_h 3 | 4 | #include "KiTrack/ISectorConnector.h" 5 | 6 | #include "ILDImpl/SectorSystemFTD.h" 7 | 8 | 9 | 10 | namespace KiTrackMarlin{ 11 | 12 | /** Used to connect two sectors. 13 | * 14 | * Allows: 15 | * 16 | * - Connections to the neighbouring petals (the one to the left and the one to the right on the same layer and side) 17 | * 18 | */ 19 | class FTDNeighborPetalSecCon : public ISectorConnector{ 20 | 21 | 22 | public: 23 | 24 | /** 25 | * 26 | */ 27 | FTDNeighborPetalSecCon ( const SectorSystemFTD* sectorSystemFTD ); 28 | 29 | virtual std::set getTargetSectors ( int sector ); 30 | 31 | virtual ~FTDNeighborPetalSecCon(){}; 32 | 33 | private: 34 | 35 | const SectorSystemFTD* _sectorSystemFTD; 36 | 37 | 38 | 39 | }; 40 | 41 | 42 | } 43 | 44 | 45 | #endif 46 | 47 | -------------------------------------------------------------------------------- /Utilities/KiTrack/include/ILDImpl/VXDHitSimple.h: -------------------------------------------------------------------------------- 1 | #ifndef VXDHitSimple_h 2 | #define VXDHitSimple_h 3 | 4 | #include "KiTrack/IHit.h" 5 | 6 | #include "ILDImpl/SectorSystemVXD.h" 7 | 8 | 9 | 10 | namespace KiTrackMarlin{ 11 | 12 | 13 | /** A hit 14 | */ 15 | class VXDHitSimple : public IHit{ 16 | 17 | 18 | public: 19 | 20 | VXDHitSimple( float x , float y , float z , int layer , int phi, int theta, const SectorSystemVXD* const sectorSystemVXD ); 21 | 22 | 23 | 24 | virtual const ISectorSystem* getSectorSystem() const { return _sectorSystemVXD; }; 25 | 26 | virtual ~VXDHitSimple(){} 27 | 28 | private: 29 | 30 | int _layer; 31 | int _phi; 32 | int _theta; 33 | 34 | const SectorSystemVXD* _sectorSystemVXD; 35 | 36 | //void calculateSector(){ _sector = _sectorSystemVXD->getSector( _side, _layer , _module , _sensor ); } 37 | 38 | }; 39 | 40 | } 41 | 42 | 43 | #endif 44 | 45 | -------------------------------------------------------------------------------- /Utilities/KiTrack/include/KiTrack/ISectorConnector.h: -------------------------------------------------------------------------------- 1 | #ifndef ISectorConnector_h 2 | #define ISectorConnector_h 3 | 4 | #include 5 | 6 | 7 | namespace KiTrack{ 8 | 9 | 10 | /** Abstract Base Class for SectorConnectors. 11 | * 12 | * A SectorConnector is pretty simple: you put in a sector (int) and get back a bunch of other sectors in a set. 13 | * What it can be used for: Suppose you want to search for the path of a particle through a detector 14 | * and you know what possible ways it can go, than you can create a SectorConnector to emulate that. 15 | * So if you have a hit in sector 43 (whatever 43 means) and you think, that from there the particle will 16 | * only go to either sector 46, 47 or 48, then you would write a SectorConnector that will return 17 | * a set of 46,47,48 when the method getTargetSectors( 43 ) is called. 18 | */ 19 | class ISectorConnector{ 20 | 21 | 22 | public: 23 | 24 | /** @return a set of sectors somehow linked to the passed one */ 25 | virtual std::set getTargetSectors ( int ) = 0; 26 | 27 | virtual ~ISectorConnector(){}; 28 | 29 | }; 30 | 31 | 32 | 33 | } 34 | 35 | 36 | 37 | #endif 38 | 39 | 40 | 41 | -------------------------------------------------------------------------------- /Utilities/KiTrack/src/Criteria/Crit2_DeltaPhi.h: -------------------------------------------------------------------------------- 1 | #ifndef Crit2_DeltaPhi_h 2 | #define Crit2_DeltaPhi_h 3 | 4 | 5 | #include "Criteria/ICriterion.h" 6 | 7 | namespace KiTrack{ 8 | 9 | /** Criterion: the difference between the \f$ \phi \f$ angles of two hits in degrees. 10 | * The \f$ \phi \f$ is the angle in the xy plane w.r.t. the positive x axis. 11 | * \f[ \phi = atan2(y,x) \f] 12 | */ 13 | class Crit2_DeltaPhi : public ICriterion{ 14 | 15 | 16 | 17 | public: 18 | 19 | Crit2_DeltaPhi ( float deltaPhiMin , float deltaPhiMax ); 20 | 21 | virtual bool areCompatible( Segment* parent , Segment* child ); 22 | 23 | virtual ~Crit2_DeltaPhi(){}; 24 | 25 | 26 | private: 27 | 28 | float _deltaPhiMax{}; 29 | float _deltaPhiMin{}; 30 | 31 | 32 | 33 | }; 34 | 35 | } 36 | 37 | #endif 38 | 39 | -------------------------------------------------------------------------------- /Utilities/KiTrack/src/Criteria/Crit2_DeltaPhi_MV.h: -------------------------------------------------------------------------------- 1 | #ifndef Crit2_DeltaPhi_MV_h 2 | #define Crit2_DeltaPhi_MV_h 3 | 4 | 5 | #include "Criteria/ICriterion.h" 6 | 7 | namespace KiTrack{ 8 | 9 | /** Criterion: the difference between the \f$ \phi \f$ angles of two hits in degrees. 10 | * The \f$ \phi \f$ is the angle in the xy plane w.r.t. the positive x axis. 11 | * \f[ \phi = atan2(y,x) \f] 12 | */ 13 | class Crit2_DeltaPhi_MV : public ICriterion{ 14 | 15 | 16 | 17 | public: 18 | 19 | Crit2_DeltaPhi_MV ( float deltaPhiMin , float deltaPhiMax ); 20 | 21 | virtual bool areCompatible( Segment* parent , Segment* child ); 22 | 23 | virtual ~Crit2_DeltaPhi_MV(){}; 24 | 25 | 26 | private: 27 | 28 | float _deltaPhiMax{}; 29 | float _deltaPhiMin{}; 30 | 31 | 32 | 33 | }; 34 | 35 | } 36 | 37 | #endif 38 | 39 | -------------------------------------------------------------------------------- /Utilities/KiTrack/src/Criteria/Crit2_DeltaRho.h: -------------------------------------------------------------------------------- 1 | #ifndef Crit2_DeltaRho_h 2 | #define Crit2_DeltaRho_h 3 | 4 | 5 | #include "Criteria/ICriterion.h" 6 | 7 | namespace KiTrack{ 8 | 9 | /** Criterion: the difference of the sqrt(x^2 + y^2) of two hits. 10 | */ 11 | class Crit2_DeltaRho : public ICriterion{ 12 | 13 | 14 | 15 | public: 16 | 17 | Crit2_DeltaRho ( float deltaRhoMin , float deltaRhoMax ); 18 | 19 | virtual bool areCompatible( Segment* parent , Segment* child ); 20 | 21 | virtual ~Crit2_DeltaRho(){}; 22 | 23 | 24 | private: 25 | 26 | float _deltaRhoMax{}; 27 | float _deltaRhoMin{}; 28 | 29 | 30 | 31 | }; 32 | 33 | } 34 | 35 | #endif 36 | 37 | -------------------------------------------------------------------------------- /Utilities/KiTrack/src/Criteria/Crit2_DeltaTheta_MV.h: -------------------------------------------------------------------------------- 1 | #ifndef Crit2_DeltaTheta_MV_h 2 | #define Crit2_DeltaTheta_MV_h 3 | 4 | 5 | #include "Criteria/ICriterion.h" 6 | 7 | namespace KiTrack{ 8 | 9 | /** Criterion: the difference between the \f$ \theta \f$ angles of two hits in degrees. 10 | * The \f$ \theta \f$ is the angle in the xy plane w.r.t. the positive x axis. 11 | * \f[ \theta = atan2(y,x) \f] 12 | */ 13 | class Crit2_DeltaTheta_MV : public ICriterion{ 14 | 15 | 16 | 17 | public: 18 | 19 | Crit2_DeltaTheta_MV ( float deltaThetaMin , float deltaThetaMax ); 20 | 21 | virtual bool areCompatible( Segment* parent , Segment* child ); 22 | 23 | virtual ~Crit2_DeltaTheta_MV(){}; 24 | 25 | 26 | private: 27 | 28 | float _deltaThetaMax{}; 29 | float _deltaThetaMin{}; 30 | 31 | 32 | 33 | }; 34 | 35 | } 36 | 37 | #endif 38 | 39 | -------------------------------------------------------------------------------- /Utilities/KiTrack/src/Criteria/Crit2_Distance_MV.h: -------------------------------------------------------------------------------- 1 | #ifndef Crit2_Distance_MV_h 2 | #define Crit2_Distance_MV_h 3 | 4 | 5 | #include "Criteria/ICriterion.h" 6 | 7 | namespace KiTrack{ 8 | 9 | /** Criterion: the difference between the \f$ \phi \f$ angles of two hits in degrees. 10 | * The \f$ \phi \f$ is the angle in the xy plane w.r.t. the positive x axis. 11 | * \f[ \phi = atan2(y,x) \f] 12 | */ 13 | class Crit2_Distance_MV : public ICriterion{ 14 | 15 | 16 | 17 | public: 18 | 19 | Crit2_Distance_MV ( float deltaPos2Min , float deltaPos2Max ); 20 | 21 | virtual bool areCompatible( Segment* parent , Segment* child ); 22 | 23 | virtual ~Crit2_Distance_MV(){}; 24 | 25 | 26 | private: 27 | 28 | float _deltaPos2Max{}; 29 | float _deltaPos2Min{}; 30 | 31 | 32 | 33 | }; 34 | 35 | } 36 | 37 | #endif 38 | 39 | -------------------------------------------------------------------------------- /Utilities/KiTrack/src/Criteria/Crit2_RZRatio.h: -------------------------------------------------------------------------------- 1 | #ifndef Crit2_RZRatio_h 2 | #define Crit2_RZRatio_h 3 | 4 | 5 | #include "Criteria/ICriterion.h" 6 | 7 | namespace KiTrack{ 8 | 9 | /** Criterion: distance of two hits divided by their z-distance. 10 | * \f[ \frac{\sqrt{ \Delta x^2 + \Delta y^2 + \Delta z^2 }}{\left| \Delta z \right|}\f] 11 | */ 12 | class Crit2_RZRatio : public ICriterion{ 13 | 14 | 15 | 16 | public: 17 | 18 | Crit2_RZRatio ( float ratioMin, float ratioMax ); 19 | 20 | virtual bool areCompatible( Segment* parent , Segment* child ); 21 | 22 | virtual ~Crit2_RZRatio(){}; 23 | 24 | private: 25 | 26 | float _ratioMax{}; 27 | float _ratioMin{}; 28 | 29 | 30 | }; 31 | 32 | } 33 | 34 | #endif 35 | 36 | -------------------------------------------------------------------------------- /Utilities/KiTrack/src/Criteria/Crit2_StraightTrackRatio.h: -------------------------------------------------------------------------------- 1 | #ifndef Crit2_StraightTrackRatio_h 2 | #define Crit2_StraightTrackRatio_h 3 | 4 | 5 | #include "Criteria/ICriterion.h" 6 | 7 | namespace KiTrack{ 8 | 9 | /** Criterion: for straight tracks: if the line between the two hits points towards IP. 10 | * Calculated is 11 | * 12 | * \f[ \frac{ \frac{\rho_1}{z_1} }{ \frac{\rho_2}{z_2} } \simeq 1 \f] 13 | * 14 | * , where \f$ \rho = \sqrt{ x^2 + y^2 }\f$ 15 | */ 16 | class Crit2_StraightTrackRatio : public ICriterion{ 17 | 18 | 19 | 20 | public: 21 | 22 | Crit2_StraightTrackRatio ( float ratioMin, float ratioMax ); 23 | 24 | virtual bool areCompatible( Segment* parent , Segment* child ); 25 | 26 | virtual ~Crit2_StraightTrackRatio(){}; 27 | 28 | 29 | private: 30 | 31 | float _ratioMax{}; 32 | float _ratioMin{}; 33 | 34 | 35 | 36 | }; 37 | 38 | } 39 | 40 | #endif 41 | 42 | -------------------------------------------------------------------------------- /Utilities/KiTrack/src/Criteria/Crit3_2DAngle.h: -------------------------------------------------------------------------------- 1 | #ifndef Crit3_2DAngle_h 2 | #define Crit3_2DAngle_h 3 | 4 | 5 | #include "Criteria/ICriterion.h" 6 | 7 | namespace KiTrack{ 8 | 9 | /** Criterion: the angle between two 2-segments in the xy - plane 10 | */ 11 | class Crit3_2DAngle : public ICriterion{ 12 | 13 | 14 | 15 | public: 16 | 17 | /** 18 | * @param angleMax the maximum angle between 2 2-segments in grad 19 | */ 20 | Crit3_2DAngle ( float angleMin, float angleMax ); 21 | 22 | virtual bool areCompatible( Segment* parent , Segment* child ); 23 | 24 | virtual ~Crit3_2DAngle(){}; 25 | 26 | private: 27 | 28 | float _cosAngleMin{}; 29 | float _cosAngleMax{}; 30 | 31 | }; 32 | 33 | } 34 | 35 | #endif 36 | 37 | -------------------------------------------------------------------------------- /Utilities/KiTrack/src/Criteria/Crit3_2DAngleTimesR.h: -------------------------------------------------------------------------------- 1 | #ifndef Crit3_2DAngleTimesR_h 2 | #define Crit3_2DAngleTimesR_h 3 | 4 | 5 | #include "Criteria/ICriterion.h" 6 | 7 | namespace KiTrack{ 8 | 9 | /** Criterion: the angle in the xy plane between two 2-segments multiplied by the radius of the circle they form 10 | */ 11 | class Crit3_2DAngleTimesR : public ICriterion{ 12 | 13 | 14 | 15 | public: 16 | 17 | /** 18 | * @param angleMax the maximum angle between 2 2-segments in grad times radius 19 | */ 20 | Crit3_2DAngleTimesR ( float angleMin, float angleMax ); 21 | 22 | virtual bool areCompatible( Segment* parent , Segment* child ); 23 | 24 | virtual ~Crit3_2DAngleTimesR(){}; 25 | 26 | private: 27 | 28 | float _angleMin{}; 29 | float _angleMax{}; 30 | 31 | }; 32 | 33 | } 34 | 35 | #endif 36 | 37 | -------------------------------------------------------------------------------- /Utilities/KiTrack/src/Criteria/Crit3_3DAngle.h: -------------------------------------------------------------------------------- 1 | #ifndef Crit3_3DAngle_h 2 | #define Crit3_3DAngle_h 3 | 4 | 5 | #include "Criteria/ICriterion.h" 6 | 7 | namespace KiTrack{ 8 | 9 | /** Criterion: the angle between two 2-segments 10 | */ 11 | class Crit3_3DAngle : public ICriterion{ 12 | 13 | 14 | 15 | public: 16 | 17 | /** 18 | * @param angleMax the maximum angle between 2 2-segments in grad 19 | */ 20 | Crit3_3DAngle ( float angleMin, float angleMax ); 21 | 22 | virtual bool areCompatible( Segment* parent , Segment* child ); 23 | 24 | virtual ~Crit3_3DAngle(){}; 25 | 26 | private: 27 | 28 | float _cosAngleMin{}; 29 | float _cosAngleMax{}; 30 | 31 | }; 32 | 33 | } 34 | 35 | #endif 36 | 37 | -------------------------------------------------------------------------------- /Utilities/KiTrack/src/Criteria/Crit3_3DAngleTimesR.h: -------------------------------------------------------------------------------- 1 | #ifndef Crit3_3DAngleTimesR_h 2 | #define Crit3_3DAngleTimesR_h 3 | 4 | 5 | #include "Criteria/ICriterion.h" 6 | 7 | namespace KiTrack{ 8 | 9 | /** Criterion: the angle between two 2-segments multiplied by the radius of the circle the segments form 10 | */ 11 | class Crit3_3DAngleTimesR : public ICriterion{ 12 | 13 | 14 | 15 | public: 16 | 17 | /** 18 | * @param angleMax the maximum angle between 2 2-segments in grad times the radius of the circle the segments form 19 | */ 20 | Crit3_3DAngleTimesR ( float angleMin, float angleMax ); 21 | 22 | virtual bool areCompatible( Segment* parent , Segment* child ); 23 | 24 | virtual ~Crit3_3DAngleTimesR(){}; 25 | 26 | private: 27 | 28 | float _angleMin{}; 29 | float _angleMax{}; 30 | 31 | }; 32 | 33 | } 34 | 35 | #endif 36 | 37 | -------------------------------------------------------------------------------- /Utilities/KiTrack/src/Criteria/Crit3_ChangeRZRatio.h: -------------------------------------------------------------------------------- 1 | #ifndef Crit2_ChangeRZRatio_h 2 | #define Crit2_ChangeRZRatio_h 3 | 4 | #include "Criteria/ICriterion.h" 5 | 6 | 7 | namespace KiTrack{ 8 | 9 | /** Criterion: the change of the ratio of the distance of two hits over the z distance 10 | */ 11 | class Crit3_ChangeRZRatio : public ICriterion{ 12 | 13 | 14 | 15 | public: 16 | 17 | Crit3_ChangeRZRatio ( float minChange , float maxChange ); 18 | 19 | virtual bool areCompatible( Segment* parent , Segment* child ); 20 | 21 | virtual ~Crit3_ChangeRZRatio(){}; 22 | 23 | 24 | private: 25 | 26 | float _ratioChangeMaxSquared{}; 27 | float _ratioChangeMinSquared{}; 28 | 29 | 30 | 31 | }; 32 | 33 | } 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | #endif 48 | 49 | -------------------------------------------------------------------------------- /Utilities/KiTrack/src/Criteria/Crit3_IPCircleDist.h: -------------------------------------------------------------------------------- 1 | #ifndef Crit2_IPCircleDist_h 2 | #define Crit2_IPCircleDist_h 3 | 4 | #include "Criteria/ICriterion.h" 5 | 6 | 7 | namespace KiTrack{ 8 | 9 | /** Criterion: the distance of the IP from the circle the 3 hits form (in the xy plane) 10 | */ 11 | class Crit3_IPCircleDist : public ICriterion{ 12 | 13 | 14 | 15 | public: 16 | 17 | Crit3_IPCircleDist ( float distToCircleMin , float distToCircleMax ); 18 | 19 | virtual bool areCompatible( Segment* parent , Segment* child ); 20 | 21 | virtual ~Crit3_IPCircleDist(){}; 22 | 23 | 24 | private: 25 | 26 | float _distToCircleMax{}; 27 | float _distToCircleMin{}; 28 | 29 | 30 | }; 31 | 32 | } 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | #endif 47 | 48 | -------------------------------------------------------------------------------- /Utilities/KiTrack/src/Criteria/Crit3_IPCircleDistTimesR.h: -------------------------------------------------------------------------------- 1 | #ifndef Crit3_IPCircleDistTimesR_h 2 | #define Crit3_IPCircleDistTimesR_h 3 | 4 | #include "Criteria/ICriterion.h" 5 | 6 | 7 | namespace KiTrack{ 8 | 9 | /** Criterion: the distance of the circle formed by the two segments from the IP multiplied by R 10 | */ 11 | class Crit3_IPCircleDistTimesR : public ICriterion{ 12 | 13 | 14 | 15 | public: 16 | 17 | Crit3_IPCircleDistTimesR ( float distToCircleMin , float distToCircleMax ); 18 | 19 | virtual bool areCompatible( Segment* parent , Segment* child ); 20 | 21 | virtual ~Crit3_IPCircleDistTimesR(){}; 22 | 23 | 24 | private: 25 | 26 | float _distToCircleMax{}; 27 | float _distToCircleMin{}; 28 | 29 | 30 | }; 31 | 32 | } 33 | 34 | 35 | 36 | 37 | 38 | 39 | #endif 40 | 41 | -------------------------------------------------------------------------------- /Utilities/KiTrack/src/Criteria/Crit3_NoZigZag_MV.h: -------------------------------------------------------------------------------- 1 | #ifndef Crit3_NoZigZag_MV_h 2 | #define Crit3_NoZigZag_MV_h 3 | 4 | 5 | #include "Criteria/ICriterion.h" 6 | 7 | namespace KiTrack{ 8 | 9 | /** Criterion: forbids zig zagging: measure the angles in the xy plane, transpose them to the range from -pi to pi 10 | * and multiply: if there is a zigzag, the sign of the angle switches and the product of both angles becomes 11 | * negative. 12 | */ 13 | class Crit3_NoZigZag_MV : public ICriterion{ 14 | 15 | 16 | 17 | public: 18 | 19 | /** 20 | * @param prodMin the minimum product of the two angles in degrees 21 | * 22 | * @param prodMax the maxinum product of the two angles in degrees 23 | */ 24 | Crit3_NoZigZag_MV ( float prodMin , float prodMax ); 25 | 26 | virtual bool areCompatible( Segment* parent , Segment* child ); 27 | 28 | virtual ~Crit3_NoZigZag_MV(){}; 29 | 30 | private: 31 | 32 | float _prodMin{}; 33 | float _prodMax{}; 34 | 35 | }; 36 | 37 | } 38 | 39 | #endif 40 | -------------------------------------------------------------------------------- /Utilities/KiTrack/src/Criteria/Crit3_PT.h: -------------------------------------------------------------------------------- 1 | #ifndef Crit2_PT_h 2 | #define Crit2_PT_h 3 | 4 | #include "Criteria/ICriterion.h" 5 | 6 | 7 | namespace KiTrack{ 8 | 9 | /** Criterion: the transversal momentum 10 | */ 11 | class Crit3_PT : public ICriterion{ 12 | 13 | 14 | 15 | public: 16 | 17 | Crit3_PT ( float ptMin , float ptMax , float Bz = 3.5 ); 18 | 19 | virtual bool areCompatible( Segment* parent , Segment* child ); 20 | 21 | virtual ~Crit3_PT(){}; 22 | 23 | 24 | private: 25 | 26 | float _ptMin{}; 27 | float _ptMax{}; 28 | float _Bz{}; 29 | 30 | 31 | }; 32 | 33 | } 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | #endif 48 | 49 | -------------------------------------------------------------------------------- /Utilities/KiTrack/src/Criteria/Crit3_PT_MV.h: -------------------------------------------------------------------------------- 1 | #ifndef Crit2_PT_MV_h 2 | #define Crit2_PT_MV_h 3 | 4 | #include "Criteria/ICriterion.h" 5 | 6 | 7 | namespace KiTrack{ 8 | 9 | /** Criterion: the transversal momentum 10 | */ 11 | class Crit3_PT_MV : public ICriterion{ 12 | 13 | 14 | 15 | public: 16 | 17 | Crit3_PT_MV ( float ptMin , float ptMax , float Bz = 3.5 ); 18 | 19 | virtual bool areCompatible( Segment* parent , Segment* child ); 20 | 21 | virtual ~Crit3_PT_MV(){}; 22 | 23 | 24 | private: 25 | 26 | float _ptMin{}; 27 | float _ptMax{}; 28 | float _Bz{}; 29 | 30 | 31 | }; 32 | 33 | } 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | #endif 48 | 49 | -------------------------------------------------------------------------------- /Utilities/KiTrack/src/Criteria/Crit4_2DAngleChange.h: -------------------------------------------------------------------------------- 1 | #ifndef Crit4_2DAngleChange_h 2 | #define Crit4_2DAngleChange_h 3 | 4 | 5 | #include "Criteria/ICriterion.h" 6 | 7 | namespace KiTrack{ 8 | 9 | /** Criterion: change of the angle (in the xy plane) between segments in the xy plane 10 | */ 11 | class Crit4_2DAngleChange : public ICriterion{ 12 | 13 | 14 | 15 | public: 16 | 17 | /** 18 | * @param changeMax 19 | */ 20 | Crit4_2DAngleChange ( float changeMin , float changeMax ); 21 | 22 | virtual bool areCompatible( Segment* parent , Segment* child ); 23 | 24 | virtual ~Crit4_2DAngleChange(){}; 25 | 26 | private: 27 | 28 | float _changeMin{}; 29 | float _changeMax{}; 30 | 31 | }; 32 | 33 | } 34 | 35 | #endif 36 | -------------------------------------------------------------------------------- /Utilities/KiTrack/src/Criteria/Crit4_3DAngleChange.h: -------------------------------------------------------------------------------- 1 | #ifndef Crit4_3DAngleChange_h 2 | #define Crit4_3DAngleChange_h 3 | 4 | 5 | #include "Criteria/ICriterion.h" 6 | 7 | namespace KiTrack{ 8 | 9 | /** Criterion: change of the angle between segments 10 | */ 11 | class Crit4_3DAngleChange : public ICriterion{ 12 | 13 | 14 | 15 | public: 16 | 17 | /** 18 | * @param changeMax 19 | */ 20 | Crit4_3DAngleChange ( float changeMin , float changeMax ); 21 | 22 | virtual bool areCompatible( Segment* parent , Segment* child ); 23 | 24 | virtual ~Crit4_3DAngleChange(){}; 25 | 26 | private: 27 | 28 | float _changeMin{}; 29 | float _changeMax{}; 30 | 31 | }; 32 | 33 | } 34 | 35 | #endif 36 | -------------------------------------------------------------------------------- /Utilities/KiTrack/src/Criteria/Crit4_3DAngleChangeNormed.h: -------------------------------------------------------------------------------- 1 | #ifndef Crit4_3DAngleChangeNormed_h 2 | #define Crit4_3DAngleChangeNormed_h 3 | 4 | 5 | #include "Criteria/ICriterion.h" 6 | 7 | namespace KiTrack{ 8 | 9 | /** Criterion: check for the change of the 3D angle and normalise it with R 10 | */ 11 | class Crit4_3DAngleChangeNormed : public ICriterion{ 12 | 13 | 14 | 15 | public: 16 | 17 | /** 18 | * @param changeMax 19 | */ 20 | Crit4_3DAngleChangeNormed ( float changeMin , float changeMax ); 21 | 22 | virtual bool areCompatible( Segment* parent , Segment* child ); 23 | 24 | virtual ~Crit4_3DAngleChangeNormed(){}; 25 | 26 | private: 27 | 28 | float _changeMin{}; 29 | float _changeMax{}; 30 | 31 | }; 32 | 33 | } 34 | 35 | #endif 36 | -------------------------------------------------------------------------------- /Utilities/KiTrack/src/Criteria/Crit4_DistOfCircleCenters.h: -------------------------------------------------------------------------------- 1 | #ifndef Crit4_DistOfCircleCenters_h 2 | #define Crit4_DistOfCircleCenters_h 3 | 4 | 5 | #include "Criteria/ICriterion.h" 6 | 7 | namespace KiTrack{ 8 | 9 | /** Criterion: make circles from the semgments and measure the distances of their centers 10 | */ 11 | class Crit4_DistOfCircleCenters : public ICriterion{ 12 | 13 | 14 | 15 | public: 16 | 17 | /** 18 | * @param distMax 19 | */ 20 | Crit4_DistOfCircleCenters ( float distMin , float distMax ); 21 | 22 | virtual bool areCompatible( Segment* parent , Segment* child ); 23 | 24 | virtual ~Crit4_DistOfCircleCenters(){}; 25 | 26 | private: 27 | 28 | float _distMax{}; 29 | float _distMin{}; 30 | 31 | }; 32 | 33 | } 34 | 35 | #endif 36 | -------------------------------------------------------------------------------- /Utilities/KiTrack/src/Criteria/Crit4_DistToExtrapolation.h: -------------------------------------------------------------------------------- 1 | #ifndef Crit4_DistToExtrapolation_h 2 | #define Crit4_DistToExtrapolation_h 3 | 4 | 5 | #include "Criteria/ICriterion.h" 6 | 7 | namespace KiTrack{ 8 | 9 | /** Criterion: use the first 3 hits to extrapolate the location in xy for a given z of the last hit. 10 | * Then measure the distance from the extrapolation to the hit. (Also divide by the z distance to the last hit, 11 | * in order to take into account that with farther distances the accuracy drops) 12 | */ 13 | class Crit4_DistToExtrapolation : public ICriterion{ 14 | 15 | 16 | 17 | public: 18 | 19 | /** 20 | * @param distMax 21 | */ 22 | Crit4_DistToExtrapolation ( float distMin , float distMax ); 23 | 24 | virtual bool areCompatible( Segment* parent , Segment* child ); 25 | 26 | virtual ~Crit4_DistToExtrapolation(){}; 27 | 28 | private: 29 | 30 | float _distMin{}; 31 | float _distMax{}; 32 | 33 | }; 34 | 35 | } 36 | 37 | #endif 38 | -------------------------------------------------------------------------------- /Utilities/KiTrack/src/Criteria/Crit4_NoZigZag.h: -------------------------------------------------------------------------------- 1 | #ifndef Crit4_NoZigZag_h 2 | #define Crit4_NoZigZag_h 3 | 4 | 5 | #include "Criteria/ICriterion.h" 6 | 7 | namespace KiTrack{ 8 | 9 | /** Criterion: forbids zig zagging: measure the angles in the xy plane, transpose them to the range from -pi to pi 10 | * and multiply: if there is a zigzag, the sign of the angle switches and the product of both angles becomes 11 | * negative. 12 | */ 13 | class Crit4_NoZigZag : public ICriterion{ 14 | 15 | 16 | 17 | public: 18 | 19 | /** 20 | * @param prodMin the minimum product of the two angles in degrees 21 | * 22 | * @param prodMax the maxinum product of the two angles in degrees 23 | */ 24 | Crit4_NoZigZag ( float prodMin , float prodMax ); 25 | 26 | virtual bool areCompatible( Segment* parent , Segment* child ); 27 | 28 | virtual ~Crit4_NoZigZag(){}; 29 | 30 | private: 31 | 32 | float _prodMin{}; 33 | float _prodMax{}; 34 | 35 | }; 36 | 37 | } 38 | 39 | #endif 40 | -------------------------------------------------------------------------------- /Utilities/KiTrack/src/Criteria/Crit4_PhiZRatioChange.h: -------------------------------------------------------------------------------- 1 | #ifndef Crit4_PhiZRatioChange_h 2 | #define Crit4_PhiZRatioChange_h 3 | 4 | 5 | #include "Criteria/ICriterion.h" 6 | 7 | namespace KiTrack{ 8 | 9 | /** Criterion: check for the change of \f$ \frac{\phi}{Z} \f$. (\f$ \phi \f$ = angle in the circle formed by the hits) 10 | */ 11 | class Crit4_PhiZRatioChange : public ICriterion{ 12 | 13 | 14 | 15 | public: 16 | 17 | /** 18 | * @param changeMax 19 | */ 20 | Crit4_PhiZRatioChange ( float changeMin , float changeMax ); 21 | 22 | virtual bool areCompatible( Segment* parent , Segment* child ); 23 | 24 | virtual ~Crit4_PhiZRatioChange(){}; 25 | 26 | private: 27 | 28 | float _changeMin{}; 29 | float _changeMax{}; 30 | 31 | }; 32 | 33 | } 34 | 35 | #endif 36 | -------------------------------------------------------------------------------- /Utilities/KiTrack/src/Criteria/Crit4_RChange.h: -------------------------------------------------------------------------------- 1 | #ifndef Crit4_RChange_h 2 | #define Crit4_RChange_h 3 | 4 | 5 | #include "Criteria/ICriterion.h" 6 | 7 | namespace KiTrack{ 8 | 9 | /** Criterion: check for the change of the radii of the circles that can be made from the 3-hit segments 10 | */ 11 | class Crit4_RChange : public ICriterion{ 12 | 13 | 14 | 15 | public: 16 | 17 | /** 18 | * @param changeMax 19 | */ 20 | Crit4_RChange ( float changeMin , float changeMax ); 21 | 22 | virtual bool areCompatible( Segment* parent , Segment* child ); 23 | 24 | virtual ~Crit4_RChange(){}; 25 | 26 | private: 27 | 28 | float _changeMin{}; 29 | float _changeMax{}; 30 | 31 | }; 32 | 33 | } 34 | 35 | #endif 36 | -------------------------------------------------------------------------------- /Utilities/KiTrack/src/Criteria/SimpleCircle.h: -------------------------------------------------------------------------------- 1 | #ifndef SimpleCircle_h 2 | #define SimpleCircle_h 3 | 4 | #include "KiTrack/KiTrackExceptions.h" 5 | 6 | namespace KiTrack{ 7 | 8 | /** A simple class representing a circle. 9 | * 10 | * In the constructor it builds a cricle from 3 2-dimensional points. 11 | * After that, the parameters can be read out (radius and position of the center) 12 | */ 13 | class SimpleCircle { 14 | 15 | 16 | 17 | public: 18 | 19 | 20 | SimpleCircle ( double x1 , double y1 , double x2 , double y2 , double x3, double y3 ) ; 21 | 22 | double getRadius() {return _R;}; 23 | double getCenterX() {return _centerX;}; 24 | double getCenterY() {return _centerY;}; 25 | 26 | private: 27 | 28 | 29 | double _R{}; 30 | double _centerX{}; 31 | double _centerY{}; 32 | 33 | double _x1{}; 34 | double _x2{}; 35 | double _x3{}; 36 | 37 | double _y1{}; 38 | double _y2{}; 39 | double _y3{}; 40 | 41 | 42 | 43 | }; 44 | 45 | 46 | 47 | 48 | } // end of namespace KiTrack 49 | 50 | 51 | 52 | 53 | #endif 54 | 55 | 56 | -------------------------------------------------------------------------------- /Utilities/KiTrack/src/ILDImpl/FTDHit01.cc: -------------------------------------------------------------------------------- 1 | #include "ILDImpl/FTDHit01.h" 2 | 3 | 4 | #include "UTIL/ILDConf.h" 5 | 6 | using namespace KiTrackMarlin; 7 | 8 | 9 | FTDHit01::FTDHit01( edm4hep::TrackerHit trackerHit , const SectorSystemFTD* const sectorSystemFTD ){ 10 | 11 | 12 | _sectorSystemFTD = sectorSystemFTD; 13 | 14 | _trackerHit = trackerHit; 15 | 16 | //Set the position of the FTDHit01 17 | const edm4hep::Vector3d& pos= trackerHit.getPosition(); 18 | _x = pos[0]; 19 | _y = pos[1]; 20 | _z = pos[2]; 21 | 22 | 23 | //find out layer, module, sensor 24 | 25 | UTIL::BitField64 cellID( UTIL::ILDCellID0::encoder_string ); 26 | 27 | cellID.setValue( trackerHit.getCellID() ); 28 | 29 | _side = cellID[ UTIL::ILDCellID0::side ]; 30 | _module = cellID[ UTIL::ILDCellID0::module ]; 31 | _sensor = cellID[ UTIL::ILDCellID0::sensor ] - 1; 32 | _layer = cellID[ UTIL::ILDCellID0::layer ] + 1; 33 | 34 | 35 | calculateSector(); 36 | 37 | 38 | //We assume a real hit. If it is virtual, this has to be set. 39 | _isVirtual = false; 40 | 41 | 42 | } 43 | 44 | 45 | -------------------------------------------------------------------------------- /Utilities/KiTrack/src/ILDImpl/FTDHitSimple.cc: -------------------------------------------------------------------------------- 1 | #include "ILDImpl/FTDHitSimple.h" 2 | 3 | 4 | using namespace KiTrackMarlin; 5 | 6 | FTDHitSimple::FTDHitSimple( float x , float y , float z , int side, unsigned layer , unsigned module, unsigned sensor, const SectorSystemFTD* const sectorSystemFTD ){ 7 | 8 | 9 | _sectorSystemFTD = sectorSystemFTD; 10 | 11 | _x = x; 12 | _y = y; 13 | _z = z; 14 | 15 | 16 | _side = side; 17 | _layer = layer; 18 | _module = module; 19 | _sensor = sensor; 20 | 21 | 22 | calculateSector(); 23 | 24 | 25 | //We assume a real hit. If it is virtual, this has to be set. 26 | _isVirtual = false; 27 | 28 | 29 | } 30 | 31 | -------------------------------------------------------------------------------- /Utilities/KiTrack/src/ILDImpl/MiniVectorHit01.h: -------------------------------------------------------------------------------- 1 | #ifndef MiniVectorHit01_h 2 | #define MiniVectorHit01_h 3 | 4 | #include "ILDImpl/IMiniVector.h" 5 | 6 | namespace KiTrackMarlin{ 7 | /** A class for mini-vectors in the VXD - SIT system (the 01 is just for historical reasons and may be renamed) 8 | */ 9 | class MiniVectorHit01 : public IMiniVector{ 10 | public: 11 | 12 | MiniVectorHit01( MiniVector* miniVector , const SectorSystemVXD* const sectorSystemVXD ); 13 | }; 14 | } 15 | #endif 16 | 17 | -------------------------------------------------------------------------------- /Utilities/KiTrack/src/ILDImpl/VXDHit01.h: -------------------------------------------------------------------------------- 1 | #ifndef VXDHit01_h 2 | #define VXDHit01_h 3 | 4 | #include "ILDImpl/IVXDHit.h" 5 | 6 | namespace KiTrackMarlin{ 7 | /** A class for hits in the VXD (the 01 is just for historical reasons and may be renamed) 8 | * 9 | * - The side is according to CellID0. 10 | * - Layer is set according to CellID0 +1 (so we can use layer 0 for the IP) 11 | * - Module is set according to CellID0. 12 | * - Sensor is set according to CellID0 -1. (because currently sensors of the VXD start with 1 in the CellID0, if this changes, this has to be modified) 13 | */ 14 | class VXDHit01 : public IVXDHit{ 15 | public: 16 | 17 | VXDHit01( edm4hep::TrackerHit* trackerHit , const SectorSystemVXD* const sectorSystemVXD ); 18 | }; 19 | //void setSectorisationInPhi(int PhiSectors); 20 | //void setSectorisationInTheta(int ThetaSectors); 21 | } 22 | #endif 23 | 24 | -------------------------------------------------------------------------------- /Utilities/KiTrack/src/ILDImpl/VXDHitSimple.cc: -------------------------------------------------------------------------------- 1 | #include "ILDImpl/VXDHitSimple.h" 2 | 3 | 4 | using namespace KiTrackMarlin; 5 | 6 | VXDHitSimple::VXDHitSimple( float x , float y , float z , int layer , int phi, int theta, const SectorSystemVXD* const sectorSystemVXD ){ 7 | 8 | 9 | _sectorSystemVXD = sectorSystemVXD; 10 | 11 | _x = x; 12 | _y = y; 13 | _z = z; 14 | 15 | 16 | _layer = layer; 17 | _phi = phi; 18 | _theta = theta; 19 | 20 | _sector = _sectorSystemVXD->getSector( layer, phi, theta ); // maybe a good idea to calculate a sector for the IP hit as well 21 | //calculateSector(); 22 | 23 | 24 | //We assume a real hit. If it is virtual, this has to be set. 25 | _isVirtual = false; 26 | 27 | 28 | } 29 | 30 | -------------------------------------------------------------------------------- /Utilities/KiTrack/src/KiTrack/IHit.cc: -------------------------------------------------------------------------------- 1 | #include "KiTrack/IHit.h" 2 | 3 | #include 4 | #include 5 | 6 | using namespace KiTrack; 7 | 8 | float IHit::distTo( IHit* otherHit ){ 9 | 10 | 11 | 12 | float dx = otherHit->getX() - _x; 13 | float dy = otherHit->getY() - _y; 14 | float dz = otherHit->getZ() - _z; 15 | 16 | return sqrt( dx*dx + dy*dy + dz*dz ); 17 | 18 | } 19 | 20 | std::string IHit::getPositionInfo(){ 21 | 22 | std::stringstream info; 23 | 24 | info << "(" << _x << "," << _y << "," << _z << ")"; 25 | 26 | return info.str(); 27 | 28 | } -------------------------------------------------------------------------------- /Utilities/KiTrack/src/KiTrack/Segment.cc: -------------------------------------------------------------------------------- 1 | #include "KiTrack/Segment.h" 2 | 3 | #include 4 | 5 | using namespace KiTrack; 6 | 7 | Segment::Segment( std::vector hits){ 8 | 9 | _hits = hits; 10 | 11 | _state.push_back(0); 12 | 13 | _children.clear(); 14 | _parents.clear(); 15 | 16 | _active = true; 17 | 18 | _layer=0; 19 | } 20 | 21 | 22 | 23 | Segment::Segment( IHit* hit){ 24 | 25 | _hits.push_back( hit) ; 26 | _state.push_back(0); 27 | _children.clear(); 28 | _parents.clear(); 29 | 30 | _active = true; 31 | 32 | _layer=0; 33 | } 34 | 35 | 36 | 37 | void Segment::resetState(){ 38 | 39 | 40 | for ( unsigned i = 0; i <_state.size(); i++){ 41 | 42 | _state[i] = 0; 43 | 44 | } 45 | 46 | } 47 | 48 | std::string Segment::getInfo(){ 49 | 50 | 51 | std::stringstream info; 52 | 53 | for( unsigned i=0; i<_hits.size(); i++ ) info << _hits[i]->getPositionInfo(); 54 | 55 | info << "["; 56 | for( unsigned i=0; i+1<_state.size(); i++ ) info << _state[i] << ","; 57 | info << _state.back() << "]"; 58 | 59 | return info.str(); 60 | 61 | 62 | } 63 | 64 | 65 | 66 | 67 | 68 | -------------------------------------------------------------------------------- /Utilities/KiTrack/src/Tools/KiTrackMarlinCEDTools.h: -------------------------------------------------------------------------------- 1 | #ifndef KiTrackMarlinCEDTools_h 2 | #define KiTrackMarlinCEDTools_h 3 | 4 | #include "KiTrack/Automaton.h" 5 | #include "KiTrack/ITrack.h" 6 | 7 | using namespace KiTrack; 8 | 9 | namespace KiTrackMarlin{ 10 | 11 | 12 | 13 | /** 14 | * Draws the segments of an automaton. 15 | * Segments will be colored according to their state. 16 | * Also the higher the state, the thicker the line. 17 | */ 18 | void drawAutomatonSegments( const Automaton& automaton ); 19 | 20 | /** 21 | * Draws a track by making straight lines between the hits 22 | */ 23 | void drawTrack( ITrack* track, int color = 0x00ff00 ); 24 | 25 | /** Draw a track in a random color, but not too bright */ 26 | void drawTrackRandColor( ITrack* track ); 27 | 28 | } 29 | 30 | #endif 31 | 32 | -------------------------------------------------------------------------------- /Utilities/KiTrack/src/Tools/Timer.h: -------------------------------------------------------------------------------- 1 | #ifndef dataharvester_Timer_H_ 2 | #define dataharvester_Timer_H_ 3 | 4 | namespace KiTrackMarlin { 5 | class Timer { 6 | public: 7 | /** 8 | * A fast, precise timer 9 | * Works on linux only 10 | * 11 | * Author: Wolfgang Waltenberger 12 | */ 13 | static void start_counter(); 14 | 15 | /// Return what the harvester thinks is the CPU frequency. 16 | static double cpuMHz(); 17 | static double lap(); //< lapsed time, in seconds. 18 | static double ticks(); //< lapsed time, in clock ticks. 19 | }; 20 | } 21 | 22 | #endif // dataharvester_Timer_H_ 23 | -------------------------------------------------------------------------------- /cmake/CEPCSWConfig.cmake: -------------------------------------------------------------------------------- 1 | include(CMakeFindDependencyMacro) 2 | find_dependency(podio REQUIRED) 3 | find_dependency(Gaudi REQUIRED) 4 | find_dependency(k4FWCore REQUIRED) 5 | find_dependency(EDM4HEP REQUIRED) 6 | find_dependency(ROOT REQUIRED) 7 | 8 | # - Include the targets file to create the imported targets that a client can 9 | # link to (libraries) or execute (programs) 10 | include("${CMAKE_CURRENT_LIST_DIR}/CEPCSWTargets.cmake") 11 | 12 | get_property(TEST_CEPCSW_LIBRARY TARGET CEPCSW::GeomSvc PROPERTY LOCATION) 13 | find_package_handle_standard_args(CEPCSW DEFAULT_MSG CMAKE_CURRENT_LIST_FILE TEST_CEPCSW_LIBRARY) 14 | -------------------------------------------------------------------------------- /cmake/CEPCSWDependencies.cmake: -------------------------------------------------------------------------------- 1 | #[[ 2 | 3 | Find all the dependencies here, so in each package user don't need to find the packages again. 4 | 5 | - CLHEP 6 | - DD4hep 7 | - EDM4hep 8 | - Garfiel++/Garfieldpp 9 | - Gaudi 10 | - Geant4 11 | - GEAR 12 | - GSL 13 | - HepMC 14 | - k4FWCore 15 | - LCContent 16 | - LCIO 17 | - PandoraSDK 18 | - podio 19 | - ROOT 20 | #]] 21 | 22 | find_package(CLHEP REQUIRED;CONFIG) 23 | find_package(DD4hep COMPONENTS DDCore DDG4 DDParsers DDRec REQUIRED) 24 | find_package(EDM4HEP REQUIRED) 25 | #find_package(Garfield REQUIRED) 26 | find_package(Garfield) 27 | find_package(Geant4 REQUIRED ui_all vis_all) 28 | find_package(GEAR REQUIRED) 29 | find_package(GSL REQUIRED) 30 | find_package(HepMC) 31 | find_package(k4FWCore REQUIRED) 32 | find_package(LCContent REQUIRED) 33 | find_package(LCIO REQUIRED) 34 | find_package(PandoraSDK REQUIRED) 35 | find_package(podio REQUIRED) 36 | find_package(ROOT COMPONENTS EG Graf Graf3d Gpad MathCore Net RIO Tree TreePlayer REQUIRED) 37 | find_package(GenFit) 38 | -------------------------------------------------------------------------------- /cmake/CEPCSWEnv.cmake: -------------------------------------------------------------------------------- 1 | # This variable will be used by GaudiToolbox.cmake to generate the cepcswenv.sh 2 | 3 | set(RUN_SCRIPT_EXTRA_COMMANDS "${RUN_SCRIPT_EXTRA_COMMANDS} 4 | export CEPCSW_ROOT=${CMAKE_SOURCE_DIR} 5 | 6 | export DETCEPCV4ROOT=${CMAKE_SOURCE_DIR}/Detector/DetCEPCv4 7 | export DETCRDROOT=${CMAKE_SOURCE_DIR}/Detector/DetCRD 8 | export DETDRIFTCHAMBERROOT=${CMAKE_SOURCE_DIR}/Detector/DetDriftChamber 9 | ") 10 | -------------------------------------------------------------------------------- /cmake/FindOnnxRuntime.cmake: -------------------------------------------------------------------------------- 1 | # Find the ONNX Runtime include directory and library. 2 | # 3 | # This module defines the `onnxruntime` imported target that encodes all 4 | # necessary information in its target properties. 5 | 6 | find_library( 7 | OnnxRuntime_LIBRARY 8 | NAMES onnxruntime 9 | PATH_SUFFIXES lib lib32 lib64 10 | DOC "The ONNXRuntime library") 11 | 12 | if(NOT OnnxRuntime_LIBRARY) 13 | message(FATAL_ERROR "onnxruntime library not found") 14 | endif() 15 | 16 | find_path( 17 | OnnxRuntime_INCLUDE_DIR 18 | NAMES core/session/onnxruntime_cxx_api.h 19 | PATH_SUFFIXES include include/onnxruntime 20 | DOC "The ONNXRuntime include directory") 21 | 22 | if(NOT OnnxRuntime_INCLUDE_DIR) 23 | message(FATAL_ERROR "onnxruntime includes not found") 24 | endif() 25 | 26 | include(FindPackageHandleStandardArgs) 27 | find_package_handle_standard_args( 28 | OnnxRuntime 29 | REQUIRED_VARS OnnxRuntime_LIBRARY OnnxRuntime_INCLUDE_DIR) 30 | 31 | add_library(OnnxRuntime SHARED IMPORTED) 32 | set_property(TARGET OnnxRuntime PROPERTY IMPORTED_LOCATION ${OnnxRuntime_LIBRARY}) 33 | set_property(TARGET OnnxRuntime PROPERTY INTERFACE_INCLUDE_DIRECTORIES ${OnnxRuntime_INCLUDE_DIR}) 34 | 35 | mark_as_advanced(OnnxRuntime_FOUND OnnxRuntime_INCLUDE_DIR OnnxRuntime_LIBRARY) 36 | -------------------------------------------------------------------------------- /docs/README.md: -------------------------------------------------------------------------------- 1 | ## CEPCSW 2 | 3 | * [Quickstart](quickstart.md) -------------------------------------------------------------------------------- /docs/_config.yml: -------------------------------------------------------------------------------- 1 | theme: jekyll-theme-slate -------------------------------------------------------------------------------- /docs/_includes/nav.html: -------------------------------------------------------------------------------- 1 |

2 | | 3 | Home | 4 | Quickstart | 5 | Tutorial | 6 |

7 | -------------------------------------------------------------------------------- /docs/quickstart.md: -------------------------------------------------------------------------------- 1 | # Quick start 2 | 3 | ## Start development environment in lxslc7 (CentOS 7) 4 | 5 | ``` 6 | $ ssh -Y USERNAME@lxslc7.ihep.ac.cn 7 | ``` 8 | 9 | ## Manage code using git 10 | 11 | Fork the CEPCSW into your own repo. For an example: 12 | * https://github.com/*USERNAME*/CEPCSW 13 | 14 | Get the source code from your own repo: 15 | ``` 16 | $ git clone git@github.com:USERNAME/CEPCSW.git 17 | $ cd CEPCSW 18 | ``` 19 | 20 | Add the upstream repo: 21 | ``` 22 | $ git remote add cepc https://github.com/cepc/CEPCSW.git 23 | ``` 24 | 25 | Sync and merge the upstream repo: 26 | ``` 27 | $ git remote update 28 | $ git merge cepc/master 29 | ``` 30 | 31 | ## Setup and build 32 | 33 | ``` 34 | $ source setup.sh 35 | $ ./build.sh 36 | ``` 37 | 38 | ## Run a simple test 39 | 40 | ``` 41 | $ ./run.sh Examples/options/tut_detsim_SDT.py 42 | ``` 43 | 44 | -------------------------------------------------------------------------------- /docs/tutorial.md: -------------------------------------------------------------------------------- 1 | # Tutorial 2 | 3 | * [CEPCSW Tutorial and detector study, IHEP, 17-18 Sept 2020](https://indico.ihep.ac.cn/event/12341/) 4 | --------------------------------------------------------------------------------