ATLAS Offline Software
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 
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 //------------------------------------------------
43 //unsigned LArParamsProperties::getClassIndex(const LArCaliPulseParamsVsCalib*) { return CaliPulseParamsVsCalib ; }
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 //------------------------------------------------
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) ;
108  useGain[TdriftComplete] = false ;
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 ;
117  //useGain[CaliPulseParamsVsCalib] = false ;
118  useGain[OFCBinComplete] = 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 //---------------------------------------------------
151 
152 
153 // gain dependance of data class
154 //-------------------------------
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)) ; }
LArTshaperP
c-struct reproducing the structure of the persistent data
Definition: LArTshaperP.h:20
LArParamsProperties::DetCellParamsComplete
@ DetCellParamsComplete
Definition: LArParamsProperties.h:82
LArEMEC_CphiComplete
This class implements the ILArEMEC_Cphi interface.
Definition: LArEMEC_CphiComplete.h:28
LArOFCBinP
Definition: LArOFCBinP.h:8
python.PerfMonSerializer.p
def p
Definition: PerfMonSerializer.py:743
LArTdriftComplete
This class implements the ILArTdrift interface.
Definition: LArTdriftComplete.h:23
LArParamsProperties::numberOfParams
unsigned numberOfParams(unsigned index)
Definition: LArParamsProperties.cxx:74
LArParamsProperties::MphysOverMcalComplete
@ MphysOverMcalComplete
Definition: LArParamsProperties.h:85
LArRinjP
c-struct reproducing the structure of the persistent data
Definition: LArRinjP.h:20
index
Definition: index.py:1
LArCableAttenuationP
c-struct reproducing the structure of the persistent data
Definition: LArCableAttenuationP.h:20
ILArCableLength::ERRORCODE
@ ERRORCODE
Definition: ILArCableLength.h:29
LArMphysOverMcalP1
c-struct reproducing the structure of the persistent data
Definition: LArMphysOverMcalP1.h:19
LArSingleFloatP
Definition: LArSingleFloatP.h:11
LArParamsProperties::EMEC_HVbetaComplete
@ EMEC_HVbetaComplete
Definition: LArParamsProperties.h:90
ILArPhysCaliTdiff::ERRORCODE
@ ERRORCODE
Definition: ILArPhysCaliTdiff.h:29
LArTdriftP
Definition: LArTdriftP.h:11
LArEMEC_CphiP
c-struct reproducing the structure of the persistent data
Definition: LArEMEC_CphiP.h:20
LArParamsProperties::CableLengthComplete
@ CableLengthComplete
Definition: LArParamsProperties.h:91
LArCableLengthP
c-struct reproducing the structure of the persistent data
Definition: LArCableLengthP.h:20
JetTiledMap::N
@ N
Definition: TiledEtaPhiMap.h:44
empty
bool empty(TH1 *h)
Definition: computils.cxx:294
LArCableLengthComplete
This class implements the ILArCableLength interface.
Definition: LArCableLengthComplete.h:26
LArParamsProperties::getClassName
const std::string & getClassName(unsigned index)
Definition: LArParamsProperties.cxx:128
LArParamsProperties::isGainDependent
bool isGainDependent(unsigned index)
Definition: LArParamsProperties.cxx:101
ILArTshaper::ERRORCODE
@ ERRORCODE
Definition: ILArTshaper.h:28
LArRinjComplete
This class implements the ILArRinj interface.
Definition: LArRinjComplete.h:26
LArDetCellParamsP
Definition: LArDetCellParamsP.h:11
JetTagCalibConfig.className
string className
Definition: JetTagCalibConfig.py:31
LArPhysCaliTdiffP
Definition: LArPhysCaliTdiffP.h:11
LArMphysOverMcalComplete
This class implements the ILArMphysOverMcal interface.
Definition: LArMphysOverMcalComplete.h:29
LArParamsProperties::RinjComplete
@ RinjComplete
Definition: LArParamsProperties.h:86
lumiFormat.i
int i
Definition: lumiFormat.py:92
LArEMEC_HValphaP
c-struct reproducing the structure of the persistent data
Definition: LArEMEC_HValphaP.h:20
ILArEMEC_HValpha::ERRORCODE
@ ERRORCODE
Definition: ILArEMEC_HValpha.h:29
LArPhysCaliTdiffComplete
This class implements the ILArPhysCaliTdiff interface ` *.
Definition: LArPhysCaliTdiffComplete.h:22
python.subdetectors.mmg.names
names
Definition: mmg.py:8
LArParamsProperties::OFCBinComplete
@ OFCBinComplete
Definition: LArParamsProperties.h:94
LArEMEC_HVbetaComplete
This class implements the ILArEMEC_HVbeta interface.
Definition: LArEMEC_HVbetaComplete.h:28
LArEMEC_HValphaComplete
This class implements the ILArEMEC_HValpha interface.
Definition: LArEMEC_HValphaComplete.h:28
ILArEMEC_Cphi::ERRORCODE
@ ERRORCODE
Definition: ILArEMEC_Cphi.h:30
LArOFCBinComplete
Definition: LArOFCBinComplete.h:13
ILArCableAttenuation::ERRORCODE
@ ERRORCODE
Definition: ILArCableAttenuation.h:30
LArCableAttenuationComplete
This class implements the ILArCableAttenuation interface.
Definition: LArCableAttenuationComplete.h:26
LArParamsProperties::CaliPulseParamsComplete
@ CaliPulseParamsComplete
Definition: LArParamsProperties.h:81
LArCaliPulseParamsComplete
This class implements the ILArCaliPulseParams interface.
Definition: LArCaliPulseParamsComplete.h:27
ILArEMEC_HVbeta::ERRORCODE
@ ERRORCODE
Definition: ILArEMEC_HVbeta.h:29
LArParamsProperties::EMEC_CphiComplete
@ EMEC_CphiComplete
Definition: LArParamsProperties.h:88
LArParamsProperties::PhysCaliTdiffComplete
@ PhysCaliTdiffComplete
Definition: LArParamsProperties.h:83
LArOFCBinP::ERRORCODE
@ ERRORCODE
Definition: LArOFCBinP.h:14
ILArRinj::ERRORCODE
@ ERRORCODE
Definition: ILArRinj.h:28
LArParamsProperties::TdriftComplete
@ TdriftComplete
Definition: LArParamsProperties.h:84
LArParamsProperties::TshaperComplete
@ TshaperComplete
Definition: LArParamsProperties.h:87
ILArDetCellParams::ERRORCODE
@ ERRORCODE
Definition: ILArDetCellParams.h:29
DeMoScan.index
string index
Definition: DeMoScan.py:362
LArParamsProperties::CableAttenuationComplete
@ CableAttenuationComplete
Definition: LArParamsProperties.h:92
LArParamsProperties::END_OF_LIST
@ END_OF_LIST
Definition: LArParamsProperties.h:95
ILArTdrift::ERRORCODE
@ ERRORCODE
Definition: ILArTdrift.h:27
LArParamsProperties::isValid
bool isValid(const LArCaliPulseParamsP &p)
Definition: LArParamsProperties.cxx:10
LArParamsProperties::ClassNames
const std::vector< std::string > & ClassNames()
Definition: LArParamsProperties.cxx:48
ILArCaliPulseParams::ERRORCODE
@ ERRORCODE
Definition: ILArCaliPulseParams.h:32
WriteCellNoiseToCool.useGain
useGain
Definition: WriteCellNoiseToCool.py:343
LArParamsProperties::getClassIndex
unsigned getClassIndex(const LArCaliPulseParamsComplete *)
Definition: LArParamsProperties.cxx:31
LArParamsProperties.h
LArParamsProperties::keyword
std::string keyword(const std::string &classname)
Definition: LArParamsProperties.cxx:160
LArParamsProperties::EMEC_HValphaComplete
@ EMEC_HValphaComplete
Definition: LArParamsProperties.h:89
LArCaliPulseParamsP
Definition: LArCaliPulseParamsP.h:12
LArDetCellParamsComplete
This class implements the ILArDetCellParams interface.
Definition: LArDetCellParamsComplete.h:24
LArEMEC_HVbetaP
c-struct reproducing the structure of the persistent data
Definition: LArEMEC_HVbetaP.h:20
LArTshaperComplete
This class implements the ILArTshaper interface.
Definition: LArTshaperComplete.h:26