1 #ifndef PhysicsTools_SelectorUtils_interface_PFJetIDSelectionFunctor_h 2 #define PhysicsTools_SelectorUtils_interface_PFJetIDSelectionFunctor_h 54 if (versionStr ==
"FIRSTDATA")
56 else if (versionStr ==
"RUNIISTARTUP")
58 else if (versionStr ==
"WINTER16")
60 else if (versionStr ==
"WINTER17")
62 else if (versionStr ==
"WINTER17PUPPI")
64 else if (versionStr ==
"SUMMER18")
66 else if (versionStr ==
"SUMMER18PUPPI")
68 else if (versionStr ==
"RUN2UL16CHS")
70 else if (versionStr ==
"RUN2UL16PUPPI")
72 else if (versionStr ==
"RUN2ULCHS")
74 else if (versionStr ==
"RUN2ULPUPPI")
79 if (qualityStr ==
"LOOSE")
81 else if (qualityStr ==
"TIGHT")
83 else if (qualityStr ==
"TIGHTLEPVETO")
92 set(
"CHF",
params.getParameter<
double>(
"CHF"));
94 set(
"NHF",
params.getParameter<
double>(
"NHF"));
99 set(
"CEF",
params.getParameter<
double>(
"CEF"));
102 set(
"NEF",
params.getParameter<
double>(
"NEF"));
104 set(
"NCH",
params.getParameter<
int>(
"NCH"));
105 if (
params.exists(
"nConstituents"))
106 set(
"nConstituents",
params.getParameter<
int>(
"nConstituents"));
108 if (
params.exists(
"NEF_FW"))
109 set(
"NEF_FW",
params.getParameter<
double>(
"NEF_FW"));
110 if (
params.exists(
"nNeutrals_FW"))
111 set(
"nNeutrals_FW",
params.getParameter<
int>(
"nNeutrals_FW"));
114 if (
params.exists(
"NHF_EC"))
115 set(
"NHF_EC",
params.getParameter<
double>(
"NHF_EC"));
116 if (
params.exists(
"NEF_EC"))
117 set(
"NEF_EC",
params.getParameter<
double>(
"NEF_EC"));
118 if (
params.exists(
"nNeutrals_EC"))
119 set(
"nNeutrals_EC",
params.getParameter<
int>(
"nNeutrals_EC"));
120 if (
params.exists(
"NEF_FW"))
121 set(
"NEF_FW",
params.getParameter<
double>(
"NEF_FW"));
122 if (
params.exists(
"nNeutrals_FW"))
123 set(
"nNeutrals_FW",
params.getParameter<
int>(
"nNeutrals_FW"));
126 set(
"MUF",
params.getParameter<
double>(
"MUF"));
130 if (
params.exists(
"NEF_EC_L"))
131 set(
"NEF_EC_L",
params.getParameter<
double>(
"NEF_EC_L"));
132 if (
params.exists(
"NEF_EC_U"))
133 set(
"NEF_EC_U",
params.getParameter<
double>(
"NEF_EC_U"));
134 if (
params.exists(
"nNeutrals_EC"))
135 set(
"nNeutrals_EC",
params.getParameter<
int>(
"nNeutrals_EC"));
136 if (
params.exists(
"NHF_FW"))
137 set(
"NHF_FW",
params.getParameter<
double>(
"NHF_FW"));
138 if (
params.exists(
"NEF_FW"))
139 set(
"NEF_FW",
params.getParameter<
double>(
"NEF_FW"));
140 if (
params.exists(
"nNeutrals_FW"))
141 set(
"nNeutrals_FW",
params.getParameter<
int>(
"nNeutrals_FW"));
144 set(
"MUF",
params.getParameter<
double>(
"MUF"));
148 if (
params.exists(
"NHF_EC"))
149 set(
"NHF_EC",
params.getParameter<
double>(
"NHF_EC"));
150 if (
params.exists(
"NHF_FW"))
151 set(
"NHF_FW",
params.getParameter<
double>(
"NHF_FW"));
152 if (
params.exists(
"NEF_FW"))
153 set(
"NEF_FW",
params.getParameter<
double>(
"NEF_FW"));
154 if (
params.exists(
"nNeutrals_FW_L"))
155 set(
"nNeutrals_FW_L",
params.getParameter<
int>(
"nNeutrals_FW_L"));
156 if (
params.exists(
"nNeutrals_FW_U"))
157 set(
"nNeutrals_FW_U",
params.getParameter<
int>(
"nNeutrals_FW_U"));
160 set(
"MUF",
params.getParameter<
double>(
"MUF"));
164 if (
params.exists(
"NHF_TR"))
165 set(
"NHF_TR",
params.getParameter<
double>(
"NHF_TR"));
166 if (
params.exists(
"NEF_TR"))
167 set(
"NEF_TR",
params.getParameter<
double>(
"NEF_TR"));
168 if (
params.exists(
"NHF_EC"))
169 set(
"NHF_EC",
params.getParameter<
double>(
"NHF_EC"));
170 if (
params.exists(
"NEF_EC_L"))
171 set(
"NEF_EC_L",
params.getParameter<
double>(
"NEF_EC_L"));
172 if (
params.exists(
"NEF_EC_U"))
173 set(
"NEF_EC_U",
params.getParameter<
double>(
"NEF_EC_U"));
174 if (
params.exists(
"nNeutrals_EC"))
175 set(
"nNeutrals_EC",
params.getParameter<
int>(
"nNeutrals_EC"));
176 if (
params.exists(
"NHF_FW"))
177 set(
"NHF_FW",
params.getParameter<
double>(
"NHF_FW"));
178 if (
params.exists(
"NEF_FW"))
179 set(
"NEF_FW",
params.getParameter<
double>(
"NEF_FW"));
180 if (
params.exists(
"nNeutrals_FW"))
181 set(
"nNeutrals_FW",
params.getParameter<
int>(
"nNeutrals_FW"));
184 set(
"MUF",
params.getParameter<
double>(
"MUF"));
188 if (
params.exists(
"NHF_TR"))
189 set(
"NHF_TR",
params.getParameter<
double>(
"NHF_TR"));
190 if (
params.exists(
"NEF_TR"))
191 set(
"NEF_TR",
params.getParameter<
double>(
"NEF_TR"));
192 if (
params.exists(
"nNeutrals_EC"))
193 set(
"nNeutrals_EC",
params.getParameter<
int>(
"nNeutrals_EC"));
194 if (
params.exists(
"NEF_FW"))
195 set(
"NEF_FW",
params.getParameter<
double>(
"NEF_FW"));
196 if (
params.exists(
"nNeutrals_FW_L"))
197 set(
"nNeutrals_FW_L",
params.getParameter<
int>(
"nNeutrals_FW_L"));
198 if (
params.exists(
"nNeutrals_FW_U"))
199 set(
"nNeutrals_FW_U",
params.getParameter<
int>(
"nNeutrals_FW_U"));
202 set(
"MUF",
params.getParameter<
double>(
"MUF"));
206 if (
params.exists(
"NHF_TR"))
207 set(
"NHF_TR",
params.getParameter<
double>(
"NHF_TR"));
208 if (
params.exists(
"NEF_TR"))
209 set(
"NEF_TR",
params.getParameter<
double>(
"NEF_TR"));
210 if (
params.exists(
"NCH_TR"))
211 set(
"NCH_TR",
params.getParameter<
int>(
"NCH_TR"));
212 if (
params.exists(
"NEF_EC_L"))
213 set(
"NEF_EC_L",
params.getParameter<
double>(
"NEF_EC_L"));
214 if (
params.exists(
"NEF_EC_U"))
215 set(
"NEF_EC_U",
params.getParameter<
double>(
"NEF_EC_U"));
216 if (
params.exists(
"nNeutrals_EC"))
217 set(
"nNeutrals_EC",
params.getParameter<
int>(
"nNeutrals_EC"));
218 if (
params.exists(
"NHF_FW"))
219 set(
"NHF_FW",
params.getParameter<
double>(
"NHF_FW"));
220 if (
params.exists(
"NEF_FW"))
221 set(
"NEF_FW",
params.getParameter<
double>(
"NEF_FW"));
222 if (
params.exists(
"nNeutrals_FW"))
223 set(
"nNeutrals_FW",
params.getParameter<
int>(
"nNeutrals_FW"));
226 set(
"MUF",
params.getParameter<
double>(
"MUF"));
227 if (
params.exists(
"MUF_TR"))
228 set(
"MUF_TR",
params.getParameter<
double>(
"MUF_TR"));
229 if (
params.exists(
"CEF_TR"))
230 set(
"CEF_TR",
params.getParameter<
double>(
"CEF_TR"));
234 if (
params.exists(
"NHF_TR"))
235 set(
"NHF_TR",
params.getParameter<
double>(
"NHF_TR"));
236 if (
params.exists(
"NEF_TR"))
237 set(
"NEF_TR",
params.getParameter<
double>(
"NEF_TR"));
238 if (
params.exists(
"NHF_EC"))
239 set(
"NHF_EC",
params.getParameter<
double>(
"NHF_EC"));
240 if (
params.exists(
"NHF_FW"))
241 set(
"NHF_FW",
params.getParameter<
double>(
"NHF_FW"));
242 if (
params.exists(
"NEF_FW"))
243 set(
"NEF_FW",
params.getParameter<
double>(
"NEF_FW"));
244 if (
params.exists(
"nNeutrals_FW_L"))
245 set(
"nNeutrals_FW_L",
params.getParameter<
int>(
"nNeutrals_FW_L"));
246 if (
params.exists(
"nNeutrals_FW_U"))
247 set(
"nNeutrals_FW_U",
params.getParameter<
int>(
"nNeutrals_FW_U"));
250 set(
"MUF",
params.getParameter<
double>(
"MUF"));
251 if (
params.exists(
"MUF_TR"))
252 set(
"MUF_TR",
params.getParameter<
double>(
"MUF_TR"));
253 if (
params.exists(
"CEF_TR"))
254 set(
"CEF_TR",
params.getParameter<
double>(
"CEF_TR"));
258 if (
params.exists(
"cutsToIgnore"))
276 if (
jet.currentJECLevel() ==
"Uncorrected" || !
jet.jecSetsAvailable())
321 int nconstituents = 0;
329 if (patJet !=
nullptr) {
385 chf = nhf = cef = nef = muf = 0.0;
389 else if (pfJet !=
nullptr) {
394 if (jetEnergyUncorrected > 0.) {
399 muf = pfJet->
muonEnergy() / jetEnergyUncorrected;
407 else if (basicJet !=
nullptr) {
864 <<
"The LOOSE operating point is only supported for the WINTER16 JetID version -- defaulting to TIGHT";
875 set(
"nConstituents", 1);
878 set(
"nNeutrals_FW", 10);
882 set(
"nNeutrals_EC", 2);
884 set(
"nNeutrals_FW", 10);
894 set(
"nConstituents", 1);
897 set(
"nNeutrals_FW", 10);
901 set(
"nNeutrals_EC", 2);
903 set(
"nNeutrals_FW", 10);
905 set(
"NEF_EC_L", 0.02);
906 set(
"NEF_EC_U", 0.99);
907 set(
"nNeutrals_EC", 2);
910 set(
"nNeutrals_FW", 10);
915 set(
"nNeutrals_FW_L", 2);
916 set(
"nNeutrals_FW_U", 15);
921 set(
"NEF_EC_L", 0.02);
922 set(
"NEF_EC_U", 0.99);
923 set(
"nNeutrals_EC", 2);
926 set(
"nNeutrals_FW", 10);
933 set(
"nNeutrals_FW_L", 2);
934 set(
"nNeutrals_FW_U", 15);
940 set(
"NEF_EC_U", 0.99);
941 set(
"nNeutrals_EC", 1);
944 set(
"nNeutrals_FW", 10);
948 set(
"nNeutrals_EC", 1);
950 set(
"nNeutrals_FW_L", 2);
951 set(
"nNeutrals_FW_U", 999999);
956 set(
"NEF_EC_L", 0.01);
957 set(
"NEF_EC_U", 0.99);
958 set(
"nNeutrals_EC", 2);
961 set(
"nNeutrals_FW", 10);
965 set(
"NHF_EC", 0.9999);
968 set(
"nNeutrals_FW_L", 2);
969 set(
"nNeutrals_FW_U", 999999);
976 set(
"nConstituents", 1);
979 set(
"NEF_EC_L", 0.02);
980 set(
"NEF_EC_U", 0.99);
981 set(
"nNeutrals_EC", 2);
984 set(
"nNeutrals_FW", 10);
991 set(
"nNeutrals_FW_L", 2);
992 set(
"nNeutrals_FW_U", 15);
998 set(
"nNeutrals_EC", 2);
999 set(
"nNeutrals_FW", 10);
1000 set(
"NEF_FW", 0.90);
1004 set(
"NHF_EC", 0.99);
1005 set(
"NHF_FW", 0.02);
1006 set(
"NEF_FW", 0.90);
1007 set(
"nNeutrals_FW_L", 2);
1008 set(
"nNeutrals_FW_U", 15);
1012 set(
"NEF_EC", 0.01);
1013 set(
"NHF_EC", 0.98);
1014 set(
"nNeutrals_EC", 2);
1015 set(
"nNeutrals_FW", 10);
1016 set(
"NEF_FW", 0.90);
1022 set(
"NEF_TR", 0.99);
1026 set(
"NEF_EC_L", 0.02);
1027 set(
"NEF_EC_U", 0.99);
1028 set(
"nNeutrals_EC", 2);
1030 set(
"NEF_FW", 0.90);
1031 set(
"nNeutrals_FW", 10);
1036 set(
"NEF_TR", 0.99);
1039 set(
"NHF_EC", 0.99);
1040 set(
"NHF_FW", 0.02);
1041 set(
"NEF_FW", 0.90);
1042 set(
"nNeutrals_FW_L", 2);
1043 set(
"nNeutrals_FW_U", 15);
1048 set(
"NEF_TR", 0.99);
1050 set(
"NEF_EC_L", 0.);
1051 set(
"NEF_EC_U", 0.99);
1052 set(
"nNeutrals_EC", 1);
1054 set(
"NEF_FW", 0.90);
1055 set(
"nNeutrals_FW", 10);
1059 set(
"NHF_TR", 0.98);
1060 set(
"NEF_TR", 0.99);
1061 set(
"nNeutrals_EC", 1);
1062 set(
"NEF_FW", 0.90);
1063 set(
"nNeutrals_FW_L", 2);
1064 set(
"nNeutrals_FW_U", 999999);
1069 set(
"NEF_TR", 0.99);
1073 set(
"NEF_EC_L", 0.01);
1074 set(
"NEF_EC_U", 0.99);
1075 set(
"nNeutrals_EC", 2);
1077 set(
"NEF_FW", 0.90);
1078 set(
"nNeutrals_FW", 10);
1083 set(
"NEF_TR", 0.99);
1086 set(
"NHF_EC", 0.9999);
1087 set(
"NHF_FW", -1.0);
1088 set(
"NEF_FW", 0.90);
1089 set(
"nNeutrals_FW_L", 2);
1090 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
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.
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