diff --git a/Detector/DetSegmentation/CMakeLists.txt b/Detector/DetSegmentation/CMakeLists.txt index 09e060a9fa1ce6707e1edb6cf394d8b813330a2e..e6273defd3967b77a61dbddf584fa5dab2d58bb4 100644 --- a/Detector/DetSegmentation/CMakeLists.txt +++ b/Detector/DetSegmentation/CMakeLists.txt @@ -12,7 +12,7 @@ gaudi_add_library(DetSegmentation LINK Gaudi::GaudiKernel ${DD4hep_COMPONENT_LIBRARIES} ${ROOT_LIBRARIES} - BelleIICKF::CKFDataobjects + CKF::CKFDataobjects ) gaudi_add_module(DetSegmentationPlugin diff --git a/Detector/DetSegmentation/include/DetSegmentation/GridDriftChamber.h b/Detector/DetSegmentation/include/DetSegmentation/GridDriftChamber.h index 4b36c8326468b4f2a3992abcdf2011efcf6e4c01..fcf65d104721260a8b0c8cfb58cf75461f372e76 100644 --- a/Detector/DetSegmentation/include/DetSegmentation/GridDriftChamber.h +++ b/Detector/DetSegmentation/include/DetSegmentation/GridDriftChamber.h @@ -46,7 +46,7 @@ inline bool operator < (const struct CID &c1, const struct CID &c2) { namespace dd4hep { namespace DDSegmentation { -class GridDriftChamber : public Belle2::IDCSegmentation,public Segmentation { +class GridDriftChamber : public CKF::IDCSegmentation,public Segmentation { public: /// default constructor using an arbitrary type GridDriftChamber(const std::string& aCellEncoding); diff --git a/Examples/options/tut_detrec_SDT.py b/Examples/options/tut_detrec_SDT.py new file mode 100644 index 0000000000000000000000000000000000000000..ab6cd199650c43dff176514bc5e05565672a18ea --- /dev/null +++ b/Examples/options/tut_detrec_SDT.py @@ -0,0 +1,327 @@ +#!/usr/bin/env python +import os +import sys + +from Gaudi.Configuration import * + +from Configurables import RndmGenSvc, HepRndm__Engine_CLHEP__RanluxEngine_ +seed = [10] +# rndmengine = HepRndm__Engine_CLHEP__RanluxEngine_() # The default engine in Gaudi +rndmengine = HepRndm__Engine_CLHEP__HepJamesRandom_("RndmGenSvc.Engine") # The default engine in Geant4 +rndmengine.SetSingleton = True +rndmengine.Seeds = seed + +rndmgensvc = RndmGenSvc("RndmGenSvc") +rndmgensvc.Engine = rndmengine.name() + +############################################################################## +# Event Data Svc +############################################################################## +from Configurables import k4DataSvc +dsvc = k4DataSvc("EventDataSvc") + + +# option for standalone tracker study +geometry_option = "CRD_o1_v01/CRD_o1_v01-onlyTracker.xml" +#geometry_option = "CRD_o1_v01/CRD_o1_v01.xml" + +if not os.getenv("DETCRDROOT"): + print("Can't find the geometry. Please setup envvar DETCRDROOT." ) + sys.exit(-1) + +geometry_path = os.path.join(os.getenv("DETCRDROOT"), "compact", geometry_option) +if not os.path.exists(geometry_path): + print("Can't find the compact geometry file: %s"%geometry_path) + sys.exit(-1) + +from Configurables import GeomSvc +geosvc = GeomSvc("GeomSvc") +geosvc.compact = geometry_path + +############################################################################## +# Physics Generator +############################################################################## +from Configurables import GenAlgo +from Configurables import GtGunTool +from Configurables import StdHepRdr +from Configurables import SLCIORdr +from Configurables import HepMCRdr +from Configurables import GenPrinter +gun = GtGunTool("GtGunTool") +gun.Particles = ["mu-"] +gun.EnergyMins = [2] # GeV +gun.EnergyMaxs = [2] # GeV +gun.ThetaMins = [40] # deg +gun.ThetaMaxs = [140] # deg +gun.PhiMins = [0] # deg +gun.PhiMaxs = [360] # deg +#stdheprdr = StdHepRdr("StdHepRdr") +#stdheprdr.Input = "/cefs/data/stdhep/CEPC240/higgs/update_from_LiangHao_1M/data/E240.Pn2n2h_e2e2.e0.p0.whizard195/n2n2h_e2e2.e0.p0.0010.stdhep" +# lciordr = SLCIORdr("SLCIORdr") +# lciordr.Input = "/cefs/data/stdhep/lcio250/signal/Higgs/E250.Pbbh.whizard195/E250.Pbbh_X.e0.p0.whizard195/Pbbh_X.e0.p0.00001.slcio" +# hepmcrdr = HepMCRdr("HepMCRdr") +# hepmcrdr.Input = "example_UsingIterators.txt" + +genprinter = GenPrinter("GenPrinter") + +genalg = GenAlgo("GenAlgo") +genalg.GenTools = ["GtGunTool"] +#genalg.GenTools = ["StdHepRdr"] +#genalg.GenTools = ["StdHepRdr", "GenPrinter"] +# genalg.GenTools = ["SLCIORdr", "GenPrinter"] +# genalg.GenTools = ["HepMCRdr", "GenPrinter"] + +############################################################################## +# Detector Simulation +############################################################################## +from Configurables import DetSimSvc +detsimsvc = DetSimSvc("DetSimSvc") + +from Configurables import DetSimAlg +detsimalg = DetSimAlg("DetSimAlg") +detsimalg.RandomSeeds = seed +# detsimalg.VisMacs = ["vis.mac"] +detsimalg.RunCmds = [ + #"/tracking/verbose 1", +] +detsimalg.AnaElems = [ + # example_anatool.name() + # "ExampleAnaElemTool" + "Edm4hepWriterAnaElemTool" +] +detsimalg.RootDetElem = "WorldDetElemTool" + +from Configurables import AnExampleDetElemTool +example_dettool = AnExampleDetElemTool("AnExampleDetElemTool") + +dedxoption = "BetheBlochEquationDedxSimTool" +from Configurables import DriftChamberSensDetTool +dc_sensdettool = DriftChamberSensDetTool("DriftChamberSensDetTool") +dc_sensdettool.DedxSimTool = dedxoption + +from Configurables import DummyDedxSimTool +from Configurables import BetheBlochEquationDedxSimTool + +if dedxoption == "DummyDedxSimTool": + dedx_simtool = DummyDedxSimTool("DummyDedxSimTool") +elif dedxoption == "BetheBlochEquationDedxSimTool": + dedx_simtool = BetheBlochEquationDedxSimTool("BetheBlochEquationDedxSimTool") + dedx_simtool.material_Z = 2 + dedx_simtool.material_A = 4 + dedx_simtool.scale = 10 + dedx_simtool.resolution = 0.0001 + +from Configurables import MarlinEvtSeeder +evtseeder = MarlinEvtSeeder("EventSeeder") + +from Configurables import GearSvc +gearsvc = GearSvc("GearSvc") + +from Configurables import TrackSystemSvc +tracksystemsvc = TrackSystemSvc("TrackSystemSvc") + +# digitization +vxdhitname = "VXDTrackerHits" +sithitname = "SITTrackerHits" +dchitname = "DCTrackerHits" +sethitname = "SETTrackerHits" +setspname = "SETSpacePoints" +ftdhitname = "FTDTrackerHits" +ftdspname = "FTDSpacePoints" +from Configurables import PlanarDigiAlg +digiVXD = PlanarDigiAlg("VXDDigi") +digiVXD.SimTrackHitCollection = "VXDCollection" +digiVXD.TrackerHitCollection = vxdhitname +digiVXD.TrackerHitAssociationCollection = "VXDTrackerHitAssociation" +digiVXD.ResolutionU = [0.0028, 0.006, 0.004, 0.004, 0.004, 0.004] +digiVXD.ResolutionV = [0.0028, 0.006, 0.004, 0.004, 0.004, 0.004] +digiVXD.UsePlanarTag = True +#digiVXD.OutputLevel = DEBUG + +digiSIT = PlanarDigiAlg("SITDigi") +digiSIT.IsStrip = False +digiSIT.SimTrackHitCollection = "SITCollection" +digiSIT.TrackerHitCollection = sithitname +digiSIT.TrackerHitAssociationCollection = "SITTrackerHitAssociation" +digiSIT.ResolutionU = [0.0072] +digiSIT.ResolutionV = [0.086] +digiSIT.UsePlanarTag = True +#digiSIT.OutputLevel = DEBUG + +digiSET = PlanarDigiAlg("SETDigi") +digiSET.IsStrip = False +digiSET.SimTrackHitCollection = "SETCollection" +digiSET.TrackerHitCollection = sethitname +digiSET.TrackerHitAssociationCollection = "SETTrackerHitAssociation" +digiSET.ResolutionU = [0.0072] +digiSET.ResolutionV = [0.086] +digiSET.UsePlanarTag = True +#digiSET.OutputLevel = DEBUG + +digiFTD = PlanarDigiAlg("FTDDigi") +digiFTD.IsStrip = False +digiFTD.SimTrackHitCollection = "FTDCollection" +digiFTD.TrackerHitCollection = ftdhitname +digiFTD.TrackerHitAssociationCollection = "FTDTrackerHitAssociation" +digiFTD.ResolutionU = [0.003, 0.003, 0.0072, 0.0072, 0.0072, 0.0072, 0.0072] +digiFTD.ResolutionV = [0.003, 0.003, 0.0072, 0.0072, 0.0072, 0.0072, 0.0072] +digiFTD.UsePlanarTag = True +#digiFTD.OutputLevel = DEBUG + +from Configurables import DCHDigiAlg +digiDC = DCHDigiAlg("DCHDigi") +digiDC.DigiDCHitCollection = dchitname +digiDC.WriteAna = True +digiDC.mixNoise = False +digiDC.noiseEff = 0 +digiDC.mixNoiseAndSkipOverlapthis = False +digiDC.mixNoiseAndSkipNoOverlapthis = False +digiDC.smear = True +#digiDC.mom_threshold=98. +#digiDC.mom_threshold_high=102. +#digiDC.OutputLevel = DEBUG + +# two strip tracker hits -> one space point +from Configurables import SpacePointBuilderAlg +spFTD = SpacePointBuilderAlg("FTDBuilder") +spFTD.TrackerHitCollection = ftdhitname +spFTD.TrackerHitAssociationCollection = "FTDTrackerHitAssociation" +spFTD.SpacePointCollection = ftdspname +spFTD.SpacePointAssociationCollection = "FTDSpacePointAssociation" +#spFTD.OutputLevel = DEBUG + +# tracking +from Configurables import SiliconTrackingAlg +tracking = SiliconTrackingAlg("SiliconTracking") +tracking.HeaderCol = "EventHeader" +tracking.VTXHitCollection = vxdhitname +tracking.SITHitCollection = sithitname +tracking.FTDPixelHitCollection = ftdhitname +tracking.FTDSpacePointCollection = ftdspname +tracking.SITRawHitCollection = "NotNeedForPixelSIT" +tracking.FTDRawHitCollection = ftdhitname +tracking.UseSIT = True +tracking.SmoothOn = False +#tracking.OutputLevel = DEBUG + +from Configurables import ForwardTrackingAlg +forward = ForwardTrackingAlg("ForwardTracking") +forward.FTDPixelHitCollection = ftdhitname +forward.FTDSpacePointCollection = ftdspname +forward.FTDRawHitCollection = ftdhitname +forward.Chi2ProbCut = 0.0 +forward.HitsPerTrackMin = 3 +forward.BestSubsetFinder = "SubsetSimple" +forward.Criteria = ["Crit2_DeltaPhi","Crit2_StraightTrackRatio","Crit3_3DAngle","Crit3_ChangeRZRatio","Crit3_IPCircleDist","Crit4_3DAngleChange","Crit4_DistToExtrapolation", + "Crit2_DeltaRho","Crit2_RZRatio","Crit3_PT"] +forward.CriteriaMin = [0, 0.9, 0, 0.995, 0, 0.8, 0, 20, 1.002, 0.1, 0, 0.99, 0, 0.999, 0, 0.99, 0] +forward.CriteriaMax = [30, 1.02, 10, 1.015, 20, 1.3, 1.0, 150, 1.08, 99999999, 0.8, 1.01, 0.35, 1.001, 1.5, 1.01, 0.05] +#forward.OutputLevel = DEBUG + +from Configurables import TrackSubsetAlg +subset = TrackSubsetAlg("TrackSubset") +subset.TrackInputCollections = ["ForwardTracks", "SiTracks"] +subset.RawTrackerHitCollections = [vxdhitname, sithitname, ftdhitname, ftdspname] +subset.TrackSubsetCollection = "SubsetTracks" +#subset.OutputLevel = DEBUG + +##TODO: DC reconstruction, as preliminary, use Clupatra like as TPC +#from Configurables import ClupatraAlg +#clupatra = ClupatraAlg("Clupatra") +#clupatra.TPCHitCollection = dchitname +#clupatra.DistanceCut = 100. +#clupatra.MaxDeltaChi2 = 100. +#clupatra.Chi2Cut = 150. +##clupatra.OutputLevel = DEBUG +# +#from Configurables import FullLDCTrackingAlg +#full = FullLDCTrackingAlg("FullTracking") +#full.VTXTrackerHits = vxdhitname +#full.SITTrackerHits = sithitname +#full.TPCTrackerHits = dchitname # add TPC or DC tracker hit here, if TPC or DC track is set by full.TPCTracks +#full.SETTrackerHits = sethitname +#full.FTDPixelTrackerHits = ftdhitname +#full.FTDSpacePoints = ftdspname +#full.SITRawHits = "NotNeedForPixelSIT" +#full.SETRawHits = "NotNeedForPixelSET" +#full.FTDRawHits = ftdhitname +#full.TPCTracks = "ClupatraTracks" # add standalone TPC or DC track here +#full.SiTracks = "SubsetTracks" +#full.OutputTracks = "MarlinTrkTracks" +#full.SITHitToTrackDistance = 3. +#full.SETHitToTrackDistance = 5. +##full.OutputLevel = DEBUG +# +##TODO: more reconstruction, PFA etc. + +from Configurables import TruthTrackerAlg +truthTrackerAlg = TruthTrackerAlg("TruthTrackerAlg") +#truthTrackerAlg.maxDigiCut=600 +truthTrackerAlg.useSi=True +truthTrackerAlg.hist=True +truthTrackerAlg.useTruthTrack=False +truthTrackerAlg.resVertexX=0 +truthTrackerAlg.resVertexY=0 +truthTrackerAlg.resVertexZ=0 +truthTrackerAlg.DCTrackFinding=True +truthTrackerAlg.DigiDCHitCollection= dchitname +truthTrackerAlg.VXDTrackerHitAssociation= "VXDTrackerHitAssociation" +#truthTrackerAlg.OutputLevel=DEBUG +############################################################################## +# GenfitAlg +############################################################################## +from Configurables import RecGenfitAlgSDT +recGenfitAlgSDT = RecGenfitAlgSDT("RecGenfitAlgSDT") +recGenfitAlgSDT.debugPid=1 +#recGenfitAlgSDT.debug=1 +#recGenfitAlgSDT.debugGenfit=10000 +recGenfitAlgSDT.DigiDCHitCollection="DCTrackerHits" +recGenfitAlgSDT.measurementTypeSi=1 # -1: not use, 0:use space point, 1:use detector measurment +recGenfitAlgSDT.measurementTypeDC=1 # -1: not use, 0:use space point, 1:use detector measurment +recGenfitAlgSDT.DCTrackFinding= True +recGenfitAlgSDT.iterFit= 2 +recGenfitAlgSDT.useSalHits = True +recGenfitAlgSDT.addSET = True +#recGenfitAlgSDT.noMaterialEffects= True +recGenfitAlgSDT.skipNear = 0. #cm +#recGenfitAlgSDT.sigmaHitU=[0.11, 0.0028, 0.006, 0.004, 0.004, 0.004, 0.004] +#recGenfitAlgSDT.sigmaHitV=[0.2, 0.0028, 0.006, 0.004, 0.004, 0.004, 0.004] +#recGenfitAlgSDT.OutputLevel=DEBUG + +from Configurables import NTupleSvc +ntsvc = NTupleSvc("NTupleSvc") +ntsvc.Output = [ + "MyTuples DATAFILE='DCH_digi.root' OPT='NEW' TYP='ROOT'", + "TruthTrackerAlg DATAFILE='truthTracker.root' OPT='NEW' TYP='ROOT'", + "DCTrackFinding DATAFILE='Track_Finding.root' OPT='NEW' TYP='ROOT'", + "RecGenfitAlgSDT DATAFILE='fit_Track.root' OPT='NEW' TYP='ROOT'" +] + +from Configurables import DCTrackFinding +dcTrackFinding = DCTrackFinding("DCTrackFinding") +dcTrackFinding.DigiDCHitCollection = dchitname +dcTrackFinding.pathSelectFilterName = "distance" +#dcTrackFinding.noMaterialEffects= True +#dcTrackFinding.correctBremsstrahlung= False +#dcTrackFinding.pathSelectFilterName = "chi2" +#dcTrackFinding.pathSelectFilterName = "arc_length" + + +# output +from Configurables import PodioOutput +out = PodioOutput("outputalg") +out.filename = "CRD_detrec.root" +out.outputCommands = ["keep *"] + +# ApplicationMgr +from Configurables import ApplicationMgr +ApplicationMgr( + TopAlg = [genalg, detsimalg, digiVXD, digiSIT, digiSET, digiFTD, spFTD, + digiDC, tracking, forward, subset,truthTrackerAlg, dcTrackFinding, + recGenfitAlgSDT,out], + EvtSel = 'NONE', + EvtMax = 1, + ExtSvc = [rndmengine, rndmgensvc, dsvc, evtseeder, geosvc, gearsvc,ntsvc], + HistogramPersistency = 'ROOT', + OutputLevel = ERROR +) diff --git a/Reconstruction/RecGenfitAlg/CMakeLists.txt b/Reconstruction/RecGenfitAlg/CMakeLists.txt index 389cd34bfc2408e304ed0c204dd3f0f489668e14..12296ed5ed8acdc84c5548cfaf694c8fcef6ba69 100644 --- a/Reconstruction/RecGenfitAlg/CMakeLists.txt +++ b/Reconstruction/RecGenfitAlg/CMakeLists.txt @@ -25,9 +25,9 @@ gaudi_add_module(RecGenfitAlg EDM4HEP::edm4hepDict k4FWCore::k4FWCore GenFit::genfit2 - BelleIICKF::CKFDataobjects - BelleIICKF::CKFFramework - BelleIICKF::CKFTracking + CKF::CKFDataobjects + CKF::CKFFramework + CKF::CKFTracking ) target_include_directories(RecGenfitAlg PUBLIC diff --git a/Reconstruction/RecGenfitAlg/src/DCTrackFinding.cpp b/Reconstruction/RecGenfitAlg/src/DCTrackFinding.cpp index fd28e135a7cbc2daf12c37a2cf67a92e8525cb55..62565e4750e141c953d19839a5589c2d749b37c6 100644 --- a/Reconstruction/RecGenfitAlg/src/DCTrackFinding.cpp +++ b/Reconstruction/RecGenfitAlg/src/DCTrackFinding.cpp @@ -166,9 +166,9 @@ StatusCode DCTrackFinding::initialize() return StatusCode::FAILURE; } - //set BelleII segmentation - Belle2::TrackFindingCDC::CDCWireTopology::getInstance(m_gridDriftChamber); - Belle2::CDCWireGeo::getInstance(m_gridDriftChamber); + //set CKF segmentation + CKF::TrackFindingCDC::CDCWireTopology::getInstance(m_gridDriftChamber); + CKF::CDCWireGeo::getInstance(m_gridDriftChamber); ///Get Decoder m_decoder = m_geomSvc->getDecoder(m_readout_name); @@ -346,8 +346,8 @@ StatusCode DCTrackFinding::execute() int charge = (int) charge_double; int pdg = mcParticle.getPDG(); - Belle2::RecoTrack *newRecoTrack = new Belle2::RecoTrack(seedPos,seedMom,charge); - Belle2::RecoTrackGenfitAccess *recoTrackGenfitAccess = new Belle2::RecoTrackGenfitAccess(); + CKF::RecoTrack *newRecoTrack = new CKF::RecoTrack(seedPos,seedMom,charge); + CKF::RecoTrackGenfitAccess *recoTrackGenfitAccess = new CKF::RecoTrackGenfitAccess(); genfit::AbsTrackRep* RecoRep = recoTrackGenfitAccess->createOrReturnRKTrackRep(*newRecoTrack,pdg); genfit::AbsTrackRep* rep; @@ -366,7 +366,7 @@ StatusCode DCTrackFinding::execute() std::cerr << e.what(); } - std::vector<Belle2::TrackFindingCDC::CDCWireHit> bestElement2; + std::vector<CKF::TrackFindingCDC::CDCWireHit> bestElement2; if(m_tuple) m_n_Digi = dCDigiCol->size(); @@ -425,20 +425,20 @@ StatusCode DCTrackFinding::execute() ndigi++; - Belle2::CDCHit * cdchit = new Belle2::CDCHit(tdcCount,adcCount, + CKF::CDCHit * cdchit = new CKF::CDCHit(tdcCount,adcCount, iSuperLayer,iLayer,iWire); - Belle2::TrackFindingCDC::CDCWireHit cdcWireHit(cdchit, + CKF::TrackFindingCDC::CDCWireHit cdcWireHit(cdchit, driftDistance,m_sigma,0,dcDigi.getTime()); bestElement2.push_back(cdcWireHit); } if(ndigi<1e-5) return StatusCode::SUCCESS; - Belle2::CKFToCDCFindlet::clearSeedRecoTrack(); - Belle2::CKFToCDCFindlet::addSeedRecoTrack(newRecoTrack); + CKF::CKFToCDCFindlet::clearSeedRecoTrack(); + CKF::CKFToCDCFindlet::addSeedRecoTrack(newRecoTrack); - Belle2::CKFToCDCFindlet m_CKFToCDC; + CKF::CKFToCDCFindlet m_CKFToCDC; std::vector< std::vector<unsigned short> > output; std::vector<double> radius; std::vector<double> arcLength; diff --git a/cmake/CEPCSWDependencies.cmake b/cmake/CEPCSWDependencies.cmake index bcac3afdfe62151d01f333f5f8183cd02504bf0c..90d8914ebf8dbf5a2e916aa515711a87c6683863 100644 --- a/cmake/CEPCSWDependencies.cmake +++ b/cmake/CEPCSWDependencies.cmake @@ -17,7 +17,7 @@ Find all the dependencies here, so in each package user don't need to find the p - PandoraSDK - podio - ROOT -- BelleIICKF +- CKF #]] find_package(CLHEP REQUIRED;CONFIG) @@ -39,7 +39,7 @@ find_package(GenFit) if (CEPCSW_USE_SYSTEM_CKF_BELLE) message("Try to use an existing installation of CKF BELLE") - find_package(BelleIICKF) + find_package(CKF) else() message("Try to use an internal installation of CKF BELLE") include("${CMAKE_CURRENT_LIST_DIR}/internal_ckf.cmake") diff --git a/cmake/internal_ckf.cmake b/cmake/internal_ckf.cmake index f160a6a090cb8472ed4d95e597a5f5b8f9851127..df76696034c26fb4b72e53cd52d5dad15e35dcf9 100644 --- a/cmake/internal_ckf.cmake +++ b/cmake/internal_ckf.cmake @@ -4,7 +4,7 @@ include(FetchContent) FetchContent_Declare( ckf_belle GIT_REPOSITORY https://code.ihep.ac.cn/cepc/externals/ckf_belle.git - GIT_TAG 72707998dfc4f7dbe4a91f995d03649cb217474d + GIT_TAG a80b052c5d3cce242b297c439b3f778e19714695 ) FetchContent_MakeAvailable(ckf_belle)