Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-06-21 08:09:17

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