CMS 3D CMS Logo

EtaPtBin Class Reference

Decide if jet/parton lie within desired rapidity/pt range. More...

#include <DQMOffline/RecoB/interface/EtaPtBin.h>

List of all members.

Public Member Functions

 EtaPtBin (bool etaActive_, double etaMin_, double etaMax_, bool ptActive_, double ptMin_, double ptMax_)
 EtaPtBin (bool etaActive_, double etaMin_, double etaMax_, bool ptActive_, double ptMin_, double ptMax_)
TString getDescriptionString () const
 String describes rapidity/pt range.
TString getDescriptionString () const
 String describes rapidity/pt range.
bool getEtaActive () const
 Get rapidity/pt ranges and check whether rapidity/pt cuts are active.
bool getEtaActive () const
 Get rapidity/pt ranges and check whether rapidity/pt cuts are active.
double getEtaMax () const
double getEtaMax () const
double getEtaMin () const
double getEtaMin () const
bool getPtActive () const
bool getPtActive () const
double getPtMax () const
double getPtMax () const
double getPtMin () const
double getPtMin () const
bool inBin (const reco::Jet &jet) const
bool inBin (const double &eta, const double &pt) const
 Check if jet/parton are within rapidity/pt cuts.
bool inBin (const reco::Jet &jet) const
bool inBin (const double &eta, const double &pt) const
 Check if jet/parton are within rapidity/pt cuts.
 ~EtaPtBin ()
 ~EtaPtBin ()

Static Public Member Functions

static TString buildDescriptionString (bool etaActive_, double etaMin_, double etaMax_, bool ptActive_, double ptMin_, double ptMax_)
 method to build the string from other quantities (static for easy external use)
static TString buildDescriptionString (bool etaActive_, double etaMin_, double etaMax_, bool ptActive_, double ptMin_, double ptMax_)
 method to build the string from other quantities (static for easy external use)

Private Attributes

TString descriptionString
bool etaActive
double etaMax
double etaMin
bool ptActive
double ptMax
double ptMin


Detailed Description

Decide if jet/parton lie within desired rapidity/pt range.

Definition at line 14 of file EtaPtBin.h.


Constructor & Destructor Documentation

EtaPtBin::EtaPtBin ( bool  etaActive_,
double  etaMin_,
double  etaMax_,
bool  ptActive_,
double  ptMin_,
double  ptMax_ 
)

Definition at line 6 of file EtaPtBin.cc.

References buildDescriptionString(), descriptionString, etaActive, etaMax, etaMin, ptActive, ptMax, and ptMin.

00008   : etaActive ( etaActive_ ) , etaMin ( etaMin_ ) , etaMax ( etaMax_ ) ,
00009     ptActive  (  ptActive_ ) , ptMin  (  ptMin_ ) , ptMax  (  ptMax_ )   {
00010 
00011   descriptionString = buildDescriptionString ( etaActive , etaMin , etaMax ,
00012                                                ptActive  , ptMin  , ptMax  );
00013 }

EtaPtBin::~EtaPtBin (  )  [inline]

Definition at line 21 of file EtaPtBin.h.

00021 {} ;

EtaPtBin::EtaPtBin ( bool  etaActive_,
double  etaMin_,
double  etaMax_,
bool  ptActive_,
double  ptMin_,
double  ptMax_ 
)

EtaPtBin::~EtaPtBin (  )  [inline]

Definition at line 21 of file EtaPtBin.h.

00021 {} ;


Member Function Documentation

static TString EtaPtBin::buildDescriptionString ( bool  etaActive_,
double  etaMin_,
double  etaMax_,
bool  ptActive_,
double  ptMin_,
double  ptMax_ 
) [static]

method to build the string from other quantities (static for easy external use)

TString EtaPtBin::buildDescriptionString ( bool  etaActive_,
double  etaMin_,
double  etaMax_,
bool  ptActive_,
double  ptMin_,
double  ptMax_ 
) [static]

method to build the string from other quantities (static for easy external use)

Definition at line 18 of file EtaPtBin.cc.

Referenced by EtaPtBin().

00020 {
00021   // create string only from the active parts
00022   TString descr ( "" );
00023 
00024   if ( etaActive_ ) {
00025     descr += "_ETA_";
00026     descr += etaMin_;
00027     descr += "-";
00028     descr += etaMax_;
00029   }
00030 
00031   if ( ptActive_ ) {
00032     descr += "_PT_";
00033     descr += ptMin_;
00034     descr += "-";
00035     descr += ptMax_;
00036   }
00037   if (!(etaActive_||ptActive_)) descr="_GLOBAL";
00038   // remove blanks which are introduced when adding doubles
00039   descr.ReplaceAll ( " " , "" );
00040   descr.ReplaceAll ( "." , "v" );
00041 
00042   return descr;
00043 }

TString EtaPtBin::getDescriptionString (  )  const [inline]

String describes rapidity/pt range.

Definition at line 24 of file EtaPtBin.h.

References descriptionString.

00024 { return descriptionString ; } 

TString EtaPtBin::getDescriptionString (  )  const [inline]

String describes rapidity/pt range.

Definition at line 24 of file EtaPtBin.h.

References descriptionString.

00024 { return descriptionString ; } 

bool EtaPtBin::getEtaActive (  )  const [inline]

Get rapidity/pt ranges and check whether rapidity/pt cuts are active.

Definition at line 34 of file EtaPtBin.h.

References etaActive.

00034 { return etaActive ; }

bool EtaPtBin::getEtaActive (  )  const [inline]

Get rapidity/pt ranges and check whether rapidity/pt cuts are active.

Definition at line 34 of file EtaPtBin.h.

References etaActive.

Referenced by BTagDifferentialPlot::bookHisto(), and BTagDifferentialPlot::fillHisto().

00034 { return etaActive ; }

double EtaPtBin::getEtaMax (  )  const [inline]

Definition at line 36 of file EtaPtBin.h.

References etaMax.

00036 { return etaMax    ; }

double EtaPtBin::getEtaMax (  )  const [inline]

Definition at line 36 of file EtaPtBin.h.

References etaMax.

Referenced by BTagDifferentialPlot::bookHisto(), and BTagDifferentialPlot::fillHisto().

00036 { return etaMax    ; }

double EtaPtBin::getEtaMin (  )  const [inline]

Definition at line 35 of file EtaPtBin.h.

References etaMin.

00035 { return etaMin    ; }

double EtaPtBin::getEtaMin (  )  const [inline]

Definition at line 35 of file EtaPtBin.h.

References etaMin.

Referenced by BTagDifferentialPlot::bookHisto(), and BTagDifferentialPlot::fillHisto().

00035 { return etaMin    ; }

bool EtaPtBin::getPtActive (  )  const [inline]

Definition at line 38 of file EtaPtBin.h.

References ptActive.

00038 { return ptActive ; }

bool EtaPtBin::getPtActive (  )  const [inline]

Definition at line 38 of file EtaPtBin.h.

References ptActive.

Referenced by BTagDifferentialPlot::bookHisto(), and BTagDifferentialPlot::fillHisto().

00038 { return ptActive ; }

double EtaPtBin::getPtMax (  )  const [inline]

Definition at line 40 of file EtaPtBin.h.

References ptMax.

00040 { return ptMax    ; }

double EtaPtBin::getPtMax (  )  const [inline]

Definition at line 40 of file EtaPtBin.h.

References ptMax.

Referenced by BTagDifferentialPlot::bookHisto(), and BTagDifferentialPlot::fillHisto().

00040 { return ptMax    ; }

double EtaPtBin::getPtMin (  )  const [inline]

Definition at line 39 of file EtaPtBin.h.

References ptMin.

00039 { return ptMin    ; }

double EtaPtBin::getPtMin (  )  const [inline]

Definition at line 39 of file EtaPtBin.h.

References ptMin.

Referenced by BTagDifferentialPlot::bookHisto(), and BTagDifferentialPlot::fillHisto().

00039 { return ptMin    ; }

bool EtaPtBin::inBin ( const reco::Jet jet  )  const

bool EtaPtBin::inBin ( const double &  eta,
const double &  pt 
) const

Check if jet/parton are within rapidity/pt cuts.

bool EtaPtBin::inBin ( const reco::Jet jet  )  const

Definition at line 45 of file EtaPtBin.cc.

References reco::Particle::eta(), inBin(), and reco::Particle::pt().

00046 {
00047   return inBin(jet.eta(), jet.pt());
00048 }

bool EtaPtBin::inBin ( const double &  eta,
const double &  pt 
) const

Check if jet/parton are within rapidity/pt cuts.

Definition at line 57 of file EtaPtBin.cc.

References etaActive, etaMax, etaMin, ptActive, ptMax, and ptMin.

Referenced by inBin().

00057                                                                    {
00058   bool inEta = true;
00059   //
00060   if ( etaActive ) {
00061     if ( fabs(eta) < etaMin ) inEta = false;
00062     if ( fabs(eta) > etaMax ) inEta = false;
00063   }
00064 
00065   bool inPt = true;
00066   //
00067   if ( ptActive ) {
00068     if ( pt < ptMin ) inPt = false;
00069     if ( pt > ptMax ) inEta = false;
00070   }
00071 
00072   return ( inEta && inPt );
00073 }


Member Data Documentation

TString EtaPtBin::descriptionString [private]

Definition at line 62 of file EtaPtBin.h.

Referenced by EtaPtBin(), and getDescriptionString().

bool EtaPtBin::etaActive [private]

Definition at line 52 of file EtaPtBin.h.

Referenced by EtaPtBin(), getEtaActive(), and inBin().

double EtaPtBin::etaMax [private]

Definition at line 54 of file EtaPtBin.h.

Referenced by EtaPtBin(), getEtaMax(), and inBin().

double EtaPtBin::etaMin [private]

Definition at line 53 of file EtaPtBin.h.

Referenced by EtaPtBin(), getEtaMin(), and inBin().

bool EtaPtBin::ptActive [private]

Definition at line 56 of file EtaPtBin.h.

Referenced by EtaPtBin(), getPtActive(), and inBin().

double EtaPtBin::ptMax [private]

Definition at line 58 of file EtaPtBin.h.

Referenced by EtaPtBin(), getPtMax(), and inBin().

double EtaPtBin::ptMin [private]

Definition at line 57 of file EtaPtBin.h.

Referenced by EtaPtBin(), getPtMin(), and inBin().


The documentation for this class was generated from the following files:
Generated on Tue Jun 9 18:20:26 2009 for CMSSW by  doxygen 1.5.4