Skip to content

Commit

Permalink
Code reorganized
Browse files Browse the repository at this point in the history
  • Loading branch information
mandrenguyen committed Jun 25, 2022
1 parent 8aae610 commit ed66c69
Showing 1 changed file with 4 additions and 3 deletions.
Expand Up @@ -140,14 +140,16 @@ class PFHFRecHitCreator final : public PFRecHitCreatorBase {
std::lower_bound(tmpOut.begin(), tmpOut.end(), longID, [](const reco::PFRecHit& a, HcalDetId b) {
return a.detId() < b.rawId();
});
double energy = 2 * sHORT;
double energy = sHORT;
if (found_hit != tmpOut.end() && found_hit->detId() == longID.rawId()) {
double lONG = found_hit->energy();
//Ask for fraction

//If in this case lONG-sHORT<0 add the energy to the sHORT
if ((lONG - sHORT) < thresh_HF_)
energy = lONG + sHORT;
energy += lONG;
else
energy += sHORT;

if (abs(detid.ieta()) <= 32)
energy *= HFCalib_;
Expand All @@ -161,7 +163,6 @@ class PFHFRecHitCreator final : public PFRecHitCreatorBase {
//only short hit!
if (abs(detid.ieta()) <= 32)
energy *= HFCalib_;
energy /= 2.;
newHit.setEnergy(energy);
if (energy > thresh_HF_)
out->push_back(newHit);
Expand Down

0 comments on commit ed66c69

Please sign in to comment.