From b6241980873b2a7854590f43c3f94aa73286ed02 Mon Sep 17 00:00:00 2001 From: EBerzin Date: Mon, 2 Dec 2024 20:03:41 -0800 Subject: [PATCH] added new Bethe-Heitler parametrization --- Tracking/CMakeLists.txt | 3 +++ Tracking/data/GeantSim_GT01_cdf_nC6_O5.par | 19 ++++++++++++++ Tracking/data/GeantSim_LT01_cdf_nC6_O5.par | 19 ++++++++++++++ Tracking/include/Tracking/Reco/GSFProcessor.h | 4 +++ Tracking/python/make_path.py | 25 +++++++++++++++++++ Tracking/python/tracking.py | 6 +++-- Tracking/src/Tracking/Reco/GSFProcessor.cxx | 18 ++++++++++--- 7 files changed, 89 insertions(+), 5 deletions(-) create mode 100644 Tracking/data/GeantSim_GT01_cdf_nC6_O5.par create mode 100644 Tracking/data/GeantSim_LT01_cdf_nC6_O5.par diff --git a/Tracking/CMakeLists.txt b/Tracking/CMakeLists.txt index 11a45e730..91e1a7829 100644 --- a/Tracking/CMakeLists.txt +++ b/Tracking/CMakeLists.txt @@ -84,3 +84,6 @@ setup_library(module Tracking #include_directories(${PROJECT_SOURCE_DIR}/include/Tracking/Reco/) setup_python(package_name LDMX/Tracking) + +setup_data(module Tracking) + diff --git a/Tracking/data/GeantSim_GT01_cdf_nC6_O5.par b/Tracking/data/GeantSim_GT01_cdf_nC6_O5.par new file mode 100644 index 000000000..c520eb56b --- /dev/null +++ b/Tracking/data/GeantSim_GT01_cdf_nC6_O5.par @@ -0,0 +1,19 @@ +6 5 1 + 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 3.4177030972717031e+00 -4.5023370509744884e+00 + 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 -3.9457052964315942e+00 -2.0763454756086683e+00 + 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 -7.1457121881276997e+00 -5.3628979048490102e+00 + 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 1.1451687460393387e+00 -2.8495425297831072e+00 + 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 -5.2948114471475387e+00 -9.8180069037555190e-02 + 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 -6.2682749645404909e+00 -3.1860384549381653e+00 +-1.6121439489178472e+04 1.5384843175364240e+04 -5.6689338934841298e+03 9.8861606625107947e+02 -7.4716003818930389e+01 -3.8665489218520077e-04 + 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 -5.3892009434433490e+00 1.6646106984668607e+00 + 8.5418865316008014e+04 -8.4729845210357686e+04 3.2509874328900842e+04 -6.0360232287805875e+03 5.4703207243206543e+02 -2.3269764393538701e+01 +-2.1753363459026186e+03 2.5480537135521458e+03 -1.0800153221381784e+03 1.9801727578735878e+02 -1.1004696684536585e+01 -1.9122411799639756e+00 +-7.2398222368353381e+04 7.1692026459293120e+04 -2.7540169230500542e+04 5.1273037919535100e+03 -4.6741803632344750e+02 1.9108986234485663e+01 + 1.1990918855988217e+05 -1.1822072172982995e+05 4.5191687950925800e+04 -8.3693591975687395e+03 7.5772428412511772e+02 -3.2747029952012895e+01 + 3.9301134316298808e+03 -3.7541418325082136e+03 1.4425795489191560e+03 -2.9377291122879348e+02 3.3552924307793113e+01 -3.1130586170893051e+00 + 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 -6.1138164489828783e+00 4.6083958462708150e+00 + 1.5753424210854530e+05 -1.5644030230854396e+05 6.0286848768357333e+04 -1.1264081605869356e+04 1.0303907886480429e+03 -4.5437223190174670e+01 + 3.2397164095336298e+04 -3.2114134513896468e+04 1.2294103984600111e+04 -2.2470209645997870e+03 1.8686345236342740e+02 -5.6709849549599838e+00 +-5.3617340636071443e+04 5.4302846581616992e+04 -2.1435558635721187e+04 4.1270402937878653e+03 -3.9750537586689597e+02 2.1789322216626250e+01 + 1.7215536713492026e+05 -1.7277470681531032e+05 6.7174146724203878e+04 -1.2602759089486393e+04 1.1522785437972470e+03 -5.3827210284314098e+01 diff --git a/Tracking/data/GeantSim_LT01_cdf_nC6_O5.par b/Tracking/data/GeantSim_LT01_cdf_nC6_O5.par new file mode 100644 index 000000000..8a7bda43b --- /dev/null +++ b/Tracking/data/GeantSim_LT01_cdf_nC6_O5.par @@ -0,0 +1,19 @@ +6 5 1 + 3.2101094136612709e+06 -9.4705630748389300e+05 1.0829875911775141e+05 -6.1863554011577025e+03 2.0135361106894280e+02 -8.0761514988818153e+00 + 4.5079440999297943e+05 -1.0647181055807657e+05 9.0139114799507752e+03 -3.6081366141823679e+02 7.0376737639960325e+00 -2.3610285047746506e+00 + 7.4586241329435969e+05 -1.6634188647165423e+05 1.2838436550628834e+04 -4.5120828291620853e+02 8.1842526809672229e+00 -5.9197536687071333e+00 + 3.5884379653355042e+06 -1.0531756617027025e+06 1.1934641124479045e+05 -6.7061190805056403e+03 2.1095020483594095e+02 -6.5568419073184483e+00 + 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 -1.5062019624783798e+00 -3.1569307956279197e-01 + 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 -1.3027693288928379e+00 -3.5400481738796068e+00 + 2.3155452602605596e+06 -7.1891501255134703e+05 8.6585158124840658e+04 -5.1799762005076909e+03 1.7441315420719826e+02 -5.3334936315347807e+00 + 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 -3.6114283847420849e+00 1.5982998291730415e+00 + 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 -9.8697714460669317e-01 -4.0296821938338319e+00 + 2.5492741738774744e+06 -7.8599345529792004e+05 9.3737591740107193e+04 -5.5326423872095538e+03 1.8118619438298339e+02 -5.2390153677605218e+00 +-3.1098153044707078e+05 1.1007248411865601e+05 -1.4280144141196661e+04 8.4109025518696251e+02 -2.5970904293141370e+01 3.1892310883718391e+00 +-5.5577338590808783e+05 1.3154358085719805e+05 -1.1694747055412488e+04 5.6105436016810438e+02 -1.5530677686084243e+01 -6.1618612270588793e+00 + 2.6932154305977230e+06 -8.2250052647013229e+05 9.6899959691172277e+04 -5.6297294779617941e+03 1.7951168208697126e+02 -4.6983951237217196e+00 + 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 -5.4812317220100892e+00 4.7513315671141720e+00 +-5.2836565144663176e+05 1.2409531281512717e+05 -1.0931090612321719e+04 5.2509257144231174e+02 -1.3301367935777353e+01 -9.1621620095231666e+00 +-2.7011359673979054e+06 8.2180193078306376e+05 -9.6658466651702445e+04 5.6226808449705832e+03 -1.8772212765456376e+02 3.8617748667187937e+00 +-5.2076889316070534e+05 1.5949629384340727e+05 -1.8999044900140336e+04 1.1022106651944848e+03 -3.4436466136411170e+01 7.4376238285956164e+00 + 6.4766725322662554e+04 -2.6994996461319020e+04 2.0876601827129484e+03 7.6609049415560705e+01 2.6995934389534368e+00 -1.6338670795256700e+01 diff --git a/Tracking/include/Tracking/Reco/GSFProcessor.h b/Tracking/include/Tracking/Reco/GSFProcessor.h index 1637962dc..f92fff036 100644 --- a/Tracking/include/Tracking/Reco/GSFProcessor.h +++ b/Tracking/include/Tracking/Reco/GSFProcessor.h @@ -206,6 +206,10 @@ class GSFProcessor final : public TrackingGeometryUser { // The output track collection std::string out_trk_collection_{"GSFTracks"}; + std::string low_parameters_path; + std::string high_parameters_path; + + // Select the hits using TrackID and pdg_id__ // int track_id_{-1}; diff --git a/Tracking/python/make_path.py b/Tracking/python/make_path.py index fa9447966..483a5b35b 100644 --- a/Tracking/python/make_path.py +++ b/Tracking/python/make_path.py @@ -48,3 +48,28 @@ def makeDetectorPath(det_name : str) -> str: sys.exit(1) return path + +def makeGSFPath(file_name : str) -> str: + """Get the full path to the detector description. + + This will generate a path to detector.gdml, the main entry point for the + detector description, for a given detector name. + + Parameters + ---------- + det_name : str + The name of the detector e.g. ldmx-det-v14 + + Returns + ------- + str + Full path to the detector.gdml of the given detector. + + """ + path = '@CMAKE_INSTALL_PREFIX@/data/Tracking/' + file_name + '.par' + if not os.path.isfile(path) : + print('GSf .par file \'%s\' does not exist.' % ( path )) + sys.exit(1) + + return path + diff --git a/Tracking/python/tracking.py b/Tracking/python/tracking.py index f2b577314..5c12c698f 100644 --- a/Tracking/python/tracking.py +++ b/Tracking/python/tracking.py @@ -1,5 +1,5 @@ from LDMX.Framework.ldmxcfg import Producer -from LDMX.Tracking.make_path import makeFieldMapPath +from LDMX.Tracking.make_path import makeFieldMapPath, makeGSFPath #from LDMX.Tracking.make_path import makeDetectorPath @@ -227,7 +227,7 @@ class GSFProcessor(Producer): def __init__(self, instance_name='GSFProcessor'): super().__init__(instance_name, 'tracking::reco::GSFProcessor', 'Tracking') - + self.trackCollection = "TaggerTracks" self.measCollection = "DigiTaggerSimHits" self.maxComponent = 12 @@ -241,6 +241,8 @@ def __init__(self, instance_name='GSFProcessor'): self.field_map = makeFieldMapPath() self.taggerTracking = True self.out_trk_collection = "GSFTracks" + self.low_parameters_path = makeGSFPath("GeantSim_LT01_cdf_nC6_O5") + self.high_parameters_path = makeGSFPath("GeantSim_LT01_cdf_nC6_O5") diff --git a/Tracking/src/Tracking/Reco/GSFProcessor.cxx b/Tracking/src/Tracking/Reco/GSFProcessor.cxx index 60874d381..d15aa60df 100644 --- a/Tracking/src/Tracking/Reco/GSFProcessor.cxx +++ b/Tracking/src/Tracking/Reco/GSFProcessor.cxx @@ -102,7 +102,10 @@ void GSFProcessor::onNewRun(const ldmx::RunHeader& rh) { DirectPropagator(std::move(directStepper), std::move(directNavigator), Acts::getDefaultLogger("GSF_PROP_DIRECT", acts_loggingLevel)); - BetheHeitlerApprox betheHeitler = Acts::makeDefaultBetheHeitlerApprox(); + BetheHeitlerApprox betheHeitler = Acts::AtlasBetheHeitlerApprox<6,5>::loadFromFiles(low_parameters_path, + high_parameters_path,0.1, 0.2); + + //BetheHeitlerApprox betheHeitler = Acts::makeDefaultBetheHeitlerApprox(); const auto gsfLogger = Acts::getDefaultLogger("GSF", acts_loggingLevel); @@ -130,7 +133,7 @@ void GSFProcessor::configure(framework::config::Parameters& parameters) { measCollection_ = parameters.getParameter("measCollection", "DigiTaggerSimHits"); - maxComponents_ = parameters.getParameter("maxComponents", 4); + maxComponents_ = parameters.getParameter("maxComponents", 100); abortOnError_ = parameters.getParameter("abortOnError", false); disableAllMaterialHandling_ = parameters.getParameter("disableAllMaterialHandling", false); @@ -146,6 +149,12 @@ void GSFProcessor::configure(framework::config::Parameters& parameters) { debug_ = parameters.getParameter("debug", false); taggerTracking_ = parameters.getParameter("taggerTracking", true); + low_parameters_path = + parameters.getParameter("low_parameters_path"); + + high_parameters_path = + parameters.getParameter("high_parameters_path"); + // finalReductionMethod_ = // parameters.getParameter("finalReductionMethod",); } @@ -210,7 +219,7 @@ void GSFProcessor::produce(framework::Event& event) { propagator_options.actionList.get(); mInteractor.multipleScattering = true; mInteractor.energyLoss = true; - mInteractor.recordInteractions = false; + mInteractor.recordInteractions = true; // The logger can be switched to sterile, e.g. for timing logging auto& sLogger = @@ -389,6 +398,9 @@ void GSFProcessor::produce(framework::Event& event) { auto gsftrk = tc.getTrack(itrk); calculateTrackQuantities(gsftrk); + // Here need to do the same thing as CKF and add extrapolation to the + // target to get the default track state. + const Acts::BoundVector& perigee_pars = gsftrk.parameters(); const Acts::BoundMatrix& trk_cov = gsftrk.covariance(); const Acts::Surface& perigee_surface = gsftrk.referenceSurface();