ATLAS Offline Software
PixelChargeCalibCondData.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 #ifndef PIXELCHARGECALIBCONDDATA_H
6 #define PIXELCHARGECALIBCONDDATA_H
7 
10 #include "PixelConditionsData/ChargeCalibParameters.h" //Thresholds, LegacyFitParameters etc
11 
12 #include <map>
13 #include <vector>
14 #include <array>
15 
16 namespace PixelChargeCalib{
17  struct ChargeCalibrationBundle;
18 }
19 
20 class PixelModuleData;
21 class PixelID;
22 
24 {
25  public:
27  PixelChargeCalibCondData(std::size_t max_module_hash);
28 
29  static constexpr size_t IBLCalibrationSize{16};
30  using IBLCalibration = std::array<float, IBLCalibrationSize>;
31  using IBLModule = std::vector<IBLCalibration>;
32 
34  {
35  RUN1PIX,
36  RUN3PIX,
37  LUTFEI4,
38  RD53
39  };
40 
41  void
42  setAllFromBundle(unsigned int moduleHash, const PixelChargeCalib::ChargeCalibrationBundle& b);
43 
44  void
45  setAllFromConfigData(unsigned int moduleHash, const PixelModuleData * configData, const std::pair<int, int> &becLayer, unsigned int numFE);
46 
47  void
48  setThresholds(InDetDD::PixelDiodeType type, unsigned int moduleHash, const std::vector<PixelChargeCalib::Thresholds> & thresholds);
49  //
50  void
51  setAnalogThreshold(InDetDD::PixelDiodeType type, unsigned int moduleHash, std::vector<int> &&value);
52  //
53  void
54  setLegacyFitParameters(InDetDD::PixelDiodeType type, unsigned int moduleHash, const std::vector<PixelChargeCalib::LegacyFitParameters> &parameters);
55  //
56  void
57  setLinearFitParameters(InDetDD::PixelDiodeType type, unsigned int moduleHash, const std::vector<PixelChargeCalib::LinearFitParameters> &parameters);
58  //
59  void
60  setTotResolutions(unsigned int moduleHash, const std::vector<PixelChargeCalib::Resolutions> &value);
61  //
63  getThresholds(InDetDD::PixelDiodeType type, unsigned int moduleHash, unsigned int FE) const;
64  //
66  getLegacyFitParameters(InDetDD::PixelDiodeType type, unsigned int moduleHash, unsigned int FE) const;
67  //
69  getLinearFitParameters(InDetDD::PixelDiodeType type, unsigned int moduleHash, unsigned int FE) const;
70  //
71  float
72  getQ2TotF(InDetDD::PixelDiodeType type, unsigned int moduleHash, unsigned int FE) const;
73  //
74  float
75  getQ2TotG(InDetDD::PixelDiodeType type, unsigned int moduleHash, unsigned int FE) const;
76  //
77  float
78  getTotRes(unsigned int moduleHash, unsigned int FE, float Q) const;
79  //
80  float
81  getToT(InDetDD::PixelDiodeType type, unsigned int moduleHash, unsigned int FE, float Q) const;
82  //
83  float
84  getCharge(InDetDD::PixelDiodeType type, unsigned int moduleHash, unsigned int FE, float ToT) const;
85  //
86  // new IBL calibration
87  void
88  setCalibrationStrategy(unsigned int moduleHash, CalibrationStrategy strategy);
89  //
90  void
91  setTot2Charges(unsigned int moduleHash, IBLModule charges);
92  //
93  const IBLCalibration &
94  getTot2Charges(unsigned int moduleHash, unsigned int FE) const;
95  //
97  getCalibrationStrategy(unsigned int moduleHash) const;
98  //
99  float
100  getChargeLUTFEI4(unsigned int moduleHash, unsigned int FE, unsigned int ToT) const;
101  //
102  float
103  getToTLUTFEI4(unsigned int moduleHash, unsigned int FE, float Q) const;
104 
105  inline constexpr int
107  return 16;
108  }
109 
110  private:
111  std::size_t m_sizeOfHashVector = 0;
113 
114  std::array<std::vector<std::vector<PixelChargeCalib::Thresholds>>, s_NPixelDiodes> m_thresholds;
115  std::array<std::vector<std::vector<PixelChargeCalib::LegacyFitParameters>>, s_NPixelDiodes> m_legacyFit;
116  std::array<std::vector<std::vector<PixelChargeCalib::LinearFitParameters>>, s_NPixelDiodes> m_linFit;
117  std::vector<std::vector<PixelChargeCalib::Resolutions>> m_totRes;
118 
119  // new IBL calibration
120  std::map<int, CalibrationStrategy> m_calibrationStrategy;
121  std::map<int, IBLModule> m_tot2Charges;
122 
123 };
124 
125 CLASS_DEF( PixelChargeCalibCondData , 345532779 , 1 )
126 
127 #include "AthenaKernel/CondCont.h"
129 
130 #endif
xAOD::strategy
strategy
Definition: L2CombinedMuon_v1.cxx:107
PixelChargeCalibCondData::getLegacyFitParameters
PixelChargeCalib::LegacyFitParameters getLegacyFitParameters(InDetDD::PixelDiodeType type, unsigned int moduleHash, unsigned int FE) const
Definition: PixelChargeCalibCondData.cxx:120
PixelChargeCalibCondData::getTot2Charges
const IBLCalibration & getTot2Charges(unsigned int moduleHash, unsigned int FE) const
Definition: PixelChargeCalibCondData.cxx:243
PixelChargeCalibCondData::setAnalogThreshold
void setAnalogThreshold(InDetDD::PixelDiodeType type, unsigned int moduleHash, std::vector< int > &&value)
PixelChargeCalibCondData::m_thresholds
std::array< std::vector< std::vector< PixelChargeCalib::Thresholds > >, s_NPixelDiodes > m_thresholds
Definition: PixelChargeCalibCondData.h:114
PixelChargeCalibCondData::getToT
float getToT(InDetDD::PixelDiodeType type, unsigned int moduleHash, unsigned int FE, float Q) const
Definition: PixelChargeCalibCondData.cxx:174
PixelChargeCalibCondData::getThresholds
PixelChargeCalib::Thresholds getThresholds(InDetDD::PixelDiodeType type, unsigned int moduleHash, unsigned int FE) const
Definition: PixelChargeCalibCondData.cxx:99
PixelModuleData
Definition: PixelModuleData.h:22
InDetDD::enum2uint
constexpr std::size_t enum2uint(T n, const std::string &callingFunctionName="")
Convert an enum class to size_t for use as an array index.
Definition: PixelReadoutDefinitions.h:48
InDetDD::PixelDiodeType
PixelDiodeType
Definition: PixelReadoutDefinitions.h:25
ChargeCalibParameters.h
Structs for holding charge calibration parameterisation and data.
CONDCONT_DEF
CONDCONT_DEF(PixelChargeCalibCondData, 578786399)
PixelChargeCalibCondData::CalibrationStrategy::RD53
@ RD53
athena.value
value
Definition: athena.py:124
PixelChargeCalibCondData::getTotRes
float getTotRes(unsigned int moduleHash, unsigned int FE, float Q) const
Definition: PixelChargeCalibCondData.cxx:163
PixelChargeCalibCondData::m_legacyFit
std::array< std::vector< std::vector< PixelChargeCalib::LegacyFitParameters > >, s_NPixelDiodes > m_legacyFit
Definition: PixelChargeCalibCondData.h:115
PixelChargeCalibCondData::setAllFromConfigData
void setAllFromConfigData(unsigned int moduleHash, const PixelModuleData *configData, const std::pair< int, int > &becLayer, unsigned int numFE)
Definition: PixelChargeCalibCondData.cxx:70
PixelChargeCalibCondData::setLinearFitParameters
void setLinearFitParameters(InDetDD::PixelDiodeType type, unsigned int moduleHash, const std::vector< PixelChargeCalib::LinearFitParameters > &parameters)
Definition: PixelChargeCalibCondData.cxx:132
PixelChargeCalib::LegacyFitParameters
Definition: ChargeCalibParameters.h:18
PixelChargeCalib::Thresholds
Definition: ChargeCalibParameters.h:73
PixelChargeCalibCondData::m_totRes
std::vector< std::vector< PixelChargeCalib::Resolutions > > m_totRes
Definition: PixelChargeCalibCondData.h:117
InDetDD::PixelDiodeType::N_DIODETYPES
@ N_DIODETYPES
PixelChargeCalibCondData::CalibrationStrategy::RUN3PIX
@ RUN3PIX
PixelChargeCalibCondData::setLegacyFitParameters
void setLegacyFitParameters(InDetDD::PixelDiodeType type, unsigned int moduleHash, const std::vector< PixelChargeCalib::LegacyFitParameters > &parameters)
Definition: PixelChargeCalibCondData.cxx:110
PixelChargeCalibCondData::s_NPixelDiodes
constexpr static std::size_t s_NPixelDiodes
Definition: PixelChargeCalibCondData.h:112
PixelChargeCalibCondData::getChargeLUTFEI4
float getChargeLUTFEI4(unsigned int moduleHash, unsigned int FE, unsigned int ToT) const
Definition: PixelChargeCalibCondData.cxx:252
PixelChargeCalibCondData::m_sizeOfHashVector
std::size_t m_sizeOfHashVector
Definition: PixelChargeCalibCondData.h:111
PixelChargeCalibCondData::PixelChargeCalibCondData
PixelChargeCalibCondData()=default
PixelChargeCalibCondData::m_calibrationStrategy
std::map< int, CalibrationStrategy > m_calibrationStrategy
Definition: PixelChargeCalibCondData.h:120
PixelChargeCalibCondData
Definition: PixelChargeCalibCondData.h:24
PixelChargeCalibCondData::setThresholds
void setThresholds(InDetDD::PixelDiodeType type, unsigned int moduleHash, const std::vector< PixelChargeCalib::Thresholds > &thresholds)
Definition: PixelChargeCalibCondData.cxx:89
PixelChargeCalibCondData::CalibrationStrategy::LUTFEI4
@ LUTFEI4
PixelChargeCalibCondData::setTot2Charges
void setTot2Charges(unsigned int moduleHash, IBLModule charges)
Definition: PixelChargeCalibCondData.cxx:235
PixelChargeCalibCondData::setCalibrationStrategy
void setCalibrationStrategy(unsigned int moduleHash, CalibrationStrategy strategy)
Definition: PixelChargeCalibCondData.cxx:215
PixelChargeCalibCondData::getCalibrationStrategy
CalibrationStrategy getCalibrationStrategy(unsigned int moduleHash) const
Definition: PixelChargeCalibCondData.cxx:223
PixelChargeCalibCondData::CalibrationStrategy
CalibrationStrategy
Definition: PixelChargeCalibCondData.h:34
PixelChargeCalibCondData::getQ2TotG
float getQ2TotG(InDetDD::PixelDiodeType type, unsigned int moduleHash, unsigned int FE) const
PixelChargeCalibCondData::m_tot2Charges
std::map< int, IBLModule > m_tot2Charges
Definition: PixelChargeCalibCondData.h:121
PixelChargeCalib::LinearFitParameters
Definition: ChargeCalibParameters.h:49
PixelChargeCalibCondData::setAllFromBundle
void setAllFromBundle(unsigned int moduleHash, const PixelChargeCalib::ChargeCalibrationBundle &b)
Definition: PixelChargeCalibCondData.cxx:51
PixelChargeCalibCondData::IBLModule
std::vector< IBLCalibration > IBLModule
Definition: PixelChargeCalibCondData.h:31
plotBeamSpotMon.b
b
Definition: plotBeamSpotMon.py:77
PixelChargeCalibCondData::CalibrationStrategy::RUN1PIX
@ RUN1PIX
PixelReadoutDefinitions.h
PixelChargeCalibCondData::getLinearFitParameters
PixelChargeCalib::LinearFitParameters getLinearFitParameters(InDetDD::PixelDiodeType type, unsigned int moduleHash, unsigned int FE) const
Definition: PixelChargeCalibCondData.cxx:143
PixelChargeCalibCondData::getQ2TotF
float getQ2TotF(InDetDD::PixelDiodeType type, unsigned int moduleHash, unsigned int FE) const
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
CLASS_DEF
#define CLASS_DEF(NAME, CID, VERSION)
associate a clid and a version to a type eg
Definition: Control/AthenaKernel/AthenaKernel/CLASS_DEF.h:64
PixelChargeCalibCondData::getFEI4OverflowToT
constexpr int getFEI4OverflowToT() const
Definition: PixelChargeCalibCondData.h:106
PixelChargeCalib
Definition: IChargeCalibrationParser.h:30
physics_parameters.parameters
parameters
Definition: physics_parameters.py:144
PixelChargeCalibCondData::getCharge
float getCharge(InDetDD::PixelDiodeType type, unsigned int moduleHash, unsigned int FE, float ToT) const
Definition: PixelChargeCalibCondData.cxx:192
PixelChargeCalibCondData::IBLCalibrationSize
static constexpr size_t IBLCalibrationSize
Definition: PixelChargeCalibCondData.h:29
PixelChargeCalib::ChargeCalibrationBundle
bundles of parameters used together in the PixelChargeCalibCondAlg
Definition: ChargeCalibrationBundle.h:24
PixelChargeCalibCondData::getToTLUTFEI4
float getToTLUTFEI4(unsigned int moduleHash, unsigned int FE, float Q) const
Definition: PixelChargeCalibCondData.cxx:262
PixelChargeCalibCondData::setTotResolutions
void setTotResolutions(unsigned int moduleHash, const std::vector< PixelChargeCalib::Resolutions > &value)
Definition: PixelChargeCalibCondData.cxx:156
PixelID
Definition: PixelID.h:67
CLASS_DEF.h
macros to associate a CLID to a type
PixelChargeCalibCondData::m_linFit
std::array< std::vector< std::vector< PixelChargeCalib::LinearFitParameters > >, s_NPixelDiodes > m_linFit
Definition: PixelChargeCalibCondData.h:116
PixelChargeCalibCondData::IBLCalibration
std::array< float, IBLCalibrationSize > IBLCalibration
Definition: PixelChargeCalibCondData.h:30