ATLAS Offline Software
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 
6 // InDet include
10 // Trk inlcude
13 #include "TrkGeometry/DiscLayer.h"
14 #include "TrkSurfaces/Surface.h"
15 // Athena
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
29 {
31  ATH_CHECK(m_SCT_ReadKey.initialize(!m_pixelCase));
32  ATH_CHECK(m_PixelReadKey.initialize());
33  return StatusCode::SUCCESS;
34 }
35 
36 
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*> >
58 {
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,
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*> >
98  const EventContext& ctx,
100  std::unique_ptr<std::vector<Trk::DiscLayer*> > discLayers) const
101 {
102 
103  // get general layout
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*> >
120 
121  // get general layout
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 
python.PerfMonSerializer.p
def p
Definition: PerfMonSerializer.py:743
InDetDD::SiDetectorElementCollection
Definition: SiDetectorElementCollection.h:30
SG::ReadCondHandle
Definition: ReadCondHandle.h:44
Surface.h
InDet::SiLayerBuilderCond::initialize
virtual StatusCode initialize() override
AlgTool initialize method.
Definition: SiLayerBuilderCond.cxx:28
BinnedArray.h
DiscLayer.h
read_hist_ntuple.t
t
Definition: read_hist_ntuple.py:5
ATH_MSG_VERBOSE
#define ATH_MSG_VERBOSE(x)
Definition: AthMsgStreamMacros.h:28
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
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
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
SiLayerBuilderCond.h
InDet::SiLayerBuilderCond::retrieveSiDetElements
SG::ReadCondHandle< InDetDD::SiDetectorElementCollection > retrieveSiDetElements(const EventContext &ctx) const
Definition: SiLayerBuilderCond.cxx:37
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
CylinderLayer.h
IOVInfiniteRange.h
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
SiDetectorElementCollection.h
SiDetectorElement.h
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::SiLayerBuilderImpl::initialize
virtual StatusCode initialize() override
AlgTool initialize method.
Definition: SiLayerBuilderImpl.cxx:34
InDet::SiLayerBuilderCond::SiLayerBuilderCond
SiLayerBuilderCond(const std::string &, const std::string &, const IInterface *)
AlgTool style constructor.
Definition: SiLayerBuilderCond.cxx:21
SiDetectorManager.h
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
SG::WriteCondHandle
Definition: WriteCondHandle.h:26
SG::WriteCondHandle::addDependency
void addDependency(const EventIDRange &range)
Definition: WriteCondHandle.h:275