ATLAS Offline Software
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
18 InDet::RobustTrackingGeometryBuilderImpl::RobustTrackingGeometryBuilderImpl(const std::string& t, const std::string& n, const IInterface* p) :
19  AthAlgTool(t,n,p),
20  Trk::TrackingVolumeManipulator()
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 ----------------------------------------------------
36  ATH_CHECK(m_layerArrayCreator.retrieve());
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 }
InDet::RobustTrackingGeometryBuilderImpl::m_namespace
StringProperty m_namespace
identificaton namespace
Definition: RobustTrackingGeometryBuilderImpl.h:164
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition: AthMsgStreamMacros.h:31
InDet::RobustTrackingGeometryBuilderImpl::m_materialProperties
CxxUtils::CachedUniquePtrT< Trk::Material > m_materialProperties
overal material properties of the ID
Definition: RobustTrackingGeometryBuilderImpl.h:112
RobustTrackingGeometryBuilderImpl.h
InDet::RobustTrackingGeometryBuilderImpl::m_trackingVolumeCreator
PublicToolHandle< Trk::ITrackingVolumeCreator > m_trackingVolumeCreator
Helper Tool to create TrackingVolumes.
Definition: RobustTrackingGeometryBuilderImpl.h:116
InDet::RobustTrackingGeometryBuilderImpl::packVolumeTriple
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.
Definition: RobustTrackingGeometryBuilderImpl.cxx:48
CxxUtils::CachedUniquePtrT::set
T * set(std::unique_ptr< T > elt) const
Atomically set the element.
Trk::BinningType
BinningType
Definition: BinningType.h:31
read_hist_ntuple.t
t
Definition: read_hist_ntuple.py:5
ATH_MSG_VERBOSE
#define ATH_MSG_VERBOSE(x)
Definition: AthMsgStreamMacros.h:28
InDet::RobustTrackingGeometryBuilderImpl::m_layerArrayCreator
PublicToolHandle< Trk::ILayerArrayCreator > m_layerArrayCreator
Helper Tool to create BinnedArrays.
Definition: RobustTrackingGeometryBuilderImpl.h:122
Trk::TrackingVolume::registerColorCode
void registerColorCode(unsigned int icolor)
Register the color code.
InDet::RobustTrackingGeometryBuilderImpl::RobustTrackingGeometryBuilderImpl
RobustTrackingGeometryBuilderImpl(const std::string &, const std::string &, const IInterface *)
Constructor.
Definition: RobustTrackingGeometryBuilderImpl.cxx:18
python.utils.AtlRunQueryDQUtils.p
p
Definition: AtlRunQueryDQUtils.py:210
beamspotman.n
n
Definition: beamspotman.py:731
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
IOVInfiniteRange.h
Trk
Ensure that the ATLAS eigen extensions are properly loaded.
Definition: FakeTrackBuilder.h:9
InDet::RobustTrackingGeometryBuilderImpl::m_enclosingEnvelopeSvc
ServiceHandle< IEnvelopeDefSvc > m_enclosingEnvelopeSvc
the service to provide the ID envelope size
Definition: RobustTrackingGeometryBuilderImpl.h:134
Trk::Volume::volumeBounds
const VolumeBounds & volumeBounds() const
returns the volumeBounds()
Definition: Volume.h:97
InDet::RobustTrackingGeometryBuilderImpl::m_replaceJointBoundaries
BooleanProperty m_replaceJointBoundaries
run with replacement of all joint boundaries
Definition: RobustTrackingGeometryBuilderImpl.h:151
AthAlgTool
Definition: AthAlgTool.h:26
checker_macros.h
Define macros for attributes used to control the static checker.
Trk::TrackingVolume
Definition: TrackingVolume.h:121
InDet::RobustTrackingGeometryBuilderImpl::initialize
virtual StatusCode initialize() override
AlgTool initialize method.
Definition: RobustTrackingGeometryBuilderImpl.cxx:26
InDet::RobustTrackingGeometryBuilderImpl::m_buildBoundaryLayers
BooleanProperty m_buildBoundaryLayers
create boundary layers
Definition: RobustTrackingGeometryBuilderImpl.h:149