CMS 3D CMS Logo

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

Public Member Functions

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

Static Public Member Functions

static void setNorm (double yAxisNorm)
 

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_
 

Static Public Attributes

static double yAxisNorm_ = 0.
 

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

References defaultMaxY_linear, defaultMaxY_log, defaultMinY_linear, defaultMinY_log, defaultYaxisTitleOffset, defaultYaxisTitleSize, defaultYscale, edm::ParameterSet::exists(), edm::ParameterSet::getParameter(), mergeVDriftHistosByStation::name, reco::print(), AlCaHLTBitMon_QueryRunRegistry::string, and HLT_25ns10e33_v2_cff::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");
240  yAxisTitleOffset_ = ( cfg.exists("yAxisTitleOffset") ) ? cfg.getParameter<double>("yAxisTitleOffset") : defaultYaxisTitleOffset;
241  yAxisTitleSize_ = ( cfg.exists("yAxisTitleSize") ) ? cfg.getParameter<double>("yAxisTitleSize") : defaultYaxisTitleSize;
242 
243  if ( verbosity ) print();
244 }
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

Member Function Documentation

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

Definition at line 260 of file DQMHistPlotter.cc.

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

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 = ( yLogScale ) ? defaultYaxisMaximumScaleFactor_log : defaultYaxisMaximumScaleFactor_linear;
276  histogram->SetMaximum(defaultYaxisMaximumScaleFactor*yAxisNorm_);
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
void TauDQMHistPlotter::cfgEntryAxisY::print ( void  ) const

Definition at line 246 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 }
tuple cout
Definition: gather_cfg.py:145
static void TauDQMHistPlotter::cfgEntryAxisY::setNorm ( double  yAxisNorm)
inlinestatic

Definition at line 59 of file DQMHistPlotter.h.

References yAxisNorm_.

Referenced by TauDQMHistPlotter::endRun().

59 { yAxisNorm_ = yAxisNorm; }

Member Data Documentation

double TauDQMHistPlotter::cfgEntryAxisY::maxY_linear_

Definition at line 64 of file DQMHistPlotter.h.

double TauDQMHistPlotter::cfgEntryAxisY::maxY_log_

Definition at line 65 of file DQMHistPlotter.h.

double TauDQMHistPlotter::cfgEntryAxisY::minY_linear_

Definition at line 62 of file DQMHistPlotter.h.

double TauDQMHistPlotter::cfgEntryAxisY::minY_log_

Definition at line 63 of file DQMHistPlotter.h.

std::string TauDQMHistPlotter::cfgEntryAxisY::name_

Definition at line 61 of file DQMHistPlotter.h.

double TauDQMHistPlotter::cfgEntryAxisY::yAxisNorm_ = 0.
static

Definition at line 70 of file DQMHistPlotter.h.

Referenced by setNorm().

std::string TauDQMHistPlotter::cfgEntryAxisY::yAxisTitle_

Definition at line 67 of file DQMHistPlotter.h.

double TauDQMHistPlotter::cfgEntryAxisY::yAxisTitleOffset_

Definition at line 68 of file DQMHistPlotter.h.

double TauDQMHistPlotter::cfgEntryAxisY::yAxisTitleSize_

Definition at line 69 of file DQMHistPlotter.h.

std::string TauDQMHistPlotter::cfgEntryAxisY::yScale_

Definition at line 66 of file DQMHistPlotter.h.