1 #ifndef PhysicsTools_SelectorUtils_interface_PFJetIDSelectionFunctor_h 2 #define PhysicsTools_SelectorUtils_interface_PFJetIDSelectionFunctor_h 44 if ( versionStr ==
"FIRSTDATA" )
46 else if( versionStr ==
"RUNIISTARTUP")
50 else if( versionStr ==
"WINTER16")
52 else if( versionStr ==
"WINTER17")
91 edm::LogWarning(
"BadJetIDVersion") <<
"Winter17 JetID version does not support the LOOSE operating point -- defaulting to TIGHT";
96 edm::LogWarning(
"BadJetIDVersion") <<
"JetID version does not support the TIGHTLEPVETO operating point -- defaulting to TIGHT";
108 set(
"nConstituents", 1);
111 set(
"nNeutrals_FW",10);
116 set(
"nNeutrals_EC",2);
118 set(
"nNeutrals_FW",10);
128 set(
"nConstituents", 1);
131 set(
"nNeutrals_FW",10);
136 set(
"nNeutrals_EC",2);
138 set(
"nNeutrals_FW",10);
141 set(
"NEF_EC_L",0.02);
142 set(
"NEF_EC_U",0.99);
143 set(
"nNeutrals_EC",2);
146 set(
"nNeutrals_FW",10);
155 set(
"nConstituents", 1);
157 set(
"NEF_EC_L",0.02);
158 set(
"NEF_EC_U",0.99);
159 set(
"nNeutrals_EC",2);
162 set(
"nNeutrals_FW",10);
175 if ( params.
exists(
"nConstituents") )
set(
"nConstituents", params.
getParameter<
int> (
"nConstituents") );
177 if ( params.
exists(
"NEF_FW") )
set(
"NEF_FW", params.
getParameter<
double> (
"NEF_FW") );
178 if ( params.
exists(
"nNeutrals_FW") )
set(
"nNeutrals_FW", params.
getParameter<
int> (
"nNeutrals_FW") );
183 if ( params.
exists(
"nNeutrals_EC") )
set(
"nNeutrals_EC", params.
getParameter<
int> (
"nNeutrals_EC") );
184 if ( params.
exists(
"NEF_FW") )
set(
"NEF_FW", params.
getParameter<
double> (
"NEF_FW") );
185 if ( params.
exists(
"nNeutrals_FW") )
set(
"nNeutrals_FW", params.
getParameter<
int> (
"nNeutrals_FW") );
188 if ( params.
exists(
"NEF_EC_L") )
set(
"NEF_EC_L", params.
getParameter<
int> (
"NEF_EC_L") );
189 if ( params.
exists(
"NEF_EC_U") )
set(
"NEF_EC_U", params.
getParameter<
int> (
"NEF_EC_U") );
190 if ( params.
exists(
"nNeutrals_EC") )
set(
"nNeutrals_EC", params.
getParameter<
int> (
"nNeutrals_EC") );
191 if ( params.
exists(
"NHF_FW") )
set(
"NHF_FW", params.
getParameter<
double> (
"NHF_FW") );
192 if ( params.
exists(
"NEF_FW") )
set(
"NEF_FW", params.
getParameter<
double> (
"NEF_FW") );
193 if ( params.
exists(
"nNeutrals_FW") )
set(
"nNeutrals_FW", params.
getParameter<
int> (
"nNeutrals_FW") );
198 if ( params.
exists(
"cutsToIgnore") )
273 edm::LogWarning(
"BadJetIDVersion") <<
"Winter17 JetID version does not support the LOOSE operating point -- defaulting to TIGHT";
277 edm::LogWarning(
"BadJetIDVersion") <<
"JetID version does not support the TIGHTLEPVETO operating point -- defaulting to TIGHT";
287 set(
"nConstituents", 1);
290 set(
"nNeutrals_FW",10);
295 set(
"nNeutrals_EC",2);
297 set(
"nNeutrals_FW",10);
310 set(
"nConstituents", 1);
313 set(
"nNeutrals_FW",10);
318 set(
"nNeutrals_EC",2);
320 set(
"nNeutrals_FW",10);
323 set(
"NEF_EC_L",0.02);
324 set(
"NEF_EC_U",0.99);
325 set(
"nNeutrals_EC",2);
328 set(
"nNeutrals_FW",10);
337 set(
"nConstituents", 1);
339 set(
"NEF_EC_L",0.02);
340 set(
"NEF_EC_U",0.99);
341 set(
"nNeutrals_EC",2);
344 set(
"nNeutrals_FW",10);
439 int nconstituents = 0;
447 if ( patJet !=
nullptr ) {
469 iend = patJet->
end(), isub = ibegin;
470 isub != iend; ++isub ) {
481 }
else if ( pfsub ) {
492 if ( e > 0.000001 ) {
498 chf = nhf = cef = nef = 0.0;
502 else if ( pfJet !=
nullptr ) {
504 double jetEnergyUncorrected =
511 if ( jetEnergyUncorrected > 0. ) {
516 muf = pfJet->
muonEnergy() / jetEnergyUncorrected;
524 else if ( basicJet !=
nullptr ) {
532 iend = patJet->
end(), isub = ibegin;
533 isub != iend; ++isub ) {
544 if ( e > 0.000001 ) {
T getParameter(std::string const &) const
index_type indexNNeutrals_EC_
float photonEnergy() const
photonEnergy
float neutralHadronEnergyFraction() const
neutralHadronEnergyFraction (relative to uncorrected jet energy)
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
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
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.
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.
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()
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".