9 #include "Identifier/Identifier.h"
16 #include "Acts/Geometry/ILayerBuilder.hpp"
17 #include "Acts/Surfaces/CylinderSurface.hpp"
18 #include "Acts/Surfaces/StrawSurface.hpp"
19 #include "Acts/Surfaces/DiscSurface.hpp"
20 #include "Acts/Geometry/LayerCreator.hpp"
21 #include "Acts/Definitions/Algebra.hpp"
22 #include "Acts/Geometry/ProtoLayer.hpp"
23 #include "Acts/Geometry/GeometryContext.hpp"
24 #include "Acts/Definitions/Units.hpp"
25 #include "Acts/Utilities/BinningType.hpp"
31 using namespace Acts::UnitLiterals;
33 const Acts::LayerVector
36 return endcapLayers(gctx, -1);
39 const Acts::LayerVector
42 return endcapLayers(gctx, 1);
47 const Acts::LayerVector
50 ACTS_VERBOSE(
"Building central Straw layers");
52 using LBBV = Acts::LineBounds::BoundValues;
59 ACTS_VERBOSE(
"- Numerology reports: - " << nBarrelRings <<
" barrel rings");
60 ACTS_VERBOSE(
" - " << nBarrelPhiSectors <<
" barrel phi sectors");
64 std::vector<Acts::ProtoLayer> protoLayers;
66 for(
size_t iring=0; iring < nBarrelRings;iring++) {
67 ACTS_VERBOSE(
"- Collecting elements for ring " << iring);
71 auto&
ext = pl.extent;
84 std::vector<std::shared_ptr<const Acts::Surface>> layerSurfaces;
87 ACTS_VERBOSE(
" - Numerology reports: " << nBarrelLayers <<
" layers in ring " << iring);
88 for (
size_t ilayer=0;ilayer < nBarrelLayers;ilayer++) {
89 for (
size_t iphisec=0;iphisec < nBarrelPhiSectors;iphisec++) {
91 for (
size_t iposneg=0;iposneg<2;iposneg++) {
94 = m_cfg.mng->getBarrelElement(iposneg, iring, iphisec, ilayer);
96 unsigned int nStraws = brlElem->
nStraws();
98 for(
unsigned int istraw=0;istraw<nStraws;istraw++) {
102 trf.translation() *= 1_mm;
104 Identifier straw_id = m_cfg.idHelper->straw_id(
code.isPosZ() == 1 ? 1 : -1,
106 code.getModuleIndex(),
107 code.getStrawLayerIndex(),
110 auto elem = std::make_shared<const ActsDetectorElement>(
111 trf, *brlElem, straw_id);
113 m_cfg.elementStore->push_back(elem);
115 auto straw =
dynamic_cast<const Acts::StrawSurface*
>(&elem->surface());
116 if (not
straw)
continue;
117 auto strawBounds =
dynamic_cast<const Acts::LineBounds*
>(&
straw->bounds());
118 if (not strawBounds)
continue;
120 double radius = strawBounds->get(LBBV::eR);
121 double length = strawBounds->get(LBBV::eHalfLengthZ);
125 Acts::Vector3
ctr =
straw->center(gctx);
131 layerSurfaces.push_back(
straw->getSharedPtr());
137 ACTS_VERBOSE(
" - Collected " << layerSurfaces.size() <<
" straws");
141 const Acts::ProtoLayer &prev = protoLayers.at(iring-1);
145 std::shared_ptr<Acts::Layer>
layer
146 = m_cfg.layerCreator->cylinderLayer(gctx, std::move(layerSurfaces), 100, 1, pl);
149 protoLayers.push_back(pl);
156 const Acts::LayerVector
159 ACTS_VERBOSE(
"Building endcap Straw layers");
160 using LBBV = Acts::LineBounds::BoundValues;
166 ACTS_VERBOSE(
"- Numerology reports: - " << nEndcapWheels<<
" endcap wheels");
167 ACTS_VERBOSE(
" - " << nEndcapPhiSectors <<
" endcap phi sectors");
171 for(
size_t iwheel=0;iwheel<nEndcapWheels;++iwheel) {
172 ACTS_VERBOSE(
"- Collecting elements for wheel " << iwheel);
176 ACTS_VERBOSE(
" - Numerology reports: " << nEndcapLayers <<
" layers in wheel " << iwheel);
177 for(
size_t ilayer=0;ilayer<nEndcapLayers;++ilayer) {
178 std::vector<std::shared_ptr<const Acts::Surface>> wheelSurfaces;
182 auto&
ext = pl.extent;;
191 for (
unsigned int iphisec=0; iphisec<nEndcapPhiSectors; ++iphisec) {
193 size_t iposneg =
side < 0 ? 0 : 1;
195 unsigned int nStraws = ecElem->
nStraws();
197 for(
unsigned int istraw=0;istraw<nStraws;istraw++) {
201 trf.translation() *= 1_mm;
204 Identifier straw_id = m_cfg.idHelper->straw_id(
code.isPosZ() == 1 ? 2 : -2,
206 code.getWheelIndex(),
207 code.getStrawLayerIndex(),
211 auto elem = std::make_shared<const ActsDetectorElement>(
212 trf, *ecElem, straw_id);
214 m_cfg.elementStore->push_back(elem);
216 auto straw =
dynamic_cast<const Acts::StrawSurface*
>(&elem->surface());
218 auto strawBounds =
dynamic_cast<const Acts::LineBounds*
>(&
straw->bounds());
220 double radius = strawBounds->get(LBBV::eR);
221 double length = strawBounds->get(LBBV::eHalfLengthZ);
223 Acts::Vector3
ctr =
straw->center(gctx);
230 wheelSurfaces.push_back(
straw->getSharedPtr());
236 std::shared_ptr<Acts::Layer>
layer
237 = m_cfg.layerCreator->discLayer(gctx, std::move(wheelSurfaces), 1, 100, pl);
239 ACTS_VERBOSE(
" - Collected " << wheelSurfaces.size() <<
" straws");
244 ACTS_VERBOSE(
" - Built " <<
layers.size() <<
" straw endcap layers");