ATLAS Offline Software
Loading...
Searching...
No Matches
HECDetectorManager Class Reference

A manager class providing access to readout geometry information for the hadronic endcap calorimeter. More...

#include <HECDetectorManager.h>

Inheritance diagram for HECDetectorManager:
Collaboration diagram for HECDetectorManager:

Public Types

typedef std::vector< constHECLongBlock * >::const_iterator BlockConstIterator
typedef std::vector< constHECDetectorRegion * >::const_iterator DetectorRegionConstIterator
typedef HECDetectorRegion const * HECDetRegionArray[2][4][2]

Public Member Functions

 HECDetectorManager (const HECHVManager *hvManager=nullptr, bool isTestBeam=false)
 Constructor.
virtual ~HECDetectorManager () override
 Destructor.
HECDetectorManager::DetectorRegionConstIterator beginDetectorRegion () const
 Iterate over detector regions.
HECDetectorManager::DetectorRegionConstIterator endDetectorRegion () const
 Iterate over detector regions.
const HECDetectorRegiongetDetectorRegion (unsigned int endcap, unsigned int sampling, unsigned int region) const
 Random Access to detector regions.
unsigned int getNumDetectorRegions () const
 Gets the number of detectors in the set of detector regions.
virtual PVConstLink getTreeTop (unsigned int i) const override
 Gets the ith tree top.
virtual unsigned int getNumTreeTops () const override
 Gets the total number of tree tops.
HECDetectorManager::BlockConstIterator beginBlock () const
 Iterate over blocks.
HECDetectorManager::BlockConstIterator endBlock () const
 Iterate over blocks.
const HECLongBlockgetBlock (unsigned int i) const
 Random Access to Blocks.
unsigned int getNumBlocks () const
 Gets the number of blocks in the set of blocks.
void addDetectorRegion (const HECDetectorRegion *region)
 Add a new HEC Detector Region.
void addTreeTop (const PVLink &treeTop)
 Add a Tree Top.
double getFocalToRef1 () const
double getFocalToRef2 () const
const HECHVManagergetHVManager () const
 Get the HV Manager.

Private Member Functions

 HECDetectorManager (const HECDetectorManager &right)
HECDetectorManageroperator= (const HECDetectorManager &right)

Private Attributes

std::vector< const HECLongBlock * > m_HecLongBlock
std::vector< PVLink > m_treeTop
 This is the set of tree tops managed by this detector node.
HECDetRegionArray m_DetRegionsRandom {}
 An array of Region pointers which exists in order to provide random access to any HECDetectorRegion held by this manager.
std::vector< const HECDetectorRegion * > m_DetRegionsIterative
 A vector of Region pointer which exists in order to provide iterative access to any HECDetectorRegion held by this manager.
double m_focalToRef1
double m_focalToRef2
const HECHVManagerm_HVManager
bool m_isTestBeam

Detailed Description

A manager class providing access to readout geometry information for the hadronic endcap calorimeter.

A manager for the HEC. Provides access to: HEC Regions, Descriptors to HEC Regions, Longitudinal HEC blocks, and top level physical volumes (or tree tops).

Definition at line 27 of file HECDetectorManager.h.

Member Typedef Documentation

◆ BlockConstIterator

typedef std::vector<constHECLongBlock*>::const_iterator HECDetectorManager::BlockConstIterator

Definition at line 32 of file HECDetectorManager.h.

◆ DetectorRegionConstIterator

typedef std::vector<constHECDetectorRegion*>::const_iterator HECDetectorManager::DetectorRegionConstIterator

Definition at line 33 of file HECDetectorManager.h.

◆ HECDetRegionArray

typedef HECDetectorRegion const* HECDetectorManager::HECDetRegionArray[2][4][2]

Definition at line 34 of file HECDetectorManager.h.

Constructor & Destructor Documentation

◆ HECDetectorManager() [1/2]

HECDetectorManager::HECDetectorManager ( const HECHVManager * hvManager = nullptr,
bool isTestBeam = false )

Constructor.

Definition at line 22 of file HECDetectorManager.cxx.

23 : GeoVDetectorManager()
24 , m_HVManager(hvManager)
25 , m_isTestBeam(isTestBeam)
26{
27 setName("LArHEC");
28
29 ISvcLocator *svcLocator = Gaudi::svcLocator();
30
31 SmartIF<IGeoModelSvc> geoModel{svcLocator->service("GeoModelSvc")};
32 if(!geoModel.isValid())
33 throw std::runtime_error("Error in HECDetectorManager, cannot access GeoModelSvc");
34
35 SmartIF<IGeoDbTagSvc> geoDbTagSvc{svcLocator->service("GeoDbTagSvc")};
36 if(!geoDbTagSvc.isValid())
37 throw std::runtime_error("Error in HECDetectorManager, cannot access GeoDbTagSvc");
38
39 SmartIF<IRDBAccessSvc> rdbAccess{svcLocator->service(geoDbTagSvc->getParamSvcName())};
40 if(!rdbAccess.isValid())
41 throw std::runtime_error("Error in HECDetectorManager, cannot access RDBAccessSvc");
42
43 std::string larKey, larNode;
44 if(geoDbTagSvc->getSqliteReader()==nullptr) {
45 DecodeVersionKey larVersionKey(geoModel, "LAr");
46 larKey = larVersionKey.tag();
47 larNode = larVersionKey.node();
48 }
49
50 IRDBRecordset_ptr hecLongBlock = rdbAccess->getRecordsetPtr("HecLongitudinalBlock",larKey,larNode);
51 IRDBRecordset_ptr hecPad = rdbAccess->getRecordsetPtr("HecPad",larKey,larNode);
52 IRDBRecordset_ptr hadronicEndcap = rdbAccess->getRecordsetPtr("HadronicEndcap",larKey,larNode);
53
54 if(hecLongBlock->size()==0) {
55 hecLongBlock = rdbAccess->getRecordsetPtr("HecLongitudinalBlock", "HecLongitudinalBlock-00");
56 if (hecLongBlock->size()==0) {
57 throw std::runtime_error("Error getting HecLongitudinalBlock table");
58 }
59 }
60
61 if(hecPad->size()==0) {
62 hecPad = rdbAccess->getRecordsetPtr("HecPad","HecPad-00");
63 if (hecPad->size()==0) {
64 throw std::runtime_error("Error getting HecPad table");
65 }
66 }
67
68 if(hadronicEndcap->size()==0) {
69 hadronicEndcap = rdbAccess->getRecordsetPtr("HadronicEndcap","HadronicEndcap-00");
70 if (hadronicEndcap->size()==0) {
71 throw std::runtime_error("Error getting HadronicEndcap table");
72 }
73 }
74
75 if (hecPad->size()!=hecLongBlock->size()) throw std::runtime_error("Error. Hec[LongitudinalBlock,Pad] size discrepancy");
76
77 // Get the focal length:
78 m_focalToRef1 = (*hadronicEndcap)[0]->getDouble("ZORIG")*Gaudi::Units::cm;
80 double betweenWheel=(*hadronicEndcap)[0]->getDouble("GAPWHL")*Gaudi::Units::cm;
81 if(!m_isTestBeam) m_focalToRef2 += betweenWheel;
82
83 for (unsigned int b=0;b<hecLongBlock->size();b++) {
84 double etaBoundary[15];
85 const IRDBRecord *block = (*hecLongBlock)[b];
86 unsigned int blockNumber= (unsigned int) (block->getDouble("IBLC")+0.01); // will truncate down.
87 double innerRadius= block->getDouble("BLRMN")*Gaudi::Units::cm;
88 double outerRadius= block->getDouble("BLRMX")*Gaudi::Units::cm;
89 double depth= block->getDouble("BLDPTH")*Gaudi::Units::cm;
90 unsigned int numLArGaps= (unsigned int) (block->getDouble("BLMOD") + 0.01); // will truncate down.
91 double frontPlateThickness= block->getDouble("PLATE0")*Gaudi::Units::cm;
92 double backPlateThickness= block->getDouble("PLATEE")*Gaudi::Units::cm;
93
94 const IRDBRecord *pad = (*hecPad)[b];
95 for (int j=0;j<15;j++) etaBoundary[j]=pad->getDouble("ETA",j);
96 HECLongBlock *longBlock = new HECLongBlock(blockNumber,
97 innerRadius,
98 outerRadius,
99 depth,
100 numLArGaps,
101 frontPlateThickness,
102 backPlateThickness,
103 etaBoundary);
104 m_HecLongBlock.push_back(longBlock);
105 if ((!m_isTestBeam) && b<3) m_focalToRef2 += depth;
106 }
107
108
109}
std::shared_ptr< IRDBRecordset > IRDBRecordset_ptr
std::vector< const HECLongBlock * > m_HecLongBlock
const HECHVManager * m_HVManager
virtual double getDouble(const std::string &fieldName) const =0
Get double field value.
virtual unsigned int size() const =0
std::string depth
tag string for intendation
Definition fastadd.cxx:46

◆ ~HECDetectorManager()

HECDetectorManager::~HECDetectorManager ( )
overridevirtual

Destructor.

Definition at line 112 of file HECDetectorManager.cxx.

113{
114 for (unsigned int i=0;i<getNumBlocks();i++) delete m_HecLongBlock[i];
115 for (unsigned int i=0;i<getNumDetectorRegions();i++) delete m_DetRegionsIterative[i];
116}
unsigned int getNumDetectorRegions() const
Gets the number of detectors in the set of detector regions.
std::vector< const HECDetectorRegion * > m_DetRegionsIterative
A vector of Region pointer which exists in order to provide iterative access to any HECDetectorRegion...
unsigned int getNumBlocks() const
Gets the number of blocks in the set of blocks.

◆ HECDetectorManager() [2/2]

HECDetectorManager::HECDetectorManager ( const HECDetectorManager & right)
private

Member Function Documentation

◆ addDetectorRegion()

void HECDetectorManager::addDetectorRegion ( const HECDetectorRegion * region)

Add a new HEC Detector Region.

Definition at line 170 of file HECDetectorManager.cxx.

171{
172 m_DetRegionsRandom[region->getEndcapIndex()][region->getSamplingIndex()][region->getRegionIndex()] = region;
173 m_DetRegionsIterative.push_back(region);
174}
HECDetRegionArray m_DetRegionsRandom
An array of Region pointers which exists in order to provide random access to any HECDetectorRegion h...
unsigned int getRegionIndex() const
Returns the Region Index.
unsigned int getSamplingIndex() const
Returns the Sampling Layer Index (0-3)
HECDetectorRegion::DetectorSide getEndcapIndex() const
The endcap index.

◆ addTreeTop()

void HECDetectorManager::addTreeTop ( const PVLink & treeTop)

Add a Tree Top.

Definition at line 176 of file HECDetectorManager.cxx.

177{
178 m_treeTop.push_back(treeTop);
179}
std::vector< PVLink > m_treeTop
This is the set of tree tops managed by this detector node.

◆ beginBlock()

HECDetectorManager::BlockConstIterator HECDetectorManager::beginBlock ( ) const

Iterate over blocks.

Definition at line 150 of file HECDetectorManager.cxx.

151{
152 return m_HecLongBlock.begin();
153}

◆ beginDetectorRegion()

HECDetectorManager::DetectorRegionConstIterator HECDetectorManager::beginDetectorRegion ( ) const

Iterate over detector regions.

Definition at line 120 of file HECDetectorManager.cxx.

121{
122 return m_DetRegionsIterative.begin();
123}

◆ endBlock()

HECDetectorManager::BlockConstIterator HECDetectorManager::endBlock ( ) const

Iterate over blocks.

Definition at line 155 of file HECDetectorManager.cxx.

156{
157 return m_HecLongBlock.end();
158}

◆ endDetectorRegion()

HECDetectorManager::DetectorRegionConstIterator HECDetectorManager::endDetectorRegion ( ) const

Iterate over detector regions.

Definition at line 125 of file HECDetectorManager.cxx.

126{
127 return m_DetRegionsIterative.end();
128}

◆ getBlock()

const HECLongBlock * HECDetectorManager::getBlock ( unsigned int i) const

Random Access to Blocks.

Definition at line 160 of file HECDetectorManager.cxx.

161{
162 return m_HecLongBlock[i];
163}

◆ getDetectorRegion()

const HECDetectorRegion * HECDetectorManager::getDetectorRegion ( unsigned int endcap,
unsigned int sampling,
unsigned int region ) const

Random Access to detector regions.

Definition at line 130 of file HECDetectorManager.cxx.

131{
132 return m_DetRegionsRandom[endcap][sampling][region];
133}

◆ getFocalToRef1()

double HECDetectorManager::getFocalToRef1 ( ) const
inline

Distance from focal point to front face of HEC1

Definition at line 175 of file HECDetectorManager.h.

176{
177
178 return m_focalToRef1;
179
180}

◆ getFocalToRef2()

double HECDetectorManager::getFocalToRef2 ( ) const
inline

Distance from focal point to front face of HEC2

Definition at line 182 of file HECDetectorManager.h.

183{
184
185 return m_focalToRef2;
186
187}

◆ getHVManager()

const HECHVManager & HECDetectorManager::getHVManager ( ) const

Get the HV Manager.

Definition at line 181 of file HECDetectorManager.cxx.

182{
183 return *m_HVManager;
184}

◆ getNumBlocks()

unsigned int HECDetectorManager::getNumBlocks ( ) const

Gets the number of blocks in the set of blocks.

Definition at line 165 of file HECDetectorManager.cxx.

166{
167 return m_HecLongBlock.size();
168}

◆ getNumDetectorRegions()

unsigned int HECDetectorManager::getNumDetectorRegions ( ) const

Gets the number of detectors in the set of detector regions.

Definition at line 135 of file HECDetectorManager.cxx.

136{
137 return m_DetRegionsIterative.size();
138}

◆ getNumTreeTops()

unsigned int HECDetectorManager::getNumTreeTops ( ) const
overridevirtual

Gets the total number of tree tops.

Definition at line 145 of file HECDetectorManager.cxx.

146{
147 return m_treeTop.size();
148}

◆ getTreeTop()

PVConstLink HECDetectorManager::getTreeTop ( unsigned int i) const
overridevirtual

Gets the ith tree top.

Definition at line 140 of file HECDetectorManager.cxx.

141{
142 return m_treeTop[i];
143}

◆ operator=()

HECDetectorManager & HECDetectorManager::operator= ( const HECDetectorManager & right)
private

Member Data Documentation

◆ m_DetRegionsIterative

std::vector<const HECDetectorRegion *> HECDetectorManager::m_DetRegionsIterative
private

A vector of Region pointer which exists in order to provide iterative access to any HECDetectorRegion held by this manager.

Definition at line 161 of file HECDetectorManager.h.

◆ m_DetRegionsRandom

HECDetRegionArray HECDetectorManager::m_DetRegionsRandom {}
private

An array of Region pointers which exists in order to provide random access to any HECDetectorRegion held by this manager.

Definition at line 152 of file HECDetectorManager.h.

152{};

◆ m_focalToRef1

double HECDetectorManager::m_focalToRef1
private

Definition at line 163 of file HECDetectorManager.h.

◆ m_focalToRef2

double HECDetectorManager::m_focalToRef2
private

Definition at line 164 of file HECDetectorManager.h.

◆ m_HecLongBlock

std::vector<const HECLongBlock *> HECDetectorManager::m_HecLongBlock
private

Definition at line 137 of file HECDetectorManager.h.

◆ m_HVManager

const HECHVManager* HECDetectorManager::m_HVManager
private

Definition at line 166 of file HECDetectorManager.h.

◆ m_isTestBeam

bool HECDetectorManager::m_isTestBeam
private

Definition at line 168 of file HECDetectorManager.h.

◆ m_treeTop

std::vector<PVLink> HECDetectorManager::m_treeTop
private

This is the set of tree tops managed by this detector node.

The tree top is a toplevel FCAL or Cryostat.

Definition at line 143 of file HECDetectorManager.h.


The documentation for this class was generated from the following files: