ATLAS Offline Software
Loading...
Searching...
No Matches
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
16namespace PixelChargeCalib{
18}
19
20class PixelModuleData;
21class 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
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 // Avoids looking for Calibration Strategy multiple times
87 float
89 const CalibrationStrategy calibStrategy,
90 unsigned int moduleHash, unsigned int FE, float ToT) const;
91 //
92 // new IBL calibration
93 void
94 setCalibrationStrategy(unsigned int moduleHash, CalibrationStrategy strategy);
95 //
96 void
97 setTot2Charges(unsigned int moduleHash, IBLModule charges);
98 //
99 const IBLCalibration &
100 getTot2Charges(unsigned int moduleHash, unsigned int FE) const;
101 //
103 getCalibrationStrategy(unsigned int moduleHash) const;
104 //
105 float
106 getChargeLUTFEI4(unsigned int moduleHash, unsigned int FE, unsigned int ToT) const;
107 //
108 float
109 getToTLUTFEI4(unsigned int moduleHash, unsigned int FE, float Q) const;
110
111 inline constexpr int
113 return 16;
114 }
115
116 private:
117 std::size_t m_sizeOfHashVector = 0;
119
120 std::array<std::vector<std::vector<PixelChargeCalib::Thresholds>>, s_NPixelDiodes> m_thresholds;
121 std::array<std::vector<std::vector<PixelChargeCalib::LegacyFitParameters>>, s_NPixelDiodes> m_legacyFit;
122 std::array<std::vector<std::vector<PixelChargeCalib::LinearFitParameters>>, s_NPixelDiodes> m_linFit;
123 std::vector<std::vector<PixelChargeCalib::Resolutions>> m_totRes;
124
125 // new IBL calibration
126 std::map<int, CalibrationStrategy> m_calibrationStrategy;
127 std::map<int, IBLModule> m_tot2Charges;
128
129};
130
131CLASS_DEF( PixelChargeCalibCondData , 345532779 , 1 )
132
133#include "AthenaKernel/CondCont.h"
135
136#endif
Structs for holding charge calibration parameterisation and data.
#define CONDCONT_DEF(...)
Definition CondCont.h:1413
macros to associate a CLID to a type
#define CLASS_DEF(NAME, CID, VERSION)
associate a clid and a version to a type eg
constexpr std::size_t enum2uint(T n, std::string_view callingFunctionName="")
Convert an enum class to size_t for use as an array index.
void setLinearFitParameters(InDetDD::PixelDiodeType type, unsigned int moduleHash, const std::vector< PixelChargeCalib::LinearFitParameters > &parameters)
void setLegacyFitParameters(InDetDD::PixelDiodeType type, unsigned int moduleHash, const std::vector< PixelChargeCalib::LegacyFitParameters > &parameters)
void setTot2Charges(unsigned int moduleHash, IBLModule charges)
float getQ2TotF(InDetDD::PixelDiodeType type, unsigned int moduleHash, unsigned int FE) const
PixelChargeCalib::LegacyFitParameters getLegacyFitParameters(InDetDD::PixelDiodeType type, unsigned int moduleHash, unsigned int FE) const
CalibrationStrategy getCalibrationStrategy(unsigned int moduleHash) const
PixelChargeCalibCondData()=default
std::map< int, CalibrationStrategy > m_calibrationStrategy
std::vector< IBLCalibration > IBLModule
float getCharge(InDetDD::PixelDiodeType type, unsigned int moduleHash, unsigned int FE, float ToT) const
std::array< std::vector< std::vector< PixelChargeCalib::LinearFitParameters > >, s_NPixelDiodes > m_linFit
void setAnalogThreshold(InDetDD::PixelDiodeType type, unsigned int moduleHash, std::vector< int > &&value)
void setAllFromConfigData(unsigned int moduleHash, const PixelModuleData *configData, const std::pair< int, int > &becLayer, unsigned int numFE)
void setThresholds(InDetDD::PixelDiodeType type, unsigned int moduleHash, const std::vector< PixelChargeCalib::Thresholds > &thresholds)
const IBLCalibration & getTot2Charges(unsigned int moduleHash, unsigned int FE) const
std::vector< std::vector< PixelChargeCalib::Resolutions > > m_totRes
constexpr int getFEI4OverflowToT() const
float getQ2TotG(InDetDD::PixelDiodeType type, unsigned int moduleHash, unsigned int FE) const
void setCalibrationStrategy(unsigned int moduleHash, CalibrationStrategy strategy)
void setAllFromBundle(unsigned int moduleHash, const PixelChargeCalib::ChargeCalibrationBundle &b)
void setTotResolutions(unsigned int moduleHash, const std::vector< PixelChargeCalib::Resolutions > &value)
static constexpr size_t IBLCalibrationSize
std::array< std::vector< std::vector< PixelChargeCalib::Thresholds > >, s_NPixelDiodes > m_thresholds
std::map< int, IBLModule > m_tot2Charges
PixelChargeCalib::Thresholds getThresholds(InDetDD::PixelDiodeType type, unsigned int moduleHash, unsigned int FE) const
float getToT(InDetDD::PixelDiodeType type, unsigned int moduleHash, unsigned int FE, float Q) const
float getToTLUTFEI4(unsigned int moduleHash, unsigned int FE, float Q) const
static constexpr std::size_t s_NPixelDiodes
float getTotRes(unsigned int moduleHash, unsigned int FE, float Q) const
PixelChargeCalib::LinearFitParameters getLinearFitParameters(InDetDD::PixelDiodeType type, unsigned int moduleHash, unsigned int FE) const
std::array< float, IBLCalibrationSize > IBLCalibration
float getChargeLUTFEI4(unsigned int moduleHash, unsigned int FE, unsigned int ToT) const
std::array< std::vector< std::vector< PixelChargeCalib::LegacyFitParameters > >, s_NPixelDiodes > m_legacyFit
This is an Identifier helper class for the Pixel subdetector.
Definition PixelID.h:67
bundles of parameters used together in the PixelChargeCalibCondAlg