32 defineParameter(
"InputWidth", 9);
33 defineParameter(
"NumResultBits", 6);
37 defineParameter(
"MinET", 0);
38 defineParameter(
"KFXE",0,0);
39 defineParameter(
"KFXE",0,1);
40 defineParameter(
"KFXE",0,2);
41 defineParameter(
"KFXE",0,3);
42 defineParameter(
"KFXE",0,4);
43 defineParameter(
"KFXE",0,5);
44 setNumberOutputBits(6);
53 p_NumberLeading2 = parameter(
"InputWidth").value();
55 p_MinEt = parameter(
"MinET").value();
57 for(
unsigned int i=0;
i<numberOutputBits(); ++
i) {
58 p_XE[
i] = parameter(
"KFXE",
i).value();
62 for(
unsigned int i=0;
i<numberOutputBits(); ++
i) {
72 weightWords[weightIndex] = parameter(
"weights"+
std::to_string(weightIndex)).value();
78 p_correctionLut[jEta][iET] = 0;
84 unsigned rawValue = ( weightWords[startBit/32] >> (startBit%32) ) & weightMask;
86 if (nOverflowBits > 0) {
111 const std::vector<TCS::TOBArray *> & ,
121 if(
input.size()!=2) {
122 TCS_EXCEPTION(
"KalmanMETCorrection alg must have exactly two input list (jets and MET list), but got " <<
input.size());
126 int64_t metXY[2] {
met.Ex(),
met.Ey()};
127 int64_t jetSumXY[2] {0, 0};
131 if( (*tob)->Et() <= p_MinEt )
continue;
132 unsigned tobEta = abs((*tob)->eta());
145 int scaledEt = (*tob)->Et() * p_correctionLut[
etaBin][etBin];
146 unsigned tobPhi = (*tob)->phi();
158 uint64_t kfmetSq = kfmetXY[0] * kfmetXY[0] + kfmetXY[1] * kfmetXY[1];
160 for(
unsigned int i=0;
i<numberOutputBits(); ++
i) {
161 decision.
setBit(
i, kfmetSq > p_XE[
i]*p_XE[
i] );
170 const std::vector<TCS::TOBArray *> &
output,
175 return this->processBitCorrect(
input,
output, decision);