31 std::vector<l1t::EtSum> & etsums) {
33 unsigned int ntowers(0);
39 if(nTT4 > 255) nTT4 = 255;
44 for (
int etaSide=1; etaSide>=-1; etaSide-=2) {
46 int ex(0), ey(0),
et(0);
47 int exHF(0), eyHF(0), etHF(0);
49 unsigned int mb0(0),
mb1(0);
51 bool ettSat(
false), ettHFSat(
false), ecalEtSat(
false), metSat(
false), metHFSat(
false);
55 int ieta = etaSide * absieta;
63 unsigned int towEtMetLUTAddr = (compNTT4<<6) | (
abs(ieta));
64 if(
abs(ieta)<13) towEtMetLUTAddr =
abs(ieta);
68 edm::LogError(
"l1t|stage 2") <<
"Invalid PUS type in calo params. Not applying PUS to Stage 2 MET" << std::endl;
76 unsigned int towEtSumEtLUTAddr = (compNTT4<<6) | (
abs(ieta));
77 if(
abs(ieta)<13) towEtSumEtLUTAddr =
abs(ieta);
81 edm::LogError(
"l1t|stage 2") <<
"Invalid PUS type in calo params. Not applying PUS to Stage 2 ETT" << std::endl;
89 unsigned int towEtEcalSumLUTAddr = (compNTT4<<6) | (
abs(ieta));
90 if(
abs(ieta)<13) towEtEcalSumLUTAddr =
abs(ieta);
94 edm::LogError(
"l1t|stage 2") <<
"Invalid PUS type in calo params. Not applying PUS to Stage 2 Ecal ETT" << std::endl;
100 int ringEx(0), ringEy(0), ringEt(0);
101 int ringExHF(0), ringEyHF(0), ringEtHF(0);
103 unsigned int ringMB0(0), ringMB1(0);
104 unsigned int ringNtowers(0);
134 ringEt += tower.
hwPt();
140 ringEtHF += tower.
hwPt();
146 ringEtEm += tower.
hwEtEm();
152 (tower.
hwQual() & 0x4) > 0)
156 (tower.
hwQual() & 0x8) > 0)
176 ntowers += ringNtowers;
179 if (mb0>0xf) mb0 = 0xf;
180 if (mb1>0xf) mb1 = 0xf;
185 if(ecalEtSat || etem > 0xffff) etem = 0xffff;
186 if(ettSat || et > 0xffff) et = 0xffff;
187 if(ettHFSat || etHF > 0xffff) etHF = 0xffff;
188 if(metSat || ex > 0x7fffffff) ex = 0x7fffffff;
189 if(metSat || ey > 0x7fffffff) ey = 0x7fffffff;
190 if(metHFSat || exHF > 0x7fffffff) exHF = 0x7fffffff;
191 if(metHFSat || eyHF > 0x7fffffff) eyHF = 0x7fffffff;
212 etsums.push_back(etSumTotalEt);
213 etsums.push_back(etSumEx);
214 etsums.push_back(etSumEy);
216 etsums.push_back(etSumTotalEtHF);
217 etsums.push_back(etSumExHF);
218 etsums.push_back(etSumEyHF);
220 etsums.push_back(etSumTotalEtEm);
222 etsums.push_back(etSumMinBias0);
223 etsums.push_back(etSumMinBias1);
229 etsums.push_back(etSumNtowers);
Stage2Layer2EtSumAlgorithmFirmwareImp1(CaloParamsHelper const *params)
void processEvent(const std::vector< l1t::CaloTower > &towers, std::vector< l1t::EtSum > &sums) override
l1t::LUT * etSumEttPUSLUT()
l1t::LUT * etSumMetPUSLUT()
std::string const & etSumEttPUSType() const
double etSumEtThreshold(unsigned isum) const
int32_t towEtEcalSumThresh_
int etSumEtaMax(unsigned isum) const
std::string const & etSumEcalSumPUSType() const
unsigned etSumBypassEttPUS() const
l1t::LUT * egCompressShapesLUT()
XYZTLorentzVectorD XYZTLorentzVector
Lorentz vector with cylindrical internal representation using pseudorapidity.
unsigned etSumBypassMetPUS() const
std::string const & etSumMetPUSType() const
int pileUpTowerThreshold() const
Abs< T >::type abs(const T &t)
CaloParamsHelper const * params_
int32_t towEtSumEtThresh_
double egPUSParam(int ipar) const
unsigned etSumBypassEcalSumPUS() const
et
define resolution functions of each parameter
double towerLsbSum() const
int data(unsigned int address) const
l1t::LUT * etSumEcalSumPUSLUT()