CMS 3D CMS Logo

Public Member Functions | Protected Member Functions | Protected Attributes

AcceptJet Class Reference

#include <AcceptJet.h>

List of all members.

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.
void setEtaMax (double d)
void setEtaMin (double d)
 Set cut parameters.
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.

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.

                                                                                                      :
  etaMin(etaMin_), etaMax(etaMax_), ptRecJetMin(ptMin_), ptRecJetMax(ptMax_), pRecJetMin(pMin_),
  pRecJetMax(pMax_), ratioMin(ratioMin_), ratioMax(ratioMax_) {}

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.

{

  // temporary fudge to correct for double loop error
  //  jetPartonMomentum /= 2.0;

  if ( fabs(jet.eta()) < etaMin  ||
       fabs(jet.eta()) > etaMax  ) return false;

//   if ( jetFlavour.underlyingParton4Vec().P() < pPartonMin  ||
//        jetFlavour.underlyingParton4Vec().P() > pPartonMax  ) accept = false;
// 
//   if ( jetFlavour.underlyingParton4Vec().Pt() < ptPartonMin  ||
//        jetFlavour.underlyingParton4Vec().Pt() > ptPartonMax  ) accept = false;

  if ( jet.pt() < ptRecJetMin ||
       jet.pt() > ptRecJetMax ) return false;

  if ( jet.p() < pRecJetMin ||
       jet.p() > pRecJetMax ) return false;

  if ( !infos.isValid() ) {
    edm::LogWarning("infos not valid") << "A valid SoftLeptonTagInfoCollection was not found!"
                                     << " Skipping ratio check.";
  }
  else {
    double pToEratio = ratio( jet, infos );
    if ( pToEratio < ratioMin ||
         pToEratio > ratioMax ) return false;
  }

  return true;
}
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()().

{
  double jetRatio = 0.0;
  reco::SoftLeptonTagInfoCollection::const_iterator infoiter = infos->begin();
  for( ; infoiter != infos->end(); ++infoiter)
  {
    if( reco::deltaR(jet.eta(), jet.phi(), infoiter->jet()->eta(), infoiter->jet()->phi()) > 1e-4 )
      continue;

    if( infoiter->leptons() == 0 )
      break;

    for( unsigned int k = 0; k != infoiter->leptons(); ++k )
    {
      double tempRatio = infoiter->properties(k).ratio;
      if( tempRatio > jetRatio )
        jetRatio = tempRatio;
    }
  }

  return jetRatio;
}
void AcceptJet::setEtaMax ( double  d) [inline]

Definition at line 24 of file AcceptJet.h.

References etaMax.

{ etaMax            = d ; } 
void AcceptJet::setEtaMin ( double  d) [inline]

Set cut parameters.

Definition at line 23 of file AcceptJet.h.

References etaMin.

{ etaMin            = d ; } 
void AcceptJet::setPRecJetMax ( double  d) [inline]

Definition at line 30 of file AcceptJet.h.

References pRecJetMax.

{ pRecJetMax        = d ; }
void AcceptJet::setPRecJetMin ( double  d) [inline]

Definition at line 29 of file AcceptJet.h.

References pRecJetMin.

{ pRecJetMin        = d ; } 
void AcceptJet::setPtRecJetMax ( double  d) [inline]

Definition at line 28 of file AcceptJet.h.

References ptRecJetMax.

{ ptRecJetMax       = d ; } 
void AcceptJet::setPtRecJetMin ( double  d) [inline]

Definition at line 27 of file AcceptJet.h.

References ptRecJetMin.

{ ptRecJetMin       = d ; } 
void AcceptJet::setRatioMax ( double  d) [inline]

Definition at line 32 of file AcceptJet.h.

References ratioMax.

{ ratioMax          = d ; }
void AcceptJet::setRatioMin ( double  d) [inline]

Definition at line 31 of file AcceptJet.h.

References ratioMin.

{ ratioMin          = d ; }

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().