45 std::reference_wrapper<const GeometryContext>
geoContext;
50 using DetectorStore = std::vector<std::unique_ptr<const DetectorElementStub>>;
70 DetectorStore& detStore,
double moduleHalfXminY,
double moduleHalfXmaxY,
71 double moduleHalfY,
double moduleThickness,
double moduleTilt,
72 double ringRadius,
double ringZ,
double zStagger,
int nPhi) {
73 std::vector<const Surface*> layerSurfaces;
79 std::shared_ptr<const ISurfaceMaterial> moduleMaterialPtr =
80 std::shared_ptr<const ISurfaceMaterial>(
84 std::shared_ptr<PlanarBounds> mBounds =
nullptr;
85 if (moduleHalfXminY == moduleHalfXmaxY) {
86 mBounds = std::make_shared<RectangleBounds>(moduleHalfXminY, moduleHalfY);
88 mBounds = std::make_shared<TrapezoidBounds>(moduleHalfXminY,
89 moduleHalfXmaxY, moduleHalfY);
92 double phiStep = 2 * M_PI / nPhi;
94 for (
int im = 0; im < nPhi; ++im) {
96 double phi = -M_PI + im * phiStep;
98 Translation3(ringRadius * std::cos(phi), ringRadius * std::sin(phi),
99 ringZ + (im % 2) * zStagger) *
100 AngleAxis3(phi - 0.5 * M_PI, Vector3::UnitZ()) *
104 auto detElement = std::make_unique<const DetectorElementStub>(
105 mModuleTransform, mBounds, moduleThickness, moduleMaterialPtr);
107 layerSurfaces.push_back(&detElement->surface());
108 detStore.push_back(
std::move(detElement));
111 return layerSurfaces;
128 DetectorStore& detStore,
double moduleHalfX,
double moduleHalfY,
129 double moduleThickness,
double moduleTiltPhi,
double layerRadius,
130 double radialStagger,
double longitudinalOverlap,
131 const std::pair<int, int>& binningSchema) {
132 std::vector<const Surface*> layerSurfaces;
138 std::shared_ptr<const ISurfaceMaterial> moduleMaterialPtr =
139 std::shared_ptr<const ISurfaceMaterial>(
143 auto mBounds = std::make_shared<RectangleBounds>(moduleHalfX, moduleHalfY);
148 longitudinalOverlap, binningSchema);
150 for (
auto& mCenter : moduleCenters) {
154 Vector3 moduleLocalZ(cos(modulePhi + moduleTiltPhi),
155 sin(modulePhi + moduleTiltPhi), 0.);
157 Vector3 moduleLocalY(0., 0., 1);
159 Vector3 moduleLocalX(-sin(modulePhi + moduleTiltPhi),
160 cos(modulePhi + moduleTiltPhi), 0.);
163 moduleRotation.col(0) = moduleLocalX;
164 moduleRotation.col(1) = moduleLocalY;
165 moduleRotation.col(2) = moduleLocalZ;
167 auto mModuleTransform =
170 auto detElement = std::make_unique<const DetectorElementStub>(
171 mModuleTransform, mBounds, moduleThickness, moduleMaterialPtr);
173 layerSurfaces.push_back(&detElement->surface());
174 detStore.push_back(
std::move(detElement));
176 return layerSurfaces;
182 double radius,
double zStagger,
double moduleHalfLength,
double lOverlap,
183 const std::pair<int, int>& binningSchema) {
184 int nPhiBins = binningSchema.first;
185 int nZbins = binningSchema.second;
187 std::vector<Vector3> mPositions;
188 mPositions.reserve(nPhiBins * nZbins);
190 double phiStep = 2 * M_PI / (nPhiBins);
191 double minPhi = -M_PI + 0.5 * phiStep;
192 double zStart = -0.5 * (nZbins - 1) * (2 * moduleHalfLength - lOverlap);
193 double zStep = 2 * std::abs(zStart) / (nZbins - 1);
195 for (
size_t zBin = 0; zBin < size_t(nZbins); ++zBin) {
197 double moduleZ = zStart + zBin * zStep;
199 (zBin % 2) != 0
u ? radius - 0.5 * zStagger : radius + 0.5 * zStagger;
200 for (
size_t phiBin = 0; phiBin < size_t(nPhiBins); ++phiBin) {
202 double modulePhi = minPhi + phiBin * phiStep;
203 mPositions.push_back(
Vector3(moduleR * cos(modulePhi),
204 moduleR * sin(modulePhi), moduleZ));
212 using namespace Acts::UnitLiterals;
219 auto surfaceArrayCreator = std::make_shared<const SurfaceArrayCreator>(
224 auto layerCreator = std::make_shared<const LayerCreator>(
228 auto layerArrayCreator = std::make_shared<const LayerArrayCreator>(
233 auto tVolumeArrayCreator =
234 std::make_shared<const TrackingVolumeArrayCreator>(
240 cvhConfig.trackingVolumeArrayCreator = tVolumeArrayCreator;
241 auto cylinderVolumeHelper = std::make_shared<const CylinderVolumeHelper>(
248 bplConfig.centralLayerRadii = std::vector<double>(1, 19.);
249 bplConfig.centralLayerHalflengthZ = std::vector<double>(1, 1000.);
250 bplConfig.centralLayerThickness = std::vector<double>(1, 0.8);
251 bplConfig.centralLayerMaterial = {
252 std::make_shared<const HomogeneousSurfaceMaterial>(beamPipeMaterial)};
253 auto beamPipeBuilder = std::make_shared<const PassiveLayerBuilder>(
258 bpvConfig.volumeName =
"BeamPipe";
259 bpvConfig.layerBuilder = beamPipeBuilder;
260 bpvConfig.layerEnvelopeR = {1_mm, 1_mm};
261 bpvConfig.buildToRadiusZero =
true;
262 bpvConfig.volumeSignature = 0;
263 auto beamPipeVolumeBuilder = std::make_shared<const CylinderVolumeBuilder>(
267 auto beamPipeBounds =
268 std::make_shared<const CylinderVolumeBounds>(0., 25., 1100.);
269 auto beamPipeVolume = beamPipeVolumeBuilder->trackingVolume(
277 std::shared_ptr<const ISurfaceMaterial> layerMaterialPtr =
278 std::shared_ptr<const ISurfaceMaterial>(
281 std::vector<double> pLayerRadii = {32., 72., 116., 172.};
282 std::vector<std::pair<int, int>> pLayerBinning = {
283 {16, 14}, {32, 14}, {52, 14}, {78, 14}};
284 std::vector<double> pModuleTiltPhi = {0.145, 0.145, 0.145, 0.145};
285 std::vector<double> pModuleHalfX = {8.4, 8.4, 8.4, 8.4};
286 std::vector<double> pModuleHalfY = {36., 36., 36., 36.};
287 std::vector<double> pModuleThickness = {0.15, 0.15, 0.15, 0.15};
289 std::vector<LayerPtr> pLayers;
291 for (
size_t ilp = 0; ilp < pLayerRadii.size(); ++ilp) {
292 std::vector<const Surface*> layerSurfaces =
294 pModuleThickness[ilp], pModuleTiltPhi[ilp],
295 pLayerRadii[ilp], 2_mm, 5_mm, pLayerBinning[ilp]);
298 std::vector<std::shared_ptr<const Surface>> layerSurfacePtrs;
299 layerSurfacePtrs.reserve(layerSurfaces.size());
300 for (
auto& sf : layerSurfaces) {
301 layerSurfacePtrs.push_back(sf->getSharedPtr());
307 auto pLayer = layerCreator->cylinderLayer(
309 pLayerBinning[ilp].second, protoLayer);
310 auto approachSurfaces = pLayer->approachDescriptor()->containedSurfaces();
311 auto mutableOuterSurface =
315 pLayers.push_back(pLayer);
320 auto pLayerArray = layerArrayCreator->layerArray(
geoContext, pLayers, 25.,
323 std::make_shared<const CylinderVolumeBounds>(25., 300., 1100.);
327 nullptr, {},
"Pixel::Barrel");
330 auto detectorVolume = cylinderVolumeHelper->createContainerTrackingVolume(
334 return std::make_shared<const TrackingGeometry>(detectorVolume);