6 #include "Identifier/Identifier.h"
14 constexpr
size_t FEStringSize{20};
22 ChargeCalibrationBundle
27 bool isLUTEnabled = (inputSource == 1);
28 bool isChargeCalibrationFromJson = (inputSource == 2);
32 for (
unsigned int j{}; j < numFE; j++) {
34 const auto &calibArray = (isLUTEnabled || isChargeCalibrationFromJson) ?
data.at(0) :
data.at(j);
35 if (!calibArray.empty()) {
38 if (calibArray.size() != FEStringSize) {
39 std::cout<<
"Parameter size is not consistent(" << FEStringSize <<
") " << calibArray.size() <<
" at (i,j)=(" << moduleHash <<
"," << j <<
")\n";
43 auto getInt = getFunc<int>(calibArray);
44 auto getFloat = getFunc<float>(calibArray);
47 charges[
k] = getFloat(
k + 4
ul);
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);
53 b.params.emplace_back(0.
f, 0.
f, 0.
f);
54 b.paramsGanged.emplace_back(0.
f, 0.
f, 0.
f);
55 b.totRes.emplace_back(0.
f, 0.
f);
57 if (calibArray.size() != FEStringSize) {
58 std::cout<<
"Parameter size is not consistent(" << FEStringSize <<
") " << calibArray.size() <<
" at (i,j)=(" << moduleHash <<
"," << j <<
")\n";
62 auto getInt = getFunc<int>(calibArray);
63 auto getFloat = getFunc<float>(calibArray);
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 b.params.emplace_back(getFloat(12), getFloat(13), getFloat(14));
68 b.paramsGanged.emplace_back(getFloat(15), getFloat(16), getFloat(17));
69 b.totRes.emplace_back(getFloat(18), getFloat(19));
76 if (!(element->
isDBM())) {
87 b.lin.emplace_back(0.
f, 0.
f);
88 b.linGanged.emplace_back(0.
f, 0.
f);
92 b.lin.emplace_back(0.
f, 0.
f);
93 b.linGanged.emplace_back(0.
f, 0.
f);
97 std::cout<<
"Array size is zero in " << calibArray <<
" at (i,j)=(" << moduleHash <<
"," << j <<
")\n";