34 ACTS_VERBOSE(
"Build LayerArray with " << layersInput.size()
35 <<
" layers at input.");
36 ACTS_VERBOSE(
" min/max provided : " << min <<
" / " << max);
45 std::sort(layers.begin(), layers.end(), layerSorter);
47 using LayerOrderPosition = std::pair<std::shared_ptr<const Layer>,
Vector3>;
49 std::shared_ptr<const Layer>
layer =
nullptr;
50 std::unique_ptr<const BinUtility> binUtility =
nullptr;
51 std::vector<LayerOrderPosition> layerOrderVector;
58 for (
auto& layIter : layers) {
59 ACTS_VERBOSE(
"equidistant : registering a Layer at binning position : "
60 << (layIter->binningPosition(gctx, bValue)));
61 layerOrderVector.push_back(LayerOrderPosition(
62 layIter, layIter->binningPosition(gctx, bValue)));
65 binUtility = std::make_unique<const BinUtility>(layers.size(),
min, max,
67 ACTS_VERBOSE(
"equidistant : created a BinUtility as " << *binUtility);
72 std::vector<float> boundaries;
74 boundaries.push_back(min);
75 double layerValue = 0.;
76 double layerThickness = 0.;
77 std::shared_ptr<const Layer> navLayer =
nullptr;
78 std::shared_ptr<const Layer> lastLayer =
nullptr;
80 for (
auto& layIter : layers) {
82 layerThickness = layIter->thickness();
83 layerValue = layIter->binningPositionValue(gctx, bValue);
85 boundaries.push_back(layerValue - 0.5 * layerThickness);
86 boundaries.push_back(layerValue + 0.5 * layerThickness);
88 double navigationValue = 0.5 * ((layerValue - 0.5 * layerThickness) +
89 boundaries.at(boundaries.size() - 3));
92 if (navigationValue == (layerValue - 0.5 * layerThickness)) {
94 "Layers are attached to each other at: "
95 << layerValue - 0.5 * layerThickness
96 <<
", which corrupts "
97 "navigation. This should never happen. Please detach the "
98 "layers in your geometry description.");
101 if (navigationValue > (layerValue - 0.5 * layerThickness)) {
103 << layerValue - 0.5 * layerThickness
104 <<
". This should never happen. "
105 "Please check your geometry description.");
109 std::shared_ptr<const Surface> navLayerSurface =
111 -std::abs(layerValue - navigationValue));
113 "arbitrary : creating a NavigationLayer at "
114 << (navLayerSurface->binningPosition(gctx, bValue)).
x() <<
", "
115 << (navLayerSurface->binningPosition(gctx, bValue)).
y() <<
", "
116 << (navLayerSurface->binningPosition(gctx, bValue)).
z());
119 layerOrderVector.push_back(LayerOrderPosition(
120 navLayer, navLayer->binningPosition(gctx, bValue)));
123 layerOrderVector.push_back(LayerOrderPosition(
124 layIter, layIter->binningPosition(gctx, bValue)));
125 ACTS_VERBOSE(
"arbitrary : registering MaterialLayer at "
126 << (layIter->binningPosition(gctx, bValue)).
x() <<
", "
127 << (layIter->binningPosition(gctx, bValue)).
y() <<
", "
128 << (layIter->binningPosition(gctx, bValue)).
z());
134 double navigationValue =
135 0.5 * (boundaries.at(boundaries.size() - 1) + max);
137 if (navigationValue != max) {
139 std::shared_ptr<const Surface> navLayerSurface =
141 navigationValue - layerValue);
143 "arbitrary : creating a NavigationLayer at "
144 << (navLayerSurface->binningPosition(gctx, bValue)).
x() <<
", "
145 << (navLayerSurface->binningPosition(gctx, bValue)).
y() <<
", "
146 << (navLayerSurface->binningPosition(gctx, bValue)).
z());
149 layerOrderVector.push_back(LayerOrderPosition(
150 navLayer, navLayer->binningPosition(gctx, bValue)));
153 boundaries.push_back(max);
156 <<
" Layers (material + navigation) built. ");
158 binUtility = std::make_unique<const BinUtility>(boundaries,
open, bValue);
159 ACTS_VERBOSE(
"arbitrary : created a BinUtility as " << *binUtility);
168 return std::make_unique<const BinnedArrayXD<LayerPtr>>(layerOrderVector,
183 translation =
Vector3(offset, 0., 0.);
187 translation =
Vector3(0., offset, 0.);
191 translation =
Vector3(0., 0., offset);
199 translation =
Vector3(offset, 0., 0.);
207 std::shared_ptr<Surface> navigationSurface;
214 navigationSurface = Surface::makeShared<PlaneSurface>(
gctx, *
plane, shift);
218 const DiscSurface* disc =
dynamic_cast<const DiscSurface*
>(&layerSurface);
219 navigationSurface = Surface::makeShared<DiscSurface>(
gctx, *disc, shift);
227 auto cylinderBounds =
228 std::make_shared<CylinderBounds>(navigationR, halflengthZ);
229 navigationSurface = Surface::makeShared<CylinderSurface>(
230 layerSurface.
transform(gctx), cylinderBounds);
234 return navigationSurface;