2 from pathlib
import Path
3 from typing
import Optional, Union
4 from collections
import namedtuple
6 from acts.examples import Sequencer, GenericDetector, RootParticleReader
10 from acts
import UnitConstants
as u
16 geometrySelection: Path,
20 truthSmearedSeeded=
False,
21 truthEstimatedSeeded=
False,
23 inputParticlePath: Optional[Path] =
None,
39 ParticleSmearingSigmas,
43 TruthEstimatedSeedingAlgorithmConfigArg,
48 events=100, numThreads=-1, logLevel=acts.logging.INFO
51 s.addContextDecorator(d)
52 rnd = acts.examples.RandomNumbers(seed=42)
53 outputDir = Path(outputDir)
55 if inputParticlePath
is None:
65 acts.logging.getLogger(
"CKFExample").info(
66 "Reading particles from %s", inputParticlePath.resolve()
68 assert inputParticlePath.exists()
71 level=acts.logging.INFO,
72 filePath=
str(inputParticlePath.resolve()),
73 particleCollection=
"particles_input",
89 digiConfigFile=digiConfigFile,
100 r=(
None, 200 * u.mm),
101 deltaR=(1 * u.mm, 60 * u.mm),
102 collisionRegion=(-250 * u.mm, 250 * u.mm),
103 z=(-2000 * u.mm, 2000 * u.mm),
106 radLengthPerSeed=0.1,
112 seedingAlgorithm=SeedingAlgorithm.TruthSmeared
113 if truthSmearedSeeded
114 else SeedingAlgorithm.TruthEstimated
115 if truthEstimatedSeeded
116 else SeedingAlgorithm.Default,
117 geoSelectionConfigFile=geometrySelection,
118 outputDirRoot=outputDir,
126 outputDirRoot=outputDir,
127 outputDirCsv=outputDir /
"csv" if outputCsv
else None,
133 if "__main__" == __name__:
134 srcdir = Path(__file__).resolve().parent.parent.parent.parent
136 detector, trackingGeometry, decorators = GenericDetector.create()
138 field = acts.ConstantBField(acts.Vector3(0, 0, 2 * u.T))
140 inputParticlePath = Path(
"particles.root")
141 if not inputParticlePath.exists():
142 inputParticlePath =
None
148 geometrySelection=srcdir
149 /
"Examples/Algorithms/TrackFinding/share/geoSelection-genericDetector.json",
150 digiConfigFile=srcdir
151 /
"Examples/Algorithms/Digitization/share/default-smearing-config-generic.json",
153 truthSmearedSeeded=
False,
154 truthEstimatedSeeded=
False,
155 inputParticlePath=inputParticlePath,
156 outputDir=Path.cwd(),