3 from pathlib
import Path
20 ParticleSmearingSigmas,
24 TruthEstimatedSeedingAlgorithmConfigArg,
26 addAmbiguityResolution,
27 AmbiguityResolutionConfig,
33 from physmon_common
import makeSetup
35 u = acts.UnitConstants
41 with tempfile.TemporaryDirectory()
as temp:
45 logLevel=acts.logging.INFO,
47 Path(__file__).parent.parent /
"fpe_masks.yml"
53 for d
in setup.decorators:
54 s.addContextDecorator(d)
56 rnd = acts.examples.RandomNumbers(seed=42)
64 vtxGen=acts.examples.GaussianVertexGenerator(
65 mean=acts.Vector4(0, 0, 0, 0),
67 0.0125 * u.mm, 0.0125 * u.mm, 55.5 * u.mm, 1.0 * u.ns
76 setup.trackingGeometry,
78 enableInteractions=
True,
84 setup.trackingGeometry,
86 digiConfigFile=setup.digiConfig,
92 setup.trackingGeometry,
99 r=(33 * u.mm, 200 * u.mm),
100 deltaR=(1 * u.mm, 60 * u.mm),
101 collisionRegion=(-250 * u.mm, 250 * u.mm),
102 z=(-2000 * u.mm, 2000 * u.mm),
105 radLengthPerSeed=0.1,
111 seedingAlgorithm=SeedingAlgorithm.TruthSmeared
112 if truthSmearedSeeded
113 else SeedingAlgorithm.TruthEstimated
114 if truthEstimatedSeeded
115 else SeedingAlgorithm.Default
117 else SeedingAlgorithm.Orthogonal,
118 geoSelectionConfigFile=setup.geoSel,
125 setup.trackingGeometry,
128 pt=(500 * u.MeV,
None),
129 loc0=(-4.0 * u.mm, 4.0 * u.mm),
135 if label
in [
"seeded",
"orthogonal"]:
145 seeder=acts.VertexSeedFinder.GaussianSeeder,
146 outputProtoVertices=
"ivf_protovertices",
147 outputVertices=
"ivf_fittedVertices",
148 vertexFinder=VertexFinder.Iterative,
149 outputDirRoot=tp /
"ivf",
155 seeder=acts.VertexSeedFinder.GaussianSeeder,
156 outputProtoVertices=
"amvf_protovertices",
157 outputVertices=
"amvf_fittedVertices",
158 vertexFinder=VertexFinder.AMVF,
159 outputDirRoot=tp /
"amvf",
164 if label ==
"seeded":
168 seeder=acts.VertexSeedFinder.AdaptiveGridSeeder,
169 outputProtoVertices=
"amvf_gridseeder_protovertices",
170 outputVertices=
"amvf_gridseeder_fittedVertices",
171 vertexFinder=VertexFinder.AMVF,
172 outputDirRoot=tp /
"amvf_gridseeder",
178 for vertexing
in [
"ivf",
"amvf"]:
180 tp / f
"{vertexing}/performance_vertexing.root",
181 tp / f
"performance_{vertexing}.root",
184 if label ==
"seeded":
185 vertexing =
"amvf_gridseeder"
187 tp / f
"{vertexing}/performance_vertexing.root",
188 tp / f
"performance_{vertexing}.root",
198 + ([
"performance_amvf_gridseeder"]
if label ==
"seeded" else [])
200 [
"performance_seeding",
"performance_ambi"]
201 if label
in [
"seeded",
"orthogonal"]
202 else [
"performance_seeding"]
203 if label ==
"truth_estimated"
207 perf_file = tp / f
"{stem}.root"
208 assert perf_file.exists(),
"Performance file not found"
209 shutil.copy(perf_file, setup.outdir / f
"{stem}_{label}.root")
212 for truthSmearedSeeded, truthEstimatedSeeded, label
in [
213 (
True,
False,
"truth_smeared"),
214 (
False,
True,
"truth_estimated"),
215 (
False,
False,
"seeded"),
216 (
False,
False,
"orthogonal"),