CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Attributes
ConfigurableAxis Class Reference

#include <ConfigurableHisto.h>

Public Member Functions

 ConfigurableAxis ()
 
 ConfigurableAxis (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 17 of file ConfigurableHisto.h.

Constructor & Destructor Documentation

ConfigurableAxis::ConfigurableAxis ( )
inline

Definition at line 19 of file ConfigurableHisto.h.

19 {}
ConfigurableAxis::ConfigurableAxis ( edm::ParameterSet  par)
inline

Definition at line 20 of file ConfigurableHisto.h.

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

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

Member Function Documentation

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

Definition at line 41 of file ConfigurableHisto.h.

References Label_.

41 { return Label_;}
double ConfigurableAxis::Max ( )
inline

Definition at line 40 of file ConfigurableHisto.h.

References Max_, variableSize(), and vBins_.

Referenced by ConfigurableHisto::book().

40 {if (variableSize()) return vBins_.back(); else return Max_;}
std::vector< double > vBins_
double ConfigurableAxis::Min ( )
inline

Definition at line 39 of file ConfigurableHisto.h.

References Min_, variableSize(), and vBins_.

Referenced by ConfigurableHisto::book().

39 {if (variableSize()) return vBins_.front(); else return Min_;}
std::vector< double > vBins_
unsigned int ConfigurableAxis::nBin ( )
inline

Definition at line 38 of file ConfigurableHisto.h.

References nBin_, variableSize(), and vBins_.

Referenced by ConfigurableHisto::book().

38 {if (variableSize()) return vBins_.size()-1;else return nBin_;}
std::vector< double > vBins_
unsigned int nBin_
bool ConfigurableAxis::variableSize ( )
inline

Definition at line 37 of file ConfigurableHisto.h.

References vBins_.

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

37 {return vBins_.size()!=0;}
std::vector< double > vBins_
const double* ConfigurableAxis::xBins ( )
inline

Definition at line 42 of file ConfigurableHisto.h.

References vBins_.

Referenced by ConfigurableHisto::book().

42 { if (vBins_.size()!=0) return &(vBins_.front()); else return 0;}
std::vector< double > vBins_

Member Data Documentation

std::string ConfigurableAxis::Label_
private

Definition at line 49 of file ConfigurableHisto.h.

Referenced by ConfigurableAxis(), and Label().

double ConfigurableAxis::Max_
private

Definition at line 48 of file ConfigurableHisto.h.

Referenced by ConfigurableAxis(), and Max().

double ConfigurableAxis::Min_
private

Definition at line 47 of file ConfigurableHisto.h.

Referenced by ConfigurableAxis(), and Min().

unsigned int ConfigurableAxis::nBin_
private

Definition at line 46 of file ConfigurableHisto.h.

Referenced by ConfigurableAxis(), and nBin().

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

Definition at line 45 of file ConfigurableHisto.h.

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