Analysis Software
Documentation for sPHENIX simulation software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
truth_tracking_gsf_refitting.py
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file truth_tracking_gsf_refitting.py
1 #!/usr/bin/env python3
2 
3 from pathlib import Path
4 
5 import acts
6 import acts.examples
7 
8 from truth_tracking_kalman import runTruthTrackingKalman
9 
10 u = acts.UnitConstants
11 
12 srcdir = Path(__file__).resolve().parent.parent.parent.parent
13 outputDir = Path.cwd()
14 
15 # detector, trackingGeometry, _ = getOpenDataDetector()
16 detector, trackingGeometry, decorators = acts.examples.GenericDetector.create()
17 field = acts.ConstantBField(acts.Vector3(0, 0, 2 * u.T))
18 
20  trackingGeometry,
21  field,
22  digiConfigFile=srcdir
23  / "Examples/Algorithms/Digitization/share/default-smearing-config-generic.json",
24  # "thirdparty/OpenDataDetector/config/odd-digi-smearing-config.json",
25  outputDir=outputDir,
26 )
27 
28 gsfOptions = {
29  "betheHeitlerApprox": acts.examples.AtlasBetheHeitlerApprox.makeDefault(),
30  "maxComponents": 4,
31  "abortOnError": False,
32  "disableAllMaterialHandling": False,
33  "finalReductionMethod": acts.examples.FinalReductionMethod.maxWeight,
34  "weightCutoff": 1.0e-4,
35  "level": acts.logging.INFO,
36 }
37 
38 s.addAlgorithm(
39  acts.examples.RefittingAlgorithm(
40  acts.logging.INFO,
41  inputTracks="kfTracks",
42  outputTracks="gsfTracks",
43  fit=acts.examples.makeGsfFitterFunction(trackingGeometry, field, **gsfOptions),
44  )
45 )
46 
47 s.addAlgorithm(
48  acts.examples.TracksToTrajectories(
49  level=acts.logging.INFO,
50  inputTracks="gsfTracks",
51  outputTrajectories="gsfTrajectories",
52  )
53 )
54 
55 s.addWriter(
56  acts.examples.TrackFitterPerformanceWriter(
57  level=acts.logging.INFO,
58  inputTrajectories="trajectories",
59  inputParticles="truth_seeds_selected",
60  inputMeasurementParticlesMap="measurement_particles_map",
61  filePath=str(outputDir / "performance_refitter.root"),
62  )
63 )
64 
65 s.run()