3 from pathlib
import Path
4 from typing
import Optional
13 trackingGeometry: acts.TrackingGeometry,
14 field: acts.MagneticFieldProvider,
18 inputParticlePath: Optional[Path] =
None,
36 events=10000, numThreads=-1, logLevel=acts.logging.INFO
39 rnd = acts.examples.RandomNumbers()
40 outputDir = Path(outputDir)
42 if inputParticlePath
is None:
50 outputDirRoot=outputDir,
53 acts.logging.getLogger(
"Truth tracking example").info(
54 "Reading particles from %s", inputParticlePath.resolve()
56 assert inputParticlePath.exists()
59 level=acts.logging.INFO,
60 filePath=
str(inputParticlePath.resolve()),
61 particleCollection=
"particles_input",
71 enableInteractions=
True,
78 digiConfigFile=digiConfigFile,
86 seedingAlgorithm=SeedingAlgorithm.TruthSmeared,
103 acts.examples.RootTrajectoryStatesWriter(
104 level=acts.logging.INFO,
105 inputTrajectories=
"trajectories",
106 inputParticles=
"truth_seeds_selected",
107 inputSimHits=
"simhits",
108 inputMeasurementParticlesMap=
"measurement_particles_map",
109 inputMeasurementSimHitsMap=
"measurement_simhits_map",
110 filePath=
str(outputDir /
"trackstates_fitter.root"),
115 acts.examples.RootTrajectorySummaryWriter(
116 level=acts.logging.INFO,
117 inputTrajectories=
"trajectories",
118 inputParticles=
"truth_seeds_selected",
119 inputMeasurementParticlesMap=
"measurement_particles_map",
120 filePath=
str(outputDir /
"tracksummary_fitter.root"),
148 if "__main__" == __name__:
149 srcdir = Path(__file__).resolve().parent.parent.parent.parent
152 detector, trackingGeometry, decorators = acts.examples.GenericDetector.create()
154 field = acts.ConstantBField(acts.Vector3(0, 0, 2 * u.T))
157 trackingGeometry=trackingGeometry,
160 digiConfigFile=srcdir
161 /
"Examples/Algorithms/Digitization/share/default-smearing-config-generic.json",
165 outputDir=Path.cwd(),