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 234 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 PFRecoTauDiscriminationAgainstMuon2_cfi::verbosity.

235 {
236  name_ = name;
237 
238  minY_linear_ = ( cfg.exists("minY_linear") ) ? cfg.getParameter<double>("minY_linear") : defaultMinY_linear;
239  minY_log_ = ( cfg.exists("minY_log") ) ? cfg.getParameter<double>("minY_log") : defaultMinY_log;
240  maxY_linear_ = ( cfg.exists("maxY_linear") ) ? cfg.getParameter<double>("maxY_linear") : defaultMaxY_linear;
241  maxY_log_ = ( cfg.exists("maxY_log") ) ? cfg.getParameter<double>("maxY_log") : defaultMaxY_log;
242  yScale_ = ( cfg.exists("yScale") ) ? cfg.getParameter<std::string>("yScale") : defaultYscale;
243  yAxisTitle_ = cfg.getParameter<std::string>("yAxisTitle");
244  yAxisTitleOffset_ = ( cfg.exists("yAxisTitleOffset") ) ? cfg.getParameter<double>("yAxisTitleOffset") : defaultYaxisTitleOffset;
245  yAxisTitleSize_ = ( cfg.exists("yAxisTitleSize") ) ? cfg.getParameter<double>("yAxisTitleSize") : defaultYaxisTitleSize;
246 
247  if ( verbosity ) print();
248 }
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 264 of file DQMHistPlotter.cc.

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

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

References gather_cfg::cout.

251 {
252  std::cout << "<TauDQMHistPlotter::cfgEntryAxisY::print>:" << std::endl;
253  std::cout << " name = " << name_ << std::endl;
254  std::cout << " minY_linear = " << minY_linear_ << std::endl;
255  std::cout << " minY_log = " << minY_log_ << std::endl;
256  std::cout << " maxY_linear = " << maxY_linear_ << std::endl;
257  std::cout << " maxY_log = " << maxY_log_ << std::endl;
258  std::cout << " yScale = " << yScale_ << std::endl;
259  std::cout << " yAxisTitle = " << yAxisTitle_ << std::endl;
260  std::cout << " yAxisTitleOffset = " << yAxisTitleOffset_ << std::endl;
261  std::cout << " yAxisTitleSize = " << yAxisTitleSize_ << std::endl;
262 }
tuple cout
Definition: gather_cfg.py:121
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.