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.

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

12  : etaActive(etaActive_), etaMin(etaMin_), etaMax(etaMax_), ptActive(ptActive_), ptMin(ptMin_), ptMax(ptMax_) {
14 }
double ptMin
Definition: EtaPtBin.h:60
std::string descriptionString
Definition: EtaPtBin.h:64
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
double etaMax
Definition: EtaPtBin.h:57
double etaMin
Definition: EtaPtBin.h:56
bool ptActive
Definition: EtaPtBin.h:59
bool etaActive
Definition: EtaPtBin.h:55
double ptMax
Definition: EtaPtBin.h:61

◆ ~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.

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

Referenced by EtaPtBin().

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 }
def replace(string, replacements)
uint32_t T const *__restrict__ uint32_t const *__restrict__ int32_t int Histo::index_type cudaStream_t stream
def remove(d, key, TELL=False)
Definition: MatrixUtil.py:234

◆ getDescriptionString()

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

String describes rapidity/pt range.

Definition at line 27 of file EtaPtBin.h.

References descriptionString.

27 { return descriptionString; }
std::string descriptionString
Definition: EtaPtBin.h:64

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

References etaActive.

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

39 { return etaActive; }
bool etaActive
Definition: EtaPtBin.h:55

◆ getEtaMax()

double EtaPtBin::getEtaMax ( ) const
inline

◆ getEtaMin()

double EtaPtBin::getEtaMin ( ) const
inline

Definition at line 40 of file EtaPtBin.h.

References etaMin.

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

40 { return etaMin; }
double etaMin
Definition: EtaPtBin.h:56

◆ getPtActive()

bool EtaPtBin::getPtActive ( ) const
inline

Definition at line 43 of file EtaPtBin.h.

References ptActive.

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

43 { return ptActive; }
bool ptActive
Definition: EtaPtBin.h:59

◆ getPtMax()

double EtaPtBin::getPtMax ( ) const
inline

Definition at line 45 of file EtaPtBin.h.

References ptMax.

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

45 { return ptMax; }
double ptMax
Definition: EtaPtBin.h:61

◆ getPtMin()

double EtaPtBin::getPtMin ( ) const
inline

Definition at line 44 of file EtaPtBin.h.

References ptMin.

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

44 { return ptMin; }
double ptMin
Definition: EtaPtBin.h:60

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

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

Referenced by inBin().

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 }
double ptMin
Definition: EtaPtBin.h:60
double etaMax
Definition: EtaPtBin.h:57
double etaMin
Definition: EtaPtBin.h:56
bool ptActive
Definition: EtaPtBin.h:59
bool etaActive
Definition: EtaPtBin.h:55
double ptMax
Definition: EtaPtBin.h:61

◆ inBin() [2/2]

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

Definition at line 43 of file EtaPtBin.cc.

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

43 { return inBin(jet.eta(), jet.pt() * jec); }
bool inBin(const double &eta, const double &pt) const
Check if jet/parton are within rapidity/pt cuts.
Definition: EtaPtBin.cc:51

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