|
ATLAS Offline Software
|
Go to the documentation of this file.
7 #include "GaudiKernel/MsgStream.h"
8 #include "GaudiKernel/Bootstrap.h"
9 #include "GaudiKernel/SystemOfUnits.h"
23 : GeoVDetectorManager()
24 , m_HVManager(hvManager)
25 , m_isTestBeam(isTestBeam)
29 ISvcLocator *svcLocator = Gaudi::svcLocator();
31 SmartIF<IGeoModelSvc> geoModel{svcLocator->service(
"GeoModelSvc")};
32 if(!geoModel.isValid())
33 throw std::runtime_error(
"Error in HECDetectorManager, cannot access GeoModelSvc");
35 SmartIF<IGeoDbTagSvc> geoDbTagSvc{svcLocator->service(
"GeoDbTagSvc")};
36 if(!geoDbTagSvc.isValid())
37 throw std::runtime_error(
"Error in HECDetectorManager, cannot access GeoDbTagSvc");
39 SmartIF<IRDBAccessSvc> rdbAccess{svcLocator->service(geoDbTagSvc->getParamSvcName())};
40 if(!rdbAccess.isValid())
41 throw std::runtime_error(
"Error in HECDetectorManager, cannot access RDBAccessSvc");
43 std::string larKey, larNode;
44 if(geoDbTagSvc->getSqliteReader()==
nullptr) {
46 larKey = larVersionKey.
tag();
47 larNode = larVersionKey.
node();
50 IRDBRecordset_ptr hecLongBlock = rdbAccess->getRecordsetPtr(
"HecLongitudinalBlock",larKey,larNode);
52 IRDBRecordset_ptr hadronicEndcap = rdbAccess->getRecordsetPtr(
"HadronicEndcap",larKey,larNode);
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");
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");
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");
75 if (hecPad->size()!=hecLongBlock->size())
throw std::runtime_error(
"Error. Hec[LongitudinalBlock,Pad] size discrepancy");
80 double betweenWheel=(*hadronicEndcap)[0]->getDouble(
"GAPWHL")*
Gaudi::Units::cm;
83 for (
unsigned int b=0;
b<hecLongBlock->size();
b++) {
84 double etaBoundary[15];
86 unsigned int blockNumber= (
unsigned int) (block->
getDouble(
"IBLC")+0.01);
90 unsigned int numLArGaps= (
unsigned int) (block->
getDouble(
"BLMOD") + 0.01);
95 for (
int j=0;j<15;j++) etaBoundary[j]=pad->
getDouble(
"ETA",j);
const HECHVManager * m_HVManager
@ depth
pointing depth of the shower as calculated in egammaqgcld
HECDetRegionArray m_DetRegionsRandom
An array of Region pointers which exists in order to provide random access to any HECDetectorRegion h...
virtual ~HECDetectorManager() override
Destructor.
const std::string & node() const
Return the version node.
unsigned int getNumDetectorRegions() const
Gets the number of detectors in the set of detector regions.
void addTreeTop(const PVLink &treeTop)
Add a Tree Top.
unsigned int getRegionIndex() const
Returns the Region Index.
HECDetectorManager::BlockConstIterator beginBlock() const
Iterate over blocks.
Definition of the abstract IRDBAccessSvc interface.
Description of a region of homogenous granularity in the hadronic endcap calorimeter.
This is a helper class to query the version tags from GeoModelSvc and determine the appropriate tag a...
HECDetectorManager::DetectorRegionConstIterator endDetectorRegion() const
Iterate over detector regions.
std::vector< const HECLongBlock * > m_HecLongBlock
const std::string & tag() const
Return version tag.
std::vector< const HECLongBlock * >::const_iterator BlockConstIterator
HECDetectorManager::DetectorRegionConstIterator beginDetectorRegion() const
Iterate over detector regions.
std::shared_ptr< IRDBRecordset > IRDBRecordset_ptr
const HECLongBlock * getBlock(unsigned int i) const
Random Access to Blocks.
HECDetectorRegion::DetectorSide getEndcapIndex() const
The endcap index.
unsigned int getNumBlocks() const
Gets the number of blocks in the set of blocks.
virtual unsigned int getNumTreeTops() const override
Gets the total number of tree tops.
This class provides direct access to information on the HV electrodes within the barrels....
Definition of the abstract IRDBRecord interface.
HECDetectorManager(const HECHVManager *hvManager=nullptr, bool isTestBeam=false)
Constructor.
IRDBRecord is one record in the IRDBRecordset object.
virtual PVConstLink getTreeTop(unsigned int i) const override
Gets the ith tree top.
std::vector< const HECDetectorRegion * >::const_iterator DetectorRegionConstIterator
void addDetectorRegion(const HECDetectorRegion *region)
Add a new HEC Detector Region.
HECDetectorManager::BlockConstIterator endBlock() const
Iterate over blocks.
const HECHVManager & getHVManager() const
Get the HV Manager.
virtual double getDouble(const std::string &fieldName) const =0
Get double field value.
const HECDetectorRegion * getDetectorRegion(unsigned int endcap, unsigned int sampling, unsigned int region) const
Random Access to detector regions.
Definition of the abstract IRDBRecordset interface.
std::vector< const HECDetectorRegion * > m_DetRegionsIterative
A vector of Region pointer which exists in order to provide iterative access to any HECDetectorRegion...
unsigned int getSamplingIndex() const
Returns the Sampling Layer Index (0-3)
std::vector< PVLink > m_treeTop
This is the set of tree tops managed by this detector node.