-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #69 from blinkseb/jetid
Store jetid for jets and fat jets
- Loading branch information
Showing
6 changed files
with
82 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
#pragma once | ||
|
||
namespace pat { | ||
class Jet; | ||
} | ||
|
||
namespace Tools { | ||
namespace Jets { | ||
|
||
// Jet id: https://twiki.cern.ch/twiki/bin/view/CMS/JetID#Recommendations_for_13_TeV_data | ||
#define DECLARE_QUANTITIES(jet) \ | ||
float eta = jet.eta(); \ | ||
float NHF = jet.neutralHadronEnergyFraction(); \ | ||
float NEMF = jet.neutralEmEnergyFraction(); \ | ||
float CHF = jet.chargedHadronEnergyFraction(); \ | ||
float MUF = jet.muonEnergyFraction(); \ | ||
float CEMF = jet.chargedEmEnergyFraction(); \ | ||
size_t NumConst = jet.chargedMultiplicity() + jet.neutralMultiplicity(); \ | ||
size_t NumNeutralParticles = jet.neutralMultiplicity(); \ | ||
size_t CHM = jet.chargedMultiplicity(); | ||
|
||
bool passLooseId(const pat::Jet& jet); | ||
bool passTightId(const pat::Jet& jet); | ||
bool passTightLeptonVetoId(const pat::Jet& jet); | ||
}; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
#include <cp3_llbb/Framework/interface/Tools.h> | ||
#include <DataFormats/PatCandidates/interface/Jet.h> | ||
|
||
namespace Tools { | ||
namespace Jets { | ||
|
||
// Jet id: https://twiki.cern.ch/twiki/bin/view/CMS/JetID#Recommendations_for_13_TeV_data | ||
#pragma GCC diagnostic push | ||
#pragma GCC diagnostic ignored "-Wunused-variable" | ||
bool passLooseId(const pat::Jet& jet) { | ||
DECLARE_QUANTITIES(jet); | ||
|
||
if (fabs(eta) <= 3.0) { | ||
return (NHF < 0.99 && NEMF < 0.99 && NumConst > 1) && ((fabs(eta) <= 2.4 && CHF > 0 && CHM > 0 && CEMF < 0.99) || fabs(eta) > 2.4); | ||
} else { | ||
return (NEMF < 0.90 && NumNeutralParticles > 10); | ||
} | ||
} | ||
|
||
bool passTightId(const pat::Jet& jet) { | ||
DECLARE_QUANTITIES(jet); | ||
|
||
if (fabs(eta) <= 3.0) { | ||
return (NHF < 0.90 && NEMF < 0.90 && NumConst > 1) && ((fabs(eta) <= 2.4 && CHF > 0 && CHM > 0 && CEMF < 0.99) || fabs(eta) > 2.4); | ||
} else { | ||
return (NEMF < 0.90 && NumNeutralParticles > 10); | ||
} | ||
} | ||
|
||
bool passTightLeptonVetoId(const pat::Jet& jet) { | ||
DECLARE_QUANTITIES(jet); | ||
|
||
return (NHF < 0.90 && NEMF < 0.90 && NumConst > 1 && MUF < 0.8) && ((fabs(eta) <= 2.4 && CHF > 0 && CHM > 0 && CEMF < 0.90) || fabs(eta) > 2.4) && fabs(eta) <= 3.0; | ||
} | ||
#pragma GCC diagnostic pop | ||
}; | ||
}; |