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.

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 }

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

Member Function Documentation

◆ applyTo()

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

Definition at line 260 of file DQMHistPlotter.cc.

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 }

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

Referenced by TauDQMHistPlotter::endRun().

◆ print()

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

Definition at line 247 of file DQMHistPlotter.cc.

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 }

References gather_cfg::cout.

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.

Referenced by TauDQMHistPlotter::endRun().

defaultYscale
const std::string defaultYscale
Definition: DQMHistPlotter.cc:41
defaultYaxisMaximumScaleFactor_log
const double defaultYaxisMaximumScaleFactor_log
Definition: DQMHistPlotter.cc:45
gather_cfg.cout
cout
Definition: gather_cfg.py:144
TauDQMHistPlotter::cfgEntryAxisY::name_
std::string name_
Definition: DQMHistPlotter.h:59
verbosity
const int verbosity
Definition: DQMHistPlotter.cc:90
defaultMinY_linear
const double defaultMinY_linear
Definition: DQMHistPlotter.cc:35
defaultMaxY_linear
const double defaultMaxY_linear
Definition: DQMHistPlotter.cc:37
TauDQMHistPlotter::cfgEntryAxisY::minY_linear_
double minY_linear_
Definition: DQMHistPlotter.h:60
TauDQMHistPlotter::cfgEntryAxisY::yAxisTitleSize_
double yAxisTitleSize_
Definition: DQMHistPlotter.h:67
defaultYaxisTitleSize
const double defaultYaxisTitleSize
Definition: DQMHistPlotter.cc:43
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
defaultYaxisTitleOffset
const double defaultYaxisTitleOffset
Definition: DQMHistPlotter.cc:42
TauDQMHistPlotter::cfgEntryAxisY::yScale_
std::string yScale_
Definition: DQMHistPlotter.h:64
defaultMaxY_log
const double defaultMaxY_log
Definition: DQMHistPlotter.cc:38
HGVHistoProducerAlgoBlock_cfi.minY
minY
Definition: HGVHistoProducerAlgoBlock_cfi.py:158
defaultMinY_log
const double defaultMinY_log
Definition: DQMHistPlotter.cc:36
TauDQMHistPlotter::cfgEntryAxisY::yAxisTitleOffset_
double yAxisTitleOffset_
Definition: DQMHistPlotter.h:66
TauDQMHistPlotter::cfgEntryAxisY::yAxisTitle_
std::string yAxisTitle_
Definition: DQMHistPlotter.h:65
looper.cfg
cfg
Definition: looper.py:297
TauDQMHistPlotter::cfgEntryAxisY::minY_log_
double minY_log_
Definition: DQMHistPlotter.h:61
HGVHistoProducerAlgoBlock_cfi.maxY
maxY
Definition: HGVHistoProducerAlgoBlock_cfi.py:159
Skims_PA_cff.name
name
Definition: Skims_PA_cff.py:17
defaultYaxisMaximumScaleFactor_linear
const double defaultYaxisMaximumScaleFactor_linear
Definition: DQMHistPlotter.cc:44
TauDQMHistPlotter::cfgEntryAxisY::print
void print() const
Definition: DQMHistPlotter.cc:247
yScale_log
const std::string yScale_log
Definition: DQMHistPlotter.cc:40
TauDQMHistPlotter::cfgEntryAxisY::maxY_linear_
double maxY_linear_
Definition: DQMHistPlotter.h:62
TauDQMHistPlotter::cfgEntryAxisY::maxY_log_
double maxY_log_
Definition: DQMHistPlotter.h:63