ATLAS Offline Software
HECDetDescr.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
3 */
4 
6 #include "GaudiKernel/MsgStream.h"
7 #include "GaudiKernel/Bootstrap.h"
8 #include "GaudiKernel/SystemOfUnits.h"
16 
18  , unsigned int sampling
19  , unsigned int region
20  , const CellBinning &phiBinning
21  , bool isTestBeam)
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  IRDBAccessSvc *rdbAccess{nullptr};
34  IGeoModelSvc *geoModel{nullptr};
35  IGeoDbTagSvc *geoDbTagSvc{nullptr};
36 
37  if(svcLocator->service("GeoModelSvc",geoModel) == StatusCode::FAILURE)
38  throw std::runtime_error("Error in HECDetectorManager, cannot access GeoModelSvc");
39 
40  if(svcLocator->service("GeoDbTagSvc",geoDbTagSvc) == StatusCode::FAILURE)
41  throw std::runtime_error("Error in HECDetectorManager, cannot access GeoDbTagSvc");
42 
43  if(svcLocator->service(geoDbTagSvc->getParamSvcName(),rdbAccess) == StatusCode::FAILURE)
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 
53 IRDBRecordset_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++) {
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  }
83  if(isTestBeam && b==2) pos += (*hadronicEndcap)[0]->getDouble("GAPWHL")*Gaudi::Units::cm;
84  }
85  }
86 }
87 
88 
90 = default;
91 
HECLongBlock::getDepth
double getDepth() const
Depth of block (CLHEP::mm)
Definition: HECLongBlock.h:163
HECDetDescr::m_numBlocks
unsigned int m_numBlocks
Definition: HECDetDescr.h:115
IGeoModelSvc
Definition: IGeoModelSvc.h:17
HECDetDescr::m_firstBlock
unsigned int m_firstBlock
Definition: HECDetDescr.h:116
HECDetDescr::m_manager
const HECDetectorManager * m_manager
Definition: HECDetDescr.h:109
DecodeVersionKey::node
const std::string & node() const
Return the version node.
Definition: DecodeVersionKey.cxx:99
HECDetDescr::HECDetDescr
HECDetDescr(const HECDetectorManager *detManager, unsigned int sampling, unsigned int region, const CellBinning &phiBinning, bool isTestBeam=false)
Constructor.
Definition: HECDetDescr.cxx:17
HECDetDescr::m_samplingIndex
unsigned int m_samplingIndex
Definition: HECDetDescr.h:110
HECDetDescr::~HECDetDescr
~HECDetDescr()
Destructor.
cm
const double cm
Definition: Simulation/ISF/ISF_FastCaloSim/ISF_FastCaloSimParametrization/tools/FCAL_ChannelMap.cxx:25
HECDetDescr::m_etaBinning
CellBinning m_etaBinning
Definition: HECDetDescr.h:114
IRDBAccessSvc.h
Definition of the abstract IRDBAccessSvc interface.
IRDBAccessSvc
IRDBAccessSvc is an abstract interface to the athena service that provides the following functionalit...
Definition: IRDBAccessSvc.h:45
DecodeVersionKey
This is a helper class to query the version tags from GeoModelSvc and determine the appropriate tag a...
Definition: DecodeVersionKey.h:18
DecodeVersionKey::tag
const std::string & tag() const
Return version tag.
Definition: DecodeVersionKey.cxx:93
IGeoDbTagSvc
Definition: IGeoDbTagSvc.h:26
IRDBRecordset_ptr
std::shared_ptr< IRDBRecordset > IRDBRecordset_ptr
Definition: IRDBAccessSvc.h:25
HECDetectorManager
A manager class providing access to readout geometry information for the hadronic endcap calorimeter.
Definition: HECDetectorManager.h:28
HECDetectorManager::getBlock
const HECLongBlock * getBlock(unsigned int i) const
Random Access to Blocks.
Definition: HECDetectorManager.cxx:160
HECDetDescr::m_zMin
std::vector< double > m_zMin
Definition: HECDetDescr.h:117
plotBeamSpotMon.b
b
Definition: plotBeamSpotMon.py:77
HECDetectorManager::getNumBlocks
unsigned int getNumBlocks() const
Gets the number of blocks in the set of blocks.
Definition: HECDetectorManager.cxx:165
DecodeVersionKey.h
python.LumiBlobConversion.pos
pos
Definition: LumiBlobConversion.py:18
IRDBRecord.h
Definition of the abstract IRDBRecord interface.
HECDetDescr.h
HECDetDescr::m_zMax
std::vector< double > m_zMax
Definition: HECDetDescr.h:118
IRDBRecordset.h
Definition of the abstract IRDBRecordset interface.
IGeoModelSvc.h
StoreGateSvc.h
IGeoDbTagSvc.h