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, caloSampleSurfaceMap_t>& caloRegionSampleSurfaceMap,
54 std::map<caloRegion, caloSampleDDEElementsMap_t>& caloRegionSampleDDEElementsMap, 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, const double& minLArBRadius, const double& lowZLarB, const double& highZLarB, bool asymmetricZ) const;
68
74 void addCylindricalTrackingVolumeToCaloNode(Acts::CylinderContainerBlueprintNode& containerNode, const std::string& volumeName,const std::vector<std::shared_ptr<Acts::Surface>>& surfaces, int layerIndex, const bool& isDisc) const;
75
76 void generateDiscSurfaces(caloSampleSurfaceMap_t& caloSampleSurfaceMap, caloSampleDDEElementsMap_t& caloSampleDDEElementsMap) const;
77
78 std::shared_ptr<Acts::DiscSurface> generateDiscSurface(const double& z, const double& maxLArBRadius, const double& minLArBRadius) const;
79
80 std::unique_ptr<CaloDetDescrManager> m_caloDetSecrMgr;
81
82 //create lists from all possible calo samplings that tracks could hit
83 //The first list is for disc shaped samples and the second for cylindrical shaped samples
84 //Note that TileGap3 is the barrel, but is disk shaped.
85 std::vector<std::pair<std::string, CaloCell_ID::CaloSample>> m_caloDiscSampleList{
86 {"PreSamplerE", CaloCell_ID::PreSamplerE},
87 {"EME1",CaloCell_ID::EME1},
88 {"EME2",CaloCell_ID::EME2},
89 {"EME3",CaloCell_ID::EME3},
90 {"HEC0",CaloCell_ID::HEC0},
91 {"HEC1",CaloCell_ID::HEC1},
92 {"HEC2",CaloCell_ID::HEC2},
93 {"HEC3",CaloCell_ID::HEC3},
94 {"TileGap3",CaloCell_ID::TileGap3},
95 {"FCAL0",CaloCell_ID::FCAL0},
96 {"FCAL1",CaloCell_ID::FCAL1},
97 {"FCAL2",CaloCell_ID::FCAL2}};
98
99 std::vector<std::pair<std::string, CaloCell_ID::CaloSample>> m_caloCylinderSymmetricSampleList{
100 { "PreSamplerB", CaloCell_ID::PreSamplerB},
101 {"EMB1", CaloCell_ID::EMB1},
102 {"EMB2", CaloCell_ID::EMB2},
103 {"EMB3", CaloCell_ID::EMB3},
104 {"TileBar0", CaloCell_ID::TileBar0},
105 {"TileBar1", CaloCell_ID::TileBar1},
106 {"TileBar2", CaloCell_ID::TileBar2}};
107
108 std::vector<std::pair<std::string, CaloCell_ID::CaloSample>> m_caloCylinderAsymmetricSampleList{
109 {"TileGap1", CaloCell_ID::TileGap1},
110 {"TileGap2", CaloCell_ID::TileGap2},
111 {"TileExt0", CaloCell_ID::TileExt0},
112 {"TileExt1", CaloCell_ID::TileExt1},
113 {"TileExt2", CaloCell_ID::TileExt2}};
114
115 Gaudi::Property<double> m_radiusTolerance { this
116 , "RadiusTolerance"
117 , 2.0
118 , "Tolerance for determining if a ring of cells in phi has changed the radius w.r.t to the previous ring in phi" };
119
120 Gaudi::Property<double> m_zTolerance { this
121 , "ZTolerance"
122 , 2.0
123 , "Tolerance for determining if a ring of cells in phi has changed the z w.r.t to the previous ring in phi" };
124
125 // TODO: Temporary function to get the sample name from the enum value.
126 std::string getSampleName(CaloCell_ID::CaloSample currentSample) const {
127 std::string sampleName = "";
128 for ( auto& [name, sample] : m_caloCylinderSymmetricSampleList) {
129 if (currentSample == sample) {
130 sampleName = name;
131 break;
132 }
133 }
134 if (sampleName == "") {
135 for ( auto& [name, sample] : m_caloCylinderAsymmetricSampleList) {
136 if (currentSample == sample) {
137 sampleName = name;
138 break;
139 }
140 }
141 }
142 if (sampleName == "") {
143 for ( auto& [name, sample] : m_caloDiscSampleList) {
144 if (currentSample == sample) {
145 sampleName = name;
146 break;
147 }
148 }
149 }
150 return sampleName;
151 }
152 // TODO: Temporary function to get the sample enum value from the name.
153 CaloCell_ID::CaloSample getSampleEnum(const std::string& sampleName) const {
154 CaloCell_ID::CaloSample sampleEnum = CaloCell_ID::Unknown;
155 for (auto& [name, sample] : m_caloCylinderSymmetricSampleList) {
156 if (sampleName == name) {
157 sampleEnum = sample;
158 break;
159 }
160 }
161 if (sampleEnum == CaloCell_ID::Unknown) {
162 for (auto& [name, sample] : m_caloCylinderAsymmetricSampleList) {
163 if (sampleName == name) {
164 sampleEnum = sample;
165 break;
166 }
167 }
168 }
169 if (sampleEnum == CaloCell_ID::Unknown) {
170 for (auto& [name, sample] : m_caloDiscSampleList) {
171 if (sampleName == name) {
172 sampleEnum = sample;
173 break;
174 }
175 }
176 }
177 return sampleEnum;
178 }
179
180
181 };
182}
183#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.
void fillMaps(std::map< caloRegion, caloSampleSurfaceMap_t > &caloRegionSampleSurfaceMap, std::map< caloRegion, caloSampleDDEElementsMap_t > &caloRegionSampleDDEElementsMap, std::map< std::string, double > &caloDimensions) const
fillMaps fills two maps.
std::vector< std::pair< std::string, CaloCell_ID::CaloSample > > m_caloDiscSampleList
std::string getSampleName(CaloCell_ID::CaloSample currentSample) const
std::shared_ptr< Acts::CylinderSurface > generateCylinderSurface(const double &maxLArBRadius, const double &minLArBRadius, const double &lowZLarB, const double &highZLarB, bool asymmetricZ) const
generateCylinderSurface generates a cylindrical surface for a given set of parameters.
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::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
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...