10 AcceptJet::AcceptJet(
const double& etaMin_,
const double& etaMax_,
const double& ptMin_,
const double& ptMax_,
11 const double& pMin_,
const double& pMax_,
const double& ratioMin_,
const double& ratioMax_,
const bool& doJetID_) :
12 etaMin(etaMin_),
etaMax(etaMax_), ptRecJetMin(ptMin_), ptRecJetMax(ptMax_), pRecJetMin(pMin_),
13 pRecJetMax(pMax_), ratioMin(ratioMin_), ratioMax(ratioMax_), doJetID(doJetID_) {}
38 LogDebug(
"infos not valid") <<
"A valid SoftLeptonTagInfoCollection was not found!" 39 <<
" Skipping ratio check.";
42 double pToEratio =
ratio( jet, infos );
44 pToEratio/jec >
ratioMax )
return false;
56 if(!(neutralHadronEnergyFraction < 0.99
57 && neutralEmEnergyFraction < 0.99
59 && chargedHadronEnergyFraction > 0.0
60 && chargedMultiplicity > 0.0
61 && chargedEmEnergyFraction < 0.99))
73 double jetRatio = 0.0;
74 reco::SoftLeptonTagInfoCollection::const_iterator infoiter = infos->begin();
75 for( ; infoiter != infos->end(); ++infoiter)
77 if(
reco::deltaR(jet.
eta(), jet.
phi(), infoiter->jet()->eta(), infoiter->jet()->phi()) > 1
e-4 )
80 if( infoiter->leptons() == 0 )
83 for(
unsigned int k = 0;
k != infoiter->leptons(); ++
k )
85 double tempRatio = infoiter->properties(
k).ratio;
86 if( tempRatio > jetRatio )
virtual double pt() const final
transverse momentum
float chargedEmEnergy() const
chargedEmEnergy
virtual double eta() const final
momentum pseudorapidity
Base class for all types of Jets.
int chargedMultiplicity() const
chargedMultiplicity
Jets made from PFObjects.
float neutralEmEnergy() const
neutralEmEnergy
virtual double phi() const final
momentum azimuthal angle
virtual double energy() const final
energy
virtual double p() const final
magnitude of momentum vector
auto deltaR(const T1 &t1, const T2 &t2) -> decltype(t1.eta())
AcceptJet(const double &etaMin_, const double &etaMax_, const double &ptMin_, const double &ptMax_, const double &pMin_, const double &pMax_, const double &ratioMin_, const double &ratioMax_, const bool &doJetID_)
double ratio(const reco::Jet &jet, const edm::Handle< reco::SoftLeptonTagInfoCollection > &infos) const
Finds the ratio of the momentum of any leptons in the jet to jet energy.
virtual std::vector< reco::PFCandidatePtr > getPFConstituents() const
get all constituents
float neutralHadronEnergy() const
neutralHadronEnergy
bool operator()(const reco::Jet &jet, const int &jetFlavour, const edm::Handle< reco::SoftLeptonTagInfoCollection > &infos, const double jec) const
Returns true if jet and associated parton satisfy kinematic cuts.
float chargedHadronEnergy() const
chargedHadronEnergy