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")
105 if (params.
exists(
"nConstituents"))
106 set(
"nConstituents", params.
getParameter<
int>(
"nConstituents"));
108 if (params.
exists(
"NEF_FW"))
110 if (params.
exists(
"nNeutrals_FW"))
111 set(
"nNeutrals_FW", params.
getParameter<
int>(
"nNeutrals_FW"));
114 if (params.
exists(
"NHF_EC"))
116 if (params.
exists(
"NEF_EC"))
118 if (params.
exists(
"nNeutrals_EC"))
119 set(
"nNeutrals_EC", params.
getParameter<
int>(
"nNeutrals_EC"));
120 if (params.
exists(
"NEF_FW"))
122 if (params.
exists(
"nNeutrals_FW"))
123 set(
"nNeutrals_FW", params.
getParameter<
int>(
"nNeutrals_FW"));
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"))
138 if (params.
exists(
"NEF_FW"))
140 if (params.
exists(
"nNeutrals_FW"))
141 set(
"nNeutrals_FW", params.
getParameter<
int>(
"nNeutrals_FW"));
148 if (params.
exists(
"NHF_EC"))
150 if (params.
exists(
"NHF_FW"))
152 if (params.
exists(
"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"));
164 if (params.
exists(
"NHF_TR"))
166 if (params.
exists(
"NEF_TR"))
168 if (params.
exists(
"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"))
178 if (params.
exists(
"NEF_FW"))
180 if (params.
exists(
"nNeutrals_FW"))
181 set(
"nNeutrals_FW", params.
getParameter<
int>(
"nNeutrals_FW"));
188 if (params.
exists(
"NHF_TR"))
190 if (params.
exists(
"NEF_TR"))
192 if (params.
exists(
"nNeutrals_EC"))
193 set(
"nNeutrals_EC", params.
getParameter<
int>(
"nNeutrals_EC"));
194 if (params.
exists(
"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"));
206 if (params.
exists(
"NHF_TR"))
208 if (params.
exists(
"NEF_TR"))
210 if (params.
exists(
"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"))
220 if (params.
exists(
"NEF_FW"))
222 if (params.
exists(
"nNeutrals_FW"))
223 set(
"nNeutrals_FW", params.
getParameter<
int>(
"nNeutrals_FW"));
227 if (params.
exists(
"MUF_TR"))
229 if (params.
exists(
"CEF_TR"))
234 if (params.
exists(
"NHF_TR"))
236 if (params.
exists(
"NEF_TR"))
238 if (params.
exists(
"NHF_EC"))
240 if (params.
exists(
"NHF_FW"))
242 if (params.
exists(
"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"));
251 if (params.
exists(
"MUF_TR"))
253 if (params.
exists(
"CEF_TR"))
258 if (params.
exists(
"cutsToIgnore"))
321 int nconstituents = 0;
329 if (patJet !=
nullptr) {
340 if (patJet->
hasUserFloat(
"patPuppiJetSpecificProducer:puppiMultiplicity"))
341 nconstituents = patJet->
userFloat(
"patPuppiJetSpecificProducer:puppiMultiplicity");
342 if (patJet->
hasUserFloat(
"patPuppiJetSpecificProducer:neutralPuppiMultiplicity"))
343 nneutrals = patJet->
userFloat(
"patPuppiJetSpecificProducer:neutralPuppiMultiplicity");
390 chf = nhf = cef = nef = muf = 0.0;
394 else if (pfJet !=
nullptr) {
399 if (jetEnergyUncorrected > 0.) {
404 muf = pfJet->
muonEnergy() / jetEnergyUncorrected;
412 else if (basicJet !=
nullptr) {
869 <<
"The LOOSE operating point is only supported for the WINTER16 JetID version -- defaulting to TIGHT";
880 set(
"nConstituents", 1);
883 set(
"nNeutrals_FW", 10);
887 set(
"nNeutrals_EC", 2);
889 set(
"nNeutrals_FW", 10);
899 set(
"nConstituents", 1);
902 set(
"nNeutrals_FW", 10);
906 set(
"nNeutrals_EC", 2);
908 set(
"nNeutrals_FW", 10);
910 set(
"NEF_EC_L", 0.02);
911 set(
"NEF_EC_U", 0.99);
912 set(
"nNeutrals_EC", 2);
915 set(
"nNeutrals_FW", 10);
920 set(
"nNeutrals_FW_L", 2);
921 set(
"nNeutrals_FW_U", 15);
926 set(
"NEF_EC_L", 0.02);
927 set(
"NEF_EC_U", 0.99);
928 set(
"nNeutrals_EC", 2);
931 set(
"nNeutrals_FW", 10);
938 set(
"nNeutrals_FW_L", 2);
939 set(
"nNeutrals_FW_U", 15);
945 set(
"NEF_EC_U", 0.99);
946 set(
"nNeutrals_EC", 1);
949 set(
"nNeutrals_FW", 10);
953 set(
"nNeutrals_EC", 1);
955 set(
"nNeutrals_FW_L", 2);
956 set(
"nNeutrals_FW_U", 999999);
961 set(
"NEF_EC_L", 0.01);
962 set(
"NEF_EC_U", 0.99);
963 set(
"nNeutrals_EC", 2);
966 set(
"nNeutrals_FW", 10);
970 set(
"NHF_EC", 0.9999);
973 set(
"nNeutrals_FW_L", 2);
974 set(
"nNeutrals_FW_U", 999999);
981 set(
"nConstituents", 1);
984 set(
"NEF_EC_L", 0.02);
985 set(
"NEF_EC_U", 0.99);
986 set(
"nNeutrals_EC", 2);
989 set(
"nNeutrals_FW", 10);
996 set(
"nNeutrals_FW_L", 2);
997 set(
"nNeutrals_FW_U", 15);
1001 set(
"NEF_EC", 0.01);
1002 set(
"NHF_EC", 0.98);
1003 set(
"nNeutrals_EC", 2);
1004 set(
"nNeutrals_FW", 10);
1005 set(
"NEF_FW", 0.90);
1009 set(
"NHF_EC", 0.99);
1010 set(
"NHF_FW", 0.02);
1011 set(
"NEF_FW", 0.90);
1012 set(
"nNeutrals_FW_L", 2);
1013 set(
"nNeutrals_FW_U", 15);
1017 set(
"NEF_EC", 0.01);
1018 set(
"NHF_EC", 0.98);
1019 set(
"nNeutrals_EC", 2);
1020 set(
"nNeutrals_FW", 10);
1021 set(
"NEF_FW", 0.90);
1027 set(
"NEF_TR", 0.99);
1031 set(
"NEF_EC_L", 0.02);
1032 set(
"NEF_EC_U", 0.99);
1033 set(
"nNeutrals_EC", 2);
1035 set(
"NEF_FW", 0.90);
1036 set(
"nNeutrals_FW", 10);
1041 set(
"NEF_TR", 0.99);
1044 set(
"NHF_EC", 0.99);
1045 set(
"NHF_FW", 0.02);
1046 set(
"NEF_FW", 0.90);
1047 set(
"nNeutrals_FW_L", 2);
1048 set(
"nNeutrals_FW_U", 15);
1053 set(
"NEF_TR", 0.99);
1055 set(
"NEF_EC_L", 0.);
1056 set(
"NEF_EC_U", 0.99);
1057 set(
"nNeutrals_EC", 1);
1059 set(
"NEF_FW", 0.90);
1060 set(
"nNeutrals_FW", 10);
1064 set(
"NHF_TR", 0.98);
1065 set(
"NEF_TR", 0.99);
1066 set(
"nNeutrals_EC", 1);
1067 set(
"NEF_FW", 0.90);
1068 set(
"nNeutrals_FW_L", 2);
1069 set(
"nNeutrals_FW_U", 999999);
1074 set(
"NEF_TR", 0.99);
1078 set(
"NEF_EC_L", 0.01);
1079 set(
"NEF_EC_U", 0.99);
1080 set(
"nNeutrals_EC", 2);
1082 set(
"NEF_FW", 0.90);
1083 set(
"nNeutrals_FW", 10);
1088 set(
"NEF_TR", 0.99);
1091 set(
"NHF_EC", 0.9999);
1092 set(
"NHF_FW", -1.0);
1093 set(
"NEF_FW", 0.90);
1094 set(
"nNeutrals_FW_L", 2);
1095 set(
"nNeutrals_FW_U", 999999);
T getParameter(std::string const &) const
index_type indexNNeutrals_EC_
float photonEnergy() const
photonEnergy
float neutralHadronEnergyFraction() const
neutralHadronEnergyFraction (relative to uncorrected jet energy)
float muonEnergy() const
muonEnergy
double eta() const final
momentum pseudorapidity
bool jecSetsAvailable() const
float muonEnergy() const
muonEnergy
float chargedHadronEnergy() const
chargedHadronEnergy
float chargedEmEnergy() const
chargedEmEnergy
float neutralEmEnergy() const
neutralEmEnergy
float chargedHadronEnergyFraction() const
chargedHadronEnergyFraction (relative to uncorrected jet energy)
PFJetIDSelectionFunctor(edm::ParameterSet const ¶ms, edm::ConsumesCollector &iC)
Base class for all types of Jets.
float neutralHadronEnergy() const
neutralHadronEnergy
float chargedEmEnergyFraction() const
chargedEmEnergyFraction (relative to uncorrected jet energy)
bool exists(std::string const ¶meterName) const
checks if a parameter exists
bool hasUserFloat(const std::string &key) const
Return true if there is a user-defined float with a given name.
index_type indexNEF_EC_L_
pat::strbitset::index_type index_type
void setIgnored(pat::strbitset &ret)
set ignored bits
int neutralMultiplicity() const
neutralMultiplicity
pat::strbitset retInternal_
internal ret if users don't care about return bits
Jets made from CaloTowers.
int chargedMultiplicity() const
chargedMultiplicity
Jets made from PFObjects.
PFJetIDSelectionFunctor(Version_t version, Quality_t quality)
float neutralEmEnergy() const
neutralEmEnergy
bool operator()(const reco::PFJet &jet, pat::strbitset &ret)
float userFloat(const std::string &key) const
index_type indexNConstituents_
float chargedEmEnergy() const
chargedEmEnergy
float electronEnergy() const
electronEnergy
size_t numberOfDaughters() const override
number of daughters
PFJetIDSelectionFunctor(edm::ParameterSet const ¶ms)
pat::strbitset bits_
the bitset indexed by strings
void passCut(pat::strbitset &ret, std::string const &s)
Passing cuts.
float HFEMEnergy() const
HFEMEnergy.
bool ignoreCut(std::string const &s) const
ignore the cut at index "s"
const_iterator end() const
last daughter const_iterator
double energy() const final
energy
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)
Functor that operates on <T>
PF Jet selector for pat::Jets.
index_type indexNNeutrals_FW_L_
bool isPFJet() const
check to see if the jet is a reco::PFJet
int neutralMultiplicity() const
neutralMultiplicity
index_type indexNEF_EC_U_
bool operator()(const pat::Jet &jet, pat::strbitset &ret) override
strbitset & set(bool val=true)
set method of all bits
std::string currentJECLevel() const
return the name of the current step of jet energy corrections
Analysis-level calorimeter jet class.
size_t numberOfDaughters() const override
pat::strbitset getBitTemplate() const
Get an empty bitset with the proper names.
index_type indexNNeutrals_FW_U_
bool isBasicJet() const
check to see if the jet is no more than a reco::BasicJet
const_iterator begin() const
first daughter const_iterator
float neutralHadronEnergy() const
neutralHadronEnergy
PFJetIDSelectionFunctor()
float muonEnergyFraction() const
muonEnergyFraction (relative to corrected jet energy)
void setIgnoredCuts(std::vector< std::string > const &bitsToIgnore)
set the bits to ignore from a vector
float neutralEmEnergyFraction() const
neutralEmEnergyFraction (relative to uncorrected jet energy)
Jet correctedJet(const std::string &level, const std::string &flavor="none", const std::string &set="") const
int chargedMultiplicity() const
chargedMultiplicity
bool firstDataCuts(reco::Jet const &jet, pat::strbitset &ret, Version_t version_)
float chargedHadronEnergy() const
chargedHadronEnergy
int cut(index_type const &i, int val) const
Access the int cut values at index "s".