CMS 3D CMS Logo

Public Member Functions | Public Attributes

DQMHistPlotter::cfgEntryAxisX Struct Reference

List of all members.

Public Member Functions

void applyTo (TH1 *) const
 cfgEntryAxisX (const std::string &, const edm::ParameterSet &)
void print () const

Public Attributes

double maxX_
double minX_
std::string name_
std::string xAxisTitle_
double xAxisTitleOffset_
double xAxisTitleSize_

Detailed Description

Definition at line 44 of file DQMHistPlotter.h.


Constructor & Destructor Documentation

DQMHistPlotter::cfgEntryAxisX::cfgEntryAxisX ( const std::string &  name,
const edm::ParameterSet cfg 
) [explicit]

Definition at line 194 of file DQMHistPlotter.cc.

References defaultMaxX, defaultMinX, defaultXaxisTitleOffset, defaultXaxisTitleSize, edm::ParameterSet::exists(), edm::ParameterSet::getParameter(), mergeVDriftHistosByStation::name, reco::print(), and verbosity.

{
  name_ = name;

  minX_ = ( cfg.exists("minX") ) ? cfg.getParameter<double>("minX") : defaultMinX;
  maxX_ = ( cfg.exists("maxX") ) ? cfg.getParameter<double>("maxX") : defaultMaxX;
  xAxisTitle_ = cfg.getParameter<std::string>("xAxisTitle");
  xAxisTitleOffset_ = ( cfg.exists("xAxisTitleOffset") ) ? cfg.getParameter<double>("xAxisTitleOffset") : defaultXaxisTitleOffset;
  xAxisTitleSize_ = ( cfg.exists("xAxisTitleSize") ) ? cfg.getParameter<double>("xAxisTitleSize") : defaultXaxisTitleSize;

  if ( verbosity ) print();
}

Member Function Documentation

void DQMHistPlotter::cfgEntryAxisX::applyTo ( TH1 *  histogram) const

Definition at line 218 of file DQMHistPlotter.cc.

References defaultMaxX, and defaultMinX.

Referenced by DQMHistPlotter::endJob().

{
  if ( histogram ) {
    double xMin = ( minX_ != defaultMinX ) ? minX_ : histogram->GetXaxis()->GetXmin();
    double xMax = ( maxX_ != defaultMaxX ) ? maxX_ : histogram->GetXaxis()->GetXmax();
    histogram->SetAxisRange(xMin, xMax, "X");
    histogram->GetXaxis()->SetTitle(xAxisTitle_.data());
    histogram->GetXaxis()->SetTitleOffset(xAxisTitleOffset_);
    histogram->GetXaxis()->SetTitleSize(xAxisTitleSize_);
  }
}
void DQMHistPlotter::cfgEntryAxisX::print ( void  ) const

Definition at line 207 of file DQMHistPlotter.cc.

References gather_cfg::cout.

{
  std::cout << "<DQMHistPlotter::cfgEntryAxisX::print>:" << std::endl;
  std::cout << " name = " << name_ << std::endl;
  std::cout << " minX_ = " << minX_ << std::endl;
  std::cout << " maxX_ = " << maxX_ << std::endl;
  std::cout << " xAxisTitle = " << xAxisTitle_ << std::endl;
  std::cout << " xAxisTitleOffset = " << xAxisTitleOffset_ << std::endl;
  std::cout << " xAxisTitleSize = " << xAxisTitleSize_ << std::endl;
}

Member Data Documentation

Definition at line 51 of file DQMHistPlotter.h.

Definition at line 50 of file DQMHistPlotter.h.

Definition at line 49 of file DQMHistPlotter.h.

Definition at line 52 of file DQMHistPlotter.h.

Definition at line 53 of file DQMHistPlotter.h.

Definition at line 54 of file DQMHistPlotter.h.