ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
InnerDetector
InDetDetDescr
PixelGeoModel
src
IBLParameterSvc.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 "
IBLParameterSvc.h
"
6
#include "GaudiKernel/ServiceHandle.h"
7
#include "GaudiKernel/PathResolver.h"
8
9
//Includes related to determining presence of IBL
10
#include "
RDBAccessSvc/IRDBAccessSvc.h
"
11
#include "
RDBAccessSvc/IRDBRecord.h
"
12
#include "
RDBAccessSvc/IRDBRecordset.h
"
13
#include "
GeoModelInterfaces/IGeoDbTagSvc.h
"
14
#include "
GeoModelUtilities/DecodeVersionKey.h
"
15
16
20
IBLParameterSvc::IBLParameterSvc
(
const
std::string& name,ISvcLocator* svc)
21
: base_class(name,svc),
22
m_IBLpresent
{},
23
m_DBMpresent
{},
24
m_LayerColumnsPerFE
{},
25
m_LayerRowsPerFE
{},
26
m_LayerFEsPerHalfModule_planar
{},
27
m_LayerFEsPerHalfModule_3d
{},
28
m_layout
{},
29
m_geoDbTagSvc
(
"GeoDbTagSvc"
,name),
30
m_disablePixMapCondDB
(false),
31
m_disableSpecialPixels
(false),
32
m_disableAlignable
(false),
33
m_disableAllClusterSplitting
(false),
34
m_disableDCS
(true) {
35
declareProperty(
"GeoDbTagSvc"
,
m_geoDbTagSvc
);
36
declareProperty(
"DisablePixMapCondDB"
,
m_disablePixMapCondDB
);
37
declareProperty(
"DisableSpecialPixels"
,
m_disableSpecialPixels
);
38
declareProperty(
"DisableAlignable"
,
m_disableAlignable
);
39
declareProperty(
"DisableAllClusterSplitting"
,
m_disableAllClusterSplitting
);
40
declareProperty(
"DisableDCS"
,
m_disableDCS
);
41
}
42
43
IBLParameterSvc::~IBLParameterSvc
()
44
{
45
}
46
50
StatusCode
IBLParameterSvc::initialize
()
51
{
52
//MsgStream log(msgSvc(), name());
53
54
StatusCode result = AthService::initialize();
55
if
(result.isFailure())
56
{
57
ATH_MSG_FATAL
(
"Unable to initialize the service!"
);
58
return
result;
59
}
60
// read Charge Collection Probability Maps
61
//
62
// get the PixelDigitization random stream
63
//
64
65
if
(!
setIblParameters
().isSuccess())
return
StatusCode::FAILURE;
66
67
ATH_MSG_DEBUG
(
"initialized service!"
);
68
return
result;
69
70
}
71
72
//Determine if IBL is present and set appropriate parameters
73
StatusCode
IBLParameterSvc::setIblParameters
() {
74
ATH_CHECK
(
m_geoDbTagSvc
.retrieve());
75
76
77
std::string versionTag{}, versionNode{};
78
if
(!
m_geoDbTagSvc
->getSqliteReader()) {
79
DecodeVersionKey
detectorKey{
m_geoDbTagSvc
.get(),
"Pixel"
};
80
versionTag = detectorKey.
tag
();
81
versionNode = detectorKey.
node
();
82
}
83
84
SmartIF<IRDBAccessSvc> rdbAccess{Gaudi::svcLocator()->service(
m_geoDbTagSvc
->getParamSvcName())};
85
if
(!rdbAccess) {
86
ATH_MSG_FATAL
(
"Could not locate RDBAccessSvc"
);
87
return
StatusCode::FAILURE;
88
}
89
IRDBRecordset_ptr
switchSet = rdbAccess->getRecordsetPtr(
"PixelSwitches"
, versionTag, versionNode);
90
const
IRDBRecord
*switchTable = (*switchSet)[0];
91
std::string versionName(
""
);
92
if
(!switchTable->
isFieldNull
(
"VERSIONNAME"
)) versionName=switchTable->
getString
(
"VERSIONNAME"
);
93
m_DBMpresent
=
false
;
94
if
(!switchTable->
isFieldNull
(
"BUILDDBM"
))
m_DBMpresent
=switchTable->
getInt
(
"BUILDDBM"
);
95
if
(versionName==
"IBL"
) {
96
m_IBLpresent
=
true
;
97
ATH_MSG_INFO
(
"IBL geometry"
);
98
}
99
else
{
100
m_IBLpresent
=
false
;
101
ATH_MSG_VERBOSE
(
"Default geometry"
);
102
}
103
m_LayerFEsPerHalfModule_3d
= 0;
104
m_LayerFEsPerHalfModule
.clear();
105
if
(
m_IBLpresent
) {
106
IRDBRecordset_ptr
PixelReadout = rdbAccess->getRecordsetPtr(
"PixelReadout"
, versionTag, versionNode);
107
IRDBRecordset_ptr
PixelStave = rdbAccess->getRecordsetPtr(
"PixelStave"
, versionTag, versionNode);
108
const
IRDBRecord
*IBLreadout = (*PixelReadout)[1];
109
if
(!IBLreadout->
isFieldNull
(
"COLSPERCHIP"
))
m_LayerColumnsPerFE
=IBLreadout->
getInt
(
"COLSPERCHIP"
);
110
if
(!IBLreadout->
isFieldNull
(
"ROWSPERCHIP"
))
m_LayerRowsPerFE
=IBLreadout->
getInt
(
"ROWSPERCHIP"
);
111
if
(!IBLreadout->
isFieldNull
(
"NCHIPSETA"
))
m_LayerFEsPerHalfModule_planar
=IBLreadout->
getInt
(
"NCHIPSETA"
);
112
if
((*PixelReadout).size()>2) {
113
const
IRDBRecord
*IBL3Dreadout = (*PixelReadout)[2];
114
if
(!IBL3Dreadout->
isFieldNull
(
"NCHIPSETA"
))
m_LayerFEsPerHalfModule_3d
=IBL3Dreadout->
getInt
(
"NCHIPSETA"
);
115
}
116
const
IRDBRecord
*IBLstave = (*PixelStave)[1];
117
if
(!IBLstave->
isFieldNull
(
"LAYOUT"
))
m_layout
=IBLstave->
getInt
(
"LAYOUT"
);
118
if
(
m_layout
==4)
for
(
int
i = 0; i < 16; i++)
m_LayerFEsPerHalfModule
.push_back(
m_LayerFEsPerHalfModule_planar
);
119
if
(
m_layout
==5) {
120
for
(
int
i =0; i < 4; i++)
m_LayerFEsPerHalfModule
.push_back(
m_LayerFEsPerHalfModule_3d
);
121
for
(
int
i =0; i < 12; i++)
m_LayerFEsPerHalfModule
.push_back(
m_LayerFEsPerHalfModule_planar
);
122
for
(
int
i =0; i < 4; i++)
m_LayerFEsPerHalfModule
.push_back(
m_LayerFEsPerHalfModule_3d
);
123
}
124
}
125
return
StatusCode::SUCCESS;
126
}
127
128
StatusCode
IBLParameterSvc::finalize
()
129
{
130
return
StatusCode::SUCCESS;
131
}
132
ATH_CHECK
#define ATH_CHECK
Evaluate an expression and check for errors.
Definition
AthCheckMacros.h:40
ATH_MSG_FATAL
#define ATH_MSG_FATAL(x)
Definition
AthMsgStreamMacros.h:34
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition
AthMsgStreamMacros.h:31
ATH_MSG_VERBOSE
#define ATH_MSG_VERBOSE(x)
Definition
AthMsgStreamMacros.h:28
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition
AthMsgStreamMacros.h:29
DecodeVersionKey.h
IBLParameterSvc.h
IGeoDbTagSvc.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
IBLParameterSvc::setIblParameters
StatusCode setIblParameters()
Definition
IBLParameterSvc.cxx:73
IBLParameterSvc::m_geoDbTagSvc
ServiceHandle< IGeoDbTagSvc > m_geoDbTagSvc
Definition
IBLParameterSvc.h:85
IBLParameterSvc::m_disablePixMapCondDB
bool m_disablePixMapCondDB
Definition
IBLParameterSvc.h:86
IBLParameterSvc::initialize
virtual StatusCode initialize() override
Initialize Service.
Definition
IBLParameterSvc.cxx:50
IBLParameterSvc::m_LayerColumnsPerFE
int m_LayerColumnsPerFE
Definition
IBLParameterSvc.h:82
IBLParameterSvc::m_disableAllClusterSplitting
bool m_disableAllClusterSplitting
Definition
IBLParameterSvc.h:89
IBLParameterSvc::m_LayerFEsPerHalfModule_3d
int m_LayerFEsPerHalfModule_3d
Definition
IBLParameterSvc.h:82
IBLParameterSvc::m_DBMpresent
bool m_DBMpresent
Definition
IBLParameterSvc.h:81
IBLParameterSvc::m_disableDCS
bool m_disableDCS
Definition
IBLParameterSvc.h:90
IBLParameterSvc::m_LayerFEsPerHalfModule_planar
int m_LayerFEsPerHalfModule_planar
Definition
IBLParameterSvc.h:82
IBLParameterSvc::finalize
virtual StatusCode finalize() override
Definition
IBLParameterSvc.cxx:128
IBLParameterSvc::m_layout
int m_layout
Definition
IBLParameterSvc.h:82
IBLParameterSvc::m_disableSpecialPixels
bool m_disableSpecialPixels
Definition
IBLParameterSvc.h:87
IBLParameterSvc::IBLParameterSvc
IBLParameterSvc(const std::string &name, ISvcLocator *svc)
Constructor(s).
Definition
IBLParameterSvc.cxx:20
IBLParameterSvc::~IBLParameterSvc
virtual ~IBLParameterSvc()
Definition
IBLParameterSvc.cxx:43
IBLParameterSvc::m_LayerRowsPerFE
int m_LayerRowsPerFE
Definition
IBLParameterSvc.h:82
IBLParameterSvc::m_IBLpresent
bool m_IBLpresent
Definition
IBLParameterSvc.h:81
IBLParameterSvc::m_disableAlignable
bool m_disableAlignable
Definition
IBLParameterSvc.h:88
IBLParameterSvc::m_LayerFEsPerHalfModule
std::vector< int > m_LayerFEsPerHalfModule
Definition
IBLParameterSvc.h:83
IRDBRecord
IRDBRecord is one record in the IRDBRecordset object.
Definition
IRDBRecord.h:28
IRDBRecord::isFieldNull
virtual bool isFieldNull(std::string_view fieldName) const =0
Check if the field value is NULL.
IRDBRecord::getInt
virtual int getInt(std::string_view fieldName) const =0
Get int field value.
IRDBRecord::getString
virtual const std::string & getString(std::string_view fieldName) const =0
Get string field value.
Generated on
for ATLAS Offline Software by
1.17.0