23 {
24 IdentifierHash wafer_hash = IdentifierHash(moduleHash);
25 const InDetDD::SiDetectorElement *element =
m_elements->getDetectorElement(wafer_hash);
27 bool isLUTEnabled = (inputSource == 1);
28 bool isChargeCalibrationFromJson = (inputSource == 2);
29
30 ChargeCalibrationBundle
b(numFE,isLUTEnabled,isChargeCalibrationFromJson);
31
32 for (unsigned int j{}; j < numFE; j++) {
33
34 const auto &calibArray = (isLUTEnabled || isChargeCalibrationFromJson) ?
data.at(0) :
data.at(j);
35 if (!calibArray.empty()) {
36
38 if (calibArray.size() != FEStringSize) {
39 std::cout<<"Parameter size is not consistent(" << FEStringSize << ") " << calibArray.size() << " at (i,j)=(" << moduleHash << "," << j << ")\n";
42 }
47 charges[
k] = getFloat(k + 4ul);
48 }
50 b.threshold.emplace_back(getInt(0), 0.f, getInt(1), 0.f);
51 b.thresholdLong.emplace_back(getInt(2), 0.f, getInt(3), 0.f);
52 b.thresholdGanged.emplace_back(getInt(2), 0.f, getInt(3), 0.f);
55 b.totRes.emplace_back(0.f, 0.f);
56 } else {
57 if (calibArray.size() != FEStringSize) {
58 std::cout<<"Parameter size is not consistent(" << FEStringSize << ") " << calibArray.size() << " at (i,j)=(" << moduleHash << "," << j << ")\n";
61 }
64 b.threshold.emplace_back(getInt(0), getInt(1), getInt(2), getInt(3));
65 b.thresholdLong.emplace_back(getInt(4), getInt(5), getInt(6), getInt(7));
66 b.thresholdGanged.emplace_back(getInt(8), getInt(9), getInt(10), getInt(11));
67
68
70 b.params.emplace_back(getFloat(12), getFloat(13), getFloat(14), totLimit);
71 b.paramsGanged.emplace_back(getFloat(15), getFloat(16), getFloat(17), totLimit);
72 b.totRes.emplace_back(getFloat(18), getFloat(19));
73
74
78
79 if (!(element->
isDBM())) {
80
81 const int totIdxStart =
m_configData->getToTThreshold(barrel_ec,layer);
82 const int totIdxEnd =
m_configData->getFEI3Latency(barrel_ec,layer);
83
86
89 } else {
90 b.lin.emplace_back(0.f, 0.f);
91 b.linGanged.emplace_back(0.f, 0.f);
92 }
93 } else {
95 b.lin.emplace_back(0.f, 0.f);
96 b.linGanged.emplace_back(0.f, 0.f);
97 }
98 }
99 } else {
100 std::cout<<"Array size is zero in " << calibArray << " at (i,j)=(" << moduleHash << "," << j << ")\n";
103 }
104 }
106 }
static constexpr size_t IBLCalibrationSize
std::array< float, IBLCalibrationSize > IBLCalibration
std::function< T(size_t)> getFunc(const std::vector< std::string > &data)
Return function converting a string to number type T at index i of data vector.
const PixelID * m_pixelID
static constexpr float m_chargeLimit
If the calculated charge exceeds this limit, a linear extrapolation is used at this point.
const PixelModuleData * m_configData
const InDetDD::SiDetectorElementCollection * m_elements
std::pair< size_t, InDetDD::PixelReadoutTechnology > numChipsAndTechnology(const InDetDD::SiDetectorElement *element)
std::pair< int, int > getBecAndLayer(const PixelID *pPixelId, IdentifierHash hash)
static constexpr float defaultOverflow