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

◆ cfgEntryAxisY()

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

Definition at line 230 of file DQMHistPlotter.cc.

References looper::cfg, defaultMaxY_linear, defaultMaxY_log, defaultMinY_linear, defaultMinY_log, defaultYaxisTitleOffset, defaultYaxisTitleSize, defaultYscale, Skims_PA_cff::name, print(), AlCaHLTBitMon_QueryRunRegistry::string, and verbosity.

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

Member Function Documentation

◆ applyTo()

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

Definition at line 260 of file DQMHistPlotter.cc.

References defaultMaxY_linear, defaultMaxY_log, defaultYaxisMaximumScaleFactor_linear, defaultYaxisMaximumScaleFactor_log, HGVHistoProducerAlgoBlock_cfi::maxY, HGVHistoProducerAlgoBlock_cfi::minY, and yScale_log.

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

◆ print()

void TauDQMHistPlotter::cfgEntryAxisY::print ( void  ) const

Definition at line 247 of file DQMHistPlotter.cc.

References gather_cfg::cout.

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

Member Data Documentation

◆ maxY_linear_

double TauDQMHistPlotter::cfgEntryAxisY::maxY_linear_

Definition at line 62 of file DQMHistPlotter.h.

◆ maxY_log_

double TauDQMHistPlotter::cfgEntryAxisY::maxY_log_

Definition at line 63 of file DQMHistPlotter.h.

◆ minY_linear_

double TauDQMHistPlotter::cfgEntryAxisY::minY_linear_

Definition at line 60 of file DQMHistPlotter.h.

◆ minY_log_

double TauDQMHistPlotter::cfgEntryAxisY::minY_log_

Definition at line 61 of file DQMHistPlotter.h.

◆ name_

std::string TauDQMHistPlotter::cfgEntryAxisY::name_

Definition at line 59 of file DQMHistPlotter.h.

◆ yAxisTitle_

std::string TauDQMHistPlotter::cfgEntryAxisY::yAxisTitle_

Definition at line 65 of file DQMHistPlotter.h.

◆ yAxisTitleOffset_

double TauDQMHistPlotter::cfgEntryAxisY::yAxisTitleOffset_

Definition at line 66 of file DQMHistPlotter.h.

◆ yAxisTitleSize_

double TauDQMHistPlotter::cfgEntryAxisY::yAxisTitleSize_

Definition at line 67 of file DQMHistPlotter.h.

◆ yScale_

std::string TauDQMHistPlotter::cfgEntryAxisY::yScale_

Definition at line 64 of file DQMHistPlotter.h.