ATLAS Offline Software
Loading...
Searching...
No Matches
RobustTrackingGeometryBuilderImpl.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
3*/
4
6// RobustTrackingGeometryBuilderImpl.cxx, (c) ATLAS Detector software
8
9// InDet
11// Athena
14//Gaudi
15#include "GaudiKernel/MsgStream.h"
16
17// constructor
18InDet::RobustTrackingGeometryBuilderImpl::RobustTrackingGeometryBuilderImpl(const std::string& t, const std::string& n, const IInterface* p) :
19 AthAlgTool(t,n,p),
21{
22}
23
24// Athena standard methods
25// initialize
27{
28 // retrieve envelope definition service --------------------------------------------------
30
31 // Retrieve the tracking volume creator -------------------------------------------------
33 ATH_MSG_DEBUG( "Retrieved tool " << m_trackingVolumeCreator );
34
35 // Retrieve the layer array creator ----------------------------------------------------
37 ATH_MSG_INFO( "Retrieved tool " << m_layerArrayCreator );
38
39 // Dummy MaterialProerties
40 m_materialProperties.set(std::make_unique<Trk::Material>());
41
42 ATH_MSG_INFO( "initialize() successful" );
43
44 return StatusCode::SUCCESS;
45}
46
47
49 const std::vector<Trk::Layer*>& negLayers,
50 const std::vector<Trk::Layer*>& centralLayers,
51 const std::vector<Trk::Layer*>& posLayers,
52 double rMin, double rMax,
53 double zMax, double zPosCentral,
54 const std::string& baseName,
55 int colorCode,
56 Trk::BinningType bintyp) const
57{
58
59
60 ATH_MSG_VERBOSE( '\t' << '\t'<< "Pack provided Layers from '" << baseName << "' triple into a container volume. " );
61
62 // create the strings
63 std::string volumeBase = m_namespace+"Detectors::"+baseName;
64
65 Trk::TrackingVolume* negativeVolume =
66 m_trackingVolumeCreator->createTrackingVolume(negLayers,
68 rMin,
69 rMax,
70 -zMax,
71 -zPosCentral,
72 volumeBase +
73 "::NegativeEndcap",
74 bintyp);
75
76 Trk::TrackingVolume* centralVolume =
77 m_trackingVolumeCreator->createTrackingVolume(centralLayers,
79 rMin,
80 rMax,
81 -zPosCentral,
82 zPosCentral,
83 volumeBase + "::Barrel",
84 bintyp);
85
86 Trk::TrackingVolume* positiveVolume =
87 m_trackingVolumeCreator->createTrackingVolume(posLayers,
89 rMin,
90 rMax,
91 zPosCentral,
92 zMax,
93 volumeBase +
94 "::PositiveEndcap",
95 bintyp);
96
97 // the base volumes have been created
99 '\t' << '\t' << "Volumes have been created, now pack them into a triple.");
100 // registerColorCode
101 negativeVolume->registerColorCode(colorCode);
102 centralVolume->registerColorCode(colorCode);
103 positiveVolume->registerColorCode(colorCode);
104
105 // pack them together
106 std::vector<Trk::TrackingVolume*> tripleVolumes;
107 tripleVolumes.push_back(negativeVolume);
108 tripleVolumes.push_back(centralVolume);
109 tripleVolumes.push_back(positiveVolume);
110
111 // create the tiple container
112 Trk::TrackingVolume* tripleContainer =
113 m_trackingVolumeCreator->createContainerTrackingVolume(
114 tripleVolumes,
116 volumeBase,
119
120 ATH_MSG_VERBOSE('\t' << '\t' << "Created container volume with bounds: "
121 << tripleContainer->volumeBounds());
122
123 return tripleContainer;
124}
125
126
128 const std::vector<Trk::TrackingVolume*>& negVolumes,
129 const std::vector<Trk::TrackingVolume*>& centralVolumes,
130 const std::vector<Trk::TrackingVolume*>& posVolumes,
131 const std::string& baseName) const
132{
133 ATH_MSG_VERBOSE( '\t' << '\t'<< "Pack provided Volumes from '" << baseName << "' triple into a container volume. " );
134
135 unsigned int negVolSize = negVolumes.size();
136 unsigned int cenVolSize = centralVolumes.size();
137 unsigned int posVolSize = posVolumes.size();
138
139
140
141 // create the strings
142 std::string volumeBase = m_namespace+"Containers::"+baseName;
143
144 Trk::TrackingVolume* negativeVolume = (negVolSize > 1) ?
145 m_trackingVolumeCreator->createContainerTrackingVolume(negVolumes,
147 volumeBase+"::NegativeSector",
150 (negVolSize ? negVolumes[0] : nullptr);
151 Trk::TrackingVolume* centralVolume = (cenVolSize > 1) ?
152 m_trackingVolumeCreator->createContainerTrackingVolume(centralVolumes,
154 volumeBase+"::CentralSector",
157 (cenVolSize ? centralVolumes[0] : nullptr) ;
158
159 Trk::TrackingVolume* positiveVolume = ( posVolSize > 1) ?
160 m_trackingVolumeCreator->createContainerTrackingVolume(posVolumes,
162 volumeBase+"::PositiveSector",
165 (posVolSize ? posVolumes[0] : nullptr);
166
167 if (!negativeVolume && !positiveVolume){
168 ATH_MSG_DEBUG( "No negative/positive sector given - no packing needed, returning central container!" );
169 return centralVolume;
170 }
171 // pack them together
172 std::vector<Trk::TrackingVolume*> tripleVolumes;
173 if (negativeVolume) tripleVolumes.push_back(negativeVolume);
174 if (centralVolume) tripleVolumes.push_back(centralVolume);
175 if (positiveVolume) tripleVolumes.push_back(positiveVolume);
176 // create the tiple container
177 Trk::TrackingVolume* tripleContainer =
178 m_trackingVolumeCreator->createContainerTrackingVolume(tripleVolumes,
180 volumeBase,
183 return tripleContainer;
184}
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_INFO(x)
#define ATH_MSG_VERBOSE(x)
#define ATH_MSG_DEBUG(x)
Define macros for attributes used to control the static checker.
AthAlgTool(const std::string &type, const std::string &name, const IInterface *parent)
Constructor with parameters:
virtual StatusCode initialize() override
AlgTool initialize method.
RobustTrackingGeometryBuilderImpl(const std::string &, const std::string &, const IInterface *)
Constructor.
PublicToolHandle< Trk::ITrackingVolumeCreator > m_trackingVolumeCreator
Helper Tool to create TrackingVolumes.
CxxUtils::CachedUniquePtrT< Trk::Material > m_materialProperties
overal material properties of the ID
ServiceHandle< IEnvelopeDefSvc > m_enclosingEnvelopeSvc
the service to provide the ID envelope size
PublicToolHandle< Trk::ILayerArrayCreator > m_layerArrayCreator
Helper Tool to create BinnedArrays.
BooleanProperty m_replaceJointBoundaries
run with replacement of all joint boundaries
Trk::TrackingVolume * packVolumeTriple(const std::vector< Trk::Layer * > &negLayers, const std::vector< Trk::Layer * > &centralLayers, const std::vector< Trk::Layer * > &posLayers, double rMin, double rMax, double zMin, double zPosCentral, const std::string &baseName="UndefinedVolume", int colorCode=21, Trk::BinningType bintype=Trk::arbitrary) const
Private method, creates and packs a triple containing of NegEndcap-Barrel-PosEndcap layers.
BooleanProperty m_buildBoundaryLayers
create boundary layers
Full Volume description used in Tracking, it inherits from Volume to get the geometrical structure,...
void registerColorCode(unsigned int icolor)
Register the color code.
const VolumeBounds & volumeBounds() const
returns the volumeBounds()
Definition Volume.h:96
Ensure that the ATLAS eigen extensions are properly loaded.
BinningType
, BinningOption & BinningAccess
Definition BinningType.h:31