CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Protected Member Functions | Protected Attributes
AcceptJet Class Reference

#include <AcceptJet.h>

Public Member Functions

 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_)
 
bool operator() (const reco::Jet &jet, const int &jetFlavour, const edm::Handle< reco::SoftLeptonTagInfoCollection > &infos) const
 Returns true if jet and associated parton satisfy kinematic cuts. More...
 
void setEtaMax (double d)
 
void setEtaMin (double d)
 Set cut parameters. More...
 
void setPRecJetMax (double d)
 
void setPRecJetMin (double d)
 
void setPtRecJetMax (double d)
 
void setPtRecJetMin (double d)
 
void setRatioMax (double d)
 
void setRatioMin (double d)
 

Protected Member Functions

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. More...
 

Protected Attributes

double etaMax
 
double etaMin
 
double pRecJetMax
 
double pRecJetMin
 
double ptRecJetMax
 
double ptRecJetMin
 
double ratioMax
 
double ratioMin
 

Detailed Description

Decide if jet and associated parton satisfy desired kinematic cuts.

Definition at line 14 of file AcceptJet.h.

Constructor & Destructor Documentation

AcceptJet::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_ 
)

Definition at line 9 of file AcceptJet.cc.

10  :
11  etaMin(etaMin_), etaMax(etaMax_), ptRecJetMin(ptMin_), ptRecJetMax(ptMax_), pRecJetMin(pMin_),
12  pRecJetMax(pMax_), ratioMin(ratioMin_), ratioMax(ratioMax_) {}
double pRecJetMax
Definition: AcceptJet.h:59
double etaMax
Definition: AcceptJet.h:44
double ptRecJetMin
Definition: AcceptJet.h:55
double ratioMin
Definition: AcceptJet.h:61
double ptRecJetMax
Definition: AcceptJet.h:56
double etaMin
Definition: AcceptJet.h:43
double pRecJetMin
Definition: AcceptJet.h:58
double ratioMax
Definition: AcceptJet.h:62

Member Function Documentation

bool AcceptJet::operator() ( const reco::Jet jet,
const int &  jetFlavour,
const edm::Handle< reco::SoftLeptonTagInfoCollection > &  infos 
) const

Returns true if jet and associated parton satisfy kinematic cuts.

Definition at line 15 of file AcceptJet.cc.

References reco::LeafCandidate::eta(), etaMax, etaMin, edm::HandleBase::isValid(), reco::LeafCandidate::p(), pRecJetMax, pRecJetMin, reco::LeafCandidate::pt(), ptRecJetMax, ptRecJetMin, ratio(), ratioMax, and ratioMin.

16 {
17 
18  // temporary fudge to correct for double loop error
19  // jetPartonMomentum /= 2.0;
20 
21  if ( fabs(jet.eta()) < etaMin ||
22  fabs(jet.eta()) > etaMax ) return false;
23 
24 // if ( jetFlavour.underlyingParton4Vec().P() < pPartonMin ||
25 // jetFlavour.underlyingParton4Vec().P() > pPartonMax ) accept = false;
26 //
27 // if ( jetFlavour.underlyingParton4Vec().Pt() < ptPartonMin ||
28 // jetFlavour.underlyingParton4Vec().Pt() > ptPartonMax ) accept = false;
29 
30  if ( jet.pt() < ptRecJetMin ||
31  jet.pt() > ptRecJetMax ) return false;
32 
33  if ( jet.p() < pRecJetMin ||
34  jet.p() > pRecJetMax ) return false;
35 
36  if ( !infos.isValid() ) {
37  edm::LogWarning("infos not valid") << "A valid SoftLeptonTagInfoCollection was not found!"
38  << " Skipping ratio check.";
39  }
40  else {
41  double pToEratio = ratio( jet, infos );
42  if ( pToEratio < ratioMin ||
43  pToEratio > ratioMax ) return false;
44  }
45 
46  return true;
47 }
double pRecJetMax
Definition: AcceptJet.h:59
double etaMax
Definition: AcceptJet.h:44
double ptRecJetMin
Definition: AcceptJet.h:55
double ratioMin
Definition: AcceptJet.h:61
virtual double p() const GCC11_FINAL
magnitude of momentum vector
double ptRecJetMax
Definition: AcceptJet.h:56
double etaMin
Definition: AcceptJet.h:43
double pRecJetMin
Definition: AcceptJet.h:58
double ratioMax
Definition: AcceptJet.h:62
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.
Definition: AcceptJet.cc:49
bool isValid() const
Definition: HandleBase.h:76
virtual float eta() const GCC11_FINAL
momentum pseudorapidity
virtual float pt() const GCC11_FINAL
transverse momentum
double AcceptJet::ratio ( const reco::Jet jet,
const edm::Handle< reco::SoftLeptonTagInfoCollection > &  infos 
) const
protected

Finds the ratio of the momentum of any leptons in the jet to jet energy.

Definition at line 49 of file AcceptJet.cc.

References reco::deltaR(), alignCSCRings::e, reco::LeafCandidate::eta(), gen::k, and reco::LeafCandidate::phi().

Referenced by operator()().

50 {
51  double jetRatio = 0.0;
52  reco::SoftLeptonTagInfoCollection::const_iterator infoiter = infos->begin();
53  for( ; infoiter != infos->end(); ++infoiter)
54  {
55  if( reco::deltaR(jet.eta(), jet.phi(), infoiter->jet()->eta(), infoiter->jet()->phi()) > 1e-4 )
56  continue;
57 
58  if( infoiter->leptons() == 0 )
59  break;
60 
61  for( unsigned int k = 0; k != infoiter->leptons(); ++k )
62  {
63  double tempRatio = infoiter->properties(k).ratio;
64  if( tempRatio > jetRatio )
65  jetRatio = tempRatio;
66  }
67  }
68 
69  return jetRatio;
70 }
virtual float phi() const GCC11_FINAL
momentum azimuthal angle
auto deltaR(const T1 &t1, const T2 &t2) -> decltype(t1.eta())
Definition: deltaR.h:30
virtual float eta() const GCC11_FINAL
momentum pseudorapidity
int k[5][pyjets_maxn]
void AcceptJet::setEtaMax ( double  d)
inline

Definition at line 24 of file AcceptJet.h.

References etaMax.

24 { etaMax = d ; }
double etaMax
Definition: AcceptJet.h:44
void AcceptJet::setEtaMin ( double  d)
inline

Set cut parameters.

Definition at line 23 of file AcceptJet.h.

References etaMin.

23 { etaMin = d ; }
double etaMin
Definition: AcceptJet.h:43
void AcceptJet::setPRecJetMax ( double  d)
inline

Definition at line 30 of file AcceptJet.h.

References pRecJetMax.

30 { pRecJetMax = d ; }
double pRecJetMax
Definition: AcceptJet.h:59
void AcceptJet::setPRecJetMin ( double  d)
inline

Definition at line 29 of file AcceptJet.h.

References pRecJetMin.

29 { pRecJetMin = d ; }
double pRecJetMin
Definition: AcceptJet.h:58
void AcceptJet::setPtRecJetMax ( double  d)
inline

Definition at line 28 of file AcceptJet.h.

References ptRecJetMax.

28 { ptRecJetMax = d ; }
double ptRecJetMax
Definition: AcceptJet.h:56
void AcceptJet::setPtRecJetMin ( double  d)
inline

Definition at line 27 of file AcceptJet.h.

References ptRecJetMin.

27 { ptRecJetMin = d ; }
double ptRecJetMin
Definition: AcceptJet.h:55
void AcceptJet::setRatioMax ( double  d)
inline

Definition at line 32 of file AcceptJet.h.

References ratioMax.

32 { ratioMax = d ; }
double ratioMax
Definition: AcceptJet.h:62
void AcceptJet::setRatioMin ( double  d)
inline

Definition at line 31 of file AcceptJet.h.

References ratioMin.

31 { ratioMin = d ; }
double ratioMin
Definition: AcceptJet.h:61

Member Data Documentation

double AcceptJet::etaMax
protected

Definition at line 44 of file AcceptJet.h.

Referenced by operator()(), and setEtaMax().

double AcceptJet::etaMin
protected

Definition at line 43 of file AcceptJet.h.

Referenced by operator()(), and setEtaMin().

double AcceptJet::pRecJetMax
protected

Definition at line 59 of file AcceptJet.h.

Referenced by operator()(), and setPRecJetMax().

double AcceptJet::pRecJetMin
protected

Definition at line 58 of file AcceptJet.h.

Referenced by operator()(), and setPRecJetMin().

double AcceptJet::ptRecJetMax
protected

Definition at line 56 of file AcceptJet.h.

Referenced by operator()(), and setPtRecJetMax().

double AcceptJet::ptRecJetMin
protected

Definition at line 55 of file AcceptJet.h.

Referenced by operator()(), and setPtRecJetMin().

double AcceptJet::ratioMax
protected

Definition at line 62 of file AcceptJet.h.

Referenced by operator()(), and setRatioMax().

double AcceptJet::ratioMin
protected

Definition at line 61 of file AcceptJet.h.

Referenced by operator()(), and setRatioMin().