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 ==
"RUN3CHSrunsBCDEprompt")
85 else if (versionStr ==
"RUN3PUPPIrunsBCDEprompt")
87 else if (versionStr ==
"RUN3CHSruns2022FGruns2023CD")
89 else if (versionStr ==
"RUN3PUPPIruns2022FGruns2023CD")
95 if (qualityStr ==
"LOOSE")
97 else if (qualityStr ==
"TIGHT")
99 else if (qualityStr ==
"TIGHTLEPVETO")
108 for (
auto i = strings_set.begin();
i != strings_set.end(); ++
i) {
118 if (
params.exists(
"cutsToIgnore"))
137 edm::allowedValues<std::string>(
"FIRSTDATA",
148 "RUN3CHSrunsBCDEprompt",
149 "RUN3PUPPIrunsBCDEprompt",
150 "RUN3CHSruns2022FGruns2023CD",
151 "RUN3PUPPIruns2022FGruns2023CD"));
153 edm::allowedValues<std::string>(
"LOOSE",
"TIGHT",
"TIGHTLEPVETO"));
154 desc.addOptional<std::vector<std::string>>(
"cutsToIgnore")->setComment(
"");
182 desc.addOptionalNode(
CHF,
false);
183 desc.addOptionalNode(
NHF,
false);
184 desc.addOptionalNode(NHF_FW,
false);
185 desc.addOptionalNode(NHF_EC,
false);
186 desc.addOptionalNode(NHF_TR,
false);
188 desc.addOptionalNode(
CEF,
false);
189 desc.addOptionalNode(CEF_TR,
false);
191 desc.addOptionalNode(
NEF,
false);
192 desc.addOptionalNode(NEF_FW,
false);
193 desc.addOptionalNode(NEF_EC_L,
false);
194 desc.addOptionalNode(NEF_EC_U,
false);
195 desc.addOptionalNode(NEF_TR,
false);
197 desc.addOptionalNode(
NCH,
false);
199 desc.addOptionalNode(MUF,
false);
200 desc.addOptionalNode(MUF_TR,
false);
203 desc.addOptionalNode(nNeutrals_FW,
false);
204 desc.addOptionalNode(nNeutrals_FW_L,
false);
205 desc.addOptionalNode(nNeutrals_FW_U,
false);
206 desc.addOptionalNode(nnNeutrals_EC,
false);
219 if (
jet.currentJECLevel() ==
"Uncorrected" || !
jet.jecSetsAvailable())
266 int nconstituents = 0;
274 if (patJet !=
nullptr) {
330 chf = nhf = cef = nef = muf = 0.0;
334 else if (pfJet !=
nullptr) {
339 if (jetEnergyUncorrected > 0.) {
344 muf = pfJet->
muonEnergy() / jetEnergyUncorrected;
352 else if (basicJet !=
nullptr) {
870 <<
"The LOOSE operating point is only supported for the WINTER16 JetID version -- defaulting to TIGHT";
881 set(
"nConstituents", 1);
884 set(
"nNeutrals_FW", 10);
888 set(
"nNeutrals_EC", 2);
890 set(
"nNeutrals_FW", 10);
907 set(
"nConstituents", 1);
910 set(
"nNeutrals_FW", 10);
914 set(
"nNeutrals_EC", 2);
916 set(
"nNeutrals_FW", 10);
918 set(
"NEF_EC_L", 0.02);
919 set(
"NEF_EC_U", 0.99);
920 set(
"nNeutrals_EC", 2);
923 set(
"nNeutrals_FW", 10);
928 set(
"nNeutrals_FW_L", 2);
929 set(
"nNeutrals_FW_U", 15);
934 set(
"NEF_EC_L", 0.02);
935 set(
"NEF_EC_U", 0.99);
936 set(
"nNeutrals_EC", 2);
939 set(
"nNeutrals_FW", 10);
946 set(
"nNeutrals_FW_L", 2);
947 set(
"nNeutrals_FW_U", 15);
953 set(
"NEF_EC_U", 0.99);
954 set(
"nNeutrals_EC", 1);
957 set(
"nNeutrals_FW", 10);
961 set(
"nNeutrals_EC", 1);
963 set(
"nNeutrals_FW_L", 2);
964 set(
"nNeutrals_FW_U", 999999);
969 set(
"NEF_EC_L", 0.01);
970 set(
"NEF_EC_U", 0.99);
971 set(
"nNeutrals_EC", 1);
974 set(
"nNeutrals_FW", 10);
979 set(
"NEF_EC_U", 0.99);
980 set(
"nNeutrals_EC", 1);
983 set(
"nNeutrals_FW", 10);
988 set(
"NEF_EC_U", 0.99);
990 set(
"nNeutrals_EC", 1);
992 set(
"nNeutrals_FW", 10);
999 set(
"nNeutrals_FW_L", 2);
1000 set(
"nNeutrals_FW_U", 999999);
1003 set(
"NEF_TR", 0.99);
1004 set(
"NHF_EC", 0.9999);
1005 set(
"NEF_FW", 0.90);
1006 set(
"nNeutrals_FW_L", 2);
1009 set(
"NEF_TR", 0.99);
1010 set(
"NHF_EC", 0.99);
1012 set(
"nNeutrals_FW_L", 1);
1020 set(
"nConstituents", 1);
1023 set(
"NEF_EC_L", 0.02);
1024 set(
"NEF_EC_U", 0.99);
1025 set(
"nNeutrals_EC", 2);
1026 set(
"NHF_FW", 0.02);
1027 set(
"NEF_FW", 0.90);
1028 set(
"nNeutrals_FW", 10);
1036 set(
"NHF_EC", 0.99);
1037 set(
"NHF_FW", 0.02);
1038 set(
"NEF_FW", 0.90);
1039 set(
"nNeutrals_FW_L", 2);
1040 set(
"nNeutrals_FW_U", 15);
1043 set(
"NEF_EC", 0.01);
1044 set(
"NHF_EC", 0.98);
1045 set(
"nNeutrals_EC", 2);
1046 set(
"nNeutrals_FW", 10);
1047 set(
"NEF_FW", 0.90);
1049 set(
"NHF_EC", 0.99);
1050 set(
"NHF_FW", 0.02);
1051 set(
"NEF_FW", 0.90);
1052 set(
"nNeutrals_FW_L", 2);
1053 set(
"nNeutrals_FW_U", 15);
1056 set(
"NEF_EC", 0.01);
1057 set(
"NHF_EC", 0.98);
1058 set(
"nNeutrals_EC", 2);
1059 set(
"nNeutrals_FW", 10);
1060 set(
"NEF_FW", 0.90);
1063 set(
"NEF_TR", 0.99);
1067 set(
"NEF_EC_L", 0.02);
1068 set(
"NEF_EC_U", 0.99);
1069 set(
"nNeutrals_EC", 2);
1071 set(
"NEF_FW", 0.90);
1072 set(
"nNeutrals_FW", 10);
1075 set(
"NEF_TR", 0.99);
1078 set(
"NHF_EC", 0.99);
1079 set(
"NHF_FW", 0.02);
1080 set(
"NEF_FW", 0.90);
1081 set(
"nNeutrals_FW_L", 2);
1082 set(
"nNeutrals_FW_U", 15);
1085 set(
"NEF_TR", 0.99);
1087 set(
"NEF_EC_L", 0.);
1088 set(
"NEF_EC_U", 0.99);
1089 set(
"nNeutrals_EC", 1);
1091 set(
"NEF_FW", 0.90);
1092 set(
"nNeutrals_FW", 10);
1094 set(
"NHF_TR", 0.98);
1095 set(
"NEF_TR", 0.99);
1096 set(
"nNeutrals_EC", 1);
1097 set(
"NEF_FW", 0.90);
1098 set(
"nNeutrals_FW_L", 2);
1099 set(
"nNeutrals_FW_U", 999999);
1102 set(
"NEF_TR", 0.99);
1106 set(
"NEF_EC_L", 0.01);
1107 set(
"NEF_EC_U", 0.99);
1108 set(
"nNeutrals_EC", 1);
1110 set(
"NEF_FW", 0.90);
1111 set(
"nNeutrals_FW", 10);
1116 set(
"NEF_TR", 0.99);
1118 set(
"NEF_EC_U", 0.99);
1119 set(
"nNeutrals_EC", 1);
1121 set(
"NEF_FW", 0.90);
1122 set(
"nNeutrals_FW", 10);
1127 set(
"NEF_TR", 0.99);
1129 set(
"NEF_EC_U", 0.99);
1130 set(
"NHF_EC", 0.99);
1131 set(
"nNeutrals_EC", 1);
1133 set(
"nNeutrals_FW", 10);
1136 set(
"NEF_TR", 0.99);
1139 set(
"NHF_EC", 0.9999);
1140 set(
"NHF_FW", -1.0);
1141 set(
"NEF_FW", 0.90);
1142 set(
"nNeutrals_FW_L", 2);
1143 set(
"nNeutrals_FW_U", 999999);
1148 set(
"NEF_TR", 0.99);
1149 set(
"NHF_EC", 0.9999);
1150 set(
"NEF_FW", 0.90);
1151 set(
"nNeutrals_FW_L", 2);
1156 set(
"NEF_TR", 0.99);
1157 set(
"NHF_EC", 0.99);
1159 set(
"nNeutrals_FW_L", 1);
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