1 from pathlib
import Path
2 from typing
import Optional
13 SpacePointGridConfigArg,
14 SeedingAlgorithmConfigArg,
17 u = acts.UnitConstants
29 customMaterialFile: Optional[str] =
None,
30 material: bool =
True,
31 jsonconfig: bool =
False,
32 logLevel=acts.logging.WARNING,
36 logger = acts.logging.getLogger(
"buildITkGeometry")
41 if customMaterialFile:
42 file = customMaterialFile
43 logger.info(
"Adding custom material from %s", file)
45 file = geo_dir /
"itk-hgtd/material-maps-ITk-HGTD.json"
46 logger.info(
"Adding material from %s", file.absolute())
47 matDeco = acts.IMaterialDecorator.fromFile(
49 level=customLogLevel(maxLevel=acts.logging.INFO),
52 tgeo_fileName = geo_dir /
"itk-hgtd/ATLAS-ITk-HGTD.tgeo.root"
55 jsonFile = geo_dir /
"itk-hgtd/tgeo-atlas-itk-hgtd.json"
56 logger.info(
"Create geometry from %s", jsonFile.absolute())
57 return TGeoDetector.create(
58 jsonFile=
str(jsonFile),
59 fileName=
str(tgeo_fileName),
60 surfaceLogLevel=customLogLevel(),
61 layerLogLevel=customLogLevel(),
62 volumeLogLevel=customLogLevel(),
66 Volume = TGeoDetector.Config.Volume
67 LayerTriplet = TGeoDetector.Config.LayerTriplet
68 equidistant = TGeoDetector.Config.BinningType.equidistant
69 arbitrary = TGeoDetector.Config.BinningType.arbitrary
87 return TGeoDetector.create(
88 fileName=
str(tgeo_fileName),
92 beamPipeRadius=23.934 * u.mm,
93 beamPipeHalflengthZ=3000.0 * u.mm,
94 beamPipeLayerThickness=0.8 * u.mm,
95 surfaceLogLevel=customLogLevel(),
96 layerLogLevel=customLogLevel(),
97 volumeLogLevel=customLogLevel(),
101 binToleranceR=(5 * u.mm, 5 * u.mm),
102 binToleranceZ=(5 * u.mm, 5 * u.mm),
103 binTolerancePhi=(0.025 * u.mm, 0.025 * u.mm),
104 layers=LayerTriplet(
True),
105 subVolumeName=LayerTriplet(
"ITkPixel__ITkPixelDetector"),
106 sensitiveNames=LayerTriplet([
"ITkPixel__*_Sensor"]),
107 sensitiveAxes=LayerTriplet(
"YZX"),
108 rRange=LayerTriplet((0 * u.mm, 135 * u.mm)),
110 negative=(-3000 * u.mm, -250 * u.mm),
111 central=(-250 * u.mm, 250 * u.mm),
112 positive=(250 * u.mm, 3000 * u.mm),
114 splitTolR=LayerTriplet(negative=-1.0, central=5 * u.mm, positive=-1.0),
115 splitTolZ=LayerTriplet(
116 negative=10 * u.mm, central=-1.0, positive=10 * u.mm
118 binning0=LayerTriplet(
119 negative=[(0, equidistant)],
120 central=[(6, equidistant), (10, equidistant)],
121 positive=[(0, equidistant)],
123 binning1=LayerTriplet(
124 negative=[(0, equidistant)],
125 central=[(12, equidistant), (6, equidistant)],
126 positive=[(0, equidistant)],
128 cylinderDiscSplit=
False,
129 cylinderNZSegments=0,
130 cylinderNPhiSegments=0,
133 itkModuleSplit=
False,
139 binToleranceR=(5 * u.mm, 5 * u.mm),
140 binToleranceZ=(5 * u.mm, 5 * u.mm),
141 binTolerancePhi=(0.025 * u.mm, 0.025 * u.mm),
142 layers=LayerTriplet(
True),
143 subVolumeName=LayerTriplet(
"ITkPixel__ITkPixelDetector"),
144 sensitiveNames=LayerTriplet([
"ITkPixel__*_Sensor"]),
145 sensitiveAxes=LayerTriplet(
"YZX"),
146 rRange=LayerTriplet((135 * u.mm, 350 * u.mm)),
148 negative=(-3000 * u.mm, -377 * u.mm),
149 central=(-377 * u.mm, 377 * u.mm),
150 positive=(377 * u.mm, 3000 * u.mm),
152 splitTolR=LayerTriplet(
153 negative=15 * u.mm, central=5 * u.mm, positive=15 * u.mm
155 splitTolZ=LayerTriplet(
156 negative=20 * u.mm, central=-1.0, positive=20 * u.mm
158 binning0=LayerTriplet(
159 negative=[(0, equidistant)],
160 central=[(0, equidistant)],
161 positive=[(0, equidistant)],
163 binning1=LayerTriplet(
164 negative=[(0, equidistant)],
165 central=[(0, equidistant)],
166 positive=[(0, equidistant)],
168 cylinderDiscSplit=
False,
169 cylinderNZSegments=0,
170 cylinderNPhiSegments=0,
173 itkModuleSplit=
False,
179 binToleranceR=(5 * u.mm, 5 * u.mm),
180 binToleranceZ=(5 * u.mm, 5 * u.mm),
181 binTolerancePhi=(0.025 * u.mm, 0.025 * u.mm),
182 layers=LayerTriplet(
True),
183 subVolumeName=LayerTriplet(
"ITkStrip__ITkStrip"),
184 sensitiveNames=LayerTriplet(
185 negative=[
"ITkStrip__ECSensor*"],
186 central=[
"ITkStrip__BRLSensor*"],
187 positive=[
"ITkStrip__ECSensor*"],
189 sensitiveAxes=LayerTriplet(
"XYZ"),
191 negative=(-1.0, 1050 * u.mm),
192 central=(380 * u.mm, 1050 * u.mm),
193 positive=(-1.0, 1050 * u.mm),
196 negative=(-3000 * u.mm, -1400 * u.mm),
197 central=(-1400 * u.mm, 1400 * u.mm),
198 positive=(1400 * u.mm, 3000 * u.mm),
200 splitTolR=LayerTriplet(
205 splitTolZ=LayerTriplet(
206 negative=35 * u.mm, central=-1.0, positive=35 * u.mm
208 binning0=LayerTriplet(
209 negative=[(-1, arbitrary)],
210 central=[(0, equidistant)],
211 positive=[(-1, arbitrary)],
213 binning1=LayerTriplet(
214 negative=[(-1, arbitrary)],
215 central=[(28, equidistant)] * 4,
216 positive=[(-1, arbitrary)],
218 cylinderDiscSplit=
False,
219 cylinderNZSegments=0,
220 cylinderNPhiSegments=0,
224 barrelMap={
"MS": 2,
"SS": 4},
238 "EC2": [[575.594, 606.402], [606.402, 637.209]],
245 "EC4": [[756.901, 811.482], [811.482, 866.062]],
246 "EC5": [[867.462, 907.623], [907.623, 967.785]],
251 ".*EC.*Sensor(|Back)0.*":
"EC0",
252 ".*EC.*Sensor(|Back)1.*":
"EC1",
253 ".*EC.*Sensor(|Back)2.*":
"EC2",
254 ".*EC.*Sensor(|Back)3.*":
"EC3",
255 ".*EC.*Sensor(|Back)4.*":
"EC4",
256 ".*EC.*Sensor(|Back)5.*":
"EC5",
261 binToleranceR=(15 * u.mm, 15 * u.mm),
262 binToleranceZ=(5 * u.mm, 5 * u.mm),
263 binTolerancePhi=(0.25 * u.mm, 0.25 * u.mm),
264 layers=LayerTriplet(positive=
True, central=
False, negative=
True),
265 subVolumeName=LayerTriplet(
"HGTD__HGTD"),
266 sensitiveNames=LayerTriplet([
"HGTD__HGTDSiSensor*"]),
267 sensitiveAxes=LayerTriplet(
"XYZ"),
269 negative=(0 * u.mm, 1050 * u.mm),
270 positive=(0 * u.mm, 1050 * u.mm),
273 negative=(-4000 * u.mm, -3000 * u.mm),
274 positive=(3000 * u.mm, 4000 * u.mm),
276 splitTolR=LayerTriplet(-1.0),
277 splitTolZ=LayerTriplet(negative=10 * u.mm, positive=10 * u.mm),
278 binning0=LayerTriplet(
279 negative=[(0, equidistant)],
280 central=[(0, equidistant)],
281 positive=[(0, equidistant)],
283 binning1=LayerTriplet(
284 negative=[(0, equidistant)],
285 central=[(0, equidistant)],
286 positive=[(0, equidistant)],
288 cylinderDiscSplit=
False,
289 cylinderNZSegments=0,
290 cylinderNPhiSegments=0,
293 itkModuleSplit=
False,
302 inputSpacePointsType: InputSpacePointsType, highOccupancyConfig=
False
304 assert isinstance(inputSpacePointsType, InputSpacePointsType)
309 zOutermostLayers = (-2700 * u.mm, 2700 * u.mm)
310 beamPos = (0 * u.mm, 0 * u.mm)
311 collisionRegionMin = -200 * u.mm
312 collisionRegionMax = 200 * u.mm
314 cotThetaMax = 27.2899
316 radLengthPerSeed = 0.0975
319 deltaRMin = 20 * u.mm
320 maxPtScattering = float(
"inf") * u.GeV
348 useVariableMiddleSPRange =
True
350 seedConfirmation =
True
351 centralSeedConfirmationRange = acts.SeedConfirmationRangeConfig(
352 zMinSeedConf=-500 * u.mm,
353 zMaxSeedConf=500 * u.mm,
354 rMaxSeedConf=140 * u.mm,
357 seedConfMinBottomRadius=60.0 * u.mm,
358 seedConfMaxZOrigin=150.0 * u.mm,
359 minImpactSeedConf=1.0 * u.mm,
361 forwardSeedConfirmationRange = acts.SeedConfirmationRangeConfig(
362 zMinSeedConf=-3000 * u.mm,
363 zMaxSeedConf=3000 * u.mm,
364 rMaxSeedConf=140 * u.mm,
367 seedConfMinBottomRadius=60.0 * u.mm,
368 seedConfMaxZOrigin=150.0 * u.mm,
369 minImpactSeedConf=1.0 * u.mm,
371 zOriginWeightFactor = 1
372 compatSeedWeight = 100
375 phiBinDeflectionCoverage = 3
382 if inputSpacePointsType
is InputSpacePointsType.PixelSpacePoints:
383 outputSeeds =
"PixelSeeds"
384 allowSeparateRMax =
False
385 rMaxGridConfig = 320 * u.mm
386 rMaxSeedFinderConfig = rMaxGridConfig
387 deltaRMinSP = 6 * u.mm
388 deltaRMax = 280 * u.mm
389 deltaRMaxTopSP = 280 * u.mm
390 deltaRMaxBottomSP = 150 * u.mm
391 deltaZMax = float(
"inf") * u.mm
392 interactionPointCut =
True
394 zBinsCustomLooping = [
420 zBinNeighborsBottom = [
433 deltaRMiddleMinSPRange = 10 * u.mm
434 deltaRMiddleMaxSPRange = 10 * u.mm
435 seedConfirmationFilter =
True
436 impactWeightFactor = 100
438 numSeedIncrement = 100
439 seedWeightIncrement = 0
440 useDetailedDoubleMeasurementInfo =
False
441 maxSeedsPerSpMConf = 5
442 maxQualitySeedsPerSpMConf = 5
443 useDeltaRorTopRadius =
True
445 if highOccupancyConfig ==
True:
446 rMaxGridConfig = 250 * u.mm
447 deltaRMax = 200 * u.mm
448 zBinsCustomLooping = [1, 11, 2, 10, 3, 9, 6, 4, 8, 5, 7]
450 skipZMiddleBinSearch = 2
452 elif inputSpacePointsType
is InputSpacePointsType.StripSpacePoints:
453 outputSeeds =
"StripSeeds"
454 allowSeparateRMax =
True
455 rMaxGridConfig = 1000.0 * u.mm
456 rMaxSeedFinderConfig = 1200.0 * u.mm
457 deltaRMinSP = 20 * u.mm
458 deltaRMax = 600 * u.mm
459 deltaRMaxTopSP = 300 * u.mm
460 deltaRMaxBottomSP = deltaRMaxTopSP
461 deltaZMax = 900 * u.mm
462 interactionPointCut =
False
463 impactMax = 20 * u.mm
464 zBinsCustomLooping = [6, 7, 5, 8, 4, 9, 3, 10, 2, 11, 1]
478 zBinNeighborsBottom = [
491 deltaRMiddleMinSPRange = 30 * u.mm
492 deltaRMiddleMaxSPRange = 150 * u.mm
493 seedConfirmationFilter =
False
494 impactWeightFactor = 1
497 seedWeightIncrement = 10100
498 useDetailedDoubleMeasurementInfo =
True
499 maxSeedsPerSpMConf = 100
500 maxQualitySeedsPerSpMConf = 100
501 useDeltaRorTopRadius =
False
503 if highOccupancyConfig ==
True:
505 collisionRegionMin = -150 * u.mm
506 collisionRegionMax = 150 * u.mm
520 useVariableMiddleSPRange =
False
522 skipZMiddleBinSearch = 0
526 maxSeedsPerSpM=maxSeedsPerSpM,
527 cotThetaMax=cotThetaMax,
528 sigmaScattering=sigmaScattering,
529 radLengthPerSeed=radLengthPerSeed,
532 deltaPhiMax=deltaPhiMax,
533 interactionPointCut=interactionPointCut,
535 maxPtScattering=maxPtScattering,
537 zBinsCustomLooping=zBinsCustomLooping,
538 skipZMiddleBinSearch=skipZMiddleBinSearch,
539 rRangeMiddleSP=rRangeMiddleSP,
540 useVariableMiddleSPRange=useVariableMiddleSPRange,
542 seedConfirmation=seedConfirmation,
543 centralSeedConfirmationRange=centralSeedConfirmationRange,
544 forwardSeedConfirmationRange=forwardSeedConfirmationRange,
545 deltaR=(deltaRMin, deltaRMax),
546 deltaRBottomSP=(deltaRMinSP, deltaRMaxBottomSP),
547 deltaRTopSP=(deltaRMinSP, deltaRMaxTopSP),
548 deltaRMiddleSPRange=(deltaRMiddleMinSPRange, deltaRMiddleMaxSPRange),
549 collisionRegion=(collisionRegionMin, collisionRegionMax),
550 r=(
None, rMaxSeedFinderConfig),
552 zOutermostLayers=zOutermostLayers,
558 impactWeightFactor=impactWeightFactor,
559 zOriginWeightFactor=zOriginWeightFactor,
560 compatSeedWeight=compatSeedWeight,
561 compatSeedLimit=compatSeedLimit,
562 numSeedIncrement=numSeedIncrement,
563 seedWeightIncrement=seedWeightIncrement,
564 seedConfirmation=seedConfirmation,
565 maxSeedsPerSpMConf=maxSeedsPerSpMConf,
566 maxQualitySeedsPerSpMConf=maxQualitySeedsPerSpMConf,
567 useDeltaRorTopRadius=useDeltaRorTopRadius,
573 phiBinDeflectionCoverage=phiBinDeflectionCoverage,
574 phi=(phiMin, phiMax),
576 maxPhiBins=maxPhiBins,
579 allowSeparateRMax=allowSeparateRMax,
580 zBinNeighborsTop=zBinNeighborsTop,
581 zBinNeighborsBottom=zBinNeighborsBottom,
582 numPhiNeighbors=numPhiNeighbors,
586 seedingAlgorithmConfigArg,
588 seedFinderOptionsArg,
590 spacePointGridConfigArg,