Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-12-16 09:23:41

0001 // This file is part of the ACTS project.
0002 //
0003 // Copyright (C) 2016 CERN for the benefit of the ACTS project
0004 //
0005 // This Source Code Form is subject to the terms of the Mozilla Public
0006 // License, v. 2.0. If a copy of the MPL was not distributed with this
0007 // file, You can obtain one at https://mozilla.org/MPL/2.0/.
0008 
0009 #include "./GenericDetectorBuilder.hpp"
0010 
0011 #include "Acts/Definitions/Units.hpp"
0012 #include "Acts/Material/HomogeneousSurfaceMaterial.hpp"
0013 #include "Acts/Material/Material.hpp"
0014 #include "Acts/Material/ProtoSurfaceMaterial.hpp"
0015 #include "ActsExamples/GenericDetector/ProtoLayerCreator.hpp"
0016 
0017 #include <memory>
0018 
0019 using namespace Acts::UnitLiterals;
0020 
0021 namespace ActsExamples::Generic {
0022 
0023 namespace {
0024 
0025 /// Helper method for positioning
0026 /// @param radius is the cylinder radius
0027 /// @param zStagger is the radial staggering along z
0028 /// @param moduleHalfLength is the module length (longitudinal)
0029 /// @param lOverlap is the overlap of the modules (longitudinal)
0030 /// @binningSchema is the way the bins are laid out rphi x z
0031 std::vector<Acts::Vector3> modulePositionsCylinder(
0032     double radius, double zStagger, double moduleHalfLength, double lOverlap,
0033     const std::pair<int, int>& binningSchema) {
0034   int nPhiBins = binningSchema.first;
0035   int nZbins = binningSchema.second;
0036   // prepare the return value
0037   std::vector<Acts::Vector3> mPositions;
0038   mPositions.reserve(nPhiBins * nZbins);
0039   // prep work
0040   double phiStep = 2 * std::numbers::pi / nPhiBins;
0041   double minPhi = -std::numbers::pi + 0.5 * phiStep;
0042   double zStart = -0.5 * (nZbins - 1) * (2 * moduleHalfLength - lOverlap);
0043   double zStep = 2 * std::abs(zStart) / (nZbins - 1);
0044   // loop over the bins
0045   for (std::size_t zBin = 0; zBin < static_cast<std::size_t>(nZbins); ++zBin) {
0046     // prepare z and r
0047     double moduleZ = zStart + static_cast<double>(zBin) * zStep;
0048     double moduleR =
0049         (zBin % 2) != 0u ? radius - 0.5 * zStagger : radius + 0.5 * zStagger;
0050     for (std::size_t phiBin = 0; phiBin < static_cast<std::size_t>(nPhiBins);
0051          ++phiBin) {
0052       // calculate the current phi value
0053       double modulePhi = minPhi + phiBin * phiStep;
0054       mPositions.push_back(Acts::Vector3(moduleR * std::cos(modulePhi),
0055                                          moduleR * std::sin(modulePhi),
0056                                          moduleZ));
0057     }
0058   }
0059   return mPositions;
0060 }
0061 
0062 /// Helper method for positioning
0063 /// @param z is the z position of the ring
0064 /// @param radius is the ring radius
0065 /// @param phiStagger is the radial staggering along phi
0066 /// @param lOverlap is the overlap of the modules
0067 /// @param nPhiBins is the number of bins in phi
0068 std::vector<Acts::Vector3> modulePositionsRing(double z, double radius,
0069                                                double phiStagger,
0070                                                double phiSubStagger,
0071                                                int nPhiBins) {
0072   // create and fill the positions
0073   std::vector<Acts::Vector3> rPositions;
0074   rPositions.reserve(nPhiBins);
0075   // prep work
0076   double phiStep = 2 * std::numbers::pi / nPhiBins;
0077   double minPhi = -std::numbers::pi + 0.5 * phiStep;
0078   // phi loop
0079   for (std::size_t iphi = 0; iphi < static_cast<std::size_t>(nPhiBins);
0080        ++iphi) {
0081     // if we have a phi sub stagger presents
0082     double rzs = 0.;
0083     // phi stagger affects 0 vs 1, 2 vs 3 ... etc
0084     // -> only works if it is a %4
0085     // phi sub stagger affects 2 vs 4, 1 vs 3 etc.
0086     if (phiSubStagger != 0. && ((nPhiBins % 4) == 0)) {
0087       // switch sides
0088       if ((iphi % 4) == 0u) {
0089         rzs = phiSubStagger;
0090       } else if (((iphi + 1) % 4) == 0u) {
0091         rzs = -phiSubStagger;
0092       }
0093     }
0094     // the module phi
0095     double phi = minPhi + static_cast<double>(iphi) * phiStep;
0096     // main z position depending on phi bin
0097     double rz = (iphi % 2) != 0u ? z - 0.5 * phiStagger : z + 0.5 * phiStagger;
0098     rPositions.push_back(Acts::Vector3(radius * std::cos(phi),
0099                                        radius * std::sin(phi), rz + rzs));
0100   }
0101   return rPositions;
0102 }
0103 
0104 /// Helper method for positioning
0105 /// @param z is the nominal z posiiton of the dis
0106 /// @param ringStagger is the staggering of the different rings
0107 /// @param phiStagger is the staggering on a ring in phi : it is even/odd
0108 /// @param phiSubStagger is the sub staggering on a ring in phi : it affects
0109 /// 0/4/8 and 3/6
0110 /// @param innerRadius is the inner Radius for the disc
0111 /// @param outerRadius is the outer Radius for the disc
0112 /// @param discBinning is the binning setup in r, phi
0113 /// @param moduleHalfLength is pair of phibins and module length
0114 std::vector<std::vector<Acts::Vector3>> modulePositionsDisc(
0115     double z, double ringStagger, std::vector<double> phiStagger,
0116     std::vector<double> phiSubStagger, double innerRadius, double outerRadius,
0117     const std::vector<std::size_t>& discBinning,
0118     const std::vector<double>& moduleHalfLength) {
0119   // calculate the radii
0120   std::vector<double> radii;
0121   // the radial span of the disc
0122   double deltaR = outerRadius - innerRadius;
0123   // quick exits
0124   if (discBinning.size() == 1) {
0125     radii.push_back(0.5 * (innerRadius + outerRadius));
0126   } else {
0127     double totalLength = 0;
0128     // sum up the total length
0129     for (auto& mhlength : moduleHalfLength) {
0130       totalLength += 2 * mhlength;
0131     }
0132     // now calculate the overlap (equal pay)
0133     double rOverlap = (totalLength - deltaR) /
0134                       static_cast<double>(moduleHalfLength.size() - 1);
0135     // and now fill the radii and gaps
0136     double lastR = innerRadius;
0137     double lastHl = 0.;
0138     double lastOl = 0.;
0139     // now calculate
0140     for (auto& mhlength : moduleHalfLength) {
0141       // calculate the radius
0142       radii.push_back(lastR + lastHl - lastOl + mhlength);
0143       lastR = radii[radii.size() - 1];
0144       lastOl = rOverlap;
0145       lastHl = mhlength;
0146     }
0147   }
0148   // now prepare the return method
0149   std::vector<std::vector<Acts::Vector3>> mPositions;
0150   for (std::size_t ir = 0; ir < radii.size(); ++ir) {
0151     // generate the z value
0152     // convention inner ring is closer to origin : makes sense
0153     double stagger =
0154         (ir % 2) != 0u ? z + 0.5 * ringStagger : z - 0.5 * ringStagger;
0155     double rz = radii.size() == 1 ? z : stagger;
0156     // fill the ring positions
0157     double psStagger = phiSubStagger.empty() ? 0. : phiSubStagger[ir];
0158     mPositions.push_back(modulePositionsRing(rz, radii[ir], phiStagger[ir],
0159                                              psStagger, discBinning[ir]));
0160   }
0161   return mPositions;
0162 }
0163 
0164 }  // namespace
0165 
0166 GenericDetectorBuilder::GenericDetectorBuilder(
0167     const Config& cfg, std::unique_ptr<const Acts::Logger> logger)
0168     : m_cfg(cfg), m_logger(std::move(logger)) {
0169   // Prepare the proto material - in case it's designed to do so
0170   // - cylindrical
0171   Acts::BinUtility pCylinderUtility(10, -1, 1, Acts::closed,
0172                                     Acts::AxisDirection::AxisPhi);
0173   pCylinderUtility +=
0174       Acts::BinUtility(10, -1, 1, Acts::open, Acts::AxisDirection::AxisZ);
0175   auto pCylinderMaterial =
0176       std::make_shared<const Acts::ProtoSurfaceMaterial>(pCylinderUtility);
0177   // - disc
0178   Acts::BinUtility pDiscUtility(10, 0, 1, Acts::open,
0179                                 Acts::AxisDirection::AxisR);
0180   pDiscUtility +=
0181       Acts::BinUtility(10, -1, 1, Acts::closed, Acts::AxisDirection::AxisPhi);
0182   auto pDiscMaterial =
0183       std::make_shared<const Acts::ProtoSurfaceMaterial>(pDiscUtility);
0184   // - plane
0185   Acts::BinUtility pPlaneUtility(1, -1, 1, Acts::open,
0186                                  Acts::AxisDirection::AxisX);
0187   auto pPlaneMaterial =
0188       std::make_shared<const Acts::ProtoSurfaceMaterial>(pPlaneUtility);
0189 
0190   ///
0191   /// BeamPipe material
0192   ///
0193   const auto beryllium = Acts::Material::fromMassDensity(
0194       static_cast<float>(352.8_mm), static_cast<float>(407_mm), 9.012f, 4.0,
0195       static_cast<float>(1.848_g / 1_cm3));
0196   m_beamPipeMaterial = std::make_shared<const Acts::HomogeneousSurfaceMaterial>(
0197       Acts::MaterialSlab(beryllium, static_cast<float>(0.8_mm)));
0198   if (m_cfg.protoMaterial) {
0199     m_beamPipeMaterial = pCylinderMaterial;
0200   }
0201 
0202   ///
0203   /// PIXEL MATERIAL
0204   ///
0205 
0206   Acts::MaterialSlab pcModuleMaterial(kSiliconMaterial, kPixelCentralModuleT);
0207   Acts::MaterialSlab peModuleMaterial(kSiliconMaterial, kPixelEndcapModuleT);
0208   // Layer material properties - thickness, X0, L0, A, Z, Rho
0209   Acts::MaterialSlab pcmbProperties(kSiliconMaterial,
0210                                     static_cast<float>(1.5_mm));
0211   Acts::MaterialSlab pcmecProperties(kSiliconMaterial,
0212                                      static_cast<float>(1.5_mm));
0213 
0214   // Module, central and disc material
0215   m_pixelCentralMaterial =
0216       std::make_shared<const Acts::HomogeneousSurfaceMaterial>(pcmbProperties);
0217   m_pixelEndcapMaterial =
0218       std::make_shared<const Acts::HomogeneousSurfaceMaterial>(pcmecProperties);
0219   m_pixelCentralModuleMaterial =
0220       std::make_shared<const Acts::HomogeneousSurfaceMaterial>(
0221           pcModuleMaterial);
0222   m_pixelEndcapModuleMaterial =
0223       std::make_shared<const Acts::HomogeneousSurfaceMaterial>(
0224           peModuleMaterial);
0225   if (m_cfg.protoMaterial) {
0226     m_pixelCentralMaterial = pCylinderMaterial;
0227     m_pixelCentralModuleMaterial = pPlaneMaterial;
0228     m_pixelEndcapMaterial = pDiscMaterial;
0229     m_pixelEndcapModuleMaterial = pPlaneMaterial;
0230   }
0231 
0232   ///
0233   /// PST MATERIAL
0234   ///
0235 
0236   m_pstMaterial = std::make_shared<const Acts::HomogeneousSurfaceMaterial>(
0237       Acts::MaterialSlab(beryllium, static_cast<float>(1.8_mm)));
0238   if (m_cfg.protoMaterial) {
0239     m_pstMaterial = pCylinderMaterial;
0240   }
0241 
0242   ///
0243   /// SHORT STRIP MATERIAL
0244   ///
0245 
0246   // Module material properties - X0, L0, A, Z, Rho
0247   // Acts::Material sscMaterial(95.7, 465.2, 28.03, 14., 2.32e-3);
0248   Acts::MaterialSlab sscModuleMaterial(kSiliconMaterial,
0249                                        kShortStripCentralModuleT);
0250   Acts::MaterialSlab sseModuleMaterial(kSiliconMaterial,
0251                                        kShortStripEndcapModuleT);
0252 
0253   // Layer material properties - thickness, X0, L0, A, Z, Rho
0254   Acts::MaterialSlab ssbmProperties(kSiliconMaterial, 2_mm);
0255   Acts::MaterialSlab ssecmProperties(kSiliconMaterial, 2.5_mm);
0256 
0257   // Module, central and disc material
0258   m_shortStripCentralMaterial =
0259       std::make_shared<const Acts::HomogeneousSurfaceMaterial>(ssbmProperties);
0260   m_shortStripEndcapMaterial =
0261       std::make_shared<const Acts::HomogeneousSurfaceMaterial>(ssecmProperties);
0262   m_shortStripCentralModuleMaterial =
0263       std::make_shared<const Acts::HomogeneousSurfaceMaterial>(
0264           sscModuleMaterial);
0265   m_shortStripEndcapModuleMaterial =
0266       std::make_shared<const Acts::HomogeneousSurfaceMaterial>(
0267           sseModuleMaterial);
0268   if (m_cfg.protoMaterial) {
0269     m_shortStripCentralMaterial = pCylinderMaterial;
0270     m_shortStripCentralModuleMaterial = pPlaneMaterial;
0271     m_shortStripEndcapMaterial = pDiscMaterial;
0272     m_shortStripEndcapModuleMaterial = pPlaneMaterial;
0273   }
0274 
0275   ///
0276   /// LONG STRIP MATERIAL
0277   ///
0278 
0279   // Module material properties - X0, L0, A, Z, Rho
0280   // Acts::Material lsMaterial(95.7, 465.2, 28.03, 14., 2.32e-3);
0281   Acts::MaterialSlab lscModuleMaterial(kSiliconMaterial,
0282                                        kLongStripCentralModuleT);
0283   Acts::MaterialSlab lseModuleMaterial(kSiliconMaterial,
0284                                        kLongStripEndcapModuleT);
0285 
0286   // Layer material properties - thickness, X0, L0, A, Z, Rho - barrel
0287   Acts::MaterialSlab lsbmProperties(kSiliconMaterial, 2.5_mm);
0288   Acts::MaterialSlab lsecmProperties(kSiliconMaterial, 3.5_mm);
0289 
0290   // Module, central and disc material
0291   m_longStripCentralMaterial =
0292       std::make_shared<const Acts::HomogeneousSurfaceMaterial>(lsbmProperties);
0293   m_longStripEndcapMaterial =
0294       std::make_shared<const Acts::HomogeneousSurfaceMaterial>(lsecmProperties);
0295   m_longStripCentralModuleMaterial =
0296       std::make_shared<const Acts::HomogeneousSurfaceMaterial>(
0297           lscModuleMaterial);
0298   m_longStripEndcapModuleMaterial =
0299       std::make_shared<const Acts::HomogeneousSurfaceMaterial>(
0300           lseModuleMaterial);
0301   if (m_cfg.protoMaterial) {
0302     m_longStripCentralMaterial = pCylinderMaterial;
0303     m_longStripCentralModuleMaterial = pPlaneMaterial;
0304     m_longStripEndcapMaterial = pDiscMaterial;
0305     m_longStripEndcapModuleMaterial = pPlaneMaterial;
0306   }
0307 }
0308 
0309 const Acts::Material GenericDetectorBuilder::kSiliconMaterial =
0310     Acts::Material::fromMassDensity(static_cast<float>(95.7_mm),
0311                                     static_cast<float>(465.2_mm), 28.03f, 14.f,
0312                                     static_cast<float>(2.32e-3_g / 1_cm3));
0313 
0314 ProtoLayerCreator GenericDetectorBuilder::createPixelProtoLayerCreator() {
0315   // envelope for layers
0316   std::pair<double, double> pcEnvelope(2., 2.);
0317 
0318   // configure the pixel proto layer builder
0319   ProtoLayerCreator::Config pplConfig;
0320   pplConfig.detectorElementFactory = m_cfg.detectorElementFactory;
0321 
0322   // standard, an approach envelope
0323   pplConfig.approachSurfaceEnvelope = 1.;
0324   // BARREL :
0325   // 4 pixel layers
0326   // configure the central barrel
0327   pplConfig.centralLayerBinMultipliers = {1, 1};
0328   pplConfig.centralLayerRadii = {32., 72., 116., 172.};
0329   pplConfig.centralLayerEnvelopes = {pcEnvelope, pcEnvelope, pcEnvelope,
0330                                      pcEnvelope};
0331   pplConfig.centralModuleBinningSchema = {
0332       {16, 14}, {32, 14}, {52, 14}, {78, 14}};
0333   pplConfig.centralModuleTiltPhi = {0.14, 0.14, 0.14, 0.14};
0334   pplConfig.centralModuleHalfX = {8.4, 8.4, 8.4, 8.4};
0335   pplConfig.centralModuleHalfY = {36., 36., 36., 36.};
0336   pplConfig.centralModuleThickness = {
0337       kPixelCentralModuleT, kPixelCentralModuleT, kPixelCentralModuleT,
0338       kPixelCentralModuleT};
0339   pplConfig.centralModuleMaterial = {
0340       m_pixelCentralModuleMaterial, m_pixelCentralModuleMaterial,
0341       m_pixelCentralModuleMaterial, m_pixelCentralModuleMaterial};
0342 
0343   // no frontside/backside
0344   pplConfig.centralModuleFrontsideStereo = {};
0345   pplConfig.centralModuleBacksideStereo = {};
0346   pplConfig.centralModuleBacksideGap = {};
0347   // mPositions
0348   std::vector<std::vector<Acts::Vector3>> pplCentralModulePositions;
0349   for (std::size_t plb = 0; plb < pplConfig.centralLayerRadii.size(); ++plb) {
0350     // call the helper function
0351     pplCentralModulePositions.push_back(
0352         modulePositionsCylinder(pplConfig.centralLayerRadii[plb],
0353                                 0.5,  // 1 mm stagger
0354                                 pplConfig.centralModuleHalfY[plb],
0355                                 2.,  // 4 mm module overlap in z
0356                                 pplConfig.centralModuleBinningSchema[plb]));
0357   }
0358   pplConfig.centralModulePositions = pplCentralModulePositions;
0359   // ENDCAP :
0360   // 7 pixel layers each side
0361   // configure the endcaps
0362   pplConfig.posnegLayerBinMultipliers = {1, 1};
0363 
0364   pplConfig.posnegLayerPositionsZ = {
0365       600. * Acts::UnitConstants::mm, 700. * Acts::UnitConstants::mm,
0366       820. * Acts::UnitConstants::mm, 960. * Acts::UnitConstants::mm,
0367       1100 * Acts::UnitConstants::mm, 1300 * Acts::UnitConstants::mm,
0368       1500 * Acts::UnitConstants::mm};
0369 
0370   pplConfig.posnegLayerEnvelopeR = {
0371       1. * Acts::UnitConstants::mm, 1. * Acts::UnitConstants::mm,
0372       1. * Acts::UnitConstants::mm, 1. * Acts::UnitConstants::mm,
0373       1. * Acts::UnitConstants::mm, 1. * Acts::UnitConstants::mm,
0374       1. * Acts::UnitConstants::mm};
0375   std::vector<double> perHX = {8.4, 8.4};     // half length x
0376   std::vector<double> perHY = {36., 36.};     // half length y
0377   std::vector<std::size_t> perBP = {40, 68};  // bins in phi
0378   std::vector<double> perT = {kPixelEndcapModuleT,
0379                               kPixelEndcapModuleT};  // module thickness
0380   std::vector<std::size_t> perBX = {336, 336};       // bins in x
0381   std::vector<std::size_t> perBY = {1280, 1280};     // bins in y
0382   std::vector<int> perRS = {-1, -1};                 // readout side
0383   std::vector<double> perLA = {0., 0.};              // lorentz angle
0384   std::vector<std::shared_ptr<const Acts::ISurfaceMaterial>> perM = {
0385       m_pixelEndcapModuleMaterial, m_pixelEndcapModuleMaterial};  // material
0386 
0387   pplConfig.posnegModuleMinHalfX = std::vector<std::vector<double>>(7, perHX);
0388   pplConfig.posnegModuleMaxHalfX = {};
0389   pplConfig.posnegModuleHalfY = std::vector<std::vector<double>>(7, perHY);
0390   pplConfig.posnegModulePhiBins =
0391       std::vector<std::vector<std::size_t>>(7, perBP);
0392   pplConfig.posnegModuleThickness = std::vector<std::vector<double>>(7, perT);
0393   pplConfig.posnegModuleMaterial =
0394       std::vector<std::vector<std::shared_ptr<const Acts::ISurfaceMaterial>>>(
0395           7, perM);
0396 
0397   // no frontside/backside
0398   pplConfig.posnegModuleFrontsideStereo = {};
0399   pplConfig.posnegModuleBacksideStereo = {};
0400   pplConfig.posnegModuleBacksideGap = {};
0401   // mPositions
0402   std::vector<std::vector<std::vector<Acts::Vector3>>> pplPosnegModulePositions;
0403   for (std::size_t id = 0; id < pplConfig.posnegLayerPositionsZ.size(); ++id) {
0404     pplPosnegModulePositions.push_back(modulePositionsDisc(
0405         pplConfig.posnegLayerPositionsZ[id], 0.0, {4.0, 4.0}, {0.5, 0.}, 30.,
0406         176., pplConfig.posnegModulePhiBins[id],
0407         pplConfig.posnegModuleHalfY[id]));
0408   }
0409   pplConfig.posnegModulePositions = pplPosnegModulePositions;
0410 
0411   /// The ProtoLayer creator
0412   ProtoLayerCreator pplCreator(pplConfig,
0413                                logger().clone("PPLCrtr", m_cfg.layerLogLevel));
0414 
0415   return pplCreator;
0416 }
0417 
0418 ProtoLayerCreator GenericDetectorBuilder::createShortStripProtoLayerCreator() {
0419   // envelope double
0420   std::pair<double, double> ssEnvelope(2., 2.);
0421 
0422   // ----------------------------------------------------------------------------
0423   // Configure the short strip proto layer builder
0424   ProtoLayerCreator::Config ssplConfig;
0425   ssplConfig.detectorElementFactory = m_cfg.detectorElementFactory;
0426 
0427   // configure the central barrel
0428   ssplConfig.centralLayerBinMultipliers = {1, 1};
0429   ssplConfig.centralLayerRadii = {260., 360., 500., 660.};
0430   ssplConfig.centralLayerEnvelopes = {ssEnvelope, ssEnvelope, ssEnvelope,
0431                                       ssEnvelope};
0432 
0433   ssplConfig.centralModuleBinningSchema = {
0434       {40, 21}, {56, 21}, {78, 21}, {102, 21}};
0435   ssplConfig.centralModuleTiltPhi = {-0.15, -0.15, -0.15, -0.15};
0436   ssplConfig.centralModuleHalfX = {24., 24., 24., 24.};
0437   ssplConfig.centralModuleHalfY = {54., 54., 54., 54.};
0438   ssplConfig.centralModuleThickness = {
0439       kShortStripCentralModuleT, kShortStripCentralModuleT,
0440       kShortStripCentralModuleT, kShortStripCentralModuleT};
0441 
0442   ssplConfig.centralModuleMaterial = {
0443       m_shortStripCentralModuleMaterial, m_shortStripCentralModuleMaterial,
0444       m_shortStripCentralModuleMaterial, m_shortStripCentralModuleMaterial};
0445   ssplConfig.centralModuleFrontsideStereo = {};
0446   ssplConfig.centralModuleBacksideStereo = {};
0447   ssplConfig.centralModuleBacksideGap = {};
0448   // mPositions
0449   std::vector<std::vector<Acts::Vector3>> ssplCentralModulePositions;
0450   for (std::size_t sslb = 0; sslb < ssplConfig.centralLayerRadii.size();
0451        ++sslb) {
0452     // call the helper function
0453     ssplCentralModulePositions.push_back(
0454         modulePositionsCylinder(ssplConfig.centralLayerRadii[sslb],
0455                                 3.,  // 3 mm stagger
0456                                 ssplConfig.centralModuleHalfY[sslb],
0457                                 5.,  // 5 mm module overlap
0458                                 ssplConfig.centralModuleBinningSchema[sslb]));
0459   }
0460   ssplConfig.centralModulePositions = ssplCentralModulePositions;
0461 
0462   // configure the endcaps
0463   std::vector<double> mrMinHx = {16.4, 24.2, 32.2};
0464   std::vector<double> mrMaxHx = {24.2, 32.2, 40.0};
0465   std::vector<double> mrHy = {78., 78., 78.};
0466 
0467   std::vector<std::size_t> mPhiBins = {54, 56, 60};
0468   std::vector<double> mThickness = {kShortStripEndcapModuleT,
0469                                     kShortStripEndcapModuleT,
0470                                     kShortStripEndcapModuleT};
0471   std::vector<std::shared_ptr<const Acts::ISurfaceMaterial>> mMaterial = {
0472       m_shortStripEndcapModuleMaterial, m_shortStripEndcapModuleMaterial,
0473       m_shortStripEndcapModuleMaterial};
0474 
0475   ssplConfig.posnegLayerBinMultipliers = {1, 2};
0476 
0477   ssplConfig.posnegLayerPositionsZ = {1220., 1500., 1800., 2150., 2550., 2950.};
0478   std::size_t nposnegs = ssplConfig.posnegLayerPositionsZ.size();
0479   ssplConfig.posnegLayerEnvelopeR = std::vector<double>(nposnegs, 5.);
0480 
0481   ssplConfig.posnegModuleMinHalfX =
0482       std::vector<std::vector<double>>(nposnegs, mrMinHx);
0483   ssplConfig.posnegModuleMaxHalfX =
0484       std::vector<std::vector<double>>(nposnegs, mrMaxHx);
0485   ssplConfig.posnegModuleHalfY =
0486       std::vector<std::vector<double>>(nposnegs, mrHy);
0487   ssplConfig.posnegModulePhiBins =
0488       std::vector<std::vector<std::size_t>>(nposnegs, mPhiBins);
0489   ssplConfig.posnegModuleThickness =
0490       std::vector<std::vector<double>>(nposnegs, mThickness);
0491 
0492   ssplConfig.posnegModuleMaterial =
0493       std::vector<std::vector<std::shared_ptr<const Acts::ISurfaceMaterial>>>(
0494           nposnegs, mMaterial);
0495 
0496   ssplConfig.posnegModuleFrontsideStereo = {};
0497   ssplConfig.posnegModuleBacksideStereo = {};
0498   ssplConfig.posnegModuleBacksideGap = {};
0499 
0500   // mPositions
0501   std::vector<std::vector<std::vector<Acts::Vector3>>>
0502       ssplPosnegModulePositions;
0503   for (std::size_t id = 0; id < ssplConfig.posnegLayerPositionsZ.size(); ++id) {
0504     ssplPosnegModulePositions.push_back(modulePositionsDisc(
0505         ssplConfig.posnegLayerPositionsZ[id], 6.0, {3., 3., 3.}, {0., 0., 0.},
0506         240., 700., ssplConfig.posnegModulePhiBins[id],
0507         ssplConfig.posnegModuleHalfY[id]));
0508   }
0509   ssplConfig.posnegModulePositions = ssplPosnegModulePositions;
0510 
0511   // The ProtoLayer creator
0512   ProtoLayerCreator ssplCreator(
0513       ssplConfig, logger().clone("SSPLCrtr", m_cfg.layerLogLevel));
0514 
0515   return ssplCreator;
0516 }
0517 
0518 ProtoLayerCreator GenericDetectorBuilder::createLongStripProtoLayerCreator() {
0519   // envelope double
0520   std::pair<double, double> lsEnvelope(2., 2.);
0521 
0522   // The proto layer creator
0523   ProtoLayerCreator::Config lsplConfig;
0524   lsplConfig.detectorElementFactory = m_cfg.detectorElementFactory;
0525 
0526   // configure the central barrel
0527   lsplConfig.centralLayerBinMultipliers = {1, 1};
0528   lsplConfig.centralLayerRadii = {820., 1020.};
0529   lsplConfig.centralLayerEnvelopes = {lsEnvelope, lsEnvelope};
0530 
0531   lsplConfig.centralModuleBinningSchema = {{120, 21}, {152, 21}};
0532   lsplConfig.centralModuleTiltPhi = {-0.15, -0.15};
0533   lsplConfig.centralModuleHalfX = {24., 24.};
0534   lsplConfig.centralModuleHalfY = {54., 54.};
0535   lsplConfig.centralModuleThickness = {kLongStripCentralModuleT,
0536                                        kLongStripCentralModuleT};
0537   lsplConfig.centralModuleMaterial = {m_longStripCentralModuleMaterial,
0538                                       m_longStripCentralModuleMaterial};
0539 
0540   lsplConfig.centralModuleFrontsideStereo = {};
0541   lsplConfig.centralModuleBacksideStereo = {};
0542   lsplConfig.centralModuleBacksideGap = {};
0543   // mPositions
0544   std::vector<std::vector<Acts::Vector3>> lslbCentralModulePositions;
0545   for (std::size_t lslb = 0; lslb < lsplConfig.centralLayerRadii.size();
0546        ++lslb) {
0547     // call the helper function
0548     lslbCentralModulePositions.push_back(
0549         modulePositionsCylinder(lsplConfig.centralLayerRadii[lslb],
0550                                 3.,  // 3 mm stagger
0551                                 lsplConfig.centralModuleHalfY[lslb],
0552                                 5.,  // 5 mm module overlap
0553                                 lsplConfig.centralModuleBinningSchema[lslb]));
0554   }
0555 
0556   lsplConfig.centralModulePositions = lslbCentralModulePositions;
0557   // configure the endcaps
0558   std::vector<double> mrMinHx = {54., 66.};
0559   std::vector<double> mrMaxHx = {64.2, 72.};
0560   std::vector<double> mrHy = {78., 78.};
0561   std::vector<std::size_t> mPhiBins = {48, 50};
0562   std::vector<double> mThickness = {kLongStripEndcapModuleT,
0563                                     kLongStripEndcapModuleT};
0564   std::vector<std::shared_ptr<const Acts::ISurfaceMaterial>> mMaterial = {
0565       m_longStripEndcapModuleMaterial, m_longStripEndcapModuleMaterial};
0566 
0567   // endcap
0568   lsplConfig.posnegLayerBinMultipliers = {1, 2};
0569   lsplConfig.posnegLayerPositionsZ = {1220., 1500., 1800., 2150., 2550., 2950.};
0570   std::size_t nposnegs = lsplConfig.posnegLayerPositionsZ.size();
0571   lsplConfig.posnegLayerEnvelopeR = std::vector<double>(nposnegs, 5.);
0572 
0573   lsplConfig.posnegModuleMinHalfX =
0574       std::vector<std::vector<double>>(nposnegs, mrMinHx);
0575   lsplConfig.posnegModuleMaxHalfX =
0576       std::vector<std::vector<double>>(nposnegs, mrMaxHx);
0577   lsplConfig.posnegModuleHalfY =
0578       std::vector<std::vector<double>>(nposnegs, mrHy);
0579   lsplConfig.posnegModulePhiBins =
0580       std::vector<std::vector<std::size_t>>(nposnegs, mPhiBins);
0581   lsplConfig.posnegModuleThickness =
0582       std::vector<std::vector<double>>(nposnegs, mThickness);
0583 
0584   lsplConfig.posnegModuleMaterial =
0585       std::vector<std::vector<std::shared_ptr<const Acts::ISurfaceMaterial>>>(
0586           nposnegs, mMaterial);
0587   lsplConfig.posnegModuleFrontsideStereo = {};
0588   lsplConfig.posnegModuleBacksideStereo = {};
0589   lsplConfig.posnegModuleBacksideGap = {};
0590 
0591   // mPositions
0592   std::vector<std::vector<std::vector<Acts::Vector3>>>
0593       lssbPosnegModulePositions;
0594   for (std::size_t id = 0; id < lsplConfig.posnegLayerPositionsZ.size(); ++id) {
0595     lssbPosnegModulePositions.push_back(modulePositionsDisc(
0596         lsplConfig.posnegLayerPositionsZ[id],
0597         8.0,  // staggering of rings, we put the disk structure in between
0598         {3., 3.}, {0., 0.}, 750., 1020., lsplConfig.posnegModulePhiBins[id],
0599         lsplConfig.posnegModuleHalfY[id]));
0600   }
0601   lsplConfig.posnegModulePositions = lssbPosnegModulePositions;
0602 
0603   // The ProtoLayer creator
0604   ProtoLayerCreator lsplCreator(
0605       lsplConfig, logger().clone("LSPLCrtr", m_cfg.layerLogLevel));
0606 
0607   return lsplCreator;
0608 }
0609 
0610 }  // namespace ActsExamples::Generic