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"))
108 if (params.
exists(
"NEF_FW"))
110 if (params.
exists(
"nNeutrals_FW"))
114 if (params.
exists(
"NHF_EC"))
116 if (params.
exists(
"NEF_EC"))
118 if (params.
exists(
"nNeutrals_EC"))
120 if (params.
exists(
"NEF_FW"))
122 if (params.
exists(
"nNeutrals_FW"))
130 if (params.
exists(
"NEF_EC_L"))
132 if (params.
exists(
"NEF_EC_U"))
134 if (params.
exists(
"nNeutrals_EC"))
136 if (params.
exists(
"NHF_FW"))
138 if (params.
exists(
"NEF_FW"))
140 if (params.
exists(
"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"))
156 if (params.
exists(
"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"))
172 if (params.
exists(
"NEF_EC_U"))
174 if (params.
exists(
"nNeutrals_EC"))
176 if (params.
exists(
"NHF_FW"))
178 if (params.
exists(
"NEF_FW"))
180 if (params.
exists(
"nNeutrals_FW"))
188 if (params.
exists(
"NHF_TR"))
190 if (params.
exists(
"NEF_TR"))
192 if (params.
exists(
"nNeutrals_EC"))
194 if (params.
exists(
"NEF_FW"))
196 if (params.
exists(
"nNeutrals_FW_L"))
198 if (params.
exists(
"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"))
214 if (params.
exists(
"NEF_EC_U"))
216 if (params.
exists(
"nNeutrals_EC"))
218 if (params.
exists(
"NHF_FW"))
220 if (params.
exists(
"NEF_FW"))
222 if (params.
exists(
"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"))
246 if (params.
exists(
"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) {
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);
void set(std::string const &s, bool val=true)
Set a given selection cut, on or off.
index_type indexNNeutrals_EC_
float photonEnergy() const
photonEnergy
tuple ret
prodAgent to be discontinued
float neutralHadronEnergyFraction() const
neutralHadronEnergyFraction (relative to uncorrected jet energy)
float muonEnergy() const
muonEnergy
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)
uint32_t const *__restrict__ Quality * quality
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
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)
index_type indexNConstituents_
float chargedEmEnergy() const
chargedEmEnergy
float electronEnergy() const
electronEnergy
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
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
This provides the interface for base classes to select objects.
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
T getParameter(std::string const &) const
Analysis-level calorimeter jet class.
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)
Log< level::Warning, false > LogWarning
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".
double energy() const final
energy
double eta() const final
momentum pseudorapidity