1 #ifndef PhysicsTools_SelectorUtils_interface_PFJetIDSelectionFunctor_h 2 #define PhysicsTools_SelectorUtils_interface_PFJetIDSelectionFunctor_h 57 if (versionStr ==
"FIRSTDATA")
59 else if (versionStr ==
"RUNIISTARTUP")
61 else if (versionStr ==
"WINTER16")
63 else if (versionStr ==
"WINTER17")
65 else if (versionStr ==
"WINTER17PUPPI")
67 else if (versionStr ==
"SUMMER18")
69 else if (versionStr ==
"SUMMER18PUPPI")
71 else if (versionStr ==
"RUN2UL16CHS")
73 else if (versionStr ==
"RUN2UL16PUPPI")
75 else if (versionStr ==
"RUN2ULCHS")
77 else if (versionStr ==
"RUN2ULPUPPI")
82 if (qualityStr ==
"LOOSE")
84 else if (qualityStr ==
"TIGHT")
86 else if (qualityStr ==
"TIGHTLEPVETO")
95 for (
auto i = strings_set.begin();
i != strings_set.end(); ++
i) {
105 if (
params.exists(
"cutsToIgnore"))
123 edm::allowedValues<std::string>(
"FIRSTDATA",
135 edm::allowedValues<std::string>(
"LOOSE",
"TIGHT",
"TIGHTLEPVETO"));
136 desc.addOptional<std::vector<std::string>>(
"cutsToIgnore")->setComment(
"");
164 desc.addOptionalNode(
CHF,
false);
165 desc.addOptionalNode(
NHF,
false);
166 desc.addOptionalNode(NHF_FW,
false);
167 desc.addOptionalNode(NHF_EC,
false);
168 desc.addOptionalNode(NHF_TR,
false);
170 desc.addOptionalNode(
CEF,
false);
171 desc.addOptionalNode(CEF_TR,
false);
173 desc.addOptionalNode(
NEF,
false);
174 desc.addOptionalNode(NEF_FW,
false);
175 desc.addOptionalNode(NEF_EC_L,
false);
176 desc.addOptionalNode(NEF_EC_U,
false);
177 desc.addOptionalNode(NEF_TR,
false);
179 desc.addOptionalNode(
NCH,
false);
181 desc.addOptionalNode(MUF,
false);
182 desc.addOptionalNode(MUF_TR,
false);
185 desc.addOptionalNode(nNeutrals_FW,
false);
186 desc.addOptionalNode(nNeutrals_FW_L,
false);
187 desc.addOptionalNode(nNeutrals_FW_U,
false);
188 desc.addOptionalNode(nnNeutrals_EC,
false);
199 if (
jet.currentJECLevel() ==
"Uncorrected" || !
jet.jecSetsAvailable())
244 int nconstituents = 0;
252 if (patJet !=
nullptr) {
308 chf = nhf = cef = nef = muf = 0.0;
312 else if (pfJet !=
nullptr) {
317 if (jetEnergyUncorrected > 0.) {
322 muf = pfJet->
muonEnergy() / jetEnergyUncorrected;
330 else if (basicJet !=
nullptr) {
787 <<
"The LOOSE operating point is only supported for the WINTER16 JetID version -- defaulting to TIGHT";
798 set(
"nConstituents", 1);
801 set(
"nNeutrals_FW", 10);
805 set(
"nNeutrals_EC", 2);
807 set(
"nNeutrals_FW", 10);
817 set(
"nConstituents", 1);
820 set(
"nNeutrals_FW", 10);
824 set(
"nNeutrals_EC", 2);
826 set(
"nNeutrals_FW", 10);
828 set(
"NEF_EC_L", 0.02);
829 set(
"NEF_EC_U", 0.99);
830 set(
"nNeutrals_EC", 2);
833 set(
"nNeutrals_FW", 10);
838 set(
"nNeutrals_FW_L", 2);
839 set(
"nNeutrals_FW_U", 15);
844 set(
"NEF_EC_L", 0.02);
845 set(
"NEF_EC_U", 0.99);
846 set(
"nNeutrals_EC", 2);
849 set(
"nNeutrals_FW", 10);
856 set(
"nNeutrals_FW_L", 2);
857 set(
"nNeutrals_FW_U", 15);
863 set(
"NEF_EC_U", 0.99);
864 set(
"nNeutrals_EC", 1);
867 set(
"nNeutrals_FW", 10);
871 set(
"nNeutrals_EC", 1);
873 set(
"nNeutrals_FW_L", 2);
874 set(
"nNeutrals_FW_U", 999999);
879 set(
"NEF_EC_L", 0.01);
880 set(
"NEF_EC_U", 0.99);
881 set(
"nNeutrals_EC", 2);
884 set(
"nNeutrals_FW", 10);
888 set(
"NHF_EC", 0.9999);
891 set(
"nNeutrals_FW_L", 2);
892 set(
"nNeutrals_FW_U", 999999);
899 set(
"nConstituents", 1);
902 set(
"NEF_EC_L", 0.02);
903 set(
"NEF_EC_U", 0.99);
904 set(
"nNeutrals_EC", 2);
907 set(
"nNeutrals_FW", 10);
914 set(
"nNeutrals_FW_L", 2);
915 set(
"nNeutrals_FW_U", 15);
921 set(
"nNeutrals_EC", 2);
922 set(
"nNeutrals_FW", 10);
930 set(
"nNeutrals_FW_L", 2);
931 set(
"nNeutrals_FW_U", 15);
937 set(
"nNeutrals_EC", 2);
938 set(
"nNeutrals_FW", 10);
949 set(
"NEF_EC_L", 0.02);
950 set(
"NEF_EC_U", 0.99);
951 set(
"nNeutrals_EC", 2);
954 set(
"nNeutrals_FW", 10);
965 set(
"nNeutrals_FW_L", 2);
966 set(
"nNeutrals_FW_U", 15);
974 set(
"NEF_EC_U", 0.99);
975 set(
"nNeutrals_EC", 1);
978 set(
"nNeutrals_FW", 10);
984 set(
"nNeutrals_EC", 1);
986 set(
"nNeutrals_FW_L", 2);
987 set(
"nNeutrals_FW_U", 999999);
996 set(
"NEF_EC_L", 0.01);
997 set(
"NEF_EC_U", 0.99);
998 set(
"nNeutrals_EC", 2);
1000 set(
"NEF_FW", 0.90);
1001 set(
"nNeutrals_FW", 10);
1006 set(
"NEF_TR", 0.99);
1009 set(
"NHF_EC", 0.9999);
1010 set(
"NHF_FW", -1.0);
1011 set(
"NEF_FW", 0.90);
1012 set(
"nNeutrals_FW_L", 2);
1013 set(
"nNeutrals_FW_U", 999999);
bool ignoreCut(std::string const &s) const
ignore the cut at index "s"
index_type indexNNeutrals_EC_
float muonEnergy() const
muonEnergy
float neutralHadronEnergy() const
neutralHadronEnergy
int chargedMultiplicity() const
chargedMultiplicity
int chargedMultiplicity() const
chargedMultiplicity
float chargedEmEnergy() const
chargedEmEnergy
float neutralEmEnergy() const
neutralEmEnergy
ret
prodAgent to be discontinued
PFJetIDSelectionFunctor(edm::ParameterSet const ¶ms, edm::ConsumesCollector &iC)
Base class for all types of Jets.
index_type indexNEF_EC_L_
bool isBasicJet() const
check to see if the jet is no more than a reco::BasicJet
pat::strbitset::index_type index_type
int neutralMultiplicity() const
neutralMultiplicity
void setIgnored(pat::strbitset &ret)
set ignored bits
pat::strbitset retInternal_
internal ret if users don't care about return bits
const std::vector< std::string > strings() const
give access to the ordered strings
int neutralMultiplicity() const
neutralMultiplicity
Jets made from CaloTowers.
float neutralHadronEnergyFraction() const
neutralHadronEnergyFraction (relative to uncorrected jet energy)
Jets made from PFObjects.
PFJetIDSelectionFunctor(Version_t version, Quality_t quality)
bool operator()(const reco::PFJet &jet, pat::strbitset &ret)
index_type indexNConstituents_
PFJetIDSelectionFunctor(edm::ParameterSet const ¶ms)
float chargedHadronEnergy() const
chargedHadronEnergy
pat::strbitset bits_
the bitset indexed by strings
void passCut(pat::strbitset &ret, std::string const &s)
Passing cuts.
float electronEnergy() const
electronEnergy
const_iterator end() const
last daughter const_iterator
Abs< T >::type abs(const T &t)
index_type indexNNeutrals_FW_
virtual void push_back(std::string const &s)
This is the registration of an individual cut string.
bool operator()(const reco::PFJet &jet)
float chargedEmEnergy() const
chargedEmEnergy
Functor that operates on <T>
bool isPFJet() const
check to see if the jet is a reco::PFJet
PF Jet selector for pat::Jets.
index_type indexNNeutrals_FW_L_
float neutralHadronEnergy() const
neutralHadronEnergy
float chargedHadronEnergyFraction() const
chargedHadronEnergyFraction (relative to uncorrected jet energy)
float HFEMEnergy() const
HFEMEnergy.
static edm::ParameterSetDescription getDescription()
pat::strbitset getBitTemplate() const
Get an empty bitset with the proper names.
index_type indexNEF_EC_U_
bool operator()(const pat::Jet &jet, pat::strbitset &ret) override
This provides the interface for base classes to select objects.
strbitset & set(bool val=true)
set method of all bits
int cut(index_type const &i, int val) const
Access the int cut values at index "s".
Analysis-level calorimeter jet class.
float muonEnergy() const
muonEnergy
float chargedEmEnergyFraction() const
chargedEmEnergyFraction (relative to uncorrected jet energy)
float muonEnergyFraction() const
muonEnergyFraction (relative to corrected jet energy)
float neutralEmEnergy() const
neutralEmEnergy
float neutralEmEnergyFraction() const
neutralEmEnergyFraction (relative to uncorrected jet energy)
float chargedHadronEnergy() const
chargedHadronEnergy
index_type indexNNeutrals_FW_U_
float photonEnergy() const
photonEnergy
PFJetIDSelectionFunctor()
void setIgnoredCuts(std::vector< std::string > const &bitsToIgnore)
set the bits to ignore from a vector
Log< level::Warning, false > LogWarning
bool firstDataCuts(reco::Jet const &jet, pat::strbitset &ret, Version_t version_)
const_iterator begin() const
first daughter const_iterator
double energy() const final
energy