1 #ifndef PhysicsTools_SelectorUtils_interface_PFJetIDSelectionFunctor_h 2 #define PhysicsTools_SelectorUtils_interface_PFJetIDSelectionFunctor_h 61 if (versionStr ==
"FIRSTDATA")
63 else if (versionStr ==
"RUNIISTARTUP")
65 else if (versionStr ==
"WINTER16")
67 else if (versionStr ==
"WINTER17")
69 else if (versionStr ==
"WINTER17PUPPI")
71 else if (versionStr ==
"SUMMER18")
73 else if (versionStr ==
"SUMMER18PUPPI")
75 else if (versionStr ==
"RUN2UL16CHS")
77 else if (versionStr ==
"RUN2UL16PUPPI")
79 else if (versionStr ==
"RUN2ULCHS")
81 else if (versionStr ==
"RUN2ULPUPPI")
83 else if (versionStr ==
"RUN3WINTER22CHSrunsBCDEprompt")
85 else if (versionStr ==
"RUN3WINTER22PUPPIrunsBCDEprompt")
87 else if (versionStr ==
"RUN3WINTER22CHS")
89 else if (versionStr ==
"RUN3WINTER22PUPPI")
94 if (qualityStr ==
"LOOSE")
96 else if (qualityStr ==
"TIGHT")
98 else if (qualityStr ==
"TIGHTLEPVETO")
107 for (
auto i = strings_set.begin();
i != strings_set.end(); ++
i) {
117 if (
params.exists(
"cutsToIgnore"))
135 edm::allowedValues<std::string>(
"FIRSTDATA",
146 "RUN3WINTER22CHSrunsBCDEprompt",
147 "RUN3WINTER22PUPPIrunsBCDEprompt",
149 "RUN3WINTER22PUPPI"));
151 edm::allowedValues<std::string>(
"LOOSE",
"TIGHT",
"TIGHTLEPVETO"));
152 desc.addOptional<std::vector<std::string>>(
"cutsToIgnore")->setComment(
"");
180 desc.addOptionalNode(
CHF,
false);
181 desc.addOptionalNode(
NHF,
false);
182 desc.addOptionalNode(NHF_FW,
false);
183 desc.addOptionalNode(NHF_EC,
false);
184 desc.addOptionalNode(NHF_TR,
false);
186 desc.addOptionalNode(
CEF,
false);
187 desc.addOptionalNode(CEF_TR,
false);
189 desc.addOptionalNode(
NEF,
false);
190 desc.addOptionalNode(NEF_FW,
false);
191 desc.addOptionalNode(NEF_EC_L,
false);
192 desc.addOptionalNode(NEF_EC_U,
false);
193 desc.addOptionalNode(NEF_TR,
false);
195 desc.addOptionalNode(
NCH,
false);
197 desc.addOptionalNode(MUF,
false);
198 desc.addOptionalNode(MUF_TR,
false);
201 desc.addOptionalNode(nNeutrals_FW,
false);
202 desc.addOptionalNode(nNeutrals_FW_L,
false);
203 desc.addOptionalNode(nNeutrals_FW_U,
false);
204 desc.addOptionalNode(nnNeutrals_EC,
false);
217 if (
jet.currentJECLevel() ==
"Uncorrected" || !
jet.jecSetsAvailable())
264 int nconstituents = 0;
272 if (patJet !=
nullptr) {
328 chf = nhf = cef = nef = muf = 0.0;
332 else if (pfJet !=
nullptr) {
337 if (jetEnergyUncorrected > 0.) {
342 muf = pfJet->
muonEnergy() / jetEnergyUncorrected;
350 else if (basicJet !=
nullptr) {
819 <<
"The LOOSE operating point is only supported for the WINTER16 JetID version -- defaulting to TIGHT";
830 set(
"nConstituents", 1);
833 set(
"nNeutrals_FW", 10);
837 set(
"nNeutrals_EC", 2);
839 set(
"nNeutrals_FW", 10);
856 set(
"nConstituents", 1);
859 set(
"nNeutrals_FW", 10);
863 set(
"nNeutrals_EC", 2);
865 set(
"nNeutrals_FW", 10);
867 set(
"NEF_EC_L", 0.02);
868 set(
"NEF_EC_U", 0.99);
869 set(
"nNeutrals_EC", 2);
872 set(
"nNeutrals_FW", 10);
877 set(
"nNeutrals_FW_L", 2);
878 set(
"nNeutrals_FW_U", 15);
883 set(
"NEF_EC_L", 0.02);
884 set(
"NEF_EC_U", 0.99);
885 set(
"nNeutrals_EC", 2);
888 set(
"nNeutrals_FW", 10);
895 set(
"nNeutrals_FW_L", 2);
896 set(
"nNeutrals_FW_U", 15);
902 set(
"NEF_EC_U", 0.99);
903 set(
"nNeutrals_EC", 1);
906 set(
"nNeutrals_FW", 10);
910 set(
"nNeutrals_EC", 1);
912 set(
"nNeutrals_FW_L", 2);
913 set(
"nNeutrals_FW_U", 999999);
918 set(
"NEF_EC_L", 0.01);
919 set(
"NEF_EC_U", 0.99);
920 set(
"nNeutrals_EC", 2);
923 set(
"nNeutrals_FW", 10);
927 set(
"NHF_EC", 0.9999);
930 set(
"nNeutrals_FW_L", 2);
931 set(
"nNeutrals_FW_U", 999999);
935 set(
"NHF_EC", 0.9999);
938 set(
"nNeutrals_FW_L", 1);
939 set(
"nNeutrals_FW_U", 999999);
947 set(
"nConstituents", 1);
950 set(
"NEF_EC_L", 0.02);
951 set(
"NEF_EC_U", 0.99);
952 set(
"nNeutrals_EC", 2);
955 set(
"nNeutrals_FW", 10);
966 set(
"nNeutrals_FW_L", 2);
967 set(
"nNeutrals_FW_U", 15);
972 set(
"nNeutrals_EC", 2);
973 set(
"nNeutrals_FW", 10);
979 set(
"nNeutrals_FW_L", 2);
980 set(
"nNeutrals_FW_U", 15);
985 set(
"nNeutrals_EC", 2);
986 set(
"nNeutrals_FW", 10);
994 set(
"NEF_EC_L", 0.02);
995 set(
"NEF_EC_U", 0.99);
996 set(
"nNeutrals_EC", 2);
999 set(
"nNeutrals_FW", 10);
1002 set(
"NEF_TR", 0.99);
1005 set(
"NHF_EC", 0.99);
1006 set(
"NHF_FW", 0.02);
1007 set(
"NEF_FW", 0.90);
1008 set(
"nNeutrals_FW_L", 2);
1009 set(
"nNeutrals_FW_U", 15);
1012 set(
"NEF_TR", 0.99);
1014 set(
"NEF_EC_L", 0.);
1015 set(
"NEF_EC_U", 0.99);
1016 set(
"nNeutrals_EC", 1);
1018 set(
"NEF_FW", 0.90);
1019 set(
"nNeutrals_FW", 10);
1021 set(
"NHF_TR", 0.98);
1022 set(
"NEF_TR", 0.99);
1023 set(
"nNeutrals_EC", 1);
1024 set(
"NEF_FW", 0.90);
1025 set(
"nNeutrals_FW_L", 2);
1026 set(
"nNeutrals_FW_U", 999999);
1029 set(
"NEF_TR", 0.99);
1033 set(
"NEF_EC_L", 0.01);
1034 set(
"NEF_EC_U", 0.99);
1035 set(
"nNeutrals_EC", 2);
1037 set(
"NEF_FW", 0.90);
1038 set(
"nNeutrals_FW", 10);
1041 set(
"NEF_TR", 0.99);
1044 set(
"NHF_EC", 0.9999);
1045 set(
"NHF_FW", -1.0);
1046 set(
"NEF_FW", 0.90);
1047 set(
"nNeutrals_FW_L", 2);
1048 set(
"nNeutrals_FW_U", 999999);
1051 set(
"NEF_TR", 0.99);
1054 set(
"NHF_EC", 0.9999);
1055 set(
"NHF_FW", -1.0);
1056 set(
"NEF_FW", 0.90);
1057 set(
"nNeutrals_FW_L", 1);
1058 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