33 ACTS_VERBOSE(
"Build LayerArray with " << layersInput.size()
34 <<
" layers at input.");
35 ACTS_VERBOSE(
" min/max provided : " << min <<
" / " << max);
44 std::sort(layers.begin(), layers.end(), layerSorter);
46 using LayerOrderPosition = std::pair<std::shared_ptr<const Layer>,
Vector3D>;
48 std::shared_ptr<const Layer>
layer =
nullptr;
49 std::unique_ptr<const BinUtility> binUtility =
nullptr;
50 std::vector<LayerOrderPosition> layerOrderVector;
57 for (
auto& layIter : layers) {
58 ACTS_VERBOSE(
"equidistant : registering a Layer at binning position : "
59 << (layIter->binningPosition(gctx, bValue)));
60 layerOrderVector.push_back(LayerOrderPosition(
61 layIter, layIter->binningPosition(gctx, bValue)));
64 binUtility = std::make_unique<const BinUtility>(layers.size(),
min,
max,
66 ACTS_VERBOSE(
"equidistant : created a BinUtility as " << *binUtility);
71 std::vector<float> boundaries;
73 boundaries.push_back(min);
74 double layerValue = 0.;
75 double layerThickness = 0.;
76 std::shared_ptr<const Layer> navLayer =
nullptr;
77 std::shared_ptr<const Layer> lastLayer =
nullptr;
79 for (
auto& layIter : layers) {
81 layerThickness = layIter->thickness();
82 layerValue = layIter->binningPositionValue(gctx, bValue);
84 boundaries.push_back(layerValue - 0.5 * layerThickness);
85 boundaries.push_back(layerValue + 0.5 * layerThickness);
87 double navigationValue = 0.5 * ((layerValue - 0.5 * layerThickness) +
88 boundaries.at(boundaries.size() - 3));
91 if (navigationValue == (layerValue - 0.5 * layerThickness)) {
93 "Layers are attached to each other at: "
94 << layerValue - 0.5 * layerThickness
95 <<
", which corrupts "
96 "navigation. This should never happen. Please detach the "
97 "layers in your geometry description.");
100 if (navigationValue > (layerValue - 0.5 * layerThickness)) {
102 << layerValue - 0.5 * layerThickness
103 <<
". This should never happen. "
104 "Please check your geometry description.");
108 std::shared_ptr<const Surface> navLayerSurface =
110 -
std::abs(layerValue - navigationValue));
112 "arbitrary : creating a NavigationLayer at "
113 << (navLayerSurface->binningPosition(gctx, bValue)).
x() <<
", "
114 << (navLayerSurface->binningPosition(gctx, bValue)).
y() <<
", "
115 << (navLayerSurface->binningPosition(gctx, bValue)).
z());
118 layerOrderVector.push_back(LayerOrderPosition(
119 navLayer, navLayer->binningPosition(gctx, bValue)));
122 layerOrderVector.push_back(LayerOrderPosition(
123 layIter, layIter->binningPosition(gctx, bValue)));
124 ACTS_VERBOSE(
"arbitrary : registering MaterialLayer at "
125 << (layIter->binningPosition(gctx, bValue)).
x() <<
", "
126 << (layIter->binningPosition(gctx, bValue)).
y() <<
", "
127 << (layIter->binningPosition(gctx, bValue)).
z());
133 double navigationValue =
134 0.5 * (boundaries.at(boundaries.size() - 1) + max);
136 if (navigationValue != max) {
138 std::shared_ptr<const Surface> navLayerSurface =
140 navigationValue - layerValue);
142 "arbitrary : creating a NavigationLayer at "
143 << (navLayerSurface->binningPosition(gctx, bValue)).
x() <<
", "
144 << (navLayerSurface->binningPosition(gctx, bValue)).
y() <<
", "
145 << (navLayerSurface->binningPosition(gctx, bValue)).
z());
148 layerOrderVector.push_back(LayerOrderPosition(
149 navLayer, navLayer->binningPosition(gctx, bValue)));
152 boundaries.push_back(max);
155 <<
" Layers (material + navigation) built. ");
157 binUtility = std::make_unique<const BinUtility>(boundaries,
open, bValue);
158 ACTS_VERBOSE(
"arbitrary : created a BinUtility as " << *binUtility);
167 return std::make_unique<const BinnedArrayXD<LayerPtr>>(layerOrderVector,
168 std::move(binUtility));
182 translation =
Vector3D(offset, 0., 0.);
186 translation =
Vector3D(0., offset, 0.);
190 translation =
Vector3D(0., 0., offset);
198 translation =
Vector3D(offset, 0., 0.);
206 std::shared_ptr<Surface> navigationSurface;
213 navigationSurface = Surface::makeShared<PlaneSurface>(
gctx, *
plane, shift);
217 const DiscSurface* disc =
dynamic_cast<const DiscSurface*
>(&layerSurface);
218 navigationSurface = Surface::makeShared<DiscSurface>(
gctx, *disc, shift);
226 std::shared_ptr<const Transform3D> navTrasform =
228 ? std::make_shared<const Transform3D>(layerSurface.
transform(gctx))
231 auto cylinderBounds =
232 std::make_shared<CylinderBounds>(navigationR, halflengthZ);
234 Surface::makeShared<CylinderSurface>(navTrasform, cylinderBounds);
238 return navigationSurface;