1 #ifndef PhysicsTools_SelectorUtils_interface_PFJetIDSelectionFunctor_h 2 #define PhysicsTools_SelectorUtils_interface_PFJetIDSelectionFunctor_h 52 if (versionStr ==
"FIRSTDATA")
54 else if (versionStr ==
"RUNIISTARTUP")
56 else if (versionStr ==
"WINTER16")
58 else if (versionStr ==
"WINTER17")
60 else if (versionStr ==
"WINTER17PUPPI")
62 else if (versionStr ==
"SUMMER18")
64 else if (versionStr ==
"SUMMER18PUPPI")
66 else if (versionStr ==
"RUN2ULCHS")
68 else if (versionStr ==
"RUN2ULPUPPI")
73 if (qualityStr ==
"LOOSE")
75 else if (qualityStr ==
"TIGHT")
77 else if (qualityStr ==
"TIGHTLEPVETO")
99 if (params.
exists(
"nConstituents"))
100 set(
"nConstituents", params.
getParameter<
int>(
"nConstituents"));
102 if (params.
exists(
"NEF_FW"))
104 if (params.
exists(
"nNeutrals_FW"))
105 set(
"nNeutrals_FW", params.
getParameter<
int>(
"nNeutrals_FW"));
108 if (params.
exists(
"NHF_EC"))
110 if (params.
exists(
"NEF_EC"))
112 if (params.
exists(
"nNeutrals_EC"))
113 set(
"nNeutrals_EC", params.
getParameter<
int>(
"nNeutrals_EC"));
114 if (params.
exists(
"NEF_FW"))
116 if (params.
exists(
"nNeutrals_FW"))
117 set(
"nNeutrals_FW", params.
getParameter<
int>(
"nNeutrals_FW"));
124 if (params.
exists(
"NEF_EC_L"))
125 set(
"NEF_EC_L", params.
getParameter<
double>(
"NEF_EC_L"));
126 if (params.
exists(
"NEF_EC_U"))
127 set(
"NEF_EC_U", params.
getParameter<
double>(
"NEF_EC_U"));
128 if (params.
exists(
"nNeutrals_EC"))
129 set(
"nNeutrals_EC", params.
getParameter<
int>(
"nNeutrals_EC"));
130 if (params.
exists(
"NHF_FW"))
132 if (params.
exists(
"NEF_FW"))
134 if (params.
exists(
"nNeutrals_FW"))
135 set(
"nNeutrals_FW", params.
getParameter<
int>(
"nNeutrals_FW"));
142 if (params.
exists(
"NHF_EC"))
144 if (params.
exists(
"NHF_FW"))
146 if (params.
exists(
"NEF_FW"))
148 if (params.
exists(
"nNeutrals_FW_L"))
149 set(
"nNeutrals_FW_L", params.
getParameter<
int>(
"nNeutrals_FW_L"));
150 if (params.
exists(
"nNeutrals_FW_U"))
151 set(
"nNeutrals_FW_U", params.
getParameter<
int>(
"nNeutrals_FW_U"));
158 if (params.
exists(
"NHF_TR"))
160 if (params.
exists(
"NEF_TR"))
162 if (params.
exists(
"NCH_TR"))
164 if (params.
exists(
"NEF_EC_L"))
165 set(
"NEF_EC_L", params.
getParameter<
double>(
"NEF_EC_L"));
166 if (params.
exists(
"NEF_EC_U"))
167 set(
"NEF_EC_U", params.
getParameter<
double>(
"NEF_EC_U"));
168 if (params.
exists(
"nNeutrals_EC"))
169 set(
"nNeutrals_EC", params.
getParameter<
int>(
"nNeutrals_EC"));
170 if (params.
exists(
"NHF_FW"))
172 if (params.
exists(
"NEF_FW"))
174 if (params.
exists(
"nNeutrals_FW"))
175 set(
"nNeutrals_FW", params.
getParameter<
int>(
"nNeutrals_FW"));
179 if (params.
exists(
"MUF_TR"))
181 if (params.
exists(
"CEF_TR"))
186 if (params.
exists(
"NHF_TR"))
188 if (params.
exists(
"NEF_TR"))
190 if (params.
exists(
"NHF_EC"))
192 if (params.
exists(
"NHF_FW"))
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"));
203 if (params.
exists(
"MUF_TR"))
205 if (params.
exists(
"CEF_TR"))
210 if (params.
exists(
"cutsToIgnore"))
273 int nconstituents = 0;
281 if (patJet !=
nullptr) {
292 if (patJet->
hasUserFloat(
"patPuppiJetSpecificProducer:puppiMultiplicity"))
293 nconstituents = patJet->
userFloat(
"patPuppiJetSpecificProducer:puppiMultiplicity");
294 if (patJet->
hasUserFloat(
"patPuppiJetSpecificProducer:neutralPuppiMultiplicity"))
295 nneutrals = patJet->
userFloat(
"patPuppiJetSpecificProducer:neutralPuppiMultiplicity");
342 chf = nhf = cef = nef = muf = 0.0;
346 else if (pfJet !=
nullptr) {
351 if (jetEnergyUncorrected > 0.) {
356 muf = pfJet->
muonEnergy() / jetEnergyUncorrected;
364 else if (basicJet !=
nullptr) {
712 <<
"The LOOSE operating point is only supported for the WINTER16 JetID version -- defaulting to TIGHT";
723 set(
"nConstituents", 1);
726 set(
"nNeutrals_FW", 10);
730 set(
"nNeutrals_EC", 2);
732 set(
"nNeutrals_FW", 10);
742 set(
"nConstituents", 1);
745 set(
"nNeutrals_FW", 10);
749 set(
"nNeutrals_EC", 2);
751 set(
"nNeutrals_FW", 10);
753 set(
"NEF_EC_L", 0.02);
754 set(
"NEF_EC_U", 0.99);
755 set(
"nNeutrals_EC", 2);
758 set(
"nNeutrals_FW", 10);
763 set(
"nNeutrals_FW_L", 2);
764 set(
"nNeutrals_FW_U", 15);
769 set(
"NEF_EC_L", 0.02);
770 set(
"NEF_EC_U", 0.99);
771 set(
"nNeutrals_EC", 2);
774 set(
"nNeutrals_FW", 10);
781 set(
"nNeutrals_FW_L", 2);
782 set(
"nNeutrals_FW_U", 15);
787 set(
"NEF_EC_L", 0.01);
788 set(
"NEF_EC_U", 0.99);
789 set(
"nNeutrals_EC", 2);
792 set(
"nNeutrals_FW", 10);
796 set(
"NHF_EC", 0.9999);
799 set(
"nNeutrals_FW_L", 2);
800 set(
"nNeutrals_FW_U", 999999);
807 set(
"nConstituents", 1);
810 set(
"NEF_EC_L", 0.02);
811 set(
"NEF_EC_U", 0.99);
812 set(
"nNeutrals_EC", 2);
815 set(
"nNeutrals_FW", 10);
822 set(
"nNeutrals_FW_L", 2);
823 set(
"nNeutrals_FW_U", 15);
829 set(
"nNeutrals_EC", 2);
830 set(
"nNeutrals_FW", 10);
838 set(
"nNeutrals_FW_L", 2);
839 set(
"nNeutrals_FW_U", 15);
845 set(
"nNeutrals_EC", 2);
846 set(
"nNeutrals_FW", 10);
857 set(
"NEF_EC_L", 0.02);
858 set(
"NEF_EC_U", 0.99);
859 set(
"nNeutrals_EC", 2);
862 set(
"nNeutrals_FW", 10);
873 set(
"nNeutrals_FW_L", 2);
874 set(
"nNeutrals_FW_U", 15);
883 set(
"NEF_EC_L", 0.01);
884 set(
"NEF_EC_U", 0.99);
885 set(
"nNeutrals_EC", 2);
888 set(
"nNeutrals_FW", 10);
896 set(
"NHF_EC", 0.9999);
899 set(
"nNeutrals_FW_L", 2);
900 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".