ATLAS Offline Software
Loading...
Searching...
No Matches
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
6
7// validity of payload data ( invalid = empty )
8//----------------------------------------------
9
13bool LArParamsProperties::isValid(const LArTdriftP & p) { return ( p.m_Tdrift != ILArTdrift::ERRORCODE ) ; }
14#ifdef LARRAWCONDITIONS_LARSINGLEFLOATP
15bool LArParamsProperties::isValid(const LArSingleFloatP & p) { return ( p.isEmpty());}
16#endif
17#ifdef LARRAWCONDITIONS_LARMPHYSOVERMCALP1
18bool LArParamsProperties::isValid(const LArMphysOverMcalP1 & p) { return ( p.m_MphysOverMcal >= 0 ) ; }
19#endif
20bool LArParamsProperties::isValid(const LArRinjP & p) { return ( p.m_Rinj != ILArRinj::ERRORCODE ) ; }
21bool LArParamsProperties::isValid(const LArTshaperP & p) { return ( p.m_Tshaper != ILArTshaper::ERRORCODE ) ; }
22bool LArParamsProperties::isValid(const LArEMEC_CphiP & p) { return ( p.m_EMEC_Cphi != ILArEMEC_Cphi::ERRORCODE ) ; }
23bool LArParamsProperties::isValid(const LArEMEC_HValphaP & p) { return ( p.m_EMEC_HValpha != ILArEMEC_HValpha::ERRORCODE ) ; }
24bool LArParamsProperties::isValid(const LArEMEC_HVbetaP & p) { return ( p.m_EMEC_HVbeta != ILArEMEC_HVbeta::ERRORCODE ) ; }
25bool LArParamsProperties::isValid(const LArCableLengthP & p) { return ( p.m_CableLength != ILArCableLength::ERRORCODE ) ; }
26bool LArParamsProperties::isValid(const LArCableAttenuationP & p) { return ( p.m_CableAttenuation != ILArCableAttenuation::ERRORCODE ) ; }
27bool LArParamsProperties::isValid(const LArOFCBinP & p) { return ( p.m_bin != LArOFCBinP::ERRORCODE ) ; }
28
29// conversion: data class pointer --> class index
30//------------------------------------------------
43//unsigned LArParamsProperties::getClassIndex(const LArCaliPulseParamsVsCalib*) { return CaliPulseParamsVsCalib ; }
45
46// vector of class names
47//-----------------------
48const 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//------------------------------------------------
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//------------------------------------------
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//---------------------------------------------------
128const 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//----------------------------------
138unsigned 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//---------------------------------------------------
150unsigned LArParamsProperties::numberOfParams(const std::string& className) { return numberOfParams(getClassIndex(className)) ; }
151
152
153// gain dependance of data class
154//-------------------------------
155bool LArParamsProperties::isGainDependent(const std::string& className) { return isGainDependent(getClassIndex(className)) ; }
156
157
158// keyword for detector store
159//----------------------------
160std::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
168std::string LArParamsProperties::keyword(unsigned i) { return keyword(getClassName(i)) ; }
static const Attributes_t empty
@ ERRORCODE
Definition ILArRinj.h:28
This class implements the ILArCableAttenuation interface.
c-struct reproducing the structure of the persistent data
This class implements the ILArCableLength interface.
c-struct reproducing the structure of the persistent data
This class implements the ILArCaliPulseParams interface.
This class implements the ILArDetCellParams interface.
This class implements the ILArEMEC_Cphi interface.
c-struct reproducing the structure of the persistent data
This class implements the ILArEMEC_HValpha interface.
c-struct reproducing the structure of the persistent data
This class implements the ILArEMEC_HVbeta interface.
c-struct reproducing the structure of the persistent data
This class implements the ILArMphysOverMcal interface.
c-struct reproducing the structure of the persistent data
This class implements the ILArPhysCaliTdiff interface ` *.
This class implements the ILArRinj interface.
c-struct reproducing the structure of the persistent data
Definition LArRinjP.h:20
This class implements the ILArTdrift interface.
This class implements the ILArTshaper interface.
c-struct reproducing the structure of the persistent data
Definition LArTshaperP.h:20
std::string keyword(const std::string &classname)
unsigned numberOfParams(unsigned index)
unsigned getClassIndex(const LArCaliPulseParamsComplete *)
bool isGainDependent(unsigned index)
bool isValid(const LArCaliPulseParamsP &p)
const std::string & getClassName(unsigned index)
const std::vector< std::string > & ClassNames()
Definition index.py:1