ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
LArCalorimeter
LArCalibTools
src
LArParamsProperties.cxx
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
3
*/
4
5
#include "
LArCalibTools/LArParamsProperties.h
"
6
7
// validity of payload data ( invalid = empty )
8
//----------------------------------------------
9
10
bool
LArParamsProperties::isValid
(
const
LArCaliPulseParamsP
& p) {
return
( p.m_Tcal !=
ILArCaliPulseParams::ERRORCODE
) ; }
11
bool
LArParamsProperties::isValid
(
const
LArDetCellParamsP
& p) {
return
( p.m_Omega0 !=
ILArDetCellParams::ERRORCODE
) ; }
12
bool
LArParamsProperties::isValid
(
const
LArPhysCaliTdiffP
& p) {
return
( p.m_Tdiff !=
ILArPhysCaliTdiff::ERRORCODE
) ; }
13
bool
LArParamsProperties::isValid
(
const
LArTdriftP
& p) {
return
( p.m_Tdrift !=
ILArTdrift::ERRORCODE
) ; }
14
#ifdef LARRAWCONDITIONS_LARSINGLEFLOATP
15
bool
LArParamsProperties::isValid
(
const
LArSingleFloatP
& p) {
return
( p.isEmpty());}
16
#endif
17
#ifdef LARRAWCONDITIONS_LARMPHYSOVERMCALP1
18
bool
LArParamsProperties::isValid
(
const
LArMphysOverMcalP1
& p) {
return
(
p
.m_MphysOverMcal >= 0 ) ; }
19
#endif
20
bool
LArParamsProperties::isValid
(
const
LArRinjP
& p) {
return
( p.m_Rinj !=
ILArRinj::ERRORCODE
) ; }
21
bool
LArParamsProperties::isValid
(
const
LArTshaperP
& p) {
return
( p.m_Tshaper !=
ILArTshaper::ERRORCODE
) ; }
22
bool
LArParamsProperties::isValid
(
const
LArEMEC_CphiP
& p) {
return
( p.m_EMEC_Cphi !=
ILArEMEC_Cphi::ERRORCODE
) ; }
23
bool
LArParamsProperties::isValid
(
const
LArEMEC_HValphaP
& p) {
return
( p.m_EMEC_HValpha !=
ILArEMEC_HValpha::ERRORCODE
) ; }
24
bool
LArParamsProperties::isValid
(
const
LArEMEC_HVbetaP
& p) {
return
( p.m_EMEC_HVbeta !=
ILArEMEC_HVbeta::ERRORCODE
) ; }
25
bool
LArParamsProperties::isValid
(
const
LArCableLengthP
& p) {
return
( p.m_CableLength !=
ILArCableLength::ERRORCODE
) ; }
26
bool
LArParamsProperties::isValid
(
const
LArCableAttenuationP
& p) {
return
( p.m_CableAttenuation !=
ILArCableAttenuation::ERRORCODE
) ; }
27
bool
LArParamsProperties::isValid
(
const
LArOFCBinP
& p) {
return
( p.m_bin !=
LArOFCBinP::ERRORCODE
) ; }
28
29
// conversion: data class pointer --> class index
30
//------------------------------------------------
31
unsigned
LArParamsProperties::getClassIndex
(
const
LArCaliPulseParamsComplete
*) {
return
CaliPulseParamsComplete
; }
32
unsigned
LArParamsProperties::getClassIndex
(
const
LArDetCellParamsComplete
*) {
return
DetCellParamsComplete
; }
33
unsigned
LArParamsProperties::getClassIndex
(
const
LArPhysCaliTdiffComplete*) {
return
PhysCaliTdiffComplete
; }
34
unsigned
LArParamsProperties::getClassIndex
(
const
LArTdriftComplete
*) {
return
TdriftComplete
; }
35
unsigned
LArParamsProperties::getClassIndex
(
const
LArMphysOverMcalComplete
*) {
return
MphysOverMcalComplete
; }
36
unsigned
LArParamsProperties::getClassIndex
(
const
LArRinjComplete
*) {
return
RinjComplete
; }
37
unsigned
LArParamsProperties::getClassIndex
(
const
LArTshaperComplete
*) {
return
TshaperComplete
; }
38
unsigned
LArParamsProperties::getClassIndex
(
const
LArEMEC_CphiComplete
*) {
return
EMEC_CphiComplete
; }
39
unsigned
LArParamsProperties::getClassIndex
(
const
LArEMEC_HValphaComplete
*) {
return
EMEC_HValphaComplete
; }
40
unsigned
LArParamsProperties::getClassIndex
(
const
LArEMEC_HVbetaComplete
*) {
return
EMEC_HVbetaComplete
; }
41
unsigned
LArParamsProperties::getClassIndex
(
const
LArCableLengthComplete
*) {
return
CableLengthComplete
; }
42
unsigned
LArParamsProperties::getClassIndex
(
const
LArCableAttenuationComplete
*) {
return
CableAttenuationComplete
; }
43
//unsigned LArParamsProperties::getClassIndex(const LArCaliPulseParamsVsCalib*) { return CaliPulseParamsVsCalib ; }
44
unsigned
LArParamsProperties::getClassIndex
(
const
LArOFCBinComplete
*) {
return
OFCBinComplete
; }
45
46
// vector of class names
47
//-----------------------
48
const
std::vector< std::string > &
LArParamsProperties::ClassNames
()
49
{
50
static
const
std::vector<std::string> names = []() {
51
std::vector<std::string> names(
END_OF_LIST
);
52
names[
CaliPulseParamsComplete
] =
"LArCaliPulseParamsComplete"
;
53
names[
DetCellParamsComplete
] =
"LArDetCellParamsComplete"
;
54
names[
PhysCaliTdiffComplete
] =
"LArPhysCaliTdiffComplete"
;
55
names[
TdriftComplete
] =
"LArTdriftComplete"
;
56
names[
MphysOverMcalComplete
] =
"LArMphysOverMcalComplete"
;
57
names[
RinjComplete
] =
"LArRinjComplete"
;
58
names[
TshaperComplete
] =
"LArTshaperComplete"
;
59
names[
EMEC_CphiComplete
] =
"LArEMEC_CphiComplete"
;
60
names[
EMEC_HValphaComplete
] =
"LArEMEC_HValphaComplete"
;
61
names[
EMEC_HVbetaComplete
] =
"LArEMEC_HVbetaComplete"
;
62
names[
CableLengthComplete
] =
"LArCableLengthComplete"
;
63
names[
CableAttenuationComplete
] =
"LArCableAttenuationComplete"
;
64
//names[CaliPulseParamsVsCalib] = "LArCaliPulseParamsVsCalib" ;
65
names[
OFCBinComplete
] =
"LArOFCBinComplete"
;
66
names[
PhysCaliTdiffComplete
] =
"LArPhysCaliTdiffComplete"
;
67
return
names ;
68
}() ;
69
return
names ;
70
}
71
72
// number of parameters hosted in each data class
73
//------------------------------------------------
74
unsigned
LArParamsProperties::numberOfParams
(
unsigned
index
)
75
{
76
static
const
std::vector<unsigned> nOfPars = []() {
77
std::vector<unsigned> nOfPars(
END_OF_LIST
) ;
78
nOfPars[
CaliPulseParamsComplete
] = 5 ;
79
nOfPars[
DetCellParamsComplete
] = 2 ;
80
nOfPars[
PhysCaliTdiffComplete
] = 1 ;
81
nOfPars[
TdriftComplete
] = 1 ;
82
nOfPars[
MphysOverMcalComplete
] = 1 ;
83
nOfPars[
RinjComplete
] = 1 ;
84
nOfPars[
TshaperComplete
] = 1 ;
85
nOfPars[
EMEC_CphiComplete
] = 1 ;
86
nOfPars[
EMEC_HValphaComplete
] = 1 ;
87
nOfPars[
EMEC_HVbetaComplete
] = 1 ;
88
nOfPars[
CableLengthComplete
] = 1 ;
89
nOfPars[
CableAttenuationComplete
] = 1 ;
90
//nOfPars[CaliPulseParamsVsCalib] = 5 ;
91
nOfPars[
OFCBinComplete
] = 1 ;
92
nOfPars[
PhysCaliTdiffComplete
] = 1 ;
93
return
nOfPars ;
94
}() ;
95
if
(
index
<
END_OF_LIST
)
return
nOfPars[
index
] ;
96
return
0 ;
97
}
98
99
// gain dependency of data class parameters
100
//------------------------------------------
101
bool
LArParamsProperties::isGainDependent
(
unsigned
index
)
102
{
103
static
const
std::vector<bool> useGain = []() {
104
std::vector<bool> useGain(
END_OF_LIST
) ;
105
useGain[
CaliPulseParamsComplete
] = true ;
106
useGain[
DetCellParamsComplete
] = true ;
107
useGain[
PhysCaliTdiffComplete
] = true ;
108
useGain[
TdriftComplete
] = false ;
109
useGain[
MphysOverMcalComplete
] = true ;
110
useGain[
RinjComplete
] = false ;
111
useGain[
TshaperComplete
] = false ;
112
useGain[
EMEC_CphiComplete
] = false ;
113
useGain[
EMEC_HValphaComplete
] = false ;
114
useGain[
EMEC_HVbetaComplete
] = false ;
115
useGain[
CableLengthComplete
] = false ;
116
useGain[
CableAttenuationComplete
] = false ;
117
//useGain[CaliPulseParamsVsCalib] = false ;
118
useGain[
OFCBinComplete
] = true ;
119
useGain[
PhysCaliTdiffComplete
] = true ;
120
return
useGain ;
121
}() ;
122
if
(
index
<
END_OF_LIST
)
return
useGain[
index
] ;
123
return
false ;
124
}
125
126
// getClassName : from class index and class pointer
127
//---------------------------------------------------
128
const
std::string &
LArParamsProperties::getClassName
(
unsigned
index
)
129
{
130
static
const
std::string
empty
(
""
);
131
const
std::vector<std::string> & names =
ClassNames
() ;
132
if
(
index
< names.size() )
return
names[
index
] ;
133
return
empty
;
134
}
135
136
// get class index from class name :
137
//----------------------------------
138
unsigned
LArParamsProperties::getClassIndex
(
const
std::string& className)
139
{
140
const
std::vector<std::string> & names =
ClassNames
() ;
141
unsigned
N = names.size() ;
142
for
(
unsigned
i=0 ; i<N ; i++ ) {
143
if
( className == names[i] )
return
i ;
144
}
145
return
N ;
146
}
147
148
// number of parameters contained in each data class
149
//---------------------------------------------------
150
unsigned
LArParamsProperties::numberOfParams
(
const
std::string& className) {
return
numberOfParams
(
getClassIndex
(className)) ; }
151
152
153
// gain dependance of data class
154
//-------------------------------
155
bool
LArParamsProperties::isGainDependent
(
const
std::string& className) {
return
isGainDependent
(
getClassIndex
(className)) ; }
156
157
158
// keyword for detector store
159
//----------------------------
160
std::string
LArParamsProperties::keyword
(
const
std::string& classname)
161
{
162
unsigned
len = classname.length() ;
163
if
( classname.substr(len-8,8) == std::string(
"Complete"
) )
return
classname.substr(0,len-8) ;
164
if
( classname.substr(len-7,7) == std::string(
"VsCalib"
) )
return
classname.substr(0,len-7) ;
165
return
classname ;
166
}
167
168
std::string
LArParamsProperties::keyword
(
unsigned
i) {
return
keyword
(
getClassName
(i)) ; }
LArParamsProperties.h
empty
static const Attributes_t empty
Definition
XmlStreamer.cxx:16
ILArCableAttenuation::ERRORCODE
@ ERRORCODE
Definition
ILArCableAttenuation.h:30
ILArCableLength::ERRORCODE
@ ERRORCODE
Definition
ILArCableLength.h:29
ILArCaliPulseParams::ERRORCODE
@ ERRORCODE
Definition
ILArCaliPulseParams.h:32
ILArDetCellParams::ERRORCODE
@ ERRORCODE
Definition
ILArDetCellParams.h:29
ILArEMEC_Cphi::ERRORCODE
@ ERRORCODE
Definition
ILArEMEC_Cphi.h:30
ILArEMEC_HValpha::ERRORCODE
@ ERRORCODE
Definition
ILArEMEC_HValpha.h:29
ILArEMEC_HVbeta::ERRORCODE
@ ERRORCODE
Definition
ILArEMEC_HVbeta.h:29
ILArPhysCaliTdiff::ERRORCODE
@ ERRORCODE
Definition
ILArPhysCaliTdiff.h:29
ILArRinj::ERRORCODE
@ ERRORCODE
Definition
ILArRinj.h:28
ILArTdrift::ERRORCODE
@ ERRORCODE
Definition
ILArTdrift.h:27
ILArTshaper::ERRORCODE
@ ERRORCODE
Definition
ILArTshaper.h:28
LArCableAttenuationComplete
This class implements the ILArCableAttenuation interface.
Definition
LArCableAttenuationComplete.h:27
LArCableAttenuationP
c-struct reproducing the structure of the persistent data
Definition
LArCableAttenuationP.h:20
LArCableLengthComplete
This class implements the ILArCableLength interface.
Definition
LArCableLengthComplete.h:27
LArCableLengthP
c-struct reproducing the structure of the persistent data
Definition
LArCableLengthP.h:20
LArCaliPulseParamsComplete
This class implements the ILArCaliPulseParams interface.
Definition
LArCaliPulseParamsComplete.h:29
LArCaliPulseParamsP
Definition
LArCaliPulseParamsP.h:12
LArDetCellParamsComplete
This class implements the ILArDetCellParams interface.
Definition
LArDetCellParamsComplete.h:26
LArDetCellParamsP
Definition
LArDetCellParamsP.h:11
LArEMEC_CphiComplete
This class implements the ILArEMEC_Cphi interface.
Definition
LArEMEC_CphiComplete.h:28
LArEMEC_CphiP
c-struct reproducing the structure of the persistent data
Definition
LArEMEC_CphiP.h:20
LArEMEC_HValphaComplete
This class implements the ILArEMEC_HValpha interface.
Definition
LArEMEC_HValphaComplete.h:28
LArEMEC_HValphaP
c-struct reproducing the structure of the persistent data
Definition
LArEMEC_HValphaP.h:20
LArEMEC_HVbetaComplete
This class implements the ILArEMEC_HVbeta interface.
Definition
LArEMEC_HVbetaComplete.h:28
LArEMEC_HVbetaP
c-struct reproducing the structure of the persistent data
Definition
LArEMEC_HVbetaP.h:20
LArMphysOverMcalComplete
This class implements the ILArMphysOverMcal interface.
Definition
LArMphysOverMcalComplete.h:29
LArMphysOverMcalP1
c-struct reproducing the structure of the persistent data
Definition
LArMphysOverMcalP1.h:19
LArOFCBinComplete
Definition
LArOFCBinComplete.h:13
LArOFCBinP
Definition
LArOFCBinP.h:8
LArOFCBinP::ERRORCODE
@ ERRORCODE
Definition
LArOFCBinP.h:14
LArPhysCaliTdiffP
Definition
LArPhysCaliTdiffP.h:11
LArRinjComplete
This class implements the ILArRinj interface.
Definition
LArRinjComplete.h:26
LArRinjP
c-struct reproducing the structure of the persistent data
Definition
LArRinjP.h:20
LArSingleFloatP
Definition
LArSingleFloatP.h:11
LArTdriftComplete
This class implements the ILArTdrift interface.
Definition
LArTdriftComplete.h:24
LArTdriftP
Definition
LArTdriftP.h:11
LArTshaperComplete
This class implements the ILArTshaper interface.
Definition
LArTshaperComplete.h:27
LArTshaperP
c-struct reproducing the structure of the persistent data
Definition
LArTshaperP.h:20
LArParamsProperties::keyword
std::string keyword(const std::string &classname)
Definition
LArParamsProperties.cxx:160
LArParamsProperties::numberOfParams
unsigned numberOfParams(unsigned index)
Definition
LArParamsProperties.cxx:74
LArParamsProperties::getClassIndex
unsigned getClassIndex(const LArCaliPulseParamsComplete *)
Definition
LArParamsProperties.cxx:31
LArParamsProperties::isGainDependent
bool isGainDependent(unsigned index)
Definition
LArParamsProperties.cxx:101
LArParamsProperties::isValid
bool isValid(const LArCaliPulseParamsP &p)
Definition
LArParamsProperties.cxx:10
LArParamsProperties::RinjComplete
@ RinjComplete
Definition
LArParamsProperties.h:86
LArParamsProperties::MphysOverMcalComplete
@ MphysOverMcalComplete
Definition
LArParamsProperties.h:85
LArParamsProperties::PhysCaliTdiffComplete
@ PhysCaliTdiffComplete
Definition
LArParamsProperties.h:83
LArParamsProperties::OFCBinComplete
@ OFCBinComplete
Definition
LArParamsProperties.h:94
LArParamsProperties::CaliPulseParamsComplete
@ CaliPulseParamsComplete
Definition
LArParamsProperties.h:81
LArParamsProperties::END_OF_LIST
@ END_OF_LIST
Definition
LArParamsProperties.h:95
LArParamsProperties::TshaperComplete
@ TshaperComplete
Definition
LArParamsProperties.h:87
LArParamsProperties::TdriftComplete
@ TdriftComplete
Definition
LArParamsProperties.h:84
LArParamsProperties::EMEC_CphiComplete
@ EMEC_CphiComplete
Definition
LArParamsProperties.h:88
LArParamsProperties::EMEC_HVbetaComplete
@ EMEC_HVbetaComplete
Definition
LArParamsProperties.h:90
LArParamsProperties::EMEC_HValphaComplete
@ EMEC_HValphaComplete
Definition
LArParamsProperties.h:89
LArParamsProperties::CableAttenuationComplete
@ CableAttenuationComplete
Definition
LArParamsProperties.h:92
LArParamsProperties::DetCellParamsComplete
@ DetCellParamsComplete
Definition
LArParamsProperties.h:82
LArParamsProperties::CableLengthComplete
@ CableLengthComplete
Definition
LArParamsProperties.h:91
LArParamsProperties::getClassName
const std::string & getClassName(unsigned index)
Definition
LArParamsProperties.cxx:128
LArParamsProperties::ClassNames
const std::vector< std::string > & ClassNames()
Definition
LArParamsProperties.cxx:48
index
Definition
index.py:1
python.utils.AtlRunQueryDQUtils.p
p
Definition
AtlRunQueryDQUtils.py:209
Generated on
for ATLAS Offline Software by
1.17.0