CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
HistDefinition Class Reference

#include <HistDefinition.h>

Detailed Description

Description: Class for parsing histogram definitions from a ParameterSet of ParameterSets defined in the python configuration. Acceptable parameters are all public members of the HistDefinition class.

Python configuration example: https://github.com/cms-sw/cmssw/blob/master/DQMOffline/L1Trigger/python/L1THistDefinitions_cff.py

Usage in CMSSW module PlotConfig enum, PlotConfigNames map: https://github.com/cms-sw/cmssw/blob/master/DQMOffline/L1Trigger/interface/L1TEGammaOffline.h

enum PlotConfig { nVertex };

static const std::map<std::string, unsigned int> PlotConfigNames;

https://github.com/cms-sw/cmssw/blob/master/DQMOffline/L1Trigger/src/L1TEGammaOffline.cc

const std::map<std::string, unsigned int> L1TEGammaOffline::PlotConfigNames = { {"nVertex", PlotConfig::nVertex} }; Read from ParameterSet in module constructor: histDefinitions_(dqmoffline::l1t::readHistDefinitions(ps.getParameterSet("histDefinitions"), PlotConfigNames)),

Use to create a histogram: dqmoffline::l1t::HistDefinition nVertexDef = histDefinitions_[PlotConfig::nVertex]; h_nVertex_ = ibooker.book1D( nVertexDef.name, nVertexDef.title, nVertexDef.nbinsX, nVertexDef.xmin, nVertexDef.xmax );

Author
: Luke Kreczko - krecz.nosp@m.ko@c.nosp@m.ern.c.nosp@m.h