CMS 3D CMS Logo

List of all members | Public Member Functions | Public Attributes
TauDQMHistPlotter::cfgEntryAxisY Struct Reference

Public Member Functions

void applyTo (TH1 *, double norm) const
 
 cfgEntryAxisY (const std::string &, const edm::ParameterSet &)
 
void print () const
 

Public Attributes

double maxY_linear_
 
double maxY_log_
 
double minY_linear_
 
double minY_log_
 
std::string name_
 
std::string yAxisTitle_
 
double yAxisTitleOffset_
 
double yAxisTitleSize_
 
std::string yScale_
 

Detailed Description

Definition at line 55 of file DQMHistPlotter.h.

Constructor & Destructor Documentation

TauDQMHistPlotter::cfgEntryAxisY::cfgEntryAxisY ( const std::string &  name,
const edm::ParameterSet cfg 
)
explicit

Definition at line 228 of file DQMHistPlotter.cc.

References defaultMaxY_linear, defaultMaxY_log, defaultMinY_linear, defaultMinY_log, defaultYaxisTitleOffset, defaultYaxisTitleSize, defaultYscale, edm::ParameterSet::exists(), edm::ParameterSet::getParameter(), dataset::name, TauDQMHistPlotter::cfgEntryProcess::name_, TauDQMHistPlotter::cfgEntryProcess::print(), AlCaHLTBitMon_QueryRunRegistry::string, and verbosity.

229 {
230  name_ = name;
231 
232  minY_linear_ = ( cfg.exists("minY_linear") ) ? cfg.getParameter<double>("minY_linear") : defaultMinY_linear;
233  minY_log_ = ( cfg.exists("minY_log") ) ? cfg.getParameter<double>("minY_log") : defaultMinY_log;
234  maxY_linear_ = ( cfg.exists("maxY_linear") ) ? cfg.getParameter<double>("maxY_linear") : defaultMaxY_linear;
235  maxY_log_ = ( cfg.exists("maxY_log") ) ? cfg.getParameter<double>("maxY_log") : defaultMaxY_log;
236  yScale_ = ( cfg.exists("yScale") ) ? cfg.getParameter<std::string>("yScale") : defaultYscale;
237  yAxisTitle_ = cfg.getParameter<std::string>("yAxisTitle");
238  yAxisTitleOffset_ = ( cfg.exists("yAxisTitleOffset") ) ? cfg.getParameter<double>("yAxisTitleOffset") : defaultYaxisTitleOffset;
239  yAxisTitleSize_ = ( cfg.exists("yAxisTitleSize") ) ? cfg.getParameter<double>("yAxisTitleSize") : defaultYaxisTitleSize;
240 
241  if ( verbosity ) print();
242 }
const double defaultMaxY_log
T getParameter(std::string const &) const
const double defaultMinY_linear
bool exists(std::string const &parameterName) const
checks if a parameter exists
const double defaultMinY_log
const double defaultYaxisTitleOffset
const double defaultYaxisTitleSize
const double defaultMaxY_linear
const std::string defaultYscale
const int verbosity

Member Function Documentation

void TauDQMHistPlotter::cfgEntryAxisY::applyTo ( TH1 *  histogram,
double  norm 
) const

Definition at line 258 of file DQMHistPlotter.cc.

References defaultMaxY_linear, defaultMaxY_log, defaultYaxisMaximumScaleFactor_linear, defaultYaxisMaximumScaleFactor_log, and yScale_log.

259 {
260  if ( histogram ) {
261  bool yLogScale = ( yScale_ == yScale_log ) ? true : false;
262  double minY = ( yLogScale ) ? minY_log_ : minY_linear_;
263  histogram->SetMinimum(minY);
264  double maxY = ( yLogScale ) ? maxY_log_ : maxY_linear_;
265  double defaultMaxY = ( yLogScale ) ? defaultMaxY_log : defaultMaxY_linear;
266  if ( maxY != defaultMaxY ) {
267 //--- normalize y-axis range using given configuration parameter
268  histogram->SetMaximum(maxY);
269  } else {
270 //--- in case configuration parameter for y-axis range not explicitely given,
271 // normalize y-axis range to maximum of any histogram included in drawJob
272 // times defaultYaxisMaximumScaleFactor (apply scale factor in order to make space for legend)
273  double defaultYaxisMaximumScaleFactor = ( yLogScale ) ? defaultYaxisMaximumScaleFactor_log : defaultYaxisMaximumScaleFactor_linear;
274  histogram->SetMaximum(defaultYaxisMaximumScaleFactor*norm);
275  }
276  histogram->GetYaxis()->SetTitle(yAxisTitle_.data());
277  histogram->GetYaxis()->SetTitleOffset(yAxisTitleOffset_);
278  histogram->GetYaxis()->SetTitleSize(yAxisTitleSize_);
279  }
280 }
const double defaultMaxY_log
const std::string yScale_log
const double defaultYaxisMaximumScaleFactor_linear
const double defaultYaxisMaximumScaleFactor_log
const double defaultMaxY_linear
void TauDQMHistPlotter::cfgEntryAxisY::print ( void  ) const

Definition at line 244 of file DQMHistPlotter.cc.

References gather_cfg::cout, and TauDQMHistPlotter::cfgEntryProcess::name_.

245 {
246  std::cout << "<TauDQMHistPlotter::cfgEntryAxisY::print>:" << std::endl;
247  std::cout << " name = " << name_ << std::endl;
248  std::cout << " minY_linear = " << minY_linear_ << std::endl;
249  std::cout << " minY_log = " << minY_log_ << std::endl;
250  std::cout << " maxY_linear = " << maxY_linear_ << std::endl;
251  std::cout << " maxY_log = " << maxY_log_ << std::endl;
252  std::cout << " yScale = " << yScale_ << std::endl;
253  std::cout << " yAxisTitle = " << yAxisTitle_ << std::endl;
254  std::cout << " yAxisTitleOffset = " << yAxisTitleOffset_ << std::endl;
255  std::cout << " yAxisTitleSize = " << yAxisTitleSize_ << std::endl;
256 }

Member Data Documentation

double TauDQMHistPlotter::cfgEntryAxisY::maxY_linear_

Definition at line 63 of file DQMHistPlotter.h.

double TauDQMHistPlotter::cfgEntryAxisY::maxY_log_

Definition at line 64 of file DQMHistPlotter.h.

double TauDQMHistPlotter::cfgEntryAxisY::minY_linear_

Definition at line 61 of file DQMHistPlotter.h.

double TauDQMHistPlotter::cfgEntryAxisY::minY_log_

Definition at line 62 of file DQMHistPlotter.h.

std::string TauDQMHistPlotter::cfgEntryAxisY::name_

Definition at line 60 of file DQMHistPlotter.h.

std::string TauDQMHistPlotter::cfgEntryAxisY::yAxisTitle_

Definition at line 66 of file DQMHistPlotter.h.

double TauDQMHistPlotter::cfgEntryAxisY::yAxisTitleOffset_

Definition at line 67 of file DQMHistPlotter.h.

double TauDQMHistPlotter::cfgEntryAxisY::yAxisTitleSize_

Definition at line 68 of file DQMHistPlotter.h.

std::string TauDQMHistPlotter::cfgEntryAxisY::yScale_

Definition at line 65 of file DQMHistPlotter.h.