Skip to content

Commit

Permalink
Merge pull request #27691 from knash/jetid_mufracfix
Browse files Browse the repository at this point in the history
Jetid muon fraction fix
  • Loading branch information
cmsbuild authored Aug 22, 2019
2 parents 808a7f6 + f29b7fb commit bd91394
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion PhysicsTools/SelectorUtils/interface/PFJetIDSelectionFunctor.h
Original file line number Diff line number Diff line change
Expand Up @@ -252,6 +252,7 @@ class PFJetIDSelectionFunctor : public Selector<pat::Jet> {
double cef = 0.0;
double nef = 0.0;
double muf = 0.0;

int nch = 0;
int nconstituents = 0;
int nneutrals = 0;
Expand All @@ -268,6 +269,7 @@ class PFJetIDSelectionFunctor : public Selector<pat::Jet> {
cef = patJet->chargedEmEnergyFraction();
nef = patJet->neutralEmEnergyFraction();
nch = patJet->chargedMultiplicity();
muf = patJet->muonEnergyFraction();
nconstituents = patJet->numberOfDaughters();
nneutrals = patJet->neutralMultiplicity();
// Handle the special case of PUPPI jets with weighted multiplicities
Expand All @@ -283,6 +285,7 @@ class PFJetIDSelectionFunctor : public Selector<pat::Jet> {
double e_nhf = 0.0;
double e_cef = 0.0;
double e_nef = 0.0;
double e_muf = 0.0;
nch = 0;
nconstituents = 0;
nneutrals = 0;
Expand All @@ -296,6 +299,7 @@ class PFJetIDSelectionFunctor : public Selector<pat::Jet> {
e_nhf += patsub->neutralHadronEnergy();
e_cef += patsub->chargedEmEnergy();
e_nef += patsub->neutralEmEnergy();
e_muf += patsub->muonEnergy();
nch += patsub->chargedMultiplicity();
nconstituents += patsub->numberOfDaughters();
nneutrals += patsub->neutralMultiplicity();
Expand All @@ -304,6 +308,7 @@ class PFJetIDSelectionFunctor : public Selector<pat::Jet> {
e_nhf += pfsub->neutralHadronEnergy();
e_cef += pfsub->chargedEmEnergy();
e_nef += pfsub->neutralEmEnergy();
e_muf += pfsub->muonEnergy();
nch += pfsub->chargedMultiplicity();
nconstituents += pfsub->numberOfDaughters();
nneutrals += pfsub->neutralMultiplicity();
Expand All @@ -316,8 +321,9 @@ class PFJetIDSelectionFunctor : public Selector<pat::Jet> {
nhf = e_nhf / e;
cef = e_cef / e;
nef = e_nef / e;
muf = e_muf / e;
} else {
chf = nhf = cef = nef = 0.0;
chf = nhf = cef = nef = muf = 0.0;
}
}
} // end if pat jet
Expand All @@ -344,6 +350,7 @@ class PFJetIDSelectionFunctor : public Selector<pat::Jet> {
double e_nhf = 0.0;
double e_cef = 0.0;
double e_nef = 0.0;
double e_muf = 0.0;
nch = 0;
nconstituents = 0;
for (reco::Jet::const_iterator ibegin = basicJet->begin(), iend = patJet->end(), isub = ibegin; isub != iend;
Expand All @@ -353,6 +360,7 @@ class PFJetIDSelectionFunctor : public Selector<pat::Jet> {
e_nhf += pfsub->neutralHadronEnergy();
e_cef += pfsub->chargedEmEnergy();
e_nef += pfsub->neutralEmEnergy();
e_muf += pfsub->muonEnergy();
nch += pfsub->chargedMultiplicity();
nconstituents += pfsub->numberOfDaughters();
nneutrals += pfsub->neutralMultiplicity();
Expand All @@ -363,6 +371,7 @@ class PFJetIDSelectionFunctor : public Selector<pat::Jet> {
nhf = e_nhf / e;
cef = e_cef / e;
nef = e_nef / e;
muf = e_muf / e;
}
} // end if basic jet

Expand Down

0 comments on commit bd91394

Please sign in to comment.