ATLAS Offline Software
Loading...
Searching...
No Matches
CaloBlueprintNodeBuilder.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2026 CERN for the benefit of the ATLAS collaboration
3*/
4
6
7#include "Acts/Geometry/Blueprint.hpp"
8#include "Acts/Geometry/PortalShell.hpp"
9#include "Acts/Geometry/Volume.hpp"
10#include "Acts/Geometry/StaticBlueprintNode.hpp"
11#include "Acts/Geometry/GeometryIdentifierBlueprintNode.hpp"
12#include <Acts/Navigation/SurfaceArrayNavigationPolicy.hpp>
13#include <Acts/Navigation/TryAllNavigationPolicy.hpp>
14#include <Acts/Utilities/AxisDefinitions.hpp>
15#include <Acts/Geometry/ContainerBlueprintNode.hpp>
16#include <Acts/Geometry/Extent.hpp>
17#include <Acts/Definitions/Units.hpp>
18#include <Acts/Geometry/LayerBlueprintNode.hpp>
19#include <Acts/Geometry/VolumeResizeStrategy.hpp>
20#include <Acts/Geometry/VolumeAttachmentStrategy.hpp>
21#include <Acts/Geometry/TrackingVolume.hpp>
22#include <Acts/Geometry/CylinderVolumeBounds.hpp>
23
25
26#include <Acts/Surfaces/SurfaceArray.hpp>
28
29using namespace Acts;
30using namespace Acts::Experimental;
31using namespace Acts::UnitLiterals;
32using AttachmentStrategy = Acts::VolumeAttachmentStrategy;
33using ResizeStrategy = Acts::VolumeResizeStrategy;
34
35namespace {
36 // Calo IDs
37 constexpr std::size_t s_caloBarrelId = 40;
38}
39
41 ATH_MSG_DEBUG("Initializing CaloBlueprintNodeBuilder");
42
45
46 return StatusCode::SUCCESS;
47}
48
49std::shared_ptr<BlueprintNode> ActsTrk::CaloBlueprintNodeBuilder::buildBlueprintNode(const GeometryContext& /*gctx*/,
50 std::shared_ptr<BlueprintNode>&& childNode) {
51
52
53 std::map<caloRegion, caloSampleSurfaceMap_t> caloRegionSampleSurfaceMap;
54 std::map<caloRegion, caloSampleDDEElementsMap_t> caloRegionSampleDDEElementsMap;
55
56 fillMaps(caloRegionSampleSurfaceMap, caloRegionSampleDDEElementsMap);
57
58 ATH_MSG_DEBUG("Have filled first two maps");
59
60 // TODO: it seems that only the CaloMaxR and CaloHalfLengthZ
61 // m_radiusTolerancesions are used later on... do we need the others?
62 caloDimensionMap_t caloDimensionMap;
63 fillCaloDimensionsMap(caloDimensionMap, caloRegionSampleDDEElementsMap[caloRegion::Global]);
64
65 ATH_MSG_DEBUG("Have filled calo dimensions map");
66
67 generateCylinderSurfaces(caloRegionSampleSurfaceMap[caloRegion::Global], caloRegionSampleDDEElementsMap[caloRegion::Global]);
68 generateDiscSurfaces(caloRegionSampleSurfaceMap[caloRegion::DiscNegativeZ], caloRegionSampleDDEElementsMap[caloRegion::DiscNegativeZ]);
69 generateDiscSurfaces(caloRegionSampleSurfaceMap[caloRegion::DiscPositiveZ], caloRegionSampleDDEElementsMap[caloRegion::DiscPositiveZ]);
70
71 ATH_MSG_DEBUG("Have generated calorimeter cylindrical surfaces");
72
73 // The calo node is a container node that will hold the itk and calo nodes as children.
74 // The calo cylinder is static in order to avoid merging issues with the itk portals
75 // that are supposed to carry material.
76 // Take the itk+calo cylinder dimensions based from the previously evaluated map adding some tolerance.
77 // Use 2.0 as a reasonable first guess at the tolerance needed.
78 auto itkCaloNode = std::make_shared<StaticBlueprintNode>(
79 std::make_unique<TrackingVolume>(Transform3::Identity(),
80 std::make_shared<CylinderVolumeBounds>(0.,
81 caloDimensionMap["CaloMaxR"] + 2.0,
82 caloDimensionMap["CaloHalfLengthZ"] + 2.0),"ITkCalo"));
83
84 if (childNode) itkCaloNode->addChild(std::move(childNode));
85
86 ATH_MSG_DEBUG("Top level calorimeter node created");
87
88 auto caloNode = std::make_shared<CylinderContainerBlueprintNode>("CaloNode", AxisDirection::AxisZ);
89 CylinderContainerBlueprintNode& caloBarrelCylinderNode = caloNode->addCylinderContainer("CaloBarrelCylinders", AxisDirection::AxisR);
90 caloBarrelCylinderNode.setAttachmentStrategy(VolumeAttachmentStrategy::Gap);
91 caloBarrelCylinderNode.setResizeStrategy(ResizeStrategy::Gap);
92
93 ATH_MSG_DEBUG("EM Barrel container node created");
94
95 //Barrel cylinders symmetric about z = 0
96 std::vector<std::string> caloBarrelCylindricalLayerNames = {"PreSamplerB", "EMB1", "EMB2", "EMB3", "TileBar0", "TileBar1", "TileBar2"};
97 for (unsigned int sampleIndex = 0; sampleIndex < caloBarrelCylindricalLayerNames.size(); ++sampleIndex) {
98 auto& sampleName = caloBarrelCylindricalLayerNames.at(sampleIndex);
99 addCylindricalTrackingVolumeToCaloNode(caloBarrelCylinderNode, sampleName, caloRegionSampleSurfaceMap[caloRegion::Global].at({sampleName, getSampleEnum(sampleName)}), sampleIndex, false);
100 }
101
102 CylinderContainerBlueprintNode& caloEndCapDiscNegativeZNode = caloNode->addCylinderContainer("CaloEndCapDiscNegativeZ", AxisDirection::AxisZ);
103 caloEndCapDiscNegativeZNode.setAttachmentStrategy(VolumeAttachmentStrategy::Gap);
104 caloEndCapDiscNegativeZNode.setResizeStrategy(ResizeStrategy::Gap);
105
106 CylinderContainerBlueprintNode& caloEndCapDiscPositiveZNode = caloNode->addCylinderContainer("CaloEndCapDiscPositiveZ", AxisDirection::AxisZ);
107 caloEndCapDiscPositiveZNode.setAttachmentStrategy(VolumeAttachmentStrategy::Gap);
108 caloEndCapDiscPositiveZNode.setResizeStrategy(ResizeStrategy::Gap);
109
110 for (unsigned int sampleIndex = 0; sampleIndex < m_caloDiscSampleList.size(); ++sampleIndex) {
111 auto& sampleName = m_caloDiscSampleList.at(sampleIndex).first;
112 addCylindricalTrackingVolumeToCaloNode(caloEndCapDiscNegativeZNode, sampleName+"NegZ", caloRegionSampleSurfaceMap[caloRegion::DiscNegativeZ].at({sampleName, getSampleEnum(sampleName)}), sampleIndex+caloBarrelCylindricalLayerNames.size(), true);
113 addCylindricalTrackingVolumeToCaloNode(caloEndCapDiscPositiveZNode, sampleName+"PosZ", caloRegionSampleSurfaceMap[caloRegion::DiscPositiveZ].at({sampleName, getSampleEnum(sampleName)}), sampleIndex+caloBarrelCylindricalLayerNames.size()+m_caloDiscSampleList.size(), true);
114 }
115
116 ATH_MSG_DEBUG("Have added all Barrel layers to caloBarrelCylinderNode");
117
118 // Add calo barrel node to the top level calo node.
119 itkCaloNode->addChild(caloNode);
120
121 //return the top level calo node
122 return itkCaloNode;
123}
124
126 ATH_MSG_DEBUG("Finalizing CaloBlueprintNodeBuilder");
127 return StatusCode::SUCCESS;
128}
129
130void ActsTrk::CaloBlueprintNodeBuilder::fillMaps(std::map<caloRegion, caloSampleSurfaceMap_t>& caloRegionSampleSurfaceMap,
131 std::map<caloRegion, caloSampleDDEElementsMap_t>& caloRegionSampleDDEElementsMap) const {
132
133
134 //loop over all possible calo sampling layers
135 //and create empty vectors of surfaces in the map
136
137 //Create map between each calorimeter sampling and a vector of
138 //cylinder surfaces. We can have N cylinders in a given sampling,
139 //and the value of N is determined by how often the average radius
140 //calculated for a given phi ring, at fixed Z, changes by more than
141 //a tolerance value
142
143 //Use the same loop to create map bwteeen sampling and vectors of DDE
144 for (const auto & currentSample : m_caloCylinderSampleList) {
145 caloRegionSampleSurfaceMap[caloRegion::Global][currentSample] = std::vector<std::shared_ptr<Surface> >();
146 caloRegionSampleDDEElementsMap[caloRegion::Global][currentSample] = std::vector<const CaloDetDescrElement*>();
147 }
148
149 for (const auto & currentSample : m_caloDiscSampleList) {
150 caloRegionSampleSurfaceMap[caloRegion::DiscNegativeZ][currentSample] = std::vector<std::shared_ptr<Surface> >();
151 caloRegionSampleDDEElementsMap[caloRegion::DiscNegativeZ][currentSample] = std::vector<const CaloDetDescrElement*>();
152 caloRegionSampleSurfaceMap[caloRegion::DiscPositiveZ][currentSample] = std::vector<std::shared_ptr<Surface> >();
153 caloRegionSampleDDEElementsMap[caloRegion::DiscPositiveZ][currentSample] = std::vector<const CaloDetDescrElement*>();
154 }
155
156 //for each calo sampling collect all the DDE in a vector
157 for (const CaloDetDescrElement* theDDE : m_caloDetSecrMgr->element_range()){
158 if (!theDDE){
159 ATH_MSG_ERROR("Null pointer to CaloDetDescrElement");
160 continue;
161 }
162 CaloCell_ID::CaloSample currentSample=theDDE->getSampling();
163 caloRegionSampleDDEElementsMap[caloRegion::Global][{getSampleName(currentSample), currentSample}].push_back(theDDE);
164 //check if sampling is in disc list
165 if (std::find(m_caloDiscSampleList.begin(), m_caloDiscSampleList.end(), std::make_pair(getSampleName(currentSample), currentSample)) != m_caloDiscSampleList.end()) {
166 //check if in negative or positive z
167 if (theDDE->z() < 0.0) {
168 caloRegionSampleDDEElementsMap[caloRegion::DiscNegativeZ][{getSampleName(currentSample), currentSample}].push_back(theDDE);
169 }
170 else {
171 caloRegionSampleDDEElementsMap[caloRegion::DiscPositiveZ][{getSampleName(currentSample), currentSample}].push_back(theDDE);
172 }
173 }
174
175 }
176
177 auto sortAllLayersInZ = [&caloRegionSampleDDEElementsMap](const std::vector<std::pair<std::string, CaloCell_ID::CaloSample>>& caloSampleList) {
178 for (const auto & currentSample : caloSampleList) {
179 std::vector<const CaloDetDescrElement*> currentElements = caloRegionSampleDDEElementsMap[caloRegion::Global][currentSample];
180 std::sort(currentElements.begin(), currentElements.end(), [](const CaloDetDescrElement* a, const CaloDetDescrElement* b) {return a->z() < b->z();});
181 caloRegionSampleDDEElementsMap[caloRegion::Global][currentSample] = std::move(currentElements);
182 }
183 };
184
185 //Sort the DDE, by Z, in all possible layers
186 sortAllLayersInZ(m_caloCylinderSampleList);
187
188 auto sortAllLayersInR = [&caloRegionSampleDDEElementsMap](const std::vector<std::pair<std::string, CaloCell_ID::CaloSample>>& caloSampleList, const caloRegion& region) {
189 for (const auto& currentSample : caloSampleList) {
190 std::vector<const CaloDetDescrElement*> currentElements = caloRegionSampleDDEElementsMap[region][currentSample];
191 std::sort(currentElements.begin(), currentElements.end(), [](const CaloDetDescrElement* a, const CaloDetDescrElement* b) {return a->r() < b->r();});
192 caloRegionSampleDDEElementsMap[region][currentSample] = std::move(currentElements);
193 }
194 };
195
196 //Sort the DDE, by R, in all possible layers
199
200}
201
203
204 for (const auto & currentSample : m_caloCylinderSampleList) {
205
206 std::vector<const CaloDetDescrElement*> currentElements = caloSampleDDEElementsMap[currentSample];
207
208 double maxLArBRadius = 0.0, minLArBRadius = std::numeric_limits<double>::max();
209 double lowZLarB = 0.0, highZLarB = 0.0;
210
211 //loop over cells runs from -z to +z in a given sampling layer
212 //There are many cells with the same z value, but different phi values
213 //We will find the average radius of the cells in a given phi ring
214 double totalRadiusFixedPhi = 0.0;
215 bool firstCellInPhiRing = true;
216 unsigned int phiCounter = 0;
217
218 //Then we will also track changes in radius as we move in Z from
219 //each ring of cells in phi to the next ring of cells in phi
220 bool firstPhiRing = true;
221 double initialRadius = 0.0;
222 double initialZ = -std::numeric_limits<double>::max();
223
224 for (const CaloDetDescrElement* theDDE : currentElements){
225
226 double z = theDDE->z();
227 double radius = theDDE->r();
228
229 ATH_MSG_DEBUG(" Calo Sampling is " << currentSample.first);
230
231 if (firstCellInPhiRing) {
232 ATH_MSG_DEBUG("First Cell in phi ring " << currentSample.first << " has z = " << z << " and r = " << radius);
233 initialZ = z;
234 firstCellInPhiRing = false;
235 }
236
237 if (firstPhiRing) {
238 ATH_MSG_DEBUG("First Cell in layer " << currentSample.first << " has z = " << z << " and r = " << radius);
239 initialRadius = theDDE->r();
240 firstPhiRing = false;
241 lowZLarB = z;
242 }
243
244 ATH_MSG_DEBUG("Z and initialZ are " << z << " and " << initialZ);
245
246 //if z has not changed then we add the radius to the summed radius for this phi ring
247 //and increment the counter of cells in this phi ring
248 if (std::abs(z - initialZ) < 0.0001) {
249 ATH_MSG_DEBUG("phiCounter is " << phiCounter << " and radius is " << radius << " and totalRadiusFixedPhi is " << totalRadiusFixedPhi << " and hash is " << theDDE->calo_hash());
250 totalRadiusFixedPhi += radius;
251 phiCounter++;
252 continue;
253 }
254 else {
255 firstCellInPhiRing = true;
256 if (phiCounter > 0) {
257 double cellRingRadius = totalRadiusFixedPhi / phiCounter;
258 totalRadiusFixedPhi = 0.0;
259 phiCounter = 0;
260
261 if (cellRingRadius > maxLArBRadius) maxLArBRadius = radius;
262 if (cellRingRadius < minLArBRadius) minLArBRadius = radius;
263
264 //if radius changes by more than tolerance, then we will create a cylinder
265 //with the average cell radius and length from neg to pos z
266 highZLarB = z;
267 ATH_MSG_DEBUG("Values of cellRingRadius, initialRadius, highZLarB and lowZLarB are " << cellRingRadius << ", " << initialRadius << ", " << highZLarB << " and " << lowZLarB);
268 if (std::abs(cellRingRadius - initialRadius) > m_radiusTolerance && highZLarB - lowZLarB > 0.0) {
269 ATH_MSG_DEBUG("CYLINDER: Create cylinder for layer " << currentSample.first);
270 ATH_MSG_DEBUG("CYLINDER: Create Cylinder: Min and Max LAr B radius are " << minLArBRadius << " " << maxLArBRadius);
271 ATH_MSG_DEBUG("CYLINDER: Create Cylinder: Min and Max LAr B z are " << lowZLarB << " " << highZLarB);
272
273 caloSampleSurfaceMap[currentSample].push_back(generateCylinderSurface(maxLArBRadius, minLArBRadius, lowZLarB, highZLarB));
274
275 //reset the dimensions of the cylinder to the initial conditions, in
276 //preparation for the next cylinder
277 firstPhiRing = true;
278 minLArBRadius = std::numeric_limits<double>::max();
279 maxLArBRadius = 0.0;
280 lowZLarB = 0.0;
281 highZLarB = 0.0;
282 }//if radius changes by more than tolerance
283 }//if at least one cell in phi (should always be the case!)
284 else ATH_MSG_ERROR("phiCounter is zero!");
285 }//if z has changed
286 }//loop over calorimeter DDE
287
288 if (0 == caloSampleSurfaceMap[currentSample].size()){
289 ATH_MSG_DEBUG("CYLINDER: Zero size Vector: Create cylinder for layer " << currentSample.first);
290 ATH_MSG_DEBUG("CYLINDER: Create Cylinder: Min and Max LAr B radius are " << minLArBRadius << " " << maxLArBRadius);
291 ATH_MSG_DEBUG("CYLINDER: Create Cylinder: Min and Max LAr B z are " << lowZLarB << " " << highZLarB);
292 caloSampleSurfaceMap[currentSample].push_back(generateCylinderSurface(maxLArBRadius, minLArBRadius, lowZLarB, highZLarB));
293 }
294 }
295}
296
297std::shared_ptr<CylinderSurface> ActsTrk::CaloBlueprintNodeBuilder::generateCylinderSurface(const double& maxLArBRadius, const double& minLArBRadius, const double& lowZLarB, const double& highZLarB) const{
298
299 //Characterise the dimensions of the cylinder
300 double LArBRadius = (maxLArBRadius + minLArBRadius) / 2.0;
301 double LArBLength = std::abs(highZLarB - lowZLarB);
302
303 ATH_MSG_DEBUG("Cylinder radius and length are " << LArBRadius << " and " << LArBLength);
304
305 auto surface = Surface::makeShared<CylinderSurface>(Transform3::Identity(), LArBRadius, LArBLength/2);
306
307 return surface;
308
309}
310
312
313 for (const auto & currentSample : m_caloDiscSampleList) {
314
315 const std::vector<const CaloDetDescrElement*> & currentElements = caloSampleDDEElementsMap[currentSample];
316
317 double totalZFixedPhi = 0.0;
318 bool firstCellInPhiRing = true;
319 unsigned int phiCounter = 0;
320
321 bool firstPhiRing = true;
322 double initialRadius = 0.0;
323 double initialZ = -std::numeric_limits<double>::max();
324
325 //loop over cells runs from -z to +z in a given sampling layer
326 //There are many cells with the same z value, but different phi values
327 //We will find a min amd max radius in this phi ring.
328 double minDiscRadius = std::numeric_limits<double>::max(), maxDiscRadius = 0.0;
329
330 unsigned int currentElementsSize = currentElements.size();
331 unsigned int DDECounter = 0;
332
333 for (const CaloDetDescrElement* theDDE : currentElements){
334
335 bool isLastDDE = (DDECounter == (currentElementsSize-1));
336
337 ATH_MSG_DEBUG("Disc DDE with sampling, r and z of " << currentSample << ", " << theDDE->r() << ", " << theDDE->z());
338 ATH_MSG_DEBUG("isLastDDE is " << isLastDDE);
339
340 double z = theDDE->z();
341 double radius = theDDE->r();
342
343 if (firstCellInPhiRing) {
344 initialRadius = radius;
345 firstCellInPhiRing = false;
346 }
347
348 if (firstPhiRing) {
349 initialZ = z;
350 firstPhiRing = false;
351 minDiscRadius = radius;
352 }
353
354 //if radius is unchanged then we add the z to the summed z for this phi ring
355 //and increment the counter of cells in this phi ring
356 if (std::abs(radius - initialRadius) < 0.0001 && !isLastDDE) {
357 totalZFixedPhi += z;
358 phiCounter++;
359 DDECounter++;
360 continue;
361 }
362 else {
363 firstCellInPhiRing = true;
364 if (phiCounter > 0) {
365 double cellRingZ = totalZFixedPhi / phiCounter;
366 totalZFixedPhi = 0.0;
367 phiCounter = 0;
368
369 //if z changes by more than tolerance, then we will create a disc
370 //with the min and max radius found
371 //if we reach the last DDE and no new surface has been created, then we also create a disc surface
372 maxDiscRadius = radius;
373 ATH_MSG_DEBUG("cellRingZ, initialZ and z tolerance are " << cellRingZ << ", " << initialZ << " and " << m_zTolerance);
374 if (std::abs(cellRingZ - initialZ) > m_zTolerance || isLastDDE) {
375 ATH_MSG_DEBUG("DISC: About to create disc surface for sampling " << currentSample);
376 caloSampleSurfaceMap[currentSample].push_back(generateDiscSurface(cellRingZ,maxDiscRadius, minDiscRadius));
377 //reset the dimensions of the disc to the initial conditions, in
378 //preparation for the next disc
379 minDiscRadius = std::numeric_limits<double>::max();
380 maxDiscRadius = 0.0;
381 firstPhiRing = true;
382 }//if z changes by more than tolerance
383 }//if at least one cell in phi (should always be the case!)
384 else ATH_MSG_ERROR("phiCounter is zero!");
385 }//if radius has changed
386 DDECounter++;
387 }//loop over calorimeter DDE
388 }//loop over calo samplings
389}
390
391std::shared_ptr<Acts::DiscSurface> ActsTrk::CaloBlueprintNodeBuilder::generateDiscSurface(const double& z, const double& maxLArBRadius, const double& minLArBRadius) const{
392
393 ATH_MSG_DEBUG("DISC: Disc min and max radius are " << minLArBRadius << " and " << maxLArBRadius << " with z of " << z);
394
395 auto transform = Acts::Transform3(Acts::Translation3(0.0,0.0,z));
396 auto surface = Surface::makeShared<DiscSurface>(transform, minLArBRadius, maxLArBRadius);
397
398 return surface;
399
400}
401
402
403
405
406 //initialise parameters we will use to find the dimensions of the calorimeter
407 double minR = std::numeric_limits<double>::max();
408 double maxR = 0.0;
409 double minZ = std::numeric_limits<double>::max();
410 double maxZ = -std::numeric_limits<double>::max();
411
412 //define functions we will use
413 auto checkMinR = [&minR](const CaloDetDescrElement* theDDE){double r = theDDE->r();if (r < minR) minR = r;};
414 auto checkMaxR = [&maxR](const CaloDetDescrElement* theDDE){double r = theDDE->r();if (r > maxR) maxR = r;};
415 auto checkMinMaxZ = [&minZ,&maxZ](const CaloDetDescrElement* theDDE){double z = theDDE->z();if (z > maxZ) maxZ = z;if (z < minZ) minZ = z;};
416 auto calcHalfLengthZ = [&minZ, &maxZ](){return (maxZ - minZ) / 2.0;};
417
418 //find minR from PreSamplerB
419 for (const CaloDetDescrElement* theDDE : caloSampleDDEElementsMap.at({getSampleName(CaloCell_ID::PreSamplerB), CaloCell_ID::PreSamplerB})) checkMinR(theDDE);
420
421 //find maxR from TileBar2, TileGap2 and Tile Ext2
422 for (auto& currentSample : std::vector<std::pair<std::string, CaloCell_ID::CaloSample>>{{"TileBar2", CaloCell_ID::TileBar2}, {"TileGap2", CaloCell_ID::TileGap2}, {"TileExt2", CaloCell_ID::TileExt2}}) {
423 for (const CaloDetDescrElement* theDDE : caloSampleDDEElementsMap.at(currentSample)) checkMaxR(theDDE);
424 }
425
426 ATH_MSG_DEBUG("Min R in PreSamplerB is " << minR);
427 ATH_MSG_DEBUG("Max R in TileBar2, TileGap2 and TileExt2 is " << maxR);
428
429 caloDimensionsMap["CaloMinR"] = minR;
430 caloDimensionsMap["CaloMaxR"] = maxR;
431
432 //find minZ and maxZ from all barrel samplings
433 for (auto& currentSample : m_caloCylinderSampleList) {
434 for (const CaloDetDescrElement* theDDE : caloSampleDDEElementsMap.at(currentSample)) checkMinMaxZ(theDDE);
435 }
436
437 caloDimensionsMap["CaloMinZ"] = minZ;
438 caloDimensionsMap["CaloMaxZ"] = maxZ;
439
440 double halfLengthZ = calcHalfLengthZ();
441 ATH_MSG_DEBUG("Half length in Z for entire barrel is " << halfLengthZ);
442 caloDimensionsMap["CaloHalfLengthZ"] = halfLengthZ;
443
444}
445
446void ActsTrk::CaloBlueprintNodeBuilder::addCylindricalTrackingVolumeToCaloNode(CylinderContainerBlueprintNode& containerNode, const std::string& volumeName,const std::vector<std::shared_ptr<Acts::Surface>>& surfaces, int layerIndex, const bool& isDisc) const{
447
448 // Construct the container node with geometry identifier and layer, and add the surfaces to the layer.
449 Acts::Experimental::GeometryIdentifierBlueprintNode& geoIdNode = containerNode.withGeometryIdentifier();
450 geoIdNode.setAllVolumeIdsTo(s_caloBarrelId +
451 layerIndex);
452
453 AxisDirection axis = AxisDirection::AxisZ;
454 if (isDisc) axis = AxisDirection::AxisR;
455 CylinderContainerBlueprintNode& cylinder = geoIdNode.addCylinderContainer(volumeName,
456 axis);
457
458 cylinder.addLayer(volumeName + "_Layer", [&](auto& layer) {
459 layer.setSurfaces(surfaces);
460 layer.setEnvelope(Acts::ExtentEnvelope{{
461 .z = {0.1_mm, 0.1_mm},
462 .r = {2_mm, 2_mm},
463 }});
464 });
465
466}
#define ATH_MSG_ERROR(x)
#define ATH_MSG_DEBUG(x)
Acts::VolumeResizeStrategy ResizeStrategy
Acts::VolumeAttachmentStrategy AttachmentStrategy
std::map< std::string, double > caloDimensionMap_t
std::map< std::pair< std::string, CaloCell_ID::CaloSample >, std::vector< std::shared_ptr< Acts::Surface > > > caloSampleSurfaceMap_t
std::map< std::pair< std::string, CaloCell_ID::CaloSample >, std::vector< const CaloDetDescrElement * > > caloSampleDDEElementsMap_t
std::unique_ptr< CaloDetDescrManager > buildCaloDetDescrNoAlign(ISvcLocator *svcLocator, IMessageSvc *msgSvc)
static Double_t a
size_t size() const
Number of registered mappings.
#define z
void fillMaps(std::map< caloRegion, caloSampleSurfaceMap_t > &caloRegionSampleSurfaceMap, std::map< caloRegion, caloSampleDDEElementsMap_t > &caloRegionSampleDDEElementsMap) const
fillMaps fills two maps.
std::vector< std::pair< std::string, CaloCell_ID::CaloSample > > m_caloDiscSampleList
std::string getSampleName(CaloCell_ID::CaloSample currentSample) const
void fillCaloDimensionsMap(caloDimensionMap_t &caloDimensionsMap, caloSampleDDEElementsMap_t &caloSampleDDEElementsMap) const
fillCaloDimensionsMap fills a map of calorimeter dimensions for each sampling layer.
std::vector< std::pair< std::string, CaloCell_ID::CaloSample > > m_caloCylinderSampleList
void generateCylinderSurfaces(caloSampleSurfaceMap_t &caloSampleSurfaceMap, caloSampleDDEElementsMap_t &caloSampleDDEElementsMap) const
generateCylinderSurfaces generates cylindrical surfaces for each calo sampling.
std::shared_ptr< Acts::CylinderSurface > generateCylinderSurface(const double &maxLArBRadius, const double &minLArBRadius, const double &lowZLarB, const double &highZLarB) const
generateCylinderSurface generates a cylindrical surface for a given set of parameters.
void addCylindricalTrackingVolumeToCaloNode(Acts::Experimental::CylinderContainerBlueprintNode &containerNode, const std::string &volumeName, const std::vector< std::shared_ptr< Acts::Surface > > &surfaces, int layerIndex, const bool &isDisc) const
addCylindricalTrackingVolumeToCaloNode adds a cylindrical tracking volume to the calo node.
std::shared_ptr< Acts::DiscSurface > generateDiscSurface(const double &z, const double &maxLArBRadius, const double &minLArBRadius) const
std::shared_ptr< Acts::Experimental::BlueprintNode > buildBlueprintNode(const Acts::GeometryContext &gctx, std::shared_ptr< Acts::Experimental::BlueprintNode > &&childNode) override
Build the Itk Blueprint Node.
std::unique_ptr< CaloDetDescrManager > m_caloDetSecrMgr
CaloCell_ID::CaloSample getSampleEnum(const std::string &sampleName) const
void generateDiscSurfaces(caloSampleSurfaceMap_t &caloSampleSurfaceMap, caloSampleDDEElementsMap_t &caloSampleDDEElementsMap) const
CaloSampling::CaloSample CaloSample
Definition CaloCell_ID.h:53
This class groups all DetDescr information related to a CaloCell.
int r
Definition globals.cxx:22
IMessageSvc * getMessageSvc(bool quiet=false)
void sort(typename DataModel_detail::iterator< DVL > beg, typename DataModel_detail::iterator< DVL > end)
Specialization of sort for DataVector/List.