Skip to content

Commit

Permalink
L1T: read pt compression bit depth from LUT for JEC
Browse files Browse the repository at this point in the history
  • Loading branch information
bundocka committed Apr 27, 2023
1 parent b0b0e73 commit faba138
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -692,6 +692,7 @@ void l1t::Stage2Layer2JetAlgorithmFirmwareImp1::calibrate(std::vector<l1t::Jet>&
// Calibrate using 3 LUTs: pt and eta compression LUTs, and a multiplicand/addend LUT.
// The pt and eta are each converted to a compressed scale using individual LUTs
// pt : 8 -> 4 bits, eta 6 -> 4 bits
// **updated** pt : 8 -> 6 bits, eta 6 -> 6 bits (uncompressed)
// This then forms an address. Using the third LUT, we get a
// multiplicand & addend, so we can do y = m*x + c on the original
// (i.e. non-compressed) jet pt.
Expand All @@ -714,9 +715,11 @@ void l1t::Stage2Layer2JetAlgorithmFirmwareImp1::calibrate(std::vector<l1t::Jet>&
if (jetHwPt >= 0x200) {
jetHwPt = 0x1FF;
}

unsigned int ptCompNrBits = params_->jetCompressPtLUT()->nrBitsData();
unsigned int ptBin = params_->jetCompressPtLUT()->data(jetHwPt >> 1);
unsigned int etaBin = params_->jetCompressEtaLUT()->data(abs(CaloTools::mpEta(jet->hwEta())));
unsigned int compBin = (etaBin << 4) | ptBin;
unsigned int compBin = (etaBin << ptCompNrBits) | ptBin;

unsigned int addPlusMult = params_->jetCalibrationLUT()->data(compBin);
unsigned int multiplier = addPlusMult & 0x3ff;
Expand Down

0 comments on commit faba138

Please sign in to comment.