CMS 3D CMS Logo

Public Member Functions | Static Public Member Functions | Public Attributes | Static Public Attributes

DQMHistPlotter::cfgEntryAxisY Struct Reference

List of all members.

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 57 of file DQMHistPlotter.h.


Constructor & Destructor Documentation

DQMHistPlotter::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(), AlCaRecoCosmics_cfg::name, reco::print(), and verbosity.

{
  name_ = name;

  minY_linear_ = ( cfg.exists("minY_linear") ) ? cfg.getParameter<double>("minY_linear") : defaultMinY_linear;
  minY_log_ = ( cfg.exists("minY_log") ) ? cfg.getParameter<double>("minY_log") : defaultMinY_log;
  maxY_linear_ = ( cfg.exists("maxY_linear") ) ? cfg.getParameter<double>("maxY_linear") : defaultMaxY_linear;
  maxY_log_ = ( cfg.exists("maxY_log") ) ? cfg.getParameter<double>("maxY_log") : defaultMaxY_log;
  yScale_ = ( cfg.exists("yScale") ) ? cfg.getParameter<std::string>("yScale") : defaultYscale;
  yAxisTitle_ = cfg.getParameter<std::string>("yAxisTitle");
  yAxisTitleOffset_ = ( cfg.exists("yAxisTitleOffset") ) ? cfg.getParameter<double>("yAxisTitleOffset") : defaultYaxisTitleOffset;
  yAxisTitleSize_ = ( cfg.exists("yAxisTitleSize") ) ? cfg.getParameter<double>("yAxisTitleSize") : defaultYaxisTitleSize;

  if ( verbosity ) print();
}

Member Function Documentation

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

Definition at line 264 of file DQMHistPlotter.cc.

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

{
  if ( histogram ) {
    bool yLogScale = ( yScale_ == yScale_log ) ? true : false;
    double minY = ( yLogScale ) ? minY_log_ : minY_linear_;
    histogram->SetMinimum(minY);
    double maxY = ( yLogScale ) ? maxY_log_ : maxY_linear_;
    double defaultMaxY = ( yLogScale ) ? defaultMaxY_log : defaultMaxY_linear;
    if ( maxY != defaultMaxY ) {
//--- normalize y-axis range using given configuration parameter
      histogram->SetMaximum(maxY);
    } else {
//--- in case configuration parameter for y-axis range not explicitely given,
//    normalize y-axis range to maximum of any histogram included in drawJob
//    times defaultYaxisMaximumScaleFactor (apply scale factor in order to make space for legend)
      double defaultYaxisMaximumScaleFactor = ( yLogScale ) ? defaultYaxisMaximumScaleFactor_log : defaultYaxisMaximumScaleFactor_linear;
      histogram->SetMaximum(defaultYaxisMaximumScaleFactor*yAxisNorm_);
    }
    histogram->GetYaxis()->SetTitle(yAxisTitle_.data());
    histogram->GetYaxis()->SetTitleOffset(yAxisTitleOffset_);
    histogram->GetYaxis()->SetTitleSize(yAxisTitleSize_);
  }
}
void DQMHistPlotter::cfgEntryAxisY::print ( void  ) const

Definition at line 250 of file DQMHistPlotter.cc.

References gather_cfg::cout.

{
  std::cout << "<DQMHistPlotter::cfgEntryAxisY::print>:" << std::endl;
  std::cout << " name = " << name_ << std::endl;
  std::cout << " minY_linear = " << minY_linear_ << std::endl;
  std::cout << " minY_log = " << minY_log_ << std::endl;
  std::cout << " maxY_linear = " << maxY_linear_ << std::endl;
  std::cout << " maxY_log = " << maxY_log_ << std::endl;
  std::cout << " yScale = " << yScale_ << std::endl;
  std::cout << " yAxisTitle = " << yAxisTitle_ << std::endl;
  std::cout << " yAxisTitleOffset = " << yAxisTitleOffset_ << std::endl;
  std::cout << " yAxisTitleSize = " << yAxisTitleSize_ << std::endl;
}
static void DQMHistPlotter::cfgEntryAxisY::setNorm ( double  yAxisNorm) [inline, static]

Definition at line 61 of file DQMHistPlotter.h.

References yAxisNorm_.

Referenced by DQMHistPlotter::endJob().

{ yAxisNorm_ = yAxisNorm; }

Member Data Documentation

Definition at line 66 of file DQMHistPlotter.h.

Definition at line 67 of file DQMHistPlotter.h.

Definition at line 64 of file DQMHistPlotter.h.

Definition at line 65 of file DQMHistPlotter.h.

Definition at line 63 of file DQMHistPlotter.h.

Definition at line 72 of file DQMHistPlotter.h.

Referenced by setNorm().

Definition at line 69 of file DQMHistPlotter.h.

Definition at line 70 of file DQMHistPlotter.h.

Definition at line 71 of file DQMHistPlotter.h.

Definition at line 68 of file DQMHistPlotter.h.