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 158 of file NanoAODDQM.cc.

Constructor & Destructor Documentation

◆ Profile1D()

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

Definition at line 160 of file NanoAODDQM.cc.

161  : Plot(booker.bookProfile(cfg.getParameter<std::string>("name"),
162  cfg.getParameter<std::string>("title"),
163  cfg.getParameter<uint32_t>("nbins"),
164  cfg.getParameter<double>("min"),
165  cfg.getParameter<double>("max"),
166  0.,
167  0.,
168  "")),
169  ycol_(cfg.getParameter<std::string>("ycolumn")),
170  xcol_(cfg.getParameter<std::string>("xcolumn")) {}
MonitorElement * bookProfile(TString const &name, TString const &title, int nchX, double lowX, double highX, int, double lowY, double highY, char const *option="s", FUNC onbooking=NOOP())
Definition: DQMStore.h:399
Plot(MonitorElement *me)
Definition: NanoAODDQM.cc:62

◆ ~Profile1D()

NanoAODDQM::Profile1D::~Profile1D ( )
inlineoverride

Definition at line 171 of file NanoAODDQM.cc.

171 {}

Member Function Documentation

◆ fill()

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

Implements NanoAODDQM::Plot.

Definition at line 172 of file NanoAODDQM.cc.

References Exception, dqm::impl::MonitorElement::Fill(), dqmiodumpmetadata::n, NanoAODDQM::Plot::plot_, TableParser::table, xcol_, and ycol_.

172  {
173  int icolx = table.columnIndex(xcol_);
174  int icoly = table.columnIndex(ycol_);
175  if (icolx == -1)
176  throw cms::Exception("LogicError", "Missing " + xcol_);
177  if (icoly == -1)
178  throw cms::Exception("LogicError", "Missing " + ycol_);
179  for (unsigned int irow = 0, n = table.size(); irow < n; ++irow) {
180  if (rowsel[irow])
181  plot_->Fill(table.getAnyValue(irow, icolx), table.getAnyValue(irow, icoly));
182  }
183  }
void Fill(long long x)
MonitorElement * plot_
Definition: NanoAODDQM.cc:68

Member Data Documentation

◆ xcol_

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

Definition at line 186 of file NanoAODDQM.cc.

Referenced by fill().

◆ ycol_

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

Definition at line 186 of file NanoAODDQM.cc.

Referenced by fill().