ATLAS Offline Software
Loading...
Searching...
No Matches
SiLayerBuilder.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// STL
16#include <map>
17
18// constructor
19InDet::SiLayerBuilder::SiLayerBuilder(const std::string& t, const std::string& n, const IInterface* p) :
20 base_class(t,n,p)
21{
22}
23
24// Athena standard methods
25// initialize
27{
29 return StatusCode::SUCCESS;
30}
31
32
34std::unique_ptr<const std::vector<Trk::CylinderLayer*> > InDet::SiLayerBuilder::cylindricalLayers() const
35{
36 const InDetDD::SiDetectorElementCollection* siDetElementCollectionPtr = m_siMgr->getDetectorElementCollection();
37 return cylindricalLayersImpl(*siDetElementCollectionPtr);
38}
39
40
42std::unique_ptr<const std::vector<Trk::DiscLayer* > > InDet::SiLayerBuilder::discLayers() const
43{
44 // sanity check for ID Helper
45 if (!m_pixIdHelper && !m_sctIdHelper){
46 ATH_MSG_ERROR("Neither Pixel nor SCT Detector Manager or ID Helper could be retrieved - giving up.");
47 return nullptr;
48 }
49
50 // check for DBMS
51 int nDBMLayers = m_siMgr->numerology().numEndcapsDBM();
52 if (!nDBMLayers) return ((m_pixelCase and m_useRingLayout) ? createRingLayers() : createDiscLayers());
53
54 ATH_MSG_DEBUG( "Found " << m_siMgr->numerology().numEndcapsDBM() << " DBM layers active, building first ECs, then DBMS");
55 std::unique_ptr<std::vector<Trk::DiscLayer*> > ecLayers = createDiscLayers();
56 if (ecLayers) {
57 ATH_MSG_VERBOSE( "Created " << ecLayers->size() << " endcap layers w/o DBM.");
58 ecLayers = createDiscLayers(std::move(ecLayers));
59 ATH_MSG_VERBOSE( "Created " << ecLayers->size() << " endcap layers with DBM.");
60 }
61 return ecLayers;
62
63}
64
65
66std::unique_ptr<std::vector< Trk::DiscLayer*> >
67InDet::SiLayerBuilder::createDiscLayers(std::unique_ptr<std::vector< Trk::DiscLayer*> > discLayers) const {
68
69 // get general layout
70 const InDetDD::SiDetectorElementCollection* siDetElementCollectionPtr = m_siMgr->getDetectorElementCollection();
71 return createDiscLayersImpl(*siDetElementCollectionPtr, std::move(discLayers));
72}
73
74
77std::unique_ptr<std::vector< Trk::DiscLayer*> >
79
80 // get general layout
81 const InDetDD::SiDetectorElementCollection* siDetElementCollectionPtr = m_siMgr->getDetectorElementCollection();
82 return createRingLayersImpl(*siDetElementCollectionPtr);
83}
84
#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.
virtual StatusCode initialize() override
AlgTool initialize method.
std::unique_ptr< std::vector< Trk::DiscLayer * > > createRingLayers() const
create the disc layers, it is dedicated to ITk implementation of the endcap rings.
virtual std::unique_ptr< const std::vector< Trk::DiscLayer * > > discLayers() const override final
LayerBuilder interface method - returning Endcap-like layers.
std::unique_ptr< std::vector< Trk::DiscLayer * > > createDiscLayers(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 StatusCode initialize() override
AlgTool initialize method.
virtual std::unique_ptr< const std::vector< Trk::CylinderLayer * > > cylindricalLayers() const override final
LayerBuilder interface method - returning Barrel-like layers.
SiLayerBuilder(const std::string &, const std::string &, const IInterface *)
AlgTool style constructor.