CMS 3D CMS Logo

List of all members | Public Member Functions | Protected Attributes
NanoAODDQM::Profile1D Class Reference
Inheritance diagram for NanoAODDQM::Profile1D:
NanoAODDQM::Plot

Public Member Functions

void fill (const FlatTable &table, const std::vector< bool > &rowsel) override
 
 Profile1D (DQMStore::IBooker &booker, const edm::ParameterSet &cfg)
 
 ~Profile1D () override
 
- Public Member Functions inherited from NanoAODDQM::Plot
const std::string & name () const
 
 Plot (MonitorElement *me)
 
virtual ~Plot ()
 

Protected Attributes

std::string xcol_
 
std::string ycol_
 
- Protected Attributes inherited from NanoAODDQM::Plot
MonitorElementplot_
 

Detailed Description

Definition at line 114 of file NanoAODDQM.cc.

Constructor & Destructor Documentation

NanoAODDQM::Profile1D::Profile1D ( DQMStore::IBooker booker,
const edm::ParameterSet cfg 
)
inline

Definition at line 116 of file NanoAODDQM.cc.

117  : Plot(booker.bookProfile(cfg.getParameter<std::string>("name"),
118  cfg.getParameter<std::string>("title"),
119  cfg.getParameter<uint32_t>("nbins"),
120  cfg.getParameter<double>("min"),
121  cfg.getParameter<double>("max"),
122  0.,
123  0.,
124  "")),
125  ycol_(cfg.getParameter<std::string>("ycolumn")),
126  xcol_(cfg.getParameter<std::string>("xcolumn")) {}
T getParameter(std::string const &) const
Plot(MonitorElement *me)
Definition: NanoAODDQM.cc:51
NanoAODDQM::Profile1D::~Profile1D ( )
inlineoverride

Definition at line 127 of file NanoAODDQM.cc.

127 {}

Member Function Documentation

void NanoAODDQM::Profile1D::fill ( const FlatTable table,
const std::vector< bool > &  rowsel 
)
inlineoverridevirtual

Implements NanoAODDQM::Plot.

Definition at line 128 of file NanoAODDQM.cc.

References nanoaod::FlatTable::columnIndex(), Exception, dqm::impl::MonitorElement::Fill(), nanoaod::FlatTable::getAnyValue(), dqmiodumpmetadata::n, NanoAODDQM::Plot::plot_, and nanoaod::FlatTable::size().

128  {
129  int icolx = table.columnIndex(xcol_);
130  int icoly = table.columnIndex(ycol_);
131  if (icolx == -1)
132  throw cms::Exception("LogicError", "Missing " + xcol_);
133  if (icoly == -1)
134  throw cms::Exception("LogicError", "Missing " + ycol_);
135  for (unsigned int irow = 0, n = table.size(); irow < n; ++irow) {
136  if (rowsel[irow])
137  plot_->Fill(table.getAnyValue(irow, icolx), table.getAnyValue(irow, icoly));
138  }
139  }
void Fill(long long x)
MonitorElement * plot_
Definition: NanoAODDQM.cc:57

Member Data Documentation

std::string NanoAODDQM::Profile1D::xcol_
protected

Definition at line 142 of file NanoAODDQM.cc.

std::string NanoAODDQM::Profile1D::ycol_
protected

Definition at line 142 of file NanoAODDQM.cc.