|
|
Go to the documentation of this file. 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")
86 set(
"CHF",
params.getParameter<
double>(
"CHF"));
88 set(
"NHF",
params.getParameter<
double>(
"NHF"));
93 set(
"CEF",
params.getParameter<
double>(
"CEF"));
96 set(
"NEF",
params.getParameter<
double>(
"NEF"));
98 set(
"NCH",
params.getParameter<
int>(
"NCH"));
99 if (
params.exists(
"nConstituents"))
100 set(
"nConstituents",
params.getParameter<
int>(
"nConstituents"));
102 if (
params.exists(
"NEF_FW"))
103 set(
"NEF_FW",
params.getParameter<
double>(
"NEF_FW"));
104 if (
params.exists(
"nNeutrals_FW"))
105 set(
"nNeutrals_FW",
params.getParameter<
int>(
"nNeutrals_FW"));
108 if (
params.exists(
"NHF_EC"))
109 set(
"NHF_EC",
params.getParameter<
double>(
"NHF_EC"));
110 if (
params.exists(
"NEF_EC"))
111 set(
"NEF_EC",
params.getParameter<
double>(
"NEF_EC"));
112 if (
params.exists(
"nNeutrals_EC"))
113 set(
"nNeutrals_EC",
params.getParameter<
int>(
"nNeutrals_EC"));
114 if (
params.exists(
"NEF_FW"))
115 set(
"NEF_FW",
params.getParameter<
double>(
"NEF_FW"));
116 if (
params.exists(
"nNeutrals_FW"))
117 set(
"nNeutrals_FW",
params.getParameter<
int>(
"nNeutrals_FW"));
120 set(
"MUF",
params.getParameter<
double>(
"MUF"));
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"))
131 set(
"NHF_FW",
params.getParameter<
double>(
"NHF_FW"));
132 if (
params.exists(
"NEF_FW"))
133 set(
"NEF_FW",
params.getParameter<
double>(
"NEF_FW"));
134 if (
params.exists(
"nNeutrals_FW"))
135 set(
"nNeutrals_FW",
params.getParameter<
int>(
"nNeutrals_FW"));
138 set(
"MUF",
params.getParameter<
double>(
"MUF"));
142 if (
params.exists(
"NHF_EC"))
143 set(
"NHF_EC",
params.getParameter<
double>(
"NHF_EC"));
144 if (
params.exists(
"NHF_FW"))
145 set(
"NHF_FW",
params.getParameter<
double>(
"NHF_FW"));
146 if (
params.exists(
"NEF_FW"))
147 set(
"NEF_FW",
params.getParameter<
double>(
"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"));
154 set(
"MUF",
params.getParameter<
double>(
"MUF"));
158 if (
params.exists(
"NHF_TR"))
159 set(
"NHF_TR",
params.getParameter<
double>(
"NHF_TR"));
160 if (
params.exists(
"NEF_TR"))
161 set(
"NEF_TR",
params.getParameter<
double>(
"NEF_TR"));
162 if (
params.exists(
"NCH_TR"))
163 set(
"NCH_TR",
params.getParameter<
int>(
"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"))
171 set(
"NHF_FW",
params.getParameter<
double>(
"NHF_FW"));
172 if (
params.exists(
"NEF_FW"))
173 set(
"NEF_FW",
params.getParameter<
double>(
"NEF_FW"));
174 if (
params.exists(
"nNeutrals_FW"))
175 set(
"nNeutrals_FW",
params.getParameter<
int>(
"nNeutrals_FW"));
178 set(
"MUF",
params.getParameter<
double>(
"MUF"));
179 if (
params.exists(
"MUF_TR"))
180 set(
"MUF_TR",
params.getParameter<
double>(
"MUF_TR"));
181 if (
params.exists(
"CEF_TR"))
182 set(
"CEF_TR",
params.getParameter<
double>(
"CEF_TR"));
186 if (
params.exists(
"NHF_TR"))
187 set(
"NHF_TR",
params.getParameter<
double>(
"NHF_TR"));
188 if (
params.exists(
"NEF_TR"))
189 set(
"NEF_TR",
params.getParameter<
double>(
"NEF_TR"));
190 if (
params.exists(
"NHF_EC"))
191 set(
"NHF_EC",
params.getParameter<
double>(
"NHF_EC"));
192 if (
params.exists(
"NHF_FW"))
193 set(
"NHF_FW",
params.getParameter<
double>(
"NHF_FW"));
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"));
203 if (
params.exists(
"MUF_TR"))
204 set(
"MUF_TR",
params.getParameter<
double>(
"MUF_TR"));
205 if (
params.exists(
"CEF_TR"))
206 set(
"CEF_TR",
params.getParameter<
double>(
"CEF_TR"));
210 if (
params.exists(
"cutsToIgnore"))
228 if (
jet.currentJECLevel() ==
"Uncorrected" || !
jet.jecSetsAvailable())
273 int nconstituents = 0;
277 reco::PFJet const *pfJet = dynamic_cast<reco::PFJet const *>(&
jet);
278 pat::Jet const *patJet = dynamic_cast<pat::Jet const *>(&
jet);
281 if (patJet !=
nullptr) {
306 reco::PFJet const *pfsub = dynamic_cast<reco::PFJet const *>(&*isub);
307 pat::Jet const *patsub = dynamic_cast<pat::Jet const *>(&*isub);
337 chf = nhf = cef = nef = muf = 0.0;
341 else if (pfJet !=
nullptr) {
346 if (jetEnergyUncorrected > 0.) {
351 muf = pfJet->
muonEnergy() / jetEnergyUncorrected;
359 else if (basicJet !=
nullptr) {
369 reco::PFJet const *pfsub = dynamic_cast<reco::PFJet const *>(&*isub);
707 <<
"The LOOSE operating point is only supported for the WINTER16 JetID version -- defaulting to TIGHT";
718 set(
"nConstituents", 1);
721 set(
"nNeutrals_FW", 10);
725 set(
"nNeutrals_EC", 2);
727 set(
"nNeutrals_FW", 10);
737 set(
"nConstituents", 1);
740 set(
"nNeutrals_FW", 10);
744 set(
"nNeutrals_EC", 2);
746 set(
"nNeutrals_FW", 10);
748 set(
"NEF_EC_L", 0.02);
749 set(
"NEF_EC_U", 0.99);
750 set(
"nNeutrals_EC", 2);
753 set(
"nNeutrals_FW", 10);
758 set(
"nNeutrals_FW_L", 2);
759 set(
"nNeutrals_FW_U", 15);
764 set(
"NEF_EC_L", 0.02);
765 set(
"NEF_EC_U", 0.99);
766 set(
"nNeutrals_EC", 2);
769 set(
"nNeutrals_FW", 10);
776 set(
"nNeutrals_FW_L", 2);
777 set(
"nNeutrals_FW_U", 15);
782 set(
"NEF_EC_L", 0.01);
783 set(
"NEF_EC_U", 0.99);
784 set(
"nNeutrals_EC", 2);
787 set(
"nNeutrals_FW", 10);
791 set(
"NHF_EC", 0.9999);
794 set(
"nNeutrals_FW_L", 2);
795 set(
"nNeutrals_FW_U", 999999);
802 set(
"nConstituents", 1);
805 set(
"NEF_EC_L", 0.02);
806 set(
"NEF_EC_U", 0.99);
807 set(
"nNeutrals_EC", 2);
810 set(
"nNeutrals_FW", 10);
817 set(
"nNeutrals_FW_L", 2);
818 set(
"nNeutrals_FW_U", 15);
824 set(
"nNeutrals_EC", 2);
825 set(
"nNeutrals_FW", 10);
833 set(
"nNeutrals_FW_L", 2);
834 set(
"nNeutrals_FW_U", 15);
840 set(
"nNeutrals_EC", 2);
841 set(
"nNeutrals_FW", 10);
852 set(
"NEF_EC_L", 0.02);
853 set(
"NEF_EC_U", 0.99);
854 set(
"nNeutrals_EC", 2);
857 set(
"nNeutrals_FW", 10);
868 set(
"nNeutrals_FW_L", 2);
869 set(
"nNeutrals_FW_U", 15);
878 set(
"NEF_EC_L", 0.01);
879 set(
"NEF_EC_U", 0.99);
880 set(
"nNeutrals_EC", 2);
883 set(
"nNeutrals_FW", 10);
891 set(
"NHF_EC", 0.9999);
894 set(
"nNeutrals_FW_L", 2);
895 set(
"nNeutrals_FW_U", 999999);
ret
prodAgent to be discontinued
float muonEnergy() const
muonEnergy
void setIgnored(pat::strbitset &ret)
set ignored bits
Functor that operates on <T>
pat::strbitset bits_
the bitset indexed by strings
Base class for all types of Jets.
index_type indexNEF_EC_L_
pat::strbitset::index_type index_type
index_type indexNNeutrals_EC_
bool firstDataCuts(reco::Jet const &jet, pat::strbitset &ret, Version_t version_)
strbitset & set(bool val=true)
set method of all bits
pat::strbitset retInternal_
internal ret if users don't care about return bits
bool ignoreCut(std::string const &s) const
ignore the cut at index "s"
bool operator()(const reco::PFJet &jet, pat::strbitset &ret)
float neutralHadronEnergyFraction() const
neutralHadronEnergyFraction (relative to uncorrected jet energy)
index_type indexNConstituents_
PFJetIDSelectionFunctor(edm::ParameterSet const ¶ms, edm::ConsumesCollector &iC)
Log< level::Warning, false > LogWarning
PF Jet selector for pat::Jets.
PFJetIDSelectionFunctor(edm::ParameterSet const ¶ms)
float chargedHadronEnergy() const
chargedHadronEnergy
Jets made from CaloTowers.
Analysis-level calorimeter jet class.
float HFEMEnergy() const
HFEMEnergy.
PFJetIDSelectionFunctor(Version_t version, Quality_t quality)
float chargedHadronEnergy() const
chargedHadronEnergy
virtual void push_back(std::string const &s)
This is the registration of an individual cut string.
int chargedMultiplicity() const
chargedMultiplicity
float neutralEmEnergy() const
neutralEmEnergy
float chargedEmEnergy() const
chargedEmEnergy
index_type indexNNeutrals_FW_
int chargedMultiplicity() const
chargedMultiplicity
float neutralHadronEnergy() const
neutralHadronEnergy
bool operator()(const reco::PFJet &jet)
float photonEnergy() const
photonEnergy
pat::strbitset getBitTemplate() const
Get an empty bitset with the proper names.
float chargedEmEnergy() const
chargedEmEnergy
const_iterator end() const
last daughter const_iterator
float neutralEmEnergyFraction() const
neutralEmEnergyFraction (relative to uncorrected jet energy)
void passCut(pat::strbitset &ret, std::string const &s)
Passing cuts.
bool isBasicJet() const
check to see if the jet is no more than a reco::BasicJet
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.
index_type indexNNeutrals_FW_L_
void setIgnoredCuts(std::vector< std::string > const &bitsToIgnore)
set the bits to ignore from a vector
bool isPFJet() const
check to see if the jet is a reco::PFJet
float chargedEmEnergyFraction() const
chargedEmEnergyFraction (relative to uncorrected jet energy)
float muonEnergy() const
muonEnergy
float chargedHadronEnergyFraction() const
chargedHadronEnergyFraction (relative to uncorrected jet energy)
int cut(index_type const &i, int val) const
Access the int cut values at index "s".
float neutralHadronEnergy() const
neutralHadronEnergy
float muonEnergyFraction() const
muonEnergyFraction (relative to corrected jet energy)
int neutralMultiplicity() const
neutralMultiplicity
PFJetIDSelectionFunctor()
Jets made from PFObjects.
float neutralEmEnergy() const
neutralEmEnergy
double energy() const final
energy
void set(std::string const &s, bool val=true)
Set a given selection cut, on or off.
index_type indexNNeutrals_FW_U_
Abs< T >::type abs(const T &t)
const_iterator begin() const
first daughter const_iterator
float electronEnergy() const
electronEnergy