CMS 3D CMS Logo

ConfigurableAxis Class Reference

#include <PhysicsTools/UtilAlgos/interface/ConfigurableHisto.h>

List of all members.

Public Member Functions

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

Private Attributes

std::string Label_
double Max_
double Min_
uint 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.

00019 {}

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

00020                                         :
00021     nBin_(0),Min_(0),Max_(0),Label_(""){
00022     Label_=par.getParameter<std::string>("Label");
00023 
00024     if (par.exists("nBins")){
00025       nBin_=par.getParameter<uint>("nBins");
00026       Min_=par.getParameter<double>("Min");
00027       Max_=par.getParameter<double>("Max");
00028     }else{
00029       if (par.exists("vBins"))
00030         vBins_=par.getParameter<std::vector<double> >("vBins");
00031       else{
00032         Min_=par.getParameter<double>("Min");
00033         Max_=par.getParameter<double>("Max");
00034       }
00035     }
00036   }
  bool variableSize(){return vBins_.size()!=0;}


Member Function Documentation

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

Definition at line 41 of file ConfigurableHisto.h.

References Label_.

00041 { return Label_;}

double ConfigurableAxis::Max (  )  [inline]

Definition at line 40 of file ConfigurableHisto.h.

References Max_, variableSize(), and vBins_.

Referenced by ConfigurableHisto::book().

00040 {if (variableSize()) return vBins_.back(); else return Max_;}

double ConfigurableAxis::Min (  )  [inline]

Definition at line 39 of file ConfigurableHisto.h.

References Min_, variableSize(), and vBins_.

Referenced by ConfigurableHisto::book().

00039 {if (variableSize()) return vBins_.front(); else return Min_;}

uint ConfigurableAxis::nBin (  )  [inline]

Definition at line 38 of file ConfigurableHisto.h.

References nBin_, variableSize(), and vBins_.

Referenced by ConfigurableHisto::book().

00038 {if (variableSize()) return vBins_.size()-1;else return nBin_;}

bool ConfigurableAxis::variableSize (  )  [inline]

Definition at line 37 of file ConfigurableHisto.h.

References vBins_.

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

00037 {return vBins_.size()!=0;}

const double* ConfigurableAxis::xBins (  )  [inline]

Definition at line 42 of file ConfigurableHisto.h.

References vBins_.

Referenced by ConfigurableHisto::book().

00042 { if (vBins_.size()!=0) return &(vBins_.front()); else return 0;}


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

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


The documentation for this class was generated from the following file:
Generated on Tue Jun 9 18:16:44 2009 for CMSSW by  doxygen 1.5.4