ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
LArCalorimeter
LArGeoModel
LArReadoutGeometry
src
EMBBasicReadoutNumbers.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 "GaudiKernel/MsgStream.h"
6
#include "GaudiKernel/Bootstrap.h"
7
#include "GaudiKernel/ISvcLocator.h"
8
#include "GaudiKernel/SystemOfUnits.h"
9
10
#include "
RDBAccessSvc/IRDBRecord.h
"
11
#include "
RDBAccessSvc/IRDBRecordset.h
"
12
#include "
RDBAccessSvc/IRDBAccessSvc.h
"
13
14
15
#include "
GeoModelInterfaces/IGeoModelSvc.h
"
16
#include "
GeoModelInterfaces/IGeoDbTagSvc.h
"
17
#include "
GeoModelUtilities/DecodeVersionKey.h
"
18
#include "
LArReadoutGeometry/EMBBasicReadoutNumbers.h
"
19
20
EMBBasicReadoutNumbers::EMBBasicReadoutNumbers
()
21
{
22
// The EMB gets and managers certain arrays needed to build descriptors. Here is that:
23
ISvcLocator *svcLocator = Gaudi::svcLocator();
24
25
SmartIF<IGeoModelSvc> geoModel{svcLocator->service(
"GeoModelSvc"
)};
26
if
(!geoModel.isValid())
27
throw
std::runtime_error(
"Error in HECDetectorManager, cannot access GeoModelSvc"
);
28
29
SmartIF<IGeoDbTagSvc> geoDbTagSvc{svcLocator->service(
"GeoDbTagSvc"
)};
30
if
(!geoDbTagSvc.isValid())
31
throw
std::runtime_error(
"Error in HECDetectorManager, cannot access GeoDbTagSvc"
);
32
33
SmartIF<IRDBAccessSvc> rdbAccess{svcLocator->service(geoDbTagSvc->getParamSvcName())};
34
if
(!rdbAccess.isValid())
35
throw
std::runtime_error(
"Error in HECDetectorManager, cannot access RDBAccessSvc"
);
36
37
std::string larKey, larNode;
38
if
(geoDbTagSvc->getSqliteReader()==
nullptr
) {
39
DecodeVersionKey
larVersionKey(geoModel,
"LAr"
);
40
larKey = larVersionKey.
tag
();
41
larNode = larVersionKey.
node
();
42
}
43
44
IRDBRecordset_ptr
barrelLongDiv = rdbAccess->getRecordsetPtr(
"BarrelLongDiv"
, larKey, larNode);
45
if
(barrelLongDiv->
size
()==0)
throw
std::runtime_error(
"Error getting BarrelLongDiv table"
);
46
47
IRDBRecordset_ptr
barrelGeometry = rdbAccess->getRecordsetPtr(
"BarrelGeometry"
, larKey, larNode);
48
if
(barrelGeometry->
size
()==0)
throw
std::runtime_error(
"Error getting BarrelGeometry table"
);
49
50
IRDBRecordset_ptr
presamplerGeometry = rdbAccess->getRecordsetPtr(
"PresamplerGeometry"
, larKey, larNode);
51
if
(presamplerGeometry->
size
()==0)
throw
std::runtime_error(
"Error getting PresamplerGeometry table"
);
52
53
IRDBRecordset_ptr
embSampSep = rdbAccess->getRecordsetPtr(
"EMBSampSep"
, larKey, larNode);
54
if
(embSampSep->
size
()==0) {
55
embSampSep = rdbAccess->getRecordsetPtr(
"EMBSampSep"
,
"EMBSampSep-00"
);
56
if
(embSampSep->
size
()==0) {
57
throw
std::runtime_error(
"Error getting EMBSampSep table"
);
58
}
59
}
60
61
m_presamplerRadius
= (*presamplerGeometry)[0]->getDouble(
"RACTIVE"
)*Gaudi::Units::cm;
62
m_rInAc
= (*barrelGeometry)[0]->getDouble(
"RIN_AC"
)*Gaudi::Units::cm;
63
m_rOutAc
= (*barrelGeometry)[0]->getDouble(
"ROUT_AC"
)*Gaudi::Units::cm;
64
for
(
int
i=0;i<8;i++)
m_EE
.push_back((*barrelLongDiv)[0]->getDouble(
"EE"
,i));
65
for
(
int
i=0;i<8;i++)
m_RMX12
.push_back((*barrelLongDiv)[0]->getDouble(
"RMX12"
,i)*Gaudi::Units::cm);
66
for
(
int
i=0;i<53;i++)
m_RMX23
.push_back((*barrelLongDiv)[0]->getDouble(
"RMX23"
,i)*Gaudi::Units::cm);
67
68
int
sampSepSize = embSampSep->
size
();
69
m_EMBSamplingSepInnerRMax
.resize(sampSepSize,0.0);
70
for
(
int
i{0}; i<sampSepSize; ++i) {
71
m_EMBSamplingSepInnerRMax
.at((*embSampSep)[i]->getInt(
"IND"
))=(*embSampSep)[i]->getDouble(
"RMAX"
);
72
}
73
}
74
75
EMBBasicReadoutNumbers::~EMBBasicReadoutNumbers
()
76
=
default
;
77
78
DecodeVersionKey.h
EMBBasicReadoutNumbers.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.
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
EMBBasicReadoutNumbers::EMBBasicReadoutNumbers
EMBBasicReadoutNumbers()
Constructor.
Definition
EMBBasicReadoutNumbers.cxx:20
EMBBasicReadoutNumbers::m_rInAc
double m_rInAc
Definition
EMBBasicReadoutNumbers.h:91
EMBBasicReadoutNumbers::m_EE
std::vector< double > m_EE
Definition
EMBBasicReadoutNumbers.h:94
EMBBasicReadoutNumbers::~EMBBasicReadoutNumbers
~EMBBasicReadoutNumbers()
Destructor.
EMBBasicReadoutNumbers::m_RMX12
std::vector< double > m_RMX12
Definition
EMBBasicReadoutNumbers.h:95
EMBBasicReadoutNumbers::m_RMX23
std::vector< double > m_RMX23
Definition
EMBBasicReadoutNumbers.h:96
EMBBasicReadoutNumbers::m_EMBSamplingSepInnerRMax
std::vector< double > m_EMBSamplingSepInnerRMax
Definition
EMBBasicReadoutNumbers.h:93
EMBBasicReadoutNumbers::m_presamplerRadius
double m_presamplerRadius
Definition
EMBBasicReadoutNumbers.h:90
EMBBasicReadoutNumbers::m_rOutAc
double m_rOutAc
Definition
EMBBasicReadoutNumbers.h:92
IRDBRecordset::size
virtual unsigned int size() const =0
Generated on
for ATLAS Offline Software by
1.17.0