Skip to content

Commit

Permalink
move average calculation out of the loop
Browse files Browse the repository at this point in the history
  • Loading branch information
jshin96 committed Jun 2, 2023
1 parent 50cea29 commit 2d370bf
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions RecoJets/JetProducers/src/PileupJetIdAlgo.cc
Original file line number Diff line number Diff line change
Expand Up @@ -652,10 +652,6 @@ PileupJetIdentifier PileupJetIdAlgo::computeIdVariables(const reco::Jet* jet,
float dphi = reco::deltaPhi(*icand, *jet);
sum_deta += deta * weight2;
sum_dphi += dphi * weight2;
if (sumW2 > 0) {
ave_deta = sum_deta / sumW2;
ave_dphi = sum_dphi / sumW2;
}
}
}

Expand Down Expand Up @@ -767,12 +763,12 @@ PileupJetIdentifier PileupJetIdAlgo::computeIdVariables(const reco::Jet* jet,
float dphi = reco::deltaPhi(*part, *jet);
sum_deta += deta * weight2;
sum_dphi += dphi * weight2;
}
if (sumW2 > 0) {
ave_deta = sum_deta / sumW2;
ave_dphi = sum_dphi / sumW2;
}
}
if (sumW2 > 0) {
ave_deta = sum_deta / sumW2;
ave_dphi = sum_dphi / sumW2;
}
float ddetaR_sum(0.0), ddphiR_sum(0.0), pull_tmp(0.0);

for (size_t i = 0; i < nCandPtrs; i++) {
Expand Down

0 comments on commit 2d370bf

Please sign in to comment.