CMS 3D CMS Logo

List of all members | Public Member Functions | Static Public Member Functions | Private Attributes
EtaPtBin Class Reference

#include <EtaPtBin.h>

Public Member Functions

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

Static Public Member Functions

static std::string buildDescriptionString (const bool &etaActive_, const double &etaMin_, const double &etaMax_, const bool &ptActive_, const double &ptMin_, const double &ptMax_)
 

Private Attributes

std::string descriptionString
 
bool etaActive
 
double etaMax
 
double etaMin
 
bool ptActive
 
double ptMax
 
double ptMin
 

Detailed Description

Decide if jet/parton lie within desired abs(pseudo-rapidity)/pt range.

Definition at line 15 of file EtaPtBin.h.

Constructor & Destructor Documentation

◆ EtaPtBin()

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

Definition at line 6 of file EtaPtBin.cc.

12  : etaActive(etaActive_), etaMin(etaMin_), etaMax(etaMax_), ptActive(ptActive_), ptMin(ptMin_), ptMax(ptMax_) {
14 }

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

◆ ~EtaPtBin()

EtaPtBin::~EtaPtBin ( )
inline

Definition at line 24 of file EtaPtBin.h.

24 {};

Member Function Documentation

◆ buildDescriptionString()

std::string EtaPtBin::buildDescriptionString ( const bool &  etaActive_,
const double &  etaMin_,
const double &  etaMax_,
const bool &  ptActive_,
const double &  ptMin_,
const double &  ptMax_ 
)
static

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

Definition at line 16 of file EtaPtBin.cc.

21  {
22  // create string only from the active parts
23  std::stringstream stream("");
24 
25  if (etaActive_) {
26  stream << "_ETA_" << etaMin_ << "-" << etaMax_;
27  }
28 
29  if (ptActive_) {
30  stream << "_PT_" << ptMin_ << "-" << ptMax_;
31  }
32  if (!(etaActive_ || ptActive_))
33  stream << "_GLOBAL";
34 
35  std::string descr(stream.str());
36  // remove blanks which are introduced when adding doubles
37  std::remove(descr.begin(), descr.end(), ' ');
38  std::replace(descr.begin(), descr.end(), '.', 'v');
39 
40  return descr;
41 }

References MatrixUtil::remove(), python.rootplot.root2matplotlib::replace(), cms::cuda::stream, and AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by EtaPtBin().

◆ getDescriptionString()

std::string EtaPtBin::getDescriptionString ( ) const
inline

String describes rapidity/pt range.

Definition at line 27 of file EtaPtBin.h.

27 { return descriptionString; }

References descriptionString.

◆ getEtaActive()

bool EtaPtBin::getEtaActive ( ) const
inline

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

Definition at line 39 of file EtaPtBin.h.

39 { return etaActive; }

References etaActive.

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

◆ getEtaMax()

double EtaPtBin::getEtaMax ( ) const
inline

◆ getEtaMin()

double EtaPtBin::getEtaMin ( ) const
inline

Definition at line 40 of file EtaPtBin.h.

40 { return etaMin; }

References etaMin.

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

◆ getPtActive()

bool EtaPtBin::getPtActive ( ) const
inline

Definition at line 43 of file EtaPtBin.h.

43 { return ptActive; }

References ptActive.

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

◆ getPtMax()

double EtaPtBin::getPtMax ( ) const
inline

Definition at line 45 of file EtaPtBin.h.

45 { return ptMax; }

References ptMax.

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

◆ getPtMin()

double EtaPtBin::getPtMin ( ) const
inline

Definition at line 44 of file EtaPtBin.h.

44 { return ptMin; }

References ptMin.

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

◆ inBin() [1/2]

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

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

Definition at line 51 of file EtaPtBin.cc.

51  {
52  if (etaActive) {
53  if (fabs(eta) < etaMin)
54  return false;
55  if (fabs(eta) > etaMax)
56  return false;
57  }
58 
59  if (ptActive) {
60  if (pt < ptMin)
61  return false;
62  if (pt > ptMax)
63  return false;
64  }
65 
66  return true;
67 }

References PVValHelper::eta, etaActive, etaMax, etaMin, DiDispStaMuonMonitor_cfi::pt, ptActive, ptMax, and ptMin.

Referenced by inBin().

◆ inBin() [2/2]

bool EtaPtBin::inBin ( const reco::Jet jet,
const double  jec 
) const

Definition at line 43 of file EtaPtBin.cc.

43 { return inBin(jet.eta(), jet.pt() * jec); }

References inBin(), jetMETDQMOfflineSource_cff::jec, and metsig::jet.

Member Data Documentation

◆ descriptionString

std::string EtaPtBin::descriptionString
private

Definition at line 64 of file EtaPtBin.h.

Referenced by EtaPtBin(), and getDescriptionString().

◆ etaActive

bool EtaPtBin::etaActive
private

Definition at line 55 of file EtaPtBin.h.

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

◆ etaMax

double EtaPtBin::etaMax
private

Definition at line 57 of file EtaPtBin.h.

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

◆ etaMin

double EtaPtBin::etaMin
private

Definition at line 56 of file EtaPtBin.h.

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

◆ ptActive

bool EtaPtBin::ptActive
private

Definition at line 59 of file EtaPtBin.h.

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

◆ ptMax

double EtaPtBin::ptMax
private

Definition at line 61 of file EtaPtBin.h.

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

◆ ptMin

double EtaPtBin::ptMin
private

Definition at line 60 of file EtaPtBin.h.

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

EtaPtBin::etaMax
double etaMax
Definition: EtaPtBin.h:57
EtaPtBin::etaActive
bool etaActive
Definition: EtaPtBin.h:55
EtaPtBin::inBin
bool inBin(const double &eta, const double &pt) const
Check if jet/parton are within rapidity/pt cuts.
Definition: EtaPtBin.cc:51
DiDispStaMuonMonitor_cfi.pt
pt
Definition: DiDispStaMuonMonitor_cfi.py:39
EtaPtBin::ptMax
double ptMax
Definition: EtaPtBin.h:61
cms::cuda::stream
cudaStream_t stream
Definition: HistoContainer.h:57
PVValHelper::eta
Definition: PVValidationHelpers.h:69
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
EtaPtBin::etaMin
double etaMin
Definition: EtaPtBin.h:56
EtaPtBin::ptMin
double ptMin
Definition: EtaPtBin.h:60
EtaPtBin::buildDescriptionString
static std::string buildDescriptionString(const bool &etaActive_, const double &etaMin_, const double &etaMax_, const bool &ptActive_, const double &ptMin_, const double &ptMax_)
Definition: EtaPtBin.cc:16
EtaPtBin::ptActive
bool ptActive
Definition: EtaPtBin.h:59
metsig::jet
Definition: SignAlgoResolutions.h:47
MatrixUtil.remove
def remove(d, key, TELL=False)
Definition: MatrixUtil.py:212
EtaPtBin::descriptionString
std::string descriptionString
Definition: EtaPtBin.h:64
jetMETDQMOfflineSource_cff.jec
jec
Definition: jetMETDQMOfflineSource_cff.py:27
python.rootplot.root2matplotlib.replace
def replace(string, replacements)
Definition: root2matplotlib.py:444