CMS 3D CMS Logo

List of all members | Classes | Public Member Functions | Public Attributes
TaggingVariablePlotter::VariableConfig Struct Reference

Classes

struct  Plot
 

Public Member Functions

 VariableConfig (const std::string &name, const edm::ParameterSet &pSet, const std::string &category, const std::string &label, unsigned int mc, DQMStore::IBooker &ibook)
 

Public Attributes

std::string label
 
bool logScale
 
double max
 
double min
 
unsigned int nBins
 
std::vector< Plotplots
 
reco::TaggingVariableName var
 

Detailed Description

Definition at line 39 of file TaggingVariablePlotter.h.

Constructor & Destructor Documentation

TaggingVariablePlotter::VariableConfig::VariableConfig ( const std::string &  name,
const edm::ParameterSet pSet,
const std::string &  category,
const std::string &  label,
unsigned int  mc,
DQMStore::IBooker ibook 
)

Definition at line 7 of file TaggingVariablePlotter.cc.

References taus_updatedMVAIds_cff::category, Exception, edm::ParameterSet::exists(), edm::ParameterSet::getParameter(), TaggingVariablePlotter::VariableConfig::Plot::histo, TaggingVariablePlotter::VariableConfig::Plot::index, label, reco::btau::lastTaggingVariable, logScale, max, CaloTowersParam_cfi::mc, min, nBins, plotFactory::plot, plots, reco::TaggingVariableDescription, and var.

9  :
11  nBins(pSet.getParameter<unsigned int>("nBins")),
12  min(pSet.getParameter<double>("min")),
13  max(pSet.getParameter<double>("max"))
14 {
16  throw cms::Exception("Configuration")
17  << "Tagging variable \"" << name
18  << "\" does not exist." << endl;
19 
20  if (pSet.exists("logScale"))
21  logScale = pSet.getParameter<bool>("logScale");
22  else
23  logScale = false;
24 
25  std::vector<unsigned int> indices;
26  if (pSet.exists("indices"))
27  indices = pSet.getParameter< vector<unsigned int> >("indices");
28  else
29  indices.push_back(0);
30 
31  for (const unsigned int iter: indices) {
32  Plot plot;
33  plot.histo = std::make_shared<FlavourHistograms<double>>(
34  name + (iter ? Form("%d", iter) : "")
35  + (category.empty() ? "_" + label
36  : ("_" + category) + "_" + label),
38  false, logScale, true, "b", label,mc,ibook);
39  plot.index = iter;
40  plots.push_back(plot);
41  }
42 }
T getParameter(std::string const &) const
bool exists(std::string const &parameterName) const
checks if a parameter exists
TaggingVariableName getTaggingVariableName(const std::string &name)
const char *const TaggingVariableDescription[]

Member Data Documentation

std::string TaggingVariablePlotter::VariableConfig::label
bool TaggingVariablePlotter::VariableConfig::logScale

Definition at line 47 of file TaggingVariablePlotter.h.

Referenced by VariableConfig().

double TaggingVariablePlotter::VariableConfig::max

Definition at line 46 of file TaggingVariablePlotter.h.

Referenced by VariableConfig().

double TaggingVariablePlotter::VariableConfig::min

Definition at line 46 of file TaggingVariablePlotter.h.

Referenced by VariableConfig().

unsigned int TaggingVariablePlotter::VariableConfig::nBins

Definition at line 45 of file TaggingVariablePlotter.h.

Referenced by VariableConfig().

std::vector<Plot> TaggingVariablePlotter::VariableConfig::plots

Definition at line 54 of file TaggingVariablePlotter.h.

Referenced by VariableConfig().

reco::TaggingVariableName TaggingVariablePlotter::VariableConfig::var

Definition at line 44 of file TaggingVariablePlotter.h.

Referenced by tree.Tree::copyStructure(), and VariableConfig().