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

Descriptor for regions of the hadronic endcap calorimeter. More...

#include <HECDetDescr.h>

Inheritance diagram for HECDetDescr:
Collaboration diagram for HECDetDescr:

Public Member Functions

 HECDetDescr (const HECDetectorManager *detManager, unsigned int sampling, unsigned int region, const CellBinning &phiBinning, bool isTestBeam=false)
 Constructor.
 ~HECDetDescr ()
 Destructor.
double getZMin (unsigned int block) const
 Returns min z for the ith block at eta index.
double getZMax (unsigned int block) const
 Returns max z for the ith block at eta index.
double getRMin (unsigned int block, unsigned int eta) const
 Returns min r for block i.
double getRMax (unsigned int block, unsigned int eta) const
 Returns max r at block i.
const HECRadialSegmentgetRadialSegment (unsigned int block, unsigned int eta) const
 Returns the radial segment of in block b with eta index i, or else NULL.
unsigned int getBlockIndex (unsigned int block) const
 Gets the block index for the ith block (in case it is ever needed).
const HECDetectorManagergetManager () const
 The manager.
unsigned int getSamplingIndex () const
 The sampling index.
unsigned int getRegionIndex () const
 The region Index.
const CellBinning & getPhiBinning () const
 The Binning in Phi.
const CellBinning & getEtaBinning () const
 The Binning in Eta.
unsigned int getNumBlocks () const
 Number of blocks in the region.

Private Member Functions

 HECDetDescr (const HECDetDescr &right)
HECDetDescroperator= (const HECDetDescr &right)

Private Attributes

const HECDetectorManagerm_manager
unsigned int m_samplingIndex
unsigned int m_regionIndex
CellBinning m_phiBinning
unsigned int m_outerRadSegNumber
CellBinning m_etaBinning
unsigned int m_numBlocks
unsigned int m_firstBlock
std::vector< double > m_zMin
std::vector< double > m_zMax

Detailed Description

Descriptor for regions of the hadronic endcap calorimeter.

This class describes completely the segmentation in "eta" and phi. Eta appears in quotes because the HEC does not have eta boundaries, it has a staircase of radial boundaries that roughly adhere to an eta value. Keeping that in mind, this region describes the phi granularity of a region of the HEC and the radial and longitudinal division of the cells within the HEC. This descriptor does not need to ever be accessed directly. If you are tempted to use it directly, look first at the HECDetectorRegion and the HECCell class. HECCells obtained from a HECDetectorRegion is normally a preferred way to access all of the information in the HECDetDescr class.

Definition at line 29 of file HECDetDescr.h.

Constructor & Destructor Documentation

◆ HECDetDescr() [1/2]

HECDetDescr::HECDetDescr ( const HECDetectorManager * detManager,
unsigned int sampling,
unsigned int region,
const CellBinning & phiBinning,
bool isTestBeam = false )

Constructor.

Definition at line 17 of file HECDetDescr.cxx.

22 : m_manager(detManager)
23 , m_samplingIndex(sampling)
24 , m_regionIndex(region)
25 , m_phiBinning(phiBinning)
26 , m_outerRadSegNumber(region==0 ? 9: 3)
27 , m_etaBinning(0,0,1,0)
28 , m_numBlocks(sampling==0 ? 1:2)
29 , m_firstBlock(sampling==0 ? 0 : 2*sampling-1)
30{
31 // This will soon be unnecessary (when the wheels are divided!
32 ISvcLocator *svcLocator = Gaudi::svcLocator();
33
34 SmartIF<IGeoModelSvc> geoModel{svcLocator->service("GeoModelSvc")};
35 if(!geoModel.isValid())
36 throw std::runtime_error("Error in HECDetectorManager, cannot access GeoModelSvc");
37
38 SmartIF<IGeoDbTagSvc> geoDbTagSvc{svcLocator->service("GeoDbTagSvc")};
39 if(!geoDbTagSvc.isValid())
40 throw std::runtime_error("Error in HECDetectorManager, cannot access GeoDbTagSvc");
41
42 SmartIF<IRDBAccessSvc> rdbAccess{svcLocator->service(geoDbTagSvc->getParamSvcName())};
43 if(!rdbAccess.isValid())
44 throw std::runtime_error("Error in HECDetectorManager, cannot access RDBAccessSvc");
45
46 std::string larKey, larNode;
47 if(geoDbTagSvc->getSqliteReader()==nullptr) {
48 DecodeVersionKey larVersionKey(geoModel, "LAr");
49 larKey = larVersionKey.tag();
50 larNode = larVersionKey.node();
51 }
52
53IRDBRecordset_ptr hadronicEndcap = rdbAccess->getRecordsetPtr("HadronicEndcap", larKey, larNode);
54
55 if (hadronicEndcap->size()==0) throw std::runtime_error("Error getting HadronicEndcap table");
56 // End of soon-to-be-unnecessary part.
57
58 if(!isTestBeam) {
59 m_etaBinning = CellBinning( region==0 ? (sampling<2 ? 1.5: (sampling<3 ? 1.6: 1.7)) : 2.5,
60 region==0 ? 2.5 : (sampling==0 || sampling==3) ? 3.3 : 3.1,
61 region==0 ? (sampling<2 ? 10: (sampling<3 ? 9:8)) : (sampling==0 || sampling==3) ? 4:3,
62 region==0 ? (sampling<2 ? 0: (sampling<3 ? 1:2)):0);
63 } else {
64 m_etaBinning = CellBinning( region==0 ? (sampling<2 ? 2.1: 2.3) : 2.5,
65 region==0 ? 2.5 : (sampling==0 ) ? 3.3 : 3.1,
66 region==0 ? (sampling<2 ? 4: 2) : (sampling==0) ? 4:3,
67 region==0 ? (sampling<2 ? 6: 8):0);
68 }
69
70
71 unsigned int startBlock = m_samplingIndex <2 ? 0 : 3;
72 if(isTestBeam) startBlock = 0;
73 {
74 double pos=0.0;
75 for (unsigned int b=startBlock;b<m_manager->getNumBlocks();b++) {
76 if (b>=m_firstBlock && b< (m_firstBlock+m_numBlocks)) {
77 double front = pos;
78 double back = pos+m_manager->getBlock(b)->getDepth();
79 m_zMin.push_back(front);
80 m_zMax.push_back(back);
81 }
82 pos += m_manager->getBlock(b)->getDepth();
83 if(isTestBeam && b==2) pos += (*hadronicEndcap)[0]->getDouble("GAPWHL")*Gaudi::Units::cm;
84 }
85 }
86}
std::shared_ptr< IRDBRecordset > IRDBRecordset_ptr
unsigned int m_samplingIndex
std::vector< double > m_zMin
unsigned int m_regionIndex
CellBinning m_phiBinning
unsigned int m_firstBlock
unsigned int m_outerRadSegNumber
const HECDetectorManager * m_manager
CellBinning m_etaBinning
std::vector< double > m_zMax
unsigned int m_numBlocks
virtual unsigned int size() const =0

◆ ~HECDetDescr()

HECDetDescr::~HECDetDescr ( )
default

Destructor.

◆ HECDetDescr() [2/2]

HECDetDescr::HECDetDescr ( const HECDetDescr & right)
private

Member Function Documentation

◆ getBlockIndex()

unsigned int HECDetDescr::getBlockIndex ( unsigned int block) const
inline

Gets the block index for the ith block (in case it is ever needed).

Definition at line 185 of file HECDetDescr.h.

186{
187
188 return m_firstBlock+block;
189
190}

◆ getEtaBinning()

const CellBinning & HECDetDescr::getEtaBinning ( ) const
inline

The Binning in Eta.

Definition at line 222 of file HECDetDescr.h.

223{
224
225 return m_etaBinning;
226
227}

◆ getManager()

const HECDetectorManager * HECDetDescr::getManager ( ) const
inline

The manager.

Definition at line 194 of file HECDetDescr.h.

195{
196
197 return m_manager;
198
199}

◆ getNumBlocks()

unsigned int HECDetDescr::getNumBlocks ( ) const
inline

Number of blocks in the region.

Definition at line 229 of file HECDetDescr.h.

230{
231
232 return m_numBlocks;
233
234}

◆ getPhiBinning()

const CellBinning & HECDetDescr::getPhiBinning ( ) const
inline

The Binning in Phi.

Definition at line 215 of file HECDetDescr.h.

216{
217
218 return m_phiBinning;
219
220}

◆ getRadialSegment()

const HECRadialSegment * HECDetDescr::getRadialSegment ( unsigned int block,
unsigned int eta ) const
inline

Returns the radial segment of in block b with eta index i, or else NULL.

Definition at line 169 of file HECDetDescr.h.

170{
171
172 // Get the block.
173 const HECLongBlock *bPtr = getManager()->getBlock(getBlockIndex(block));
174 // Check that it exists:
175 if (!bPtr) throw std::range_error("Error in HECDetDescr, nonexistent block.");
176
177 // From the block, get the radial segment:
178 unsigned int index = m_outerRadSegNumber-eta;
179
180 const HECRadialSegment *segment=bPtr->getRadialSegment(index);
181 return segment;
182
183}
Scalar eta() const
pseudorapidity method
unsigned int getBlockIndex(unsigned int block) const
Gets the block index for the ith block (in case it is ever needed).
const HECDetectorManager * getManager() const
The manager.
const HECLongBlock * getBlock(unsigned int i) const
Random Access to Blocks.
const HECRadialSegment * getRadialSegment(unsigned int i) const
Returns a radial segment if it exists.
str index
Definition DeMoScan.py:362

◆ getRegionIndex()

unsigned int HECDetDescr::getRegionIndex ( ) const
inline

The region Index.

Definition at line 208 of file HECDetDescr.h.

209{
210
211 return m_regionIndex;
212
213}

◆ getRMax()

double HECDetDescr::getRMax ( unsigned int block,
unsigned int eta ) const
inline

Returns max r at block i.

Definition at line 155 of file HECDetDescr.h.

156{
157
158
159 // Check that it exists:
160 const HECRadialSegment *segment = getRadialSegment(block,eta);
161 if (!segment) throw std::range_error("Error in HECDetDescr, nonexistent segment.");
162
163 // Return value:
164 return segment->getMaxVal();
165
166
167}
const HECRadialSegment * getRadialSegment(unsigned int block, unsigned int eta) const
Returns the radial segment of in block b with eta index i, or else NULL.
double getMaxVal() const
Maximum Range Value.

◆ getRMin()

double HECDetDescr::getRMin ( unsigned int block,
unsigned int eta ) const
inline

Returns min r for block i.

Definition at line 141 of file HECDetDescr.h.

142{
143
144
145 // Check that it exists:
146 const HECRadialSegment *segment = getRadialSegment(block,eta);
147 if (!segment) throw std::range_error("Error in HECDetDescr, nonexistent segment.");
148
149 // Return value:
150 return segment->getMinVal();
151
152
153}
double getMinVal() const
Minimum Range Value.

◆ getSamplingIndex()

unsigned int HECDetDescr::getSamplingIndex ( ) const
inline

The sampling index.

Definition at line 201 of file HECDetDescr.h.

202{
203
204 return m_samplingIndex;
205
206}

◆ getZMax()

double HECDetDescr::getZMax ( unsigned int block) const
inline

Returns max z for the ith block at eta index.

Definition at line 134 of file HECDetDescr.h.

135{
136
137 return m_zMax[block];
138
139}

◆ getZMin()

double HECDetDescr::getZMin ( unsigned int block) const
inline

Returns min z for the ith block at eta index.

Definition at line 127 of file HECDetDescr.h.

128{
129
130 return m_zMin[block];
131
132}

◆ operator=()

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

Member Data Documentation

◆ m_etaBinning

CellBinning HECDetDescr::m_etaBinning
private

Definition at line 114 of file HECDetDescr.h.

◆ m_firstBlock

unsigned int HECDetDescr::m_firstBlock
private

Definition at line 116 of file HECDetDescr.h.

◆ m_manager

const HECDetectorManager* HECDetDescr::m_manager
private

Definition at line 109 of file HECDetDescr.h.

◆ m_numBlocks

unsigned int HECDetDescr::m_numBlocks
private

Definition at line 115 of file HECDetDescr.h.

◆ m_outerRadSegNumber

unsigned int HECDetDescr::m_outerRadSegNumber
private

Definition at line 113 of file HECDetDescr.h.

◆ m_phiBinning

CellBinning HECDetDescr::m_phiBinning
private

Definition at line 112 of file HECDetDescr.h.

◆ m_regionIndex

unsigned int HECDetDescr::m_regionIndex
private

Definition at line 111 of file HECDetDescr.h.

◆ m_samplingIndex

unsigned int HECDetDescr::m_samplingIndex
private

Definition at line 110 of file HECDetDescr.h.

◆ m_zMax

std::vector<double> HECDetDescr::m_zMax
private

Definition at line 118 of file HECDetDescr.h.

◆ m_zMin

std::vector<double> HECDetDescr::m_zMin
private

Definition at line 117 of file HECDetDescr.h.


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