11 unsigned short satBcidThreshLow,
12 unsigned short satBcidThreshHigh,
13 unsigned short satBcidLevel,
14 unsigned short bcidEnergyRangeLow,
15 unsigned short bcidEnergyRangeHigh,
16 unsigned short firStartBit,
22 unsigned short lutCpStrategy,
23 unsigned short lutCpOffset,
24 unsigned short lutCpSlope,
25 unsigned short lutCpNoiseCut,
30 unsigned short lutCpScale,
31 unsigned short lutJepStrategy,
32 unsigned short lutJepOffset,
33 unsigned short lutJepSlope,
34 unsigned short lutJepNoiseCut,
39 unsigned short lutJepScale,
40 unsigned int pedValue,
42 unsigned int pedFirSum)
43 : m_extBcidThreshold(extBcidThreshold),
44 m_satBcidThreshLow(satBcidThreshLow),
45 m_satBcidThreshHigh(satBcidThreshHigh),
46 m_satBcidLevel(satBcidLevel),
47 m_bcidEnergyRangeLow(bcidEnergyRangeLow),
48 m_bcidEnergyRangeHigh(bcidEnergyRangeHigh),
49 m_firStartBit(firStartBit),
50 m_vFirCoefficients({firCoeff1, firCoeff2, firCoeff3, firCoeff4, firCoeff5}),
51 m_lutCpStrategy(lutCpStrategy),
52 m_lutCpOffset(lutCpOffset),
53 m_lutCpSlope(lutCpSlope),
54 m_lutCpNoiseCut(lutCpNoiseCut),
55 m_lutCpPar1(lutCpPar1),
56 m_lutCpPar2(lutCpPar2),
57 m_lutCpPar3(lutCpPar3),
58 m_lutCpPar4(lutCpPar4),
59 m_lutCpScale(lutCpScale),
60 m_lutJepStrategy(lutJepStrategy),
61 m_lutJepOffset(lutJepOffset),
62 m_lutJepSlope(lutJepSlope),
63 m_lutJepNoiseCut(lutJepNoiseCut),
64 m_lutJepPar1(lutJepPar1),
65 m_lutJepPar2(lutJepPar2),
66 m_lutJepPar3(lutJepPar3),
67 m_lutJepPar4(lutJepPar4),
68 m_lutJepScale(lutJepScale),
71 m_pedFirSum(pedFirSum)
76 unsigned short getLutOffset(
double pedMean,
unsigned short firStartBit,
77 const std::vector<short int>& firCoeff,
78 unsigned short lutSlope,
79 unsigned short lutStrategy) {
80 unsigned short lutOffset = 0;
82 for (
unsigned int i = 0;
i < firCoeff.size();
i++) {
83 firCoeffSum += firCoeff.at(
i);
85 float lutOffsetReal = 0;
86 if (lutStrategy == 0) {
87 lutOffsetReal = (pedMean *
static_cast<float>(firCoeffSum) /
88 std::pow(2.,
static_cast<float>(firStartBit)));
90 lutOffsetReal = (pedMean *
static_cast<float>(firCoeffSum) *
91 static_cast<float>(lutSlope) /
92 std::pow(2.,
static_cast<float>(firStartBit)) -
93 static_cast<float>(lutSlope) / 2.0);
96 static_cast<unsigned short>(lutOffsetReal < 0. ? 0 : lutOffsetReal + 0.5);
102 short int firCoeff2,
short int firCoeff3,
short int firCoeff4,
103 short int firCoeff5,
unsigned short lutCpSlope,
unsigned short lutCpNoiseCut,
104 unsigned short lutJepSlope,
unsigned short lutJepNoiseCut)
118 output <<
"extBcidThreshold: " <<
r.m_extBcidThreshold <<
", "
119 <<
"satBcidThreshLow: " <<
r.m_satBcidThreshLow <<
", "
120 <<
"satBcidThreshHigh: " <<
r.m_satBcidThreshHigh <<
", "
121 <<
"bcidEnergyRangeLow: " <<
r.m_bcidEnergyRangeLow <<
", "
122 <<
"bcidEnergyRangeHigh: " <<
r.m_bcidEnergyRangeHigh << std::endl
123 <<
"firStartBit: " <<
r.m_firStartBit <<
", "
124 <<
"firCoeff1: " <<
r.m_vFirCoefficients.at(0) <<
", "
125 <<
"firCoeff2: " <<
r.m_vFirCoefficients.at(1) <<
", "
126 <<
"firCoeff3: " <<
r.m_vFirCoefficients.at(2) <<
", "
127 <<
"firCoeff4: " <<
r.m_vFirCoefficients.at(3) <<
", "
128 <<
"firCoeff5: " <<
r.m_vFirCoefficients.at(4) << std::endl
129 <<
"lutCpStrategy: " <<
r.m_lutCpStrategy <<
", "
130 <<
"lutCpOffset: " <<
r.m_lutCpOffset <<
", "
131 <<
"lutCpSlope: " <<
r.m_lutCpSlope <<
", "
132 <<
"lutCpNoiseCut: " <<
r.m_lutCpNoiseCut <<
", "
133 <<
"lutCpScale: " <<
r.m_lutCpScale << std::endl
134 <<
"lutCpPar1:" <<
r.m_lutCpPar1 <<
", "
135 <<
"lutCpPar2:" <<
r.m_lutCpPar2 <<
", "
136 <<
"lutCpPar3:" <<
r.m_lutCpPar3 <<
", "
137 <<
"lutCpPar4:" <<
r.m_lutCpPar4 << std::endl
138 <<
"lutJepStrategy: " <<
r.m_lutJepStrategy <<
", "
139 <<
"lutJepOffset: " <<
r.m_lutJepOffset <<
", "
140 <<
"lutJepSlope: " <<
r.m_lutJepSlope <<
", "
141 <<
"lutJepNoiseCut: " <<
r.m_lutJepNoiseCut <<
", "
142 <<
"lutJepScale: " <<
r.m_lutJepScale << std::endl
143 <<
"lutJepPar1:" <<
r.m_lutJepPar1 <<
", "
144 <<
"lutJepPar2:" <<
r.m_lutJepPar2 <<
", "
145 <<
"lutJepPar3:" <<
r.m_lutJepPar3 <<
", "
146 <<
"lutJepPar4:" <<
r.m_lutJepPar4 << std::endl
147 <<
"pedValue: " <<
r.m_pedValue <<
", "
148 <<
"pedMean: " <<
r.m_pedMean <<
", "
149 <<
"pedFirSum: " <<
r.m_pedFirSum << std::endl;