1 #ifndef PhysicsTools_SelectorUtils_interface_PFJetIDSelectionFunctor_h 2 #define PhysicsTools_SelectorUtils_interface_PFJetIDSelectionFunctor_h 41 if (versionStr ==
"FIRSTDATA")
43 else if (versionStr ==
"RUNIISTARTUP")
47 else if (versionStr ==
"WINTER16")
49 else if (versionStr ==
"WINTER17")
51 else if (versionStr ==
"WINTER17PUPPI")
53 else if (versionStr ==
"SUMMER18")
55 else if (versionStr ==
"SUMMER18PUPPI")
60 if (qualityStr ==
"LOOSE")
62 else if (qualityStr ==
"TIGHT")
64 else if (qualityStr ==
"TIGHTLEPVETO")
85 if (params.
exists(
"nConstituents"))
86 set(
"nConstituents", params.
getParameter<
int>(
"nConstituents"));
88 if (params.
exists(
"NEF_FW"))
90 if (params.
exists(
"nNeutrals_FW"))
91 set(
"nNeutrals_FW", params.
getParameter<
int>(
"nNeutrals_FW"));
94 if (params.
exists(
"NHF_EC"))
96 if (params.
exists(
"NEF_EC"))
98 if (params.
exists(
"nNeutrals_EC"))
99 set(
"nNeutrals_EC", params.
getParameter<
int>(
"nNeutrals_EC"));
100 if (params.
exists(
"NEF_FW"))
102 if (params.
exists(
"nNeutrals_FW"))
103 set(
"nNeutrals_FW", params.
getParameter<
int>(
"nNeutrals_FW"));
110 if (params.
exists(
"NEF_EC_L"))
111 set(
"NEF_EC_L", params.
getParameter<
double>(
"NEF_EC_L"));
112 if (params.
exists(
"NEF_EC_U"))
113 set(
"NEF_EC_U", params.
getParameter<
double>(
"NEF_EC_U"));
114 if (params.
exists(
"nNeutrals_EC"))
115 set(
"nNeutrals_EC", params.
getParameter<
int>(
"nNeutrals_EC"));
116 if (params.
exists(
"NHF_FW"))
118 if (params.
exists(
"NEF_FW"))
120 if (params.
exists(
"nNeutrals_FW"))
121 set(
"nNeutrals_FW", params.
getParameter<
int>(
"nNeutrals_FW"));
128 if (params.
exists(
"NHF_EC"))
130 if (params.
exists(
"NHF_FW"))
132 if (params.
exists(
"NEF_FW"))
134 if (params.
exists(
"nNeutrals_FW_L"))
135 set(
"nNeutrals_FW_L", params.
getParameter<
int>(
"nNeutrals_FW_L"));
136 if (params.
exists(
"nNeutrals_FW_U"))
137 set(
"nNeutrals_FW_U", params.
getParameter<
int>(
"nNeutrals_FW_U"));
144 if (params.
exists(
"NHF_TR"))
146 if (params.
exists(
"NEF_TR"))
148 if (params.
exists(
"NCH_TR"))
150 if (params.
exists(
"NEF_EC_L"))
151 set(
"NEF_EC_L", params.
getParameter<
double>(
"NEF_EC_L"));
152 if (params.
exists(
"NEF_EC_U"))
153 set(
"NEF_EC_U", params.
getParameter<
double>(
"NEF_EC_U"));
154 if (params.
exists(
"nNeutrals_EC"))
155 set(
"nNeutrals_EC", params.
getParameter<
int>(
"nNeutrals_EC"));
156 if (params.
exists(
"NHF_FW"))
158 if (params.
exists(
"NEF_FW"))
160 if (params.
exists(
"nNeutrals_FW"))
161 set(
"nNeutrals_FW", params.
getParameter<
int>(
"nNeutrals_FW"));
165 if (params.
exists(
"MUF_TR"))
167 if (params.
exists(
"CEF_TR"))
172 if (params.
exists(
"NHF_TR"))
174 if (params.
exists(
"NEF_TR"))
176 if (params.
exists(
"NHF_EC"))
178 if (params.
exists(
"NHF_FW"))
180 if (params.
exists(
"NEF_FW"))
182 if (params.
exists(
"nNeutrals_FW_L"))
183 set(
"nNeutrals_FW_L", params.
getParameter<
int>(
"nNeutrals_FW_L"));
184 if (params.
exists(
"nNeutrals_FW_U"))
185 set(
"nNeutrals_FW_U", params.
getParameter<
int>(
"nNeutrals_FW_U"));
189 if (params.
exists(
"MUF_TR"))
191 if (params.
exists(
"CEF_TR"))
196 if (params.
exists(
"cutsToIgnore"))
257 int nconstituents = 0;
265 if (patJet !=
nullptr) {
276 if (patJet->
hasUserFloat(
"patPuppiJetSpecificProducer:puppiMultiplicity"))
277 nconstituents = patJet->
userFloat(
"patPuppiJetSpecificProducer:puppiMultiplicity");
278 if (patJet->
hasUserFloat(
"patPuppiJetSpecificProducer:neutralPuppiMultiplicity"))
279 nneutrals = patJet->
userFloat(
"patPuppiJetSpecificProducer:neutralPuppiMultiplicity");
326 chf = nhf = cef = nef = muf = 0.0;
330 else if (pfJet !=
nullptr) {
335 if (jetEnergyUncorrected > 0.) {
340 muf = pfJet->
muonEnergy() / jetEnergyUncorrected;
348 else if (basicJet !=
nullptr) {
693 <<
"The LOOSE operating point is only supported for the WINTER16 JetID version -- defaulting to TIGHT";
704 set(
"nConstituents", 1);
707 set(
"nNeutrals_FW", 10);
711 set(
"nNeutrals_EC", 2);
713 set(
"nNeutrals_FW", 10);
722 set(
"nConstituents", 1);
725 set(
"nNeutrals_FW", 10);
729 set(
"nNeutrals_EC", 2);
731 set(
"nNeutrals_FW", 10);
733 set(
"NEF_EC_L", 0.02);
734 set(
"NEF_EC_U", 0.99);
735 set(
"nNeutrals_EC", 2);
738 set(
"nNeutrals_FW", 10);
743 set(
"nNeutrals_FW_L", 2);
744 set(
"nNeutrals_FW_U", 15);
749 set(
"NEF_EC_L", 0.02);
750 set(
"NEF_EC_U", 0.99);
751 set(
"nNeutrals_EC", 2);
754 set(
"nNeutrals_FW", 10);
761 set(
"nNeutrals_FW_L", 2);
762 set(
"nNeutrals_FW_U", 15);
769 set(
"nConstituents", 1);
772 set(
"NEF_EC_L", 0.02);
773 set(
"NEF_EC_U", 0.99);
774 set(
"nNeutrals_EC", 2);
777 set(
"nNeutrals_FW", 10);
784 set(
"nNeutrals_FW_L", 2);
785 set(
"nNeutrals_FW_U", 15);
791 set(
"nNeutrals_EC", 2);
792 set(
"nNeutrals_FW", 10);
800 set(
"nNeutrals_FW_L", 2);
801 set(
"nNeutrals_FW_U", 15);
807 set(
"nNeutrals_EC", 2);
808 set(
"nNeutrals_FW", 10);
819 set(
"NEF_EC_L", 0.02);
820 set(
"NEF_EC_U", 0.99);
821 set(
"nNeutrals_EC", 2);
824 set(
"nNeutrals_FW", 10);
835 set(
"nNeutrals_FW_L", 2);
836 set(
"nNeutrals_FW_U", 15);
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".