74 ACTS_VERBOSE(
"Build layers: " << (
type < 0 ?
"NEGATIVE" :
"POSITIVE")
77 std::vector<std::shared_ptr<const ActsDetectorElement>> elements =
79 std::map<int, std::vector<const Acts::Surface *>>
82 for (
const auto &element : elements) {
93 initialLayers[currentLayer].push_back(&element->surface());
96 ACTS_VERBOSE(
"Found " << initialLayers.size() <<
" "
97 << (
type < 0 ?
"NEGATIVE" :
"POSITIVE")
98 <<
" ENDCAP inital layers");
107 std::vector<Acts::ProtoLayer> protoLayers;
108 protoLayers.reserve(initialLayers.size());
110 for (
const auto &[
key, surfaces] : initialLayers) {
111 auto &pl = protoLayers.emplace_back(gctx, surfaces);
118 std::sort(protoLayers.begin(), protoLayers.end(),
119 [
type](
const Acts::ProtoLayer &
a,
const Acts::ProtoLayer &
b) {
120 double midA = (a.min(Acts::BinningValue::binZ) + a.max(Acts::BinningValue::binZ)) / 2.0;
121 double midB = (b.min(Acts::BinningValue::binZ) + b.max(Acts::BinningValue::binZ)) / 2.0;
129 std::vector<std::shared_ptr<const Surface>> ownedSurfaces;
130 for (
const auto &pl : protoLayers) {
132 std::unique_ptr<Acts::ApproachDescriptor> approachDescriptor =
nullptr;
133 std::shared_ptr<const Acts::ProtoSurfaceMaterial> materialProxy =
nullptr;
138 double layerZInner = layerZ - layerHalfZ;
139 double layerZOuter = layerZ + layerHalfZ;
141 if (std::abs(layerZInner) > std::abs(layerZOuter))
144 std::vector<std::shared_ptr<const Acts::Surface>> aSurfaces;
146 Acts::Transform3 transformNominal(Translation3(0., 0., layerZ));
147 Acts::Transform3 transformInner(Translation3(0., 0., layerZInner));
148 Acts::Transform3 transformOuter(Translation3(0., 0., layerZOuter));
150 std::shared_ptr<Acts::DiscSurface> innerBoundary =
151 Acts::Surface::makeShared<Acts::DiscSurface>(
153 aSurfaces.push_back(innerBoundary);
155 std::shared_ptr<Acts::DiscSurface> nominalSurface =
156 Acts::Surface::makeShared<Acts::DiscSurface>(
158 aSurfaces.push_back(nominalSurface);
160 std::shared_ptr<Acts::DiscSurface> outerBoundary =
161 Acts::Surface::makeShared<Acts::DiscSurface>(
163 aSurfaces.push_back(outerBoundary);
175 std::make_shared<const Acts::ProtoSurfaceMaterial>(materialBinUtil);
177 ACTS_VERBOSE(
"[L] Layer is marked to carry support material on Surface ( "
178 "inner=0 / center=1 / outer=2 ) : "
180 ACTS_VERBOSE(
"with binning: [" << matBinsPhi <<
", " << matBinsR <<
"]");
182 ACTS_VERBOSE(
"Created ApproachSurfaces for disc layer at:");
183 ACTS_VERBOSE(
" - inner: Z=" << layerZInner);
184 ACTS_VERBOSE(
" - central: Z=" << layerZ);
185 ACTS_VERBOSE(
" - outer: Z=" << layerZOuter);
188 innerBoundary->assignSurfaceMaterial(materialProxy);
190 std::set<int> phiModuleByRing;
192 for (
const auto &srf : pl.surfaces()) {
194 srf->associatedDetectorElement());
204 ACTS_VERBOSE(
"Identifier reports: " << nModPhi <<
" is lowest for " << nModR
207 size_t nBinsPhi = nModPhi;
208 size_t nBinsR = nModR;
211 ACTS_VERBOSE(
"Creating r x phi binned layer with " << nBinsR <<
" x "
212 << nBinsPhi <<
" bins");
216 std::make_unique<Acts::GenericApproachDescriptor>(aSurfaces);
219 ownedSurfaces.clear();
220 ownedSurfaces.reserve(pl.surfaces().size());
222 std::back_inserter(ownedSurfaces),
223 [](
const auto &
s) { return s->getSharedPtr(); });
226 nBinsPhi, pl, transformNominal,
227 std::move(approachDescriptor));
229 layersOutput.push_back( std::move(
layer) );