ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
InnerDetector
InDetDetDescr
InDetTrackingGeometry
src
SiLayerBuilderCond.cxx
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
3
*/
4
5
#include "
InDetTrackingGeometry/SiLayerBuilderCond.h
"
6
// InDet include
7
#include "
InDetReadoutGeometry/SiDetectorManager.h
"
8
#include "
InDetReadoutGeometry/SiDetectorElement.h
"
9
#include "
InDetReadoutGeometry/SiDetectorElementCollection.h
"
10
// Trk inlcude
11
#include "
TrkDetDescrUtils/BinnedArray.h
"
12
#include "
TrkGeometry/CylinderLayer.h
"
13
#include "
TrkGeometry/DiscLayer.h
"
14
#include "
TrkSurfaces/Surface.h
"
15
// Athena
16
#include "
AthenaKernel/IOVInfiniteRange.h
"
17
// STL
18
#include <map>
19
20
// constructor
21
InDet::SiLayerBuilderCond::SiLayerBuilderCond
(
const
std::string& t,
const
std::string& n,
const
IInterface* p) :
22
base_class(t,n,p)
23
{
24
}
25
26
// Athena standard methods
27
// initialize
28
StatusCode
InDet::SiLayerBuilderCond::initialize
()
29
{
30
ATH_CHECK
(
InDet::SiLayerBuilderImpl::initialize
());
31
ATH_CHECK
(m_SCT_ReadKey.initialize(!m_pixelCase));
32
ATH_CHECK
(m_PixelReadKey.initialize());
33
return
StatusCode::SUCCESS;
34
}
35
36
37
SG::ReadCondHandle<InDetDD::SiDetectorElementCollection>
InDet::SiLayerBuilderCond::retrieveSiDetElements
(
const
EventContext& ctx)
const
38
{
39
if
(m_pixelCase){
40
auto
readHandle =
SG::ReadCondHandle<InDetDD::SiDetectorElementCollection>
(m_PixelReadKey, ctx);
41
if
(*readHandle==
nullptr
) {
42
ATH_MSG_ERROR
(
"Null pointer to the read conditions object of "
<< m_PixelReadKey.key());
43
}
44
return
readHandle;
45
}
else
{
46
auto
readHandle =
SG::ReadCondHandle<InDetDD::SiDetectorElementCollection>
(m_SCT_ReadKey, ctx);
47
if
(*readHandle==
nullptr
) {
48
ATH_MSG_ERROR
(
"Null pointer to the read conditions object of "
<< m_SCT_ReadKey.key());
49
}
50
return
readHandle;
51
}
52
}
53
55
std::unique_ptr<const std::vector<Trk::CylinderLayer*> >
56
InDet::SiLayerBuilderCond::cylindricalLayers
(
const
EventContext& ctx,
57
SG::WriteCondHandle<Trk::TrackingGeometry>
& whandle)
const
58
{
59
SG::ReadCondHandle<InDetDD::SiDetectorElementCollection>
readHandle =
retrieveSiDetElements
(ctx);
60
if
(*readHandle ==
nullptr
){
61
return
nullptr
;
62
}
63
whandle.
addDependency
(readHandle);
64
65
const
InDetDD::SiDetectorElementCollection
* readCdo{*readHandle};
66
return
cylindricalLayersImpl(*readCdo);
67
}
68
69
71
std::unique_ptr<const std::vector<Trk::DiscLayer*> >
72
InDet::SiLayerBuilderCond::discLayers
(
const
EventContext& ctx,
73
SG::WriteCondHandle<Trk::TrackingGeometry>
& whandle)
const
74
{
75
// sanity check for ID Helper
76
if
(!m_pixIdHelper && !m_sctIdHelper){
77
ATH_MSG_ERROR
(
"Neither Pixel nor SCT Detector Manager or ID Helper could be retrieved - giving up."
);
78
return
nullptr
;
79
}
80
81
// check for DBMS
82
int
nDBMLayers = m_siMgr->numerology().numEndcapsDBM();
83
if
(!nDBMLayers)
return
((m_pixelCase and m_useRingLayout) ?
createRingLayers
(ctx, whandle) :
createDiscLayers
(ctx, whandle));
84
85
ATH_MSG_DEBUG
(
"Found "
<< m_siMgr->numerology().numEndcapsDBM() <<
" DBM layers active, building first ECs, then DBMS"
);
86
std::unique_ptr<std::vector<Trk::DiscLayer*> > ecLayers =
createDiscLayers
(ctx, whandle);
87
if
(ecLayers) {
88
ATH_MSG_VERBOSE
(
"Created "
<< ecLayers->size() <<
" endcap layers w/o DBM."
);
89
ecLayers =
createDiscLayers
(ctx, whandle, std::move(ecLayers));
90
ATH_MSG_VERBOSE
(
"Created "
<< ecLayers->size() <<
" endcap layers with DBM."
);
91
}
92
return
ecLayers;
93
}
94
96
std::unique_ptr<std::vector<Trk::DiscLayer*> >
97
InDet::SiLayerBuilderCond::createDiscLayers
(
98
const
EventContext& ctx,
99
SG::WriteCondHandle<Trk::TrackingGeometry>
& whandle,
100
std::unique_ptr<std::vector<Trk::DiscLayer*> >
discLayers
)
const
101
{
102
103
// get general layout
104
SG::ReadCondHandle<InDetDD::SiDetectorElementCollection>
readHandle =
retrieveSiDetElements
(ctx);
105
if
(*readHandle ==
nullptr
){
106
return
nullptr
;
107
}
108
whandle.
addDependency
(readHandle);
109
110
const
InDetDD::SiDetectorElementCollection
* readCdo{*readHandle};
111
return
createDiscLayersImpl(*readCdo, std::move(
discLayers
));
112
}
113
114
117
std::unique_ptr<std::vector< Trk::DiscLayer*> >
118
InDet::SiLayerBuilderCond::createRingLayers
(
const
EventContext& ctx,
119
SG::WriteCondHandle<Trk::TrackingGeometry>
& whandle)
const
{
120
121
// get general layout
122
SG::ReadCondHandle<InDetDD::SiDetectorElementCollection>
readHandle =
retrieveSiDetElements
(ctx);
123
if
(*readHandle ==
nullptr
){
124
return
nullptr
;
125
}
126
whandle.
addDependency
(readHandle);
127
128
const
InDetDD::SiDetectorElementCollection
* readCdo{*readHandle};
129
return
createRingLayersImpl(*readCdo);
130
}
131
132
133
ATH_CHECK
#define ATH_CHECK
Evaluate an expression and check for errors.
Definition
AthCheckMacros.h:40
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition
AthMsgStreamMacros.h:32
ATH_MSG_VERBOSE
#define ATH_MSG_VERBOSE(x)
Definition
AthMsgStreamMacros.h:27
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition
AthMsgStreamMacros.h:28
BinnedArray.h
CylinderLayer.h
DiscLayer.h
IOVInfiniteRange.h
SiDetectorElementCollection.h
SiDetectorElement.h
SiDetectorManager.h
SiLayerBuilderCond.h
Surface.h
InDetDD::SiDetectorElementCollection
Class to hold the SiDetectorElement objects to be put in the detector store.
Definition
SiDetectorElementCollection.h:27
InDet::SiLayerBuilderCond::retrieveSiDetElements
SG::ReadCondHandle< InDetDD::SiDetectorElementCollection > retrieveSiDetElements(const EventContext &ctx) const
Definition
SiLayerBuilderCond.cxx:37
InDet::SiLayerBuilderCond::createRingLayers
std::unique_ptr< std::vector< Trk::DiscLayer * > > createRingLayers(const EventContext &ctx, SG::WriteCondHandle< Trk::TrackingGeometry > &whandle) const
create the disc layers, it is dedicated to ITk implementation of the endcap rings.
Definition
SiLayerBuilderCond.cxx:118
InDet::SiLayerBuilderCond::cylindricalLayers
virtual std::unique_ptr< const std::vector< Trk::CylinderLayer * > > cylindricalLayers(const EventContext &ctx, SG::WriteCondHandle< Trk::TrackingGeometry > &whandle) const override final
LayerBuilder interface method - returning Barrel-like layers.
Definition
SiLayerBuilderCond.cxx:56
InDet::SiLayerBuilderCond::SiLayerBuilderCond
SiLayerBuilderCond(const std::string &, const std::string &, const IInterface *)
AlgTool style constructor.
Definition
SiLayerBuilderCond.cxx:21
InDet::SiLayerBuilderCond::initialize
virtual StatusCode initialize() override
AlgTool initialize method.
Definition
SiLayerBuilderCond.cxx:28
InDet::SiLayerBuilderCond::createDiscLayers
std::unique_ptr< std::vector< Trk::DiscLayer * > > createDiscLayers(const EventContext &ctx, SG::WriteCondHandle< Trk::TrackingGeometry > &whandle, std::unique_ptr< std::vector< Trk::DiscLayer * > > discLayers=nullptr) const
create the disc layers, if no vector is given, then it's the first pass, else it's the DBM for the Pi...
Definition
SiLayerBuilderCond.cxx:97
InDet::SiLayerBuilderCond::discLayers
virtual std::unique_ptr< const std::vector< Trk::DiscLayer * > > discLayers(const EventContext &ctx, SG::WriteCondHandle< Trk::TrackingGeometry > &whandle) const override final
LayerBuilder interface method - returning Endcap-like layers.
Definition
SiLayerBuilderCond.cxx:72
InDet::SiLayerBuilderImpl::initialize
virtual StatusCode initialize() override
AlgTool initialize method.
Definition
SiLayerBuilderImpl.cxx:34
SG::ReadCondHandle
Definition
ReadCondHandle.h:40
SG::WriteCondHandle
Definition
WriteCondHandle.h:26
SG::WriteCondHandle::addDependency
void addDependency(const EventIDRange &range)
Definition
WriteCondHandle.h:279
Generated on
for ATLAS Offline Software by
1.17.0