ATLAS Offline Software
LArParamsProperties.h
Go to the documentation of this file.
1 //Dear emacs, this is -*- c++ -*-
2 
3 /*
4  Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
5 */
6 
7 
15 #ifndef LARCALIBTOOLS_LARPARAMSPROPERTIES_H
16 #define LARCALIBTOOLS_LARPARAMSPROPERTIES_H
17 
31 
33 
35  //
36  // To add a new LAr data class (e.g. LArNewClass) containing payload objects
37  // (e.g. LArPayload) you must:
38  //
39  // (0) overload the 'inline bool isValid()' function with the reference
40  // to the payload object (e.g. isValid(const LArPayload&) {return(...);};
41  // giving a validity criterion
42  //
43  // (1) add its sequential number to the enum, before END_OF_LIST
44  // (call it with the class name without 'LAr', e.g. 'NewClass')
45  //
46  // (2) overload the 'inline unsigned getClassIndex()' with the pointer
47  // to the new class (e.g. getClassIndex(LArNewClass*) {return NewClass;};
48  //
49  // (3) add the properties of the new class to the functions:
50  // ClassNames(), numberOfParams(unsigned), isGainDependent(unsigned)
51  //
52  // all the rest should be self-consistent and does not need any update.
53  //
55 
56  // validity of payload data ( invalid = empty )
57  //----------------------------------------------
58  bool isValid(const LArCaliPulseParamsP & p);
59  bool isValid(const LArDetCellParamsP & p);
60  bool isValid(const LArPhysCaliTdiffP & p);
61  bool isValid(const LArTdriftP & p);
62 #ifdef LARRAWCONDITIONS_LARSINGLEFLOATP
63  bool isValid(const LArSingleFloatP & p);
64 #endif
65 #ifdef LARRAWCONDITIONS_LARMPHYSOVERMCALP1
66  bool isValid(const LArMphysOverMcalP1 & p);
67 #endif
68  bool isValid(const LArRinjP & p);
69  bool isValid(const LArTshaperP & p);
70  bool isValid(const LArEMEC_CphiP & p);
71  bool isValid(const LArEMEC_HValphaP & p);
72  bool isValid(const LArEMEC_HVbetaP & p);
73  bool isValid(const LArCableLengthP & p);
74  bool isValid(const LArCableAttenuationP & p);
75  bool isValid(const LArOFCBinP & p);
76  bool isValid(const LArPhysCaliTdiffP & p);
77 
78  // sequential number associated to foreseen data classes
79  //-------------------------------------------------------
93  //CaliPulseParamsVsCalib ,
95  END_OF_LIST // used to count allowed data classes
96  } ;
97 
98  // conversion: data class pointer --> class index
99  //------------------------------------------------
100  unsigned getClassIndex(const LArCaliPulseParamsComplete*);
101  unsigned getClassIndex(const LArDetCellParamsComplete*);
102  unsigned getClassIndex(const LArPhysCaliTdiffComplete*);
103  unsigned getClassIndex(const LArTdriftComplete*);
104  unsigned getClassIndex(const LArMphysOverMcalComplete*);
105  unsigned getClassIndex(const LArRinjComplete*);
106  unsigned getClassIndex(const LArTshaperComplete*);
107  unsigned getClassIndex(const LArEMEC_CphiComplete*);
108  unsigned getClassIndex(const LArEMEC_HValphaComplete*);
109  unsigned getClassIndex(const LArEMEC_HVbetaComplete*);
110  unsigned getClassIndex(const LArCableLengthComplete*);
112  //unsigned getClassIndex(const LArCaliPulseParamsVsCalib*);
113  unsigned getClassIndex(const LArOFCBinComplete*);
114  unsigned getClassIndex(const LArPhysCaliTdiffComplete*);
115 
116  // vector of class names
117  //-----------------------
118  const std::vector< std::string > & ClassNames();
119 
120  // number of parameters hosted in each data class
121  //------------------------------------------------
122  unsigned numberOfParams(unsigned index);
123 
124  // gain dependency of data class parameters
125  //------------------------------------------
126  bool isGainDependent(unsigned index);
127 
129  // don't modify anything from now on!
131 
132  // getClassName : from class index and class pointer
133  //---------------------------------------------------
134  const std::string & getClassName(unsigned index);
135  template <class T>
136  const std::string & getClassName(const T* p) { return getClassName(getClassIndex(p)) ; }
137 
138  // get class index from class name :
139  //-----------------------------------
140  unsigned getClassIndex(const std::string& className);
141 
142  // number of parameters contained in each data class
143  //---------------------------------------------------
144  unsigned numberOfParams(const std::string& className);
145 
146  template <class T>
147  unsigned numberOfParams(const T* p) { return numberOfParams(getClassIndex(p)) ; }
148 
149  // gain dependance of data class
150  //-------------------------------
151  bool isGainDependent(const std::string& className);
152 
153  template <class T>
154  bool isGainDependent(const T* p) { return isGainDependent(getClassIndex(p)) ; }
155 
156  // keyword for detector store
157  //----------------------------
158  std::string keyword(const std::string& classname);
159  std::string keyword(unsigned i);
160 
161  template < class T >
162  std::string keyword(const T* p){ return keyword(getClassName(p)) ; }
163 
164 }
165 
166 #endif
LArDetCellParamsComplete.h
LArTshaperP
c-struct reproducing the structure of the persistent data
Definition: LArTshaperP.h:20
LArParamsProperties::DetCellParamsComplete
@ DetCellParamsComplete
Definition: LArParamsProperties.h:82
LArCableLengthComplete.h
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
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
LArTdriftP
Definition: LArTdriftP.h:11
LArParamsProperties
This include file contains inline functions describing LAr Parameters properties used in LArReadParam...
Definition: LArParamsProperties.h:32
LArEMEC_CphiP
c-struct reproducing the structure of the persistent data
Definition: LArEMEC_CphiP.h:20
LArTshaperComplete.h
LArParamsProperties::CableLengthComplete
@ CableLengthComplete
Definition: LArParamsProperties.h:91
LArCableLengthP
c-struct reproducing the structure of the persistent data
Definition: LArCableLengthP.h:20
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
LArRinjComplete
This class implements the ILArRinj interface.
Definition: LArRinjComplete.h:26
LArEMEC_CphiComplete.h
LArRinjComplete.h
LArDetCellParamsP
Definition: LArDetCellParamsP.h:11
JetTagCalibConfig.className
string className
Definition: JetTagCalibConfig.py:31
LArPhysCaliTdiffP
Definition: LArPhysCaliTdiffP.h:11
LArCableAttenuationComplete.h
LArMphysOverMcalComplete
This class implements the ILArMphysOverMcal interface.
Definition: LArMphysOverMcalComplete.h:29
LArOFCBinComplete.h
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
LArPhysCaliTdiffComplete
This class implements the ILArPhysCaliTdiff interface ` *.
Definition: LArPhysCaliTdiffComplete.h:22
LArParamsProperties::OFCBinComplete
@ OFCBinComplete
Definition: LArParamsProperties.h:94
LArCaliPulseParamsComplete.h
LArEMEC_HValphaComplete.h
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
LArOFCBinComplete
Definition: LArOFCBinComplete.h:13
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
LArParamsProperties::EMEC_CphiComplete
@ EMEC_CphiComplete
Definition: LArParamsProperties.h:88
LArParamsProperties::PhysCaliTdiffComplete
@ PhysCaliTdiffComplete
Definition: LArParamsProperties.h:83
LArParamsProperties::TdriftComplete
@ TdriftComplete
Definition: LArParamsProperties.h:84
LArParamsProperties::TshaperComplete
@ TshaperComplete
Definition: LArParamsProperties.h:87
LArParamsProperties::CableAttenuationComplete
@ CableAttenuationComplete
Definition: LArParamsProperties.h:92
LArParamsProperties::END_OF_LIST
@ END_OF_LIST
Definition: LArParamsProperties.h:95
LArParamsProperties::ClassNumbering
ClassNumbering
Definition: LArParamsProperties.h:80
LArParamsProperties::isValid
bool isValid(const LArCaliPulseParamsP &p)
Definition: LArParamsProperties.cxx:10
LArParamsProperties::ClassNames
const std::vector< std::string > & ClassNames()
Definition: LArParamsProperties.cxx:48
LArPhysCaliTdiffComplete.h
LArParamsProperties::getClassIndex
unsigned getClassIndex(const LArCaliPulseParamsComplete *)
Definition: LArParamsProperties.cxx:31
LArMphysOverMcalComplete.h
LArEMEC_HVbetaComplete.h
LArParamsProperties::keyword
std::string keyword(const std::string &classname)
Definition: LArParamsProperties.cxx:160
LArTdriftComplete.h
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