Skip to content
This repository has been archived by the owner on May 1, 2024. It is now read-only.

Commit

Permalink
Stage 1 MET fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
R. Alex Barbieri committed Sep 18, 2015
1 parent 439c1ef commit b6a725d
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 10 deletions.
2 changes: 2 additions & 0 deletions L1Trigger/L1TCalorimeter/src/PUSubtractionMethods.cc
Expand Up @@ -130,6 +130,8 @@ namespace l1t {
//std::cout << "eta: " << regionEta << " pusub: " << puSub << std::endl;

int regionEtCorr = std::max(0, regionET - puSub);
if(regionET == 1023)
regionEtCorr = 1023; // do not subtract overflow regions

ROOT::Math::LorentzVector<ROOT::Math::PxPyPzE4D<double> > lorentz(0,0,0,0);
CaloRegion newSubRegion(*&lorentz, 0, 0, regionEtCorr, regionEta, regionPhi, notCorrectedRegion->hwQual(), notCorrectedRegion->hwEtEm(), notCorrectedRegion->hwEtHad());
Expand Down
Expand Up @@ -63,6 +63,26 @@ void l1t::Stage1Layer2EtSumAlgorithmImpHW::processEvent(const std::vector<l1t::C
std::vector<SimpleRegion> regionEtVect;
std::vector<SimpleRegion> regionHtVect;

// check the un-subtracted regions for overflow
bool regionOverflowEt(false);
bool regionOverflowHt(false);
for (auto& region : regions) {
if(region.hwEta() >= etSumEtaMinEt && region.hwEta() <= etSumEtaMaxEt)
{
if(region.hwPt() >= 1023)
{
regionOverflowEt = true;
}
}
if ( region.hwEta() >= etSumEtaMinHt && region.hwEta() <= etSumEtaMaxHt)
{
if(region.hwPt() >= 1023)
{
regionOverflowHt = true;
}
}
}

// hwPt() is the sum ET+HT in region, for stage 1 this will be
// the region sum input to MET algorithm
// In stage 2, we would move to hwEtEm() and hwEtHad() for separate MET/MHT
Expand Down Expand Up @@ -108,13 +128,13 @@ void l1t::Stage1Layer2EtSumAlgorithmImpHW::processEvent(const std::vector<l1t::C
int MHTqual = 0;
int ETTqual = 0;
int HTTqual = 0;
if(MET >= 0xfff) // MET 12 bits
if(MET >= 0xfff || regionOverflowEt) // MET 12 bits
METqual = 1;
if(MHT >= 0x7f) // MHT 7 bits
if(MHT >= 0x7f || regionOverflowHt) // MHT 7 bits
MHTqual = 1;
if(sumET >= 0xfff)
if(sumET >= 0xfff || regionOverflowEt)
ETTqual = 1;
if(sumHT >= 0xfff)
if(sumHT >= 0xfff || regionOverflowHt)
HTTqual = 1;


Expand Down Expand Up @@ -171,16 +191,12 @@ l1t::Stage1Layer2EtSumAlgorithmImpHW::doSumAndMET(const std::vector<SimpleRegion
{
std::array<int, 18> sumEtaPos{};
std::array<int, 18> sumEtaNeg{};
bool inputOverflow(false);
for (const auto& r : regionEt)
{
if ( r.ieta < 11 )
sumEtaNeg[r.iphi] += r.et;
else
sumEtaPos[r.iphi] += r.et;

if ( r.et >= (1<<10) )

This comment has been minimized.

Copy link
@nsmith-

nsmith- Sep 25, 2015

Just changing this line to (1<<10)-1 (along with the PU subtraction fix) would've worked, I think.

This comment has been minimized.

Copy link
@harmonicoscillator

harmonicoscillator Sep 25, 2015

Owner

That's true, but then we would still be left with a situation where this function AND the top level function both check for overflow. I felt that it was better to only have one check, and since I'm more familiar with the top level function I moved it there.

inputOverflow = true;
}

std::array<int, 18> sumEta{};
Expand All @@ -191,8 +207,6 @@ l1t::Stage1Layer2EtSumAlgorithmImpHW::doSumAndMET(const std::vector<SimpleRegion
sumEta[i] = sumEtaPos[i] + sumEtaNeg[i];
sumEt += sumEta[i];
}
sumEt = (sumEt % (1<<12)) | ((sumEt >= (1<<12) || inputOverflow) ? (1<<12):0);
assert(sumEt>=0 && sumEt < (1<<13));

// 0, 20, 40, 60, 80 degrees
std::array<int, 5> sumsForCos{};
Expand Down

0 comments on commit b6a725d

Please sign in to comment.