45 std::reference_wrapper<const GeometryContext>
geoContext;
49 std::reference_wrapper<const GeometryContext>
gctx)
52 using DetectorStore = std::vector<std::unique_ptr<const DetectorElementStub>>;
72 DetectorStore& detStore,
double moduleHalfXminY,
double moudleHalfXmaxY,
73 double moduleHalfY,
double moduleThickness,
double moduleTilt,
74 double ringRadius,
double ringZ,
double zStagger,
int nPhi) {
75 std::vector<const Surface*> layerSurfaces;
81 std::shared_ptr<const ISurfaceMaterial> moduleMaterialPtr =
82 std::shared_ptr<const ISurfaceMaterial>(
86 std::shared_ptr<PlanarBounds> mBounds =
nullptr;
87 if (moduleHalfXminY == moudleHalfXmaxY) {
88 mBounds = std::make_shared<RectangleBounds>(moduleHalfXminY, moduleHalfY);
90 mBounds = std::make_shared<TrapezoidBounds>(moduleHalfXminY,
91 moudleHalfXmaxY, moduleHalfY);
94 double phiStep = 2 *
M_PI / nPhi;
96 for (
int im = 0; im < nPhi; ++im) {
98 double phi = -
M_PI + im * phiStep;
101 ringZ + (im % 2) * zStagger) *
106 auto detElement = std::make_unique<const DetectorElementStub>(
107 mModuleTransform, mBounds, moduleThickness, moduleMaterialPtr);
109 layerSurfaces.push_back(&detElement->surface());
110 detStore.push_back(std::move(detElement));
113 return layerSurfaces;
130 DetectorStore& detStore,
double moduleHalfX,
double moduleHalfY,
131 double moduleThickness,
double moduleTiltPhi,
double layerRadius,
132 double radialStagger,
double longitudinalOverlap,
133 const std::pair<int, int>& binningSchema) {
134 std::vector<const Surface*> layerSurfaces;
140 std::shared_ptr<const ISurfaceMaterial> moduleMaterialPtr =
141 std::shared_ptr<const ISurfaceMaterial>(
145 auto mBounds = std::make_shared<RectangleBounds>(moduleHalfX, moduleHalfY);
150 longitudinalOverlap, binningSchema);
152 for (
auto& mCenter : moduleCenters) {
156 Vector3D moduleLocalZ(
cos(modulePhi + moduleTiltPhi),
157 sin(modulePhi + moduleTiltPhi), 0.);
161 Vector3D moduleLocalX(-sin(modulePhi + moduleTiltPhi),
162 cos(modulePhi + moduleTiltPhi), 0.);
165 moduleRotation.col(0) = moduleLocalX;
166 moduleRotation.col(1) = moduleLocalY;
167 moduleRotation.col(2) = moduleLocalZ;
169 auto mModuleTransform =
172 auto detElement = std::make_unique<const DetectorElementStub>(
173 mModuleTransform, mBounds, moduleThickness, moduleMaterialPtr);
175 layerSurfaces.push_back(&detElement->surface());
176 detStore.push_back(std::move(detElement));
178 return layerSurfaces;
184 double radius,
double zStagger,
double moduleHalfLength,
double lOverlap,
185 const std::pair<int, int>& binningSchema) {
186 int nPhiBins = binningSchema.first;
187 int nZbins = binningSchema.second;
189 std::vector<Vector3D> mPositions;
190 mPositions.reserve(nPhiBins * nZbins);
192 double phiStep = 2 *
M_PI / (nPhiBins);
194 double zStart = -0.5 * (nZbins - 1) * (2 * moduleHalfLength - lOverlap);
195 double zStep = 2 *
std::abs(zStart) / (nZbins - 1);
197 for (
size_t zBin = 0; zBin < size_t(nZbins); ++zBin) {
199 double moduleZ = zStart + zBin * zStep;
201 (zBin % 2) != 0
u ? radius - 0.5 * zStagger : radius + 0.5 * zStagger;
202 for (
size_t phiBin = 0; phiBin < size_t(nPhiBins); ++phiBin) {
204 double modulePhi = minPhi + phiBin * phiStep;
205 mPositions.push_back(
Vector3D(moduleR *
cos(modulePhi),
206 moduleR * sin(modulePhi), moduleZ));
214 using namespace Acts::UnitLiterals;
221 auto surfaceArrayCreator = std::make_shared<const SurfaceArrayCreator>(
226 auto layerCreator = std::make_shared<const LayerCreator>(
230 auto layerArrayCreator = std::make_shared<const LayerArrayCreator>(
235 auto tVolumeArrayCreator =
236 std::make_shared<const TrackingVolumeArrayCreator>(
242 cvhConfig.trackingVolumeArrayCreator = tVolumeArrayCreator;
243 auto cylinderVolumeHelper = std::make_shared<const CylinderVolumeHelper>(
250 bplConfig.centralLayerRadii = std::vector<double>(1, 19.);
251 bplConfig.centralLayerHalflengthZ = std::vector<double>(1, 1000.);
252 bplConfig.centralLayerThickness = std::vector<double>(1, 0.8);
253 bplConfig.centralLayerMaterial = {
254 std::make_shared<const HomogeneousSurfaceMaterial>(beamPipeMaterial)};
255 auto beamPipeBuilder = std::make_shared<const PassiveLayerBuilder>(
260 bpvConfig.volumeName =
"BeamPipe";
261 bpvConfig.layerBuilder = beamPipeBuilder;
262 bpvConfig.layerEnvelopeR = {1_mm, 1_mm};
263 bpvConfig.buildToRadiusZero =
true;
264 bpvConfig.volumeSignature = 0;
265 auto beamPipeVolumeBuilder = std::make_shared<const CylinderVolumeBuilder>(
269 auto beamPipeBounds =
270 std::make_shared<const CylinderVolumeBounds>(0., 25., 1100.);
271 auto beamPipeVolume = beamPipeVolumeBuilder->trackingVolume(
279 std::shared_ptr<const ISurfaceMaterial> layerMaterialPtr =
280 std::shared_ptr<const ISurfaceMaterial>(
283 std::vector<double> pLayerRadii = {32., 72., 116., 172.};
284 std::vector<std::pair<int, int>> pLayerBinning = {
285 {16, 14}, {32, 14}, {52, 14}, {78, 14}};
286 std::vector<double> pModuleTiltPhi = {0.145, 0.145, 0.145, 0.145};
287 std::vector<double> pModuleHalfX = {8.4, 8.4, 8.4, 8.4};
288 std::vector<double> pModuleHalfY = {36., 36., 36., 36.};
289 std::vector<double> pModuleThickness = {0.15, 0.15, 0.15, 0.15};
291 std::vector<LayerPtr> pLayers;
293 for (
size_t ilp = 0; ilp < pLayerRadii.size(); ++ilp) {
294 std::vector<const Surface*> layerSurfaces =
296 pModuleThickness[ilp], pModuleTiltPhi[ilp],
297 pLayerRadii[ilp], 2_mm, 5_mm, pLayerBinning[ilp]);
300 std::vector<std::shared_ptr<const Surface>> layerSurfacePtrs;
301 layerSurfacePtrs.reserve(layerSurfaces.size());
302 for (
auto& sf : layerSurfaces) {
303 layerSurfacePtrs.push_back(sf->getSharedPtr());
309 auto pLayer = layerCreator->cylinderLayer(
310 geoContext, std::move(layerSurfacePtrs), pLayerBinning[ilp].first,
311 pLayerBinning[ilp].second, protoLayer);
312 auto approachSurfaces = pLayer->approachDescriptor()->containedSurfaces();
313 auto mutableOuterSurface =
317 pLayers.push_back(pLayer);
322 auto pLayerArray = layerArrayCreator->layerArray(
geoContext, pLayers, 25.,
325 std::make_shared<const CylinderVolumeBounds>(25., 300., 1100.);
328 Transform3D::Identity(), pVolumeBounds,
nullptr, std::move(pLayerArray),
329 nullptr, {},
"Pixel::Barrel");
332 auto detectorVolume = cylinderVolumeHelper->createContainerTrackingVolume(
336 return std::make_shared<const TrackingGeometry>(detectorVolume);