10 LayerStructureBuilder,
12 VolumeStructureBuilder,
13 DetectorVolumeBuilder,
15 CylindricalContainerBuilder,
21 """helper method to create phi binning
23 :param phiBins: number of phi bins
24 :param extraBins: number of phi bins
28 Binning.phi, Binning.closed, -math.pi, math.pi, phiBins, extraBins
40 loglevel=logging.INFO,
42 """Create a cylindrical, concentric volume builder
44 :param name: name of the volume
45 :param extent: extent of the volume
46 :param provider: surface provider for the volume
47 :param binning: binning of surfces in this volume
48 :param support: support surface description
49 :param loglevel: logging level
59 "Return the associated builder"
62 rRange = self._extent.range(acts.Binning.r)
63 zRange = self._extent.range(acts.Binning.z)
66 shapeConfig = VolumeStructureBuilder.Config()
67 shapeConfig.boundsType = VolumeBoundsType.Cylinder
68 shapeConfig.boundValues = [
71 0.5 * (zRange[1] - zRange[0]),
75 shapeConfig.transform =
Transform3([0, 0, 0.5 * (zRange[1] + zRange[0])])
76 shapeConfig.auxiliary =
"Shape[" + self.
_name +
"]"
79 volConfig = acts.DetectorVolumeBuilder.Config()
80 volConfig.name = self.
_name
81 volConfig.auxiliary =
"Volume[" + self.
_name +
"]"
82 volConfig.externalsBuilder = VolumeStructureBuilder(
83 shapeConfig, shapeConfig.auxiliary, self.
_loglevel
86 layerConfig = LayerStructureBuilder.Config()
87 layerConfig.surfacesProvider = self.
_provider
90 layerConfig.auxiliary =
"Layer[" + self.
_name +
"]"
91 volConfig.internalsBuilder = LayerStructureBuilder(
92 layerConfig, layerConfig.auxiliary, self.
_loglevel
95 return DetectorVolumeBuilder(volConfig, self.
_name, self.
_loglevel)
98 """Allows to set the name from a parent"""
102 """Return the extent of the volume in order to create gap volumes"""
117 loglevel=logging.INFO,
119 """Create a cylindrical container builder from volumes or layer definitions
121 :param name: name of the container
122 :param extent: extent of the container
123 :param volumes: list of volumes
124 :param layers: list of layers [ [extent, provider, binnings, supports], ... ]
125 :param binning: binning of surfces in this container
126 :param rootbuilder: root volume finder builder
127 :param geoidgenerator: geoid generator for setting geo ids
128 :param reversegeoids: reverse the geo id order
129 :param loglevel: logging level
143 "Return the associated builder"
144 orthogonal = Binning.r
if self.
_binning == Binning.r
else Binning.z
149 builders = [volume.builder()
for volume
in self.
_volumes]
152 bReference = self._extent.range(self.
_binning)[0]
153 oRange = self._extent.range(orthogonal)
158 bRange = layer.extent().range(self.
_binning)
160 if bReference < bRange[0]:
162 [[self.
_binning, [bReference, bRange[0]]], [orthogonal, oRange]]
166 self.
_name +
"_gap_" +
str(il), gExtent
170 layer.prependName(self.
_name)
172 builders += [layer.builder()]
174 bReference = bRange[1]
178 if bReference < self._extent.range(self.
_binning)[1]:
183 [bReference, self._extent.range(self.
_binning)[1]],
185 [orthogonal, oRange],
190 self.
_name +
"_gap_" +
str(il), gExtent
195 containerConfig = CylindricalContainerBuilder.Config()
196 containerConfig.builders = builders
197 containerConfig.binning = [self.
_binning]
198 containerConfig.rootVolumeFinderBuilder = self.
_rootbuilder
201 containerConfig.auxiliary =
"Container[" + self.
_name +
"]"
202 return CylindricalContainerBuilder(containerConfig, self.
_name, self.
_loglevel)