forked from acts-project/acts
-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathfull_chain_itk.py
More file actions
executable file
·161 lines (148 loc) · 4.03 KB
/
full_chain_itk.py
File metadata and controls
executable file
·161 lines (148 loc) · 4.03 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
#!/usr/bin/env python3
import pathlib, acts, acts.root, acts.examples, acts.examples.itk
from acts.examples.simulation import (
addParticleGun,
MomentumConfig,
EtaConfig,
ParticleConfig,
addPythia8,
ParticleSelectorConfig,
addGenParticleSelection,
addFatras,
addDigitization,
addDigiParticleSelection,
)
from acts.examples.reconstruction import (
addSeeding,
SeedingAlgorithm,
addCKFTracks,
CkfConfig,
TrackSelectorConfig,
addAmbiguityResolution,
AmbiguityResolutionConfig,
addVertexFitting,
VertexFinder,
)
ttbar_pu200 = False
u = acts.UnitConstants
geo_dir = pathlib.Path("acts-itk")
outputDir = pathlib.Path.cwd() / "itk_output"
# acts.examples.dump_args_calls() # show acts.examples python binding calls
detector = acts.examples.itk.buildITkGeometry(geo_dir)
trackingGeometry = detector.trackingGeometry()
field = acts.root.MagneticFieldMapXyz(str(geo_dir / "bfield/ATLAS-BField-xyz.root"))
rnd = acts.examples.RandomNumbers(seed=42)
s = acts.examples.Sequencer(events=100, numThreads=-1, outputDir=str(outputDir))
if not ttbar_pu200:
addParticleGun(
s,
MomentumConfig(1.0 * u.GeV, 10.0 * u.GeV, transverse=True),
EtaConfig(-4.0, 4.0, uniform=True),
ParticleConfig(2, acts.PdgParticle.eMuon, randomizeCharge=True),
rnd=rnd,
)
else:
addPythia8(
s,
hardProcess=["Top:qqbar2ttbar=on"],
npileup=200,
vtxGen=acts.examples.GaussianVertexGenerator(
stddev=acts.Vector4(0.0125 * u.mm, 0.0125 * u.mm, 55.5 * u.mm, 5.0 * u.ns),
mean=acts.Vector4(0, 0, 0, 0),
),
rnd=rnd,
outputDirRoot=outputDir,
)
addGenParticleSelection(
s,
ParticleSelectorConfig(
rho=(0.0 * u.mm, 28.0 * u.mm),
absZ=(0.0 * u.mm, 1.0 * u.m),
eta=(-4.0, 4.0),
pt=(150 * u.MeV, None),
),
)
addFatras(
s,
trackingGeometry,
field,
rnd=rnd,
outputDirRoot=outputDir,
)
addDigitization(
s,
trackingGeometry,
field,
digiConfigFile=geo_dir / "itk-hgtd/itk-smearing-config.json",
outputDirRoot=outputDir,
rnd=rnd,
)
addDigiParticleSelection(
s,
ParticleSelectorConfig(
pt=(1.0 * u.GeV, None),
eta=(-4.0, 4.0),
measurements=(9, None),
removeNeutral=True,
),
)
addSeeding(
s,
trackingGeometry,
field,
seedingAlgorithm=SeedingAlgorithm.GridTriplet,
*acts.examples.itk.itkSeedingAlgConfig(
acts.examples.itk.InputSpacePointsType.PixelSpacePoints
),
initialSigmas=[
1 * u.mm,
1 * u.mm,
1 * u.degree,
1 * u.degree,
0 * u.e / u.GeV,
1 * u.ns,
],
initialSigmaQoverPt=0.1 * u.e / u.GeV,
initialSigmaPtRel=0.1,
initialVarInflation=[1.0] * 6,
geoSelectionConfigFile=geo_dir / "itk-hgtd/geoSelection-ITk.json",
outputDirRoot=outputDir,
)
addCKFTracks(
s,
trackingGeometry,
field,
trackSelectorConfig=(
# fmt: off
TrackSelectorConfig(absEta=(None, 2.0), pt=(0.9 * u.GeV, None), nMeasurementsMin=9, maxHoles=2, maxOutliers=2, maxSharedHits=2),
TrackSelectorConfig(absEta=(None, 2.6), pt=(0.4 * u.GeV, None), nMeasurementsMin=8, maxHoles=2, maxOutliers=2, maxSharedHits=2),
TrackSelectorConfig(absEta=(None, 4.0), pt=(0.4 * u.GeV, None), nMeasurementsMin=7, maxHoles=2, maxOutliers=2, maxSharedHits=2),
# fmt: on
),
ckfConfig=CkfConfig(
seedDeduplication=True,
stayOnSeed=True,
# ITk volumes from Noemi's plot
pixelVolumes=[8, 9, 10, 13, 14, 15, 16, 18, 19, 20],
stripVolumes=[22, 23, 24],
maxPixelHoles=1,
maxStripHoles=2,
),
outputDirRoot=outputDir,
)
addAmbiguityResolution(
s,
AmbiguityResolutionConfig(
maximumSharedHits=3,
maximumIterations=10000,
nMeasurementsMin=6,
),
outputDirRoot=outputDir,
)
addVertexFitting(
s,
field,
vertexFinder=VertexFinder.AMVF,
outputDirRoot=outputDir,
)
s.run()