15 KdtSurfacesProvider2D,
16 IndexedRootVolumeFinderBuilder,
33 llevel=acts.logging.INFO,
37 necEndcapExtent = Extent([[Binning.r, rRange], [Binning.z, zDivisions[0:2]]])
40 for zPos
in necPositionsZ:
45 [Binning.z, [zPos - necHalfThickness, zPos + necHalfThickness]],
48 provider = KdtSurfacesProvider2D(sensitivesKdt, lExtent)
51 "lay_" +
str(ilay), lExtent, provider, necBinning, [], llevel
56 if len(containerIds) > 0:
57 necGigConf = GeometryIdGenerator.Config()
58 necGigConf.containerMode =
True
59 necGigConf.containerId = containerIds[0]
60 necGig = GeometryIdGenerator(necGigConf, name +
"_nec_gig", llevel)
64 extent=necEndcapExtent,
69 geoidgenerator=necGig,
75 barrelExtent = Extent([[Binning.r, rRange], [Binning.z, zDivisions[1:3]]])
79 for layerR
in barrelPositionsR:
80 ilay = len(barrelLayers)
85 [layerR - barrelHalfThickness, layerR + barrelHalfThickness],
87 [Binning.z, zDivisions[1:3]],
90 provider = KdtSurfacesProvider2D(sensitivesKdt, lExtent)
91 binning = barrelBinnings[ilay]
94 "lay_" +
str(ilay), lExtent, provider, binning, [], llevel
99 if len(containerIds) > 1:
100 barrelGiConfg = GeometryIdGenerator.Config()
101 barrelGiConfg.containerMode =
True
102 barrelGiConfg.containerId = containerIds[1]
103 barrelGig = GeometryIdGenerator(barrelGiConfg, name +
"_barrel_gig", llevel)
106 name=name +
"_barrel",
112 geoidgenerator=barrelGig,
118 pecEndcapExtent = Extent([[Binning.r, rRange], [Binning.z, zDivisions[2:4]]])
119 necPositionsZ.reverse()
122 for zPos
in necPositionsZ:
123 ilay = len(pecLayers)
129 [-1 * zPos - necHalfThickness, -1 * zPos + necHalfThickness],
133 provider = KdtSurfacesProvider2D(sensitivesKdt, lExtent)
136 "lay_" +
str(ilay), lExtent, provider, necBinning, [], llevel
141 if len(containerIds) > 2:
142 pecGigConf = GeometryIdGenerator.Config()
143 pecGigConf.containerMode =
True
144 pecGigConf.containerId = containerIds[2]
145 pecGig = GeometryIdGenerator(pecGigConf, name +
"_pec_gig", llevel)
149 extent=pecEndcapExtent,
154 geoidgenerator=pecGig,
163 volumes=[nec, barrel, pec],
172 def get_detector(geoContext, ssurfaces, psurfaces, llevel=acts.logging.DEBUG):
175 sensitivesKdt = KdtSurfaces2D(geoContext, ssurfaces, [Binning.z, Binning.r])
176 passivesKdt = KdtSurfaces2D(geoContext, psurfaces, [Binning.z, Binning.r])
179 detRrange = [0, 1100]
180 detZrange = [-3100, 3100]
183 bpRrange = [detRrange[0], 25.0]
184 bpExtent = Extent([[Binning.r, bpRrange], [Binning.z, detZrange]])
185 bpProvider = KdtSurfacesProvider2D(passivesKdt, bpExtent)
186 bpBinning = [ProtoBinning(Binning.r, Binning.bound, 0, 25, 1, 0)]
188 "ODD_beampipe", bpExtent, bpProvider, bpBinning, [], llevel
192 pixRrange = [25, 190]
193 pixZdivisions = [detZrange[0], -590, 590, detZrange[1]]
194 pixNecPositionsZ = [-1520, -1320, -1120, -980, -840, -720, -620]
195 pixNecHalfThickness = 5
197 ProtoBinning(Binning.r, Binning.bound, 40, 175, 2, 1),
198 detector.phiBinning(56, 1),
200 pixBarrelPositionsR = [34, 70, 116, 172]
201 pixBarrelHalfThickness = 5
202 pixBarrelZbinning = ProtoBinning(Binning.z, Binning.bound, -500, 500, 14, 1)
203 pixBarrelPhiBinnings = [[16, 1], [32, 1], [52, 1], [78, 1]]
205 [pixBarrelZbinning, detector.phiBinning(phiBinning[0], phiBinning[1])]
206 for phiBinning
in pixBarrelPhiBinnings
218 pixBarrelHalfThickness,
225 pstRrange = [pixRrange[1], 220]
226 pstExtent = Extent([[Binning.r, pstRrange], [Binning.z, detZrange]])
227 pstProvider = KdtSurfacesProvider2D(passivesKdt, pstExtent)
228 pstBinning = [ProtoBinning(Binning.r, Binning.bound, pixRrange[1], 220, 1, 0)]
230 "ODD_pst", pstExtent, pstProvider, pstBinning, [], llevel
234 sstripRrange = [pstRrange[1], 720]
235 sstripZdivisions = [detZrange[0], -1250, 1250, detZrange[1]]
237 sstripNecPositionsZ = [-2950, -2550, -2200, -1850, -1550, -1300]
238 sstripNecHalfThickness = 15
240 ProtoBinning(Binning.r, Binning.bound, 230, 710, 3, 1),
241 detector.phiBinning(40, 1),
243 sstripBarrelPositionsR = [260, 360, 500, 660]
244 sstripBarrelHalfThickness = 25
245 sstripBarrelZbinning = ProtoBinning(Binning.z, Binning.bound, -1100, 1100, 21, 1)
246 sstripBarrelPhiBinnings = [[40, 1], [56, 1], [78, 1], [102, 1]]
247 sstripBarrelBinning = [
248 [sstripBarrelZbinning, detector.phiBinning(phiBinning[0], phiBinning[1])]
249 for phiBinning
in sstripBarrelPhiBinnings
258 sstripNecHalfThickness,
260 sstripBarrelPositionsR,
261 sstripBarrelHalfThickness,
269 lstripRrange = [sstripRrange[1], detRrange[1]]
270 lstripZdivisions = [detZrange[0], -1250, 1250, detZrange[1]]
272 lstripNecPositionsZ = [-3000, -2600, -2250, -1900, -1600, -1300]
273 lstripNecHalfThickness = 15
275 ProtoBinning(Binning.r, Binning.bound, 720, 1020, 2, 1),
276 detector.phiBinning(40, 1),
278 lstripBarrelPositionsR = [830, 1030]
279 lstripBarrelHalfThickness = 35
280 lstripBarrelZbinning = ProtoBinning(Binning.z, Binning.bound, -1100, 1100, 21, 1)
281 lstripBarrelPhiBinnings = [[40, 1], [56, 1]]
282 lstripBarrelBinning = [
283 [lstripBarrelZbinning, detector.phiBinning(phiBinning[0], phiBinning[1])]
284 for phiBinning
in lstripBarrelPhiBinnings
293 lstripNecHalfThickness,
295 lstripBarrelPositionsR,
296 lstripBarrelHalfThickness,
303 rootBuilder = IndexedRootVolumeFinderBuilder([Binning.z, Binning.r])
308 volumes=[bp, pix, pst, sstrip, lstrip],
311 rootbuilder=rootBuilder,
317 gigConfig = GeometryIdGenerator.Config()
318 gigConfig.overrideExistingIds =
False
319 gigConfig.resetSubCounters =
True
320 gig = GeometryIdGenerator(gigConfig,
"GeometryIdGenerator", llevel)
323 detConfig = DetectorBuilder.Config()
324 detConfig.name =
"ODD"
325 detConfig.builder = det.builder()
326 detConfig.geoIdGenerator = gig
327 detConfig.auxiliary =
"Detector[" + detConfig.name +
"]"
329 detBuilder = DetectorBuilder(detConfig, detConfig.auxiliary, llevel)
330 return detBuilder.construct(geoContext)
335 p = argparse.ArgumentParser()
340 default=
"odd-light.gdml",
341 help=
"GDML input file.",
348 help=
"Match string for sensitive surfaces",
355 help=
"Match string for passive surfaces",
357 args = p.parse_args()
361 [elements, ssurfaces, psurfaces] = acts_g4.convertSurfaces(
362 args.input, [args.sensitives], [args.passives]
364 odd_light =
get_detector(geoContext, ssurfaces, psurfaces, acts.logging.DEBUG)
367 if "__main__" == __name__: