ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
LArCalorimeter
LArGeoModel
LArReadoutGeometry
src
HECDetDescr.cxx
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3
*/
4
5
#include "
LArReadoutGeometry/HECDetDescr.h
"
6
#include "GaudiKernel/MsgStream.h"
7
#include "GaudiKernel/Bootstrap.h"
8
#include "GaudiKernel/SystemOfUnits.h"
9
#include "
StoreGate/StoreGateSvc.h
"
10
#include "
RDBAccessSvc/IRDBRecord.h
"
11
#include "
RDBAccessSvc/IRDBRecordset.h
"
12
#include "
RDBAccessSvc/IRDBAccessSvc.h
"
13
#include "
GeoModelInterfaces/IGeoModelSvc.h
"
14
#include "
GeoModelInterfaces/IGeoDbTagSvc.h
"
15
#include "
GeoModelUtilities/DecodeVersionKey.h
"
16
17
HECDetDescr::HECDetDescr
(
const
HECDetectorManager
*detManager
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
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
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++) {
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
}
87
88
89
HECDetDescr::~HECDetDescr
()
90
=
default
;
91
DecodeVersionKey.h
HECDetDescr.h
IGeoDbTagSvc.h
IGeoModelSvc.h
IRDBAccessSvc.h
Definition of the abstract IRDBAccessSvc interface.
IRDBRecordset_ptr
std::shared_ptr< IRDBRecordset > IRDBRecordset_ptr
Definition
IRDBAccessSvc.h:30
IRDBRecord.h
Definition of the abstract IRDBRecord interface.
IRDBRecordset.h
Definition of the abstract IRDBRecordset interface.
StoreGateSvc.h
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:91
DecodeVersionKey::node
const std::string & node() const
Return the version node.
Definition
DecodeVersionKey.cxx:97
HECDetDescr::m_samplingIndex
unsigned int m_samplingIndex
Definition
HECDetDescr.h:110
HECDetDescr::m_zMin
std::vector< double > m_zMin
Definition
HECDetDescr.h:117
HECDetDescr::~HECDetDescr
~HECDetDescr()
Destructor.
HECDetDescr::m_regionIndex
unsigned int m_regionIndex
Definition
HECDetDescr.h:111
HECDetDescr::m_phiBinning
CellBinning m_phiBinning
Definition
HECDetDescr.h:112
HECDetDescr::m_firstBlock
unsigned int m_firstBlock
Definition
HECDetDescr.h:116
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_outerRadSegNumber
unsigned int m_outerRadSegNumber
Definition
HECDetDescr.h:113
HECDetDescr::m_manager
const HECDetectorManager * m_manager
Definition
HECDetDescr.h:109
HECDetDescr::m_etaBinning
CellBinning m_etaBinning
Definition
HECDetDescr.h:114
HECDetDescr::m_zMax
std::vector< double > m_zMax
Definition
HECDetDescr.h:118
HECDetDescr::m_numBlocks
unsigned int m_numBlocks
Definition
HECDetDescr.h:115
HECDetectorManager
A manager class providing access to readout geometry information for the hadronic endcap calorimeter.
Definition
HECDetectorManager.h:28
IRDBRecordset::size
virtual unsigned int size() const =0
Generated on
for ATLAS Offline Software by
1.17.0