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.

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  }

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

Member Function Documentation

◆ Label()

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

Definition at line 54 of file ConfigurableHisto.h.

54 { return Label_; }

References Label_.

◆ Max()

double ConfigurableAxis::Max ( )
inline

Definition at line 48 of file ConfigurableHisto.h.

48  {
49  if (variableSize())
50  return vBins_.back();
51  else
52  return Max_;
53  }

References Max_, variableSize(), and vBins_.

◆ Min()

double ConfigurableAxis::Min ( )
inline

Definition at line 42 of file ConfigurableHisto.h.

42  {
43  if (variableSize())
44  return vBins_.front();
45  else
46  return Min_;
47  }

References Min_, variableSize(), and vBins_.

◆ nBin()

unsigned int ConfigurableAxis::nBin ( )
inline

Definition at line 36 of file ConfigurableHisto.h.

36  {
37  if (variableSize())
38  return vBins_.size() - 1;
39  else
40  return nBin_;
41  }

References nBin_, variableSize(), and vBins_.

◆ variableSize()

bool ConfigurableAxis::variableSize ( )
inline

Definition at line 35 of file ConfigurableHisto.h.

35 { return !vBins_.empty(); }

References vBins_.

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

◆ xBins()

const double* ConfigurableAxis::xBins ( )
inline

Definition at line 55 of file ConfigurableHisto.h.

55  {
56  if (!vBins_.empty())
57  return &(vBins_.front());
58  else
59  return nullptr;
60  }

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

ConfigurableAxis::variableSize
bool variableSize()
Definition: ConfigurableHisto.h:35
ConfigurableAxis::nBin_
unsigned int nBin_
Definition: ConfigurableHisto.h:64
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
ConfigurableAxis::vBins_
std::vector< double > vBins_
Definition: ConfigurableHisto.h:63
edm::ParameterSet::exists
bool exists(std::string const &parameterName) const
checks if a parameter exists
Definition: ParameterSet.cc:674
ConfigurableAxis::Label_
std::string Label_
Definition: ConfigurableHisto.h:67
ConfigurableAxis::Min_
double Min_
Definition: ConfigurableHisto.h:65
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
ConfigurableAxis::Max_
double Max_
Definition: ConfigurableHisto.h:66