CMS 3D CMS Logo

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

#include <ConfigurableHisto.h>

Public Member Functions

 ConfigurableAxis ()
 
 ConfigurableAxis (const edm::ParameterSet &par)
 
const std::string & Label ()
 
double Max ()
 
double Min ()
 
unsigned int nBin ()
 
bool variableSize ()
 
const double * xBins ()
 

Private Attributes

std::string Label_
 
double Max_
 
double Min_
 
unsigned int nBin_
 
std::vector< double > vBins_
 

Detailed Description

Definition at line 16 of file ConfigurableHisto.h.

Constructor & Destructor Documentation

◆ ConfigurableAxis() [1/2]

ConfigurableAxis::ConfigurableAxis ( )
inline

Definition at line 18 of file ConfigurableHisto.h.

18 {}

◆ ConfigurableAxis() [2/2]

ConfigurableAxis::ConfigurableAxis ( const edm::ParameterSet par)
inline

Definition at line 19 of file ConfigurableHisto.h.

References edm::ParameterSet::exists(), edm::ParameterSet::getParameter(), Label_, Max_, Min_, nBin_, AlCaHLTBitMon_QueryRunRegistry::string, and vBins_.

19  : nBin_(0), Min_(0), Max_(0), Label_("") {
20  Label_ = par.getParameter<std::string>("Label");
21 
22  if (par.exists("nBins")) {
23  nBin_ = par.getParameter<unsigned int>("nBins");
24  Min_ = par.getParameter<double>("Min");
25  Max_ = par.getParameter<double>("Max");
26  } else {
27  if (par.exists("vBins"))
28  vBins_ = par.getParameter<std::vector<double> >("vBins");
29  else {
30  Min_ = par.getParameter<double>("Min");
31  Max_ = par.getParameter<double>("Max");
32  }
33  }
34  }
T getParameter(std::string const &) const
Definition: ParameterSet.h:307
std::vector< double > vBins_
bool exists(std::string const &parameterName) const
checks if a parameter exists
unsigned int nBin_

Member Function Documentation

◆ Label()

const std::string& ConfigurableAxis::Label ( )
inline

Definition at line 54 of file ConfigurableHisto.h.

References Label_.

54 { return Label_; }

◆ Max()

double ConfigurableAxis::Max ( )
inline

Definition at line 48 of file ConfigurableHisto.h.

References Max_, variableSize(), and vBins_.

48  {
49  if (variableSize())
50  return vBins_.back();
51  else
52  return Max_;
53  }
std::vector< double > vBins_

◆ Min()

double ConfigurableAxis::Min ( )
inline

Definition at line 42 of file ConfigurableHisto.h.

References Min_, variableSize(), and vBins_.

42  {
43  if (variableSize())
44  return vBins_.front();
45  else
46  return Min_;
47  }
std::vector< double > vBins_

◆ nBin()

unsigned int ConfigurableAxis::nBin ( )
inline

Definition at line 36 of file ConfigurableHisto.h.

References nBin_, variableSize(), and vBins_.

36  {
37  if (variableSize())
38  return vBins_.size() - 1;
39  else
40  return nBin_;
41  }
std::vector< double > vBins_
unsigned int nBin_

◆ variableSize()

bool ConfigurableAxis::variableSize ( )
inline

Definition at line 35 of file ConfigurableHisto.h.

References vBins_.

Referenced by Max(), Min(), and nBin().

35 { return !vBins_.empty(); }
std::vector< double > vBins_

◆ xBins()

const double* ConfigurableAxis::xBins ( )
inline

Definition at line 55 of file ConfigurableHisto.h.

References vBins_.

55  {
56  if (!vBins_.empty())
57  return &(vBins_.front());
58  else
59  return nullptr;
60  }
std::vector< double > vBins_

Member Data Documentation

◆ Label_

std::string ConfigurableAxis::Label_
private

Definition at line 67 of file ConfigurableHisto.h.

Referenced by ConfigurableAxis(), and Label().

◆ Max_

double ConfigurableAxis::Max_
private

Definition at line 66 of file ConfigurableHisto.h.

Referenced by ConfigurableAxis(), and Max().

◆ Min_

double ConfigurableAxis::Min_
private

Definition at line 65 of file ConfigurableHisto.h.

Referenced by ConfigurableAxis(), and Min().

◆ nBin_

unsigned int ConfigurableAxis::nBin_
private

Definition at line 64 of file ConfigurableHisto.h.

Referenced by ConfigurableAxis(), and nBin().

◆ vBins_

std::vector<double> ConfigurableAxis::vBins_
private

Definition at line 63 of file ConfigurableHisto.h.

Referenced by ConfigurableAxis(), Max(), Min(), nBin(), variableSize(), and xBins().