ATLAS Offline Software
Loading...
Searching...
No Matches
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
14#include "TrkSurfaces/Surface.h"
15// Athena
17// STL
18#include <map>
19
20// constructor
21InDet::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
55std::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
71std::unique_ptr<const std::vector<Trk::DiscLayer*> >
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
96std::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
117std::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
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_ERROR(x)
#define ATH_MSG_VERBOSE(x)
#define ATH_MSG_DEBUG(x)
Class to hold the SiDetectorElement objects to be put in the detector store.
SG::ReadCondHandle< InDetDD::SiDetectorElementCollection > retrieveSiDetElements(const EventContext &ctx) const
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.
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.
SiLayerBuilderCond(const std::string &, const std::string &, const IInterface *)
AlgTool style constructor.
virtual StatusCode initialize() override
AlgTool initialize method.
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...
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.
virtual StatusCode initialize() override
AlgTool initialize method.
void addDependency(const EventIDRange &range)