Skip to content

Commit

Permalink
added new Bethe-Heitler parametrization
Browse files Browse the repository at this point in the history
  • Loading branch information
EBerzin committed Dec 3, 2024
1 parent fc1420b commit b624198
Show file tree
Hide file tree
Showing 7 changed files with 89 additions and 5 deletions.
3 changes: 3 additions & 0 deletions Tracking/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)

19 changes: 19 additions & 0 deletions Tracking/data/GeantSim_GT01_cdf_nC6_O5.par
Original file line number Diff line number Diff line change
@@ -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
19 changes: 19 additions & 0 deletions Tracking/data/GeantSim_LT01_cdf_nC6_O5.par
Original file line number Diff line number Diff line change
@@ -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
4 changes: 4 additions & 0 deletions Tracking/include/Tracking/Reco/GSFProcessor.h
Original file line number Diff line number Diff line change
Expand Up @@ -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};
Expand Down
25 changes: 25 additions & 0 deletions Tracking/python/make_path.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

6 changes: 4 additions & 2 deletions Tracking/python/tracking.py
Original file line number Diff line number Diff line change
@@ -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


Expand Down Expand Up @@ -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
Expand All @@ -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")



Expand Down
18 changes: 15 additions & 3 deletions Tracking/src/Tracking/Reco/GSFProcessor.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down Expand Up @@ -130,7 +133,7 @@ void GSFProcessor::configure(framework::config::Parameters& parameters) {
measCollection_ = parameters.getParameter<std::string>("measCollection",
"DigiTaggerSimHits");

maxComponents_ = parameters.getParameter<int>("maxComponents", 4);
maxComponents_ = parameters.getParameter<int>("maxComponents", 100);
abortOnError_ = parameters.getParameter<bool>("abortOnError", false);
disableAllMaterialHandling_ =
parameters.getParameter<bool>("disableAllMaterialHandling", false);
Expand All @@ -146,6 +149,12 @@ void GSFProcessor::configure(framework::config::Parameters& parameters) {
debug_ = parameters.getParameter<bool>("debug", false);
taggerTracking_ = parameters.getParameter<bool>("taggerTracking", true);

low_parameters_path =
parameters.getParameter<std::string>("low_parameters_path");

high_parameters_path =
parameters.getParameter<std::string>("high_parameters_path");

// finalReductionMethod_ =
// parameters.getParameter<double>("finalReductionMethod",);
}
Expand Down Expand Up @@ -210,7 +219,7 @@ void GSFProcessor::produce(framework::Event& event) {
propagator_options.actionList.get<Acts::MaterialInteractor>();
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 =
Expand Down Expand Up @@ -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();
Expand Down

0 comments on commit b624198

Please sign in to comment.