CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Public Attributes
TauDQMHistPlotter::cfgEntryAxisX Struct Reference

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 42 of file DQMHistPlotter.h.

Constructor & Destructor Documentation

TauDQMHistPlotter::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(), AlCaHLTBitMon_QueryRunRegistry::string, and PFRecoTauDiscriminationAgainstMuon2_cfi::verbosity.

195 {
196  name_ = name;
197 
198  minX_ = ( cfg.exists("minX") ) ? cfg.getParameter<double>("minX") : defaultMinX;
199  maxX_ = ( cfg.exists("maxX") ) ? cfg.getParameter<double>("maxX") : defaultMaxX;
200  xAxisTitle_ = cfg.getParameter<std::string>("xAxisTitle");
201  xAxisTitleOffset_ = ( cfg.exists("xAxisTitleOffset") ) ? cfg.getParameter<double>("xAxisTitleOffset") : defaultXaxisTitleOffset;
202  xAxisTitleSize_ = ( cfg.exists("xAxisTitleSize") ) ? cfg.getParameter<double>("xAxisTitleSize") : defaultXaxisTitleSize;
203 
204  if ( verbosity ) print();
205 }
T getParameter(std::string const &) const
bool exists(std::string const &parameterName) const
checks if a parameter exists
const double defaultMinX
const double defaultXaxisTitleSize
const double defaultMaxX
const double defaultXaxisTitleOffset

Member Function Documentation

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

Definition at line 218 of file DQMHistPlotter.cc.

References defaultMaxX, and defaultMinX.

Referenced by TauDQMHistPlotter::endRun().

219 {
220  if ( histogram ) {
221  double xMin = ( minX_ != defaultMinX ) ? minX_ : histogram->GetXaxis()->GetXmin();
222  double xMax = ( maxX_ != defaultMaxX ) ? maxX_ : histogram->GetXaxis()->GetXmax();
223  histogram->SetAxisRange(xMin, xMax, "X");
224  histogram->GetXaxis()->SetTitle(xAxisTitle_.data());
225  histogram->GetXaxis()->SetTitleOffset(xAxisTitleOffset_);
226  histogram->GetXaxis()->SetTitleSize(xAxisTitleSize_);
227  }
228 }
const double defaultMinX
const double defaultMaxX
void TauDQMHistPlotter::cfgEntryAxisX::print ( void  ) const

Definition at line 207 of file DQMHistPlotter.cc.

References gather_cfg::cout.

208 {
209  std::cout << "<TauDQMHistPlotter::cfgEntryAxisX::print>:" << std::endl;
210  std::cout << " name = " << name_ << std::endl;
211  std::cout << " minX_ = " << minX_ << std::endl;
212  std::cout << " maxX_ = " << maxX_ << std::endl;
213  std::cout << " xAxisTitle = " << xAxisTitle_ << std::endl;
214  std::cout << " xAxisTitleOffset = " << xAxisTitleOffset_ << std::endl;
215  std::cout << " xAxisTitleSize = " << xAxisTitleSize_ << std::endl;
216 }
tuple cout
Definition: gather_cfg.py:121

Member Data Documentation

double TauDQMHistPlotter::cfgEntryAxisX::maxX_

Definition at line 49 of file DQMHistPlotter.h.

double TauDQMHistPlotter::cfgEntryAxisX::minX_

Definition at line 48 of file DQMHistPlotter.h.

std::string TauDQMHistPlotter::cfgEntryAxisX::name_

Definition at line 47 of file DQMHistPlotter.h.

std::string TauDQMHistPlotter::cfgEntryAxisX::xAxisTitle_

Definition at line 50 of file DQMHistPlotter.h.

double TauDQMHistPlotter::cfgEntryAxisX::xAxisTitleOffset_

Definition at line 51 of file DQMHistPlotter.h.

double TauDQMHistPlotter::cfgEntryAxisX::xAxisTitleSize_

Definition at line 52 of file DQMHistPlotter.h.