35 ACTS_VERBOSE(
"Build LayerArray with " << layersInput.size()
36 <<
" layers at input.");
37 ACTS_VERBOSE(
" min/max provided : " << min <<
" / " << max);
46 std::sort(layers.begin(), layers.end(), layerSorter);
48 using LayerOrderPosition = std::pair<std::shared_ptr<const Layer>,
Vector3D>;
50 std::shared_ptr<const Layer>
layer =
nullptr;
51 std::unique_ptr<const BinUtility> binUtility =
nullptr;
52 std::vector<LayerOrderPosition> layerOrderVector;
59 for (
auto& layIter : layers) {
60 ACTS_VERBOSE(
"equidistant : registering a Layer at binning position : "
61 << (layIter->binningPosition(gctx, bValue)));
62 layerOrderVector.push_back(LayerOrderPosition(
63 layIter, layIter->binningPosition(gctx, bValue)));
66 binUtility = std::make_unique<const BinUtility>(layers.size(),
min,
max,
68 ACTS_VERBOSE(
"equidistant : created a BinUtility as " << *binUtility);
75 boundaries.push_back(min);
76 double layerValue = 0.;
77 double layerThickness = 0.;
78 std::shared_ptr<const Layer> navLayer =
nullptr;
79 std::shared_ptr<const Layer> lastLayer =
nullptr;
81 for (
auto& layIter : layers) {
83 layerThickness = layIter->thickness();
84 layerValue = layIter->binningPositionValue(gctx, bValue);
86 boundaries.push_back(layerValue - 0.5 * layerThickness);
87 boundaries.push_back(layerValue + 0.5 * layerThickness);
89 double navigationValue = 0.5 * ((layerValue - 0.5 * layerThickness) +
90 boundaries.at(boundaries.size() - 3));
93 if (navigationValue == (layerValue - 0.5 * layerThickness)) {
95 "Layers are attached to each other at: "
96 << layerValue - 0.5 * layerThickness
97 <<
", which corrupts "
98 "navigation. This should never happen. Please detach the "
99 "layers in your geometry description.");
102 if (navigationValue > (layerValue - 0.5 * layerThickness)) {
104 << layerValue - 0.5 * layerThickness
105 <<
". This should never happen. "
106 "Please check your geometry description.");
110 std::shared_ptr<const Surface> navLayerSurface =
112 -
std::abs(layerValue - navigationValue));
114 "arbitrary : creating a NavigationLayer at "
115 << (navLayerSurface->binningPosition(gctx, bValue)).
x() <<
", "
116 << (navLayerSurface->binningPosition(gctx, bValue)).
y() <<
", "
117 << (navLayerSurface->binningPosition(gctx, bValue)).
z());
120 layerOrderVector.push_back(LayerOrderPosition(
121 navLayer, navLayer->binningPosition(gctx, bValue)));
124 layerOrderVector.push_back(LayerOrderPosition(
125 layIter, layIter->binningPosition(gctx, bValue)));
126 ACTS_VERBOSE(
"arbitrary : registering MaterialLayer at "
127 << (layIter->binningPosition(gctx, bValue)).
x() <<
", "
128 << (layIter->binningPosition(gctx, bValue)).
y() <<
", "
129 << (layIter->binningPosition(gctx, bValue)).
z());
135 double navigationValue =
136 0.5 * (boundaries.at(boundaries.size() - 1) + max);
138 if (navigationValue != max) {
140 std::shared_ptr<const Surface> navLayerSurface =
142 navigationValue - layerValue);
144 "arbitrary : creating a NavigationLayer at "
145 << (navLayerSurface->binningPosition(gctx, bValue)).
x() <<
", "
146 << (navLayerSurface->binningPosition(gctx, bValue)).
y() <<
", "
147 << (navLayerSurface->binningPosition(gctx, bValue)).
z());
150 layerOrderVector.push_back(LayerOrderPosition(
151 navLayer, navLayer->binningPosition(gctx, bValue)));
154 boundaries.push_back(max);
157 <<
" Layers (material + navigation) built. ");
159 binUtility = std::make_unique<const BinUtility>(
boundaries,
open, bValue);
160 ACTS_VERBOSE(
"arbitrary : created a BinUtility as " << *binUtility);
169 return std::make_unique<const BinnedArrayXD<LayerPtr>>(layerOrderVector,
170 std::move(binUtility));
184 translation =
Vector3D(offset, 0., 0.);
188 translation =
Vector3D(0., offset, 0.);
192 translation =
Vector3D(0., 0., offset);
200 translation =
Vector3D(offset, 0., 0.);
208 std::shared_ptr<Surface> navigationSurface;
215 navigationSurface = Surface::makeShared<PlaneSurface>(
gctx, *
plane, shift);
219 const DiscSurface* disc =
dynamic_cast<const DiscSurface*
>(&layerSurface);
220 navigationSurface = Surface::makeShared<DiscSurface>(
gctx, *disc, shift);
228 auto cylinderBounds =
229 std::make_shared<CylinderBounds>(navigationR, halflengthZ);
230 navigationSurface = Surface::makeShared<CylinderSurface>(
231 layerSurface.
transform(gctx), cylinderBounds);
235 return navigationSurface;