ATLAS Offline Software
Loading...
Searching...
No Matches
CaloBlueprintNodeBuilder.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2026 CERN for the benefit of the ATLAS collaboration
3*/
4
5#ifndef ACTSGEOMETRY_CALOBLUEPRINTNODEBUILDER_H
6#define ACTSGEOMETRY_CALOBLUEPRINTNODEBUILDER_H
7
10
11#include "Acts/Surfaces/CylinderSurface.hpp"
12#include "Acts/Surfaces/DiscSurface.hpp"
13#include "Acts/Surfaces/Surface.hpp"
15#include "CaloDetDescr/CaloDetDescrElement.h"
16
17#include <map>
18#include <string>
19#include <vector>
20#include <memory>
21
22using caloSampleSurfaceMap_t = std::map<std::pair<std::string, CaloCell_ID::CaloSample>, std::vector<std::shared_ptr<Acts::Surface> > >;
23using caloSampleDDEElementsMap_t = std::map<std::pair<std::string, CaloCell_ID::CaloSample>, std::vector<const CaloDetDescrElement*> >;
24using caloDimensionMap_t = std::map<std::string, double>;
25
26namespace ActsTrk {
27
29
33 class CaloBlueprintNodeBuilder : public extends<AthAlgTool, IBlueprintNodeBuilder> {
34 public:
35 StatusCode initialize() override;
36 StatusCode finalize() override;
37 using base_class::base_class;
38
42 std::shared_ptr<Acts::BlueprintNode> buildBlueprintNode(const Acts::GeometryContext& gctx,
43 std::shared_ptr<Acts::BlueprintNode>&& childNode) override;
44
45 private:
46
53 void fillMaps(std::map<caloRegion, caloSampleDDEElementsMap_t>& caloRegionSampleDDEElementsMap,
54 std::map<std::string, double>& caloDimensions) const;
55
61 void generateCylinderSurfaces(caloSampleSurfaceMap_t& caloSampleSurfaceMap, caloSampleDDEElementsMap_t& caloSampleDDEElementsMap, bool asymmetricZ) const;
62
67 std::shared_ptr<Acts::CylinderSurface> generateCylinderSurface(const double maxLArBRadius,
68 const double minLArBRadius,
69 const double lowZLarB,
70 const double highZLarB) const;
71
77 void addCylindricalTrackingVolumeToCaloNode(Acts::CylinderContainerBlueprintNode& containerNode, const std::string& volumeName,const std::vector<std::shared_ptr<Acts::Surface>>& surfaces, int layerIndex, const bool& isDisc) const;
78
79 void generateDiscSurfaces(caloSampleSurfaceMap_t& caloSampleSurfaceMap, caloSampleDDEElementsMap_t& caloSampleDDEElementsMap) const;
80
81 std::shared_ptr<Acts::DiscSurface> generateDiscSurface(const double& z, const double& maxLArBRadius, const double& minLArBRadius) const;
82
83 std::unique_ptr<CaloDetDescrManager> m_caloDetSecrMgr;
84
85 //create lists from all possible calo samplings that tracks could hit
86 //The first list is for disc shaped samples and the second for cylindrical shaped samples
87 //Note that TileGap3 is the barrel, but is disk shaped.
88 std::vector<std::pair<std::string, CaloCell_ID::CaloSample>> m_caloDiscSampleList{
89 {"PreSamplerE", CaloCell_ID::PreSamplerE},
90 {"EME1",CaloCell_ID::EME1},
91 {"EME2",CaloCell_ID::EME2},
92 {"EME3",CaloCell_ID::EME3},
93 {"HEC0",CaloCell_ID::HEC0},
94 {"HEC1",CaloCell_ID::HEC1},
95 {"HEC2",CaloCell_ID::HEC2},
96 {"HEC3",CaloCell_ID::HEC3},
97 {"TileGap3",CaloCell_ID::TileGap3},
98 {"FCAL0",CaloCell_ID::FCAL0},
99 {"FCAL1",CaloCell_ID::FCAL1},
100 {"FCAL2",CaloCell_ID::FCAL2}};
101
102 std::vector<std::pair<std::string, CaloCell_ID::CaloSample>> m_caloCylinderSymmetricSampleList{
103 { "PreSamplerB", CaloCell_ID::PreSamplerB},
104 {"EMB1", CaloCell_ID::EMB1},
105 {"EMB2", CaloCell_ID::EMB2},
106 {"EMB3", CaloCell_ID::EMB3},
107 {"TileBar0", CaloCell_ID::TileBar0},
108 {"TileBar1", CaloCell_ID::TileBar1},
109 {"TileBar2", CaloCell_ID::TileBar2}};
110
111 std::vector<std::pair<std::string, CaloCell_ID::CaloSample>> m_caloCylinderAsymmetricSampleList{
112 {"TileGap1", CaloCell_ID::TileGap1},
113 {"TileGap2", CaloCell_ID::TileGap2},
114 {"TileExt0", CaloCell_ID::TileExt0},
115 {"TileExt1", CaloCell_ID::TileExt1},
116 {"TileExt2", CaloCell_ID::TileExt2}};
117
118 Gaudi::Property<double> m_radiusTolerance { this
119 , "RadiusTolerance"
120 , 2.0
121 , "Tolerance for determining if a ring of cells in phi has changed the radius w.r.t to the previous ring in phi" };
122
123 Gaudi::Property<double> m_zTolerance { this
124 , "ZTolerance"
125 , 2.0
126 , "Tolerance for determining if a ring of cells in phi has changed the z w.r.t to the previous ring in phi" };
127
128 // TODO: Temporary function to get the sample name from the enum value.
129 std::string getSampleName(CaloCell_ID::CaloSample currentSample) const {
130 std::string sampleName = "";
131 for ( auto& [name, sample] : m_caloCylinderSymmetricSampleList) {
132 if (currentSample == sample) {
133 sampleName = name;
134 break;
135 }
136 }
137 if (sampleName == "") {
138 for ( auto& [name, sample] : m_caloCylinderAsymmetricSampleList) {
139 if (currentSample == sample) {
140 sampleName = name;
141 break;
142 }
143 }
144 }
145 if (sampleName == "") {
146 for ( auto& [name, sample] : m_caloDiscSampleList) {
147 if (currentSample == sample) {
148 sampleName = name;
149 break;
150 }
151 }
152 }
153 return sampleName;
154 }
155 // TODO: Temporary function to get the sample enum value from the name.
156 CaloCell_ID::CaloSample getSampleEnum(const std::string& sampleName) const {
157 CaloCell_ID::CaloSample sampleEnum = CaloCell_ID::Unknown;
158 for (auto& [name, sample] : m_caloCylinderSymmetricSampleList) {
159 if (sampleName == name) {
160 sampleEnum = sample;
161 break;
162 }
163 }
164 if (sampleEnum == CaloCell_ID::Unknown) {
165 for (auto& [name, sample] : m_caloCylinderAsymmetricSampleList) {
166 if (sampleName == name) {
167 sampleEnum = sample;
168 break;
169 }
170 }
171 }
172 if (sampleEnum == CaloCell_ID::Unknown) {
173 for (auto& [name, sample] : m_caloDiscSampleList) {
174 if (sampleName == name) {
175 sampleEnum = sample;
176 break;
177 }
178 }
179 }
180 return sampleEnum;
181 }
182
183
184 };
185}
186#endif
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
Definition of CaloDetDescrManager.
#define z
Builds the Calo Blueprint Node.
void addCylindricalTrackingVolumeToCaloNode(Acts::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::vector< std::pair< std::string, CaloCell_ID::CaloSample > > m_caloDiscSampleList
std::string getSampleName(CaloCell_ID::CaloSample currentSample) const
std::shared_ptr< Acts::DiscSurface > generateDiscSurface(const double &z, const double &maxLArBRadius, const double &minLArBRadius) const
std::vector< std::pair< std::string, CaloCell_ID::CaloSample > > m_caloCylinderAsymmetricSampleList
void generateCylinderSurfaces(caloSampleSurfaceMap_t &caloSampleSurfaceMap, caloSampleDDEElementsMap_t &caloSampleDDEElementsMap, bool asymmetricZ) 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.
std::shared_ptr< Acts::BlueprintNode > buildBlueprintNode(const Acts::GeometryContext &gctx, std::shared_ptr< Acts::BlueprintNode > &&childNode) override
Build the Itk Blueprint Node.
std::vector< std::pair< std::string, CaloCell_ID::CaloSample > > m_caloCylinderSymmetricSampleList
void fillMaps(std::map< caloRegion, caloSampleDDEElementsMap_t > &caloRegionSampleDDEElementsMap, std::map< std::string, double > &caloDimensions) const
fillMaps fills two maps.
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
The AlignStoreProviderAlg loads the rigid alignment corrections and pipes them through the readout ge...