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 231 of file DQMHistPlotter.cc.

References looper::cfg, mergeVDriftHistosByStation::name, print(), AlCaHLTBitMon_QueryRunRegistry::string, and verbosity.

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

Member Function Documentation

◆ applyTo()

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

Definition at line 261 of file DQMHistPlotter.cc.

References HGVHistoProducerAlgoBlock_cfi::maxY, and HGVHistoProducerAlgoBlock_cfi::minY.

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

◆ print()

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

Definition at line 248 of file DQMHistPlotter.cc.

References gather_cfg::cout.

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

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.