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

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

#include <EMECDetectorManager.h>

Inheritance diagram for EMECDetectorManager:
Collaboration diagram for EMECDetectorManager:

Classes

class  EMECMagicNumbers
 This is a collection of numbers used to specify the construction of the electromagnetic endcap calorimeter and its cells. More...

Public Types

typedef std::vector< constEMECDetectorRegion * >::const_iterator DetectorRegionConstIterator
typedef EMECDetectorRegion const * EMECDetRegionArray[6][4][2][2]

Public Member Functions

 EMECDetectorManager (const EMECHVManager *hvManagerInner=nullptr, const EMECHVManager *hvManagerOuter=nullptr, const EMECPresamplerHVManager *presamplerHVManager=nullptr)
 Constructor.
virtual ~EMECDetectorManager () override
 Destructor.
EMECDetectorManager::DetectorRegionConstIterator beginDetectorRegion () const
 Iterate over detector regions.
EMECDetectorManager::DetectorRegionConstIterator endDetectorRegion () const
 Iterate over detector regions.
const EMECDetectorRegiongetDetectorRegion (unsigned int endcap, unsigned int sampling, unsigned int region, bool inner) 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.
double getFocalToRef () const
 This provides the distance in CLHEP::mm from the Focal Plane to the reference plane.
double getRefToActive () const
 This provides the distance in CLHEP::mm from the Active EMEC volume to the reference plane.
double getActiveLength () const
 Gives the overall active length of the EMEC outer and inner wheel volumes.
double getRefToPresampler () const
 This provides the distance in CLHEP::mm from the Active Endcap Presampler volume (center) to the reference plane.
double getPresamplerFullLength () const
 Gives the overall active length of the presampler volume.
unsigned int getNumZIW () const
 Gets the length of the ZIW Array.
double getZIW (unsigned int i) const
 This method provides access to the Array ZIW, which in turn comes from the database.
unsigned int getNumZSEP12 () const
 Gets the length of the ZSEP12 Array.
double getZSEP12 (unsigned int i) const
 This method provides access to the Array ZSEP12, which in turn comes from the database (EmecSamplingSep table).
unsigned int getNumZSEP23 () const
 Gets the length of the ZSEP23Array.
double getZSEP23 (unsigned int i) const
 This method provides access to the Array ZSEP23, which in turn comes from the database (EmecSamplingSep table).
void addDetectorRegion (const EMECDetectorRegion *region)
 Add a new HEC Detector Region.
void addTreeTop (const PVLink &treeTop)
 Add a Tree Top.
const EMECHVManagergetHVManager (EMECHVManager::IOType io) const
 Get the HV Managers.
const EMECPresamplerHVManagergetPresamplerHVManager () const
 Get the HV Manager (presampler)

Private Member Functions

 EMECDetectorManager (const EMECDetectorManager &right)
EMECDetectorManageroperator= (const EMECDetectorManager &right)

Private Attributes

std::vector< PVLink > m_treeTop
 This is the set of tree tops managed by this detector node.
std::vector< const EMECDetectorRegion * > m_DetRegionsIterative
 A vector of Region pointers which exists in order to provide iterative access to any EMECDetectorRegion held by this manager.
EMECDetRegionArray m_DetRegionsRandom {}
 A vector of Region pointers which exists in order to provide iterative access to any EMECDetectorRegion held by this manager.
std::vector< double > m_ziw
 A vector of doubles used to hold an array of sampling separations for the EMEC inner wheel.
std::vector< double > m_zsep12
 A vector of doubles used to hold an array of sampling separations for the EMEC outer wheel between sampling layer 1 and 2.
std::vector< double > m_zsep23
 A vector of doubles used to hold an array of sampling separations for the EMEC outer wheel between sampling layer 2 and 3.
EMECMagicNumbersm_MagicNumbers
 Clockwork for the EMECDetectorManager.
CxxUtils::CachedPointer< const EMECHVManagerm_HVManager [2]
 The HV Managers for the emec;.
CxxUtils::CachedPointer< const EMECPresamplerHVManagerm_presamplerHVManager

Detailed Description

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

The EMECDetectorManager provides access to EMEC Regions, to Descriptors for EMEC regions, to the physical volumes (tree tops) within the EMEC, and to a number of important engineering numbers (like the focal lengths) within the EMEC.

The ownership of EMECHVManager pointers NOT trasferred to EMECDetectorManager

Definition at line 30 of file EMECDetectorManager.h.

Member Typedef Documentation

◆ DetectorRegionConstIterator

typedef std::vector<constEMECDetectorRegion*>::const_iterator EMECDetectorManager::DetectorRegionConstIterator

Definition at line 34 of file EMECDetectorManager.h.

◆ EMECDetRegionArray

typedef EMECDetectorRegion const* EMECDetectorManager::EMECDetRegionArray[6][4][2][2]

Definition at line 35 of file EMECDetectorManager.h.

Constructor & Destructor Documentation

◆ EMECDetectorManager() [1/2]

EMECDetectorManager::EMECDetectorManager ( const EMECHVManager * hvManagerInner = nullptr,
const EMECHVManager * hvManagerOuter = nullptr,
const EMECPresamplerHVManager * presamplerHVManager = nullptr )

Constructor.

Definition at line 24 of file EMECDetectorManager.cxx.

28 , m_presamplerHVManager(presamplerHVManager)
29{
30 setName("LArEMEC");
31
32 for (unsigned int r=0;r<6;r++) {
33 for (unsigned int s=0;s<4;s++) {
34 for (unsigned int io=0;io<2;io++) {
35 for (unsigned int e=0;e<2;e++) {
36 m_DetRegionsRandom[r][s][io][e]=nullptr;
37 }
38 }
39 }
40 }
41
42 m_HVManager[0].store (hvManagerInner);
43 m_HVManager[1].store (hvManagerOuter);
44
45 // The EMEC gets and managers certain arrays needed to build descriptors. Here is that:
46 ISvcLocator *svcLocator = Gaudi::svcLocator();
47
48 SmartIF<IGeoModelSvc> geoModel{svcLocator->service("GeoModelSvc")};
49 if(!geoModel.isValid())
50 throw std::runtime_error("Error in EMECDetectorManager, cannot access GeoModelSvc");
51
52 SmartIF<IGeoDbTagSvc> geoDbTagSvc{svcLocator->service("GeoDbTagSvc")};
53 if(!geoDbTagSvc.isValid())
54 throw std::runtime_error("Error in EMECDetectorManager, cannot access GeoDbTagSvc");
55
56 SmartIF<IRDBAccessSvc> rdbAccess{svcLocator->service(geoDbTagSvc->getParamSvcName())};
57 if(!rdbAccess.isValid())
58 throw std::runtime_error("Error in EMECDetectorManager, cannot access RDBAccessSvc");
59
60 std::string larKey, larNode;
61 if(geoDbTagSvc->getSqliteReader()==nullptr) {
62 DecodeVersionKey larVersionKey(geoModel, "LAr");
63 larKey = larVersionKey.tag();
64 larNode = larVersionKey.node();
65 }
66
67 IRDBRecordset_ptr emecSamplingSep = rdbAccess->getRecordsetPtr("EmecSamplingSep", larKey, larNode);
68 if (emecSamplingSep->size()==0) throw std::runtime_error("Error getting EmecSamplingSep table");
69
70 const IRDBRecord *ess = (*emecSamplingSep)[0];
71 for (int j=0;j<7;j++) m_ziw.push_back(ess->getDouble("ZIW",j)*Gaudi::Units::cm);
72 for (int j=0;j<44;j++) m_zsep12.push_back(ess->getDouble("ZSEP12",j)*Gaudi::Units::cm);
73 for (int j=0;j<22;j++) m_zsep23.push_back(ess->getDouble("ZSEP23",j)*Gaudi::Units::cm);
74
75 IRDBRecordset_ptr emecMagicNumbers = rdbAccess->getRecordsetPtr("EmecMagicNumbers", larKey, larNode);
76 if (emecMagicNumbers->size()==0) {
77 emecMagicNumbers = rdbAccess->getRecordsetPtr("EmecMagicNumbers", "EmecMagicNumbers-00");
78 if (emecMagicNumbers->size()==0) {
79 throw std::runtime_error("Error getting EmecMagicNumbers table");
80 }
81 }
82 m_MagicNumbers->focalToRef =(*emecMagicNumbers)[0]->getDouble("FOCALTOREF")*Gaudi::Units::mm;
83 m_MagicNumbers->refToActive =(*emecMagicNumbers)[0]->getDouble("REFTOACTIVE")*Gaudi::Units::mm;
84 m_MagicNumbers->activeLength =(*emecMagicNumbers)[0]->getDouble("ACTIVELENGTH")*Gaudi::Units::mm;
85 m_MagicNumbers->refToPresampler =(*emecMagicNumbers)[0]->getDouble("REFTOPRESAMPLER")*Gaudi::Units::mm;
86 m_MagicNumbers->presamplerLength =(*emecMagicNumbers)[0]->getDouble("PRESAMPLERLENGTH")*Gaudi::Units::mm;
87}
std::shared_ptr< IRDBRecordset > IRDBRecordset_ptr
This is a collection of numbers used to specify the construction of the electromagnetic endcap calori...
CxxUtils::CachedPointer< const EMECPresamplerHVManager > m_presamplerHVManager
EMECDetRegionArray m_DetRegionsRandom
A vector of Region pointers which exists in order to provide iterative access to any EMECDetectorRegi...
CxxUtils::CachedPointer< const EMECHVManager > m_HVManager[2]
The HV Managers for the emec;.
EMECMagicNumbers * m_MagicNumbers
Clockwork for the EMECDetectorManager.
std::vector< double > m_zsep23
A vector of doubles used to hold an array of sampling separations for the EMEC outer wheel between sa...
std::vector< double > m_zsep12
A vector of doubles used to hold an array of sampling separations for the EMEC outer wheel between sa...
std::vector< double > m_ziw
A vector of doubles used to hold an array of sampling separations for the EMEC inner wheel.
virtual double getDouble(const std::string &fieldName) const =0
Get double field value.
virtual unsigned int size() const =0
int r
Definition globals.cxx:22

◆ ~EMECDetectorManager()

EMECDetectorManager::~EMECDetectorManager ( )
overridevirtual

Destructor.

Definition at line 90 of file EMECDetectorManager.cxx.

90 {
91 for (unsigned int i=0;i<getNumDetectorRegions();i++) delete m_DetRegionsIterative[i];
92 delete m_MagicNumbers;
93}
unsigned int getNumDetectorRegions() const
Gets the number of detectors in the set of detector regions.
std::vector< const EMECDetectorRegion * > m_DetRegionsIterative
A vector of Region pointers which exists in order to provide iterative access to any EMECDetectorRegi...

◆ EMECDetectorManager() [2/2]

EMECDetectorManager::EMECDetectorManager ( const EMECDetectorManager & right)
private

Member Function Documentation

◆ addDetectorRegion()

void EMECDetectorManager::addDetectorRegion ( const EMECDetectorRegion * region)

Add a new HEC Detector Region.

Definition at line 128 of file EMECDetectorManager.cxx.

129{
130 m_DetRegionsIterative.push_back(region);
131 size_t iregion = region->getRegionIndex();
132 if (iregion >= 6) {
133 throw std::out_of_range("EMECDetectorManager::addDetectorRegion -- region");
134 }
135 size_t isampling = region->getSamplingIndex();
136 if (isampling >= 4) {
137 throw std::out_of_range("EMECDetectorManager::addDetectorRegion -- sampling");
138 }
139 // coverity[checked_return]
140 size_t iradius = region->getRadialIndex();
141 if (iradius >= 2) {
142 throw std::out_of_range("EMECDetectorManager::addDetectorRegion -- radius");
143 }
144 size_t iendcap = region->getEndcapIndex();
145 if (iendcap >= 2) {
146 throw std::out_of_range("EMECDetectorManager::addDetectorRegion -- endcap");
147 }
148 m_DetRegionsRandom[iregion][isampling][iradius][iendcap] = region;
149}
unsigned int getRadialIndex() const
Returns the Radial (Outer Wheel=0,InnerWheel=1) Index.
unsigned int getRegionIndex() const
Returns the Region Index.
EMECDetectorRegion::DetectorSide getEndcapIndex() const
The endcap index.
unsigned int getSamplingIndex() const
Returns the Sampling Layer Index.

◆ addTreeTop()

void EMECDetectorManager::addTreeTop ( const PVLink & treeTop)

Add a Tree Top.

Definition at line 151 of file EMECDetectorManager.cxx.

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

◆ beginDetectorRegion()

EMECDetectorManager::DetectorRegionConstIterator EMECDetectorManager::beginDetectorRegion ( ) const

Iterate over detector regions.

Definition at line 98 of file EMECDetectorManager.cxx.

99{
100 return m_DetRegionsIterative.begin();
101}

◆ endDetectorRegion()

EMECDetectorManager::DetectorRegionConstIterator EMECDetectorManager::endDetectorRegion ( ) const

Iterate over detector regions.

Definition at line 103 of file EMECDetectorManager.cxx.

104{
105 return m_DetRegionsIterative.end();
106}

◆ getActiveLength()

double EMECDetectorManager::getActiveLength ( ) const
inline

Gives the overall active length of the EMEC outer and inner wheel volumes.

Definition at line 299 of file EMECDetectorManager.h.

300{
301
302 return m_MagicNumbers->activeLength;
303
304}

◆ getDetectorRegion()

const EMECDetectorRegion * EMECDetectorManager::getDetectorRegion ( unsigned int endcap,
unsigned int sampling,
unsigned int region,
bool inner ) const

Random Access to detector regions.

Definition at line 108 of file EMECDetectorManager.cxx.

109{
110 return m_DetRegionsRandom[region][sampling][inner ? 1 : 0][endcap];
111}

◆ getFocalToRef()

double EMECDetectorManager::getFocalToRef ( ) const
inline

This provides the distance in CLHEP::mm from the Focal Plane to the reference plane.

The reference plane is at the back of the transverse bar. The Focal distance is the point where cell boundaries cross. It is an engineering number used in the fabrication of the emec. Its value is 3689.5.

Definition at line 285 of file EMECDetectorManager.h.

286{
287
288 return m_MagicNumbers->focalToRef;
289
290}

◆ getHVManager()

const EMECHVManager & EMECDetectorManager::getHVManager ( EMECHVManager::IOType io) const

Get the HV Managers.

Definition at line 156 of file EMECDetectorManager.cxx.

157{
158 const EMECHVManager* out = m_HVManager[io].get();
159 if (!out) {
160 //Support lazy initialization for testbeams
161 ServiceHandle<StoreGateSvc> detStore ("DetectorStore", "HECHVManager");
162 const LArHVManager *manager{nullptr};
163 if (detStore->retrieve(manager)==StatusCode::SUCCESS) {
164 out = &(manager->getEMECHVManager(io));
165 m_HVManager[io].set (out);
166 }
167 }
168 if (!out) {
169 throw std::runtime_error ("EMECDetectorManager::getHVManager: Can't find LArHVManager in DetectorStore");
170 }
171 return *out;
172}

◆ getNumDetectorRegions()

unsigned int EMECDetectorManager::getNumDetectorRegions ( ) const

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

Definition at line 113 of file EMECDetectorManager.cxx.

114{
115 return m_DetRegionsIterative.size();
116}

◆ getNumTreeTops()

unsigned int EMECDetectorManager::getNumTreeTops ( ) const
overridevirtual

Gets the total number of tree tops.

Definition at line 123 of file EMECDetectorManager.cxx.

124{
125 return m_treeTop.size();
126}

◆ getNumZIW()

unsigned int EMECDetectorManager::getNumZIW ( ) const
inline

Gets the length of the ZIW Array.

Definition at line 320 of file EMECDetectorManager.h.

321{
322
323 return m_ziw.size();
324
325}

◆ getNumZSEP12()

unsigned int EMECDetectorManager::getNumZSEP12 ( ) const
inline

Gets the length of the ZSEP12 Array.

Definition at line 334 of file EMECDetectorManager.h.

335{
336
337 return m_zsep12.size();
338
339}

◆ getNumZSEP23()

unsigned int EMECDetectorManager::getNumZSEP23 ( ) const
inline

Gets the length of the ZSEP23Array.

Definition at line 348 of file EMECDetectorManager.h.

349{
350
351 return m_zsep23.size();
352
353}

◆ getPresamplerFullLength()

double EMECDetectorManager::getPresamplerFullLength ( ) const
inline

Gives the overall active length of the presampler volume.

Definition at line 313 of file EMECDetectorManager.h.

314{
315
316 return m_MagicNumbers->presamplerLength;
317
318}

◆ getPresamplerHVManager()

const EMECPresamplerHVManager & EMECDetectorManager::getPresamplerHVManager ( ) const

Get the HV Manager (presampler)

Definition at line 174 of file EMECDetectorManager.cxx.

175{
176 const EMECPresamplerHVManager* out = m_presamplerHVManager.get();
177 if (!out) {
178 ServiceHandle<StoreGateSvc> detStore ("DetectorStore", "HECHVManager");
179 const LArHVManager *manager{nullptr};
180 if (detStore->retrieve(manager)==StatusCode::SUCCESS) {
181 out = &(manager->getEMECPresamplerHVManager());
182 m_presamplerHVManager.set (out);
183 }
184 }
185 if (!out) {
186 throw std::runtime_error ("EMECDetectorManager::getPresamplerHVManager: Can't find LArHVManager in DetectorStore");
187 }
188 return *out;
189}

◆ getRefToActive()

double EMECDetectorManager::getRefToActive ( ) const
inline

This provides the distance in CLHEP::mm from the Active EMEC volume to the reference plane.

The reference plane is at the back of the transverse bar. Active EMEC volume is called LArOuterWheel or LArInnerWheel. Its value is 11 CLHEP::mm.

Definition at line 292 of file EMECDetectorManager.h.

293{
294
295 return m_MagicNumbers->refToActive;
296
297}

◆ getRefToPresampler()

double EMECDetectorManager::getRefToPresampler ( ) const
inline

This provides the distance in CLHEP::mm from the Active Endcap Presampler volume (center) to the reference plane.

The reference plane is at the back of the transverse bar.

Definition at line 306 of file EMECDetectorManager.h.

307{
308
309 return m_MagicNumbers->refToPresampler;
310
311}

◆ getTreeTop()

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

Gets the ith tree top.

Definition at line 118 of file EMECDetectorManager.cxx.

119{
120 return m_treeTop[i];
121}

◆ getZIW()

double EMECDetectorManager::getZIW ( unsigned int i) const
inline

This method provides access to the Array ZIW, which in turn comes from the database.

This array provides a list of positions where the two sampling layers in the inner wheel of the EMEC separate. These positions are measured from the focal plane.

Definition at line 327 of file EMECDetectorManager.h.

328{
329
330 return m_ziw[i];
331
332}

◆ getZSEP12()

double EMECDetectorManager::getZSEP12 ( unsigned int i) const
inline

This method provides access to the Array ZSEP12, which in turn comes from the database (EmecSamplingSep table).

This array provides a list of positions where the first two sampling layers in the outer wheel of the EMEC separate. These positions are measured from the focal plane.

Definition at line 341 of file EMECDetectorManager.h.

342{
343
344 return m_zsep12[i];
345
346}

◆ getZSEP23()

double EMECDetectorManager::getZSEP23 ( unsigned int i) const
inline

This method provides access to the Array ZSEP23, which in turn comes from the database (EmecSamplingSep table).

This array provides a list of positions where the second two sampling layers in the outer wheel of the EMEC separate. These positions are measured from the focal plane.

Definition at line 355 of file EMECDetectorManager.h.

356{
357
358 return m_zsep23[i];
359
360}

◆ operator=()

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

Member Data Documentation

◆ m_DetRegionsIterative

std::vector<const EMECDetectorRegion *> EMECDetectorManager::m_DetRegionsIterative
private

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

Definition at line 201 of file EMECDetectorManager.h.

◆ m_DetRegionsRandom

EMECDetRegionArray EMECDetectorManager::m_DetRegionsRandom {}
private

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

Definition at line 208 of file EMECDetectorManager.h.

208{};

◆ m_HVManager

CxxUtils::CachedPointer<const EMECHVManager> EMECDetectorManager::m_HVManager[2]
private

The HV Managers for the emec;.

Definition at line 243 of file EMECDetectorManager.h.

◆ m_MagicNumbers

EMECMagicNumbers* EMECDetectorManager::m_MagicNumbers
private

Clockwork for the EMECDetectorManager.

Definition at line 238 of file EMECDetectorManager.h.

◆ m_presamplerHVManager

CxxUtils::CachedPointer<const EMECPresamplerHVManager> EMECDetectorManager::m_presamplerHVManager
private

Definition at line 245 of file EMECDetectorManager.h.

◆ m_treeTop

std::vector<PVLink> EMECDetectorManager::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 194 of file EMECDetectorManager.h.

◆ m_ziw

std::vector<double> EMECDetectorManager::m_ziw
private

A vector of doubles used to hold an array of sampling separations for the EMEC inner wheel.

Note, these separations are relative to the focal point of the EMEC.

Definition at line 215 of file EMECDetectorManager.h.

◆ m_zsep12

std::vector<double> EMECDetectorManager::m_zsep12
private

A vector of doubles used to hold an array of sampling separations for the EMEC outer wheel between sampling layer 1 and 2.

Note, these separations are relative to the focal point of the EMEC.

Definition at line 225 of file EMECDetectorManager.h.

◆ m_zsep23

std::vector<double> EMECDetectorManager::m_zsep23
private

A vector of doubles used to hold an array of sampling separations for the EMEC outer wheel between sampling layer 2 and 3.

Note, these separations are relative to the focal point of the EMEC.

Definition at line 233 of file EMECDetectorManager.h.


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