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

Constructor & Destructor Documentation

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

Definition at line 101 of file NanoAODDQM.cc.

101  :
102  Plot(booker.bookProfile(cfg.getParameter<std::string>("name"), cfg.getParameter<std::string>("title"),
103  cfg.getParameter<uint32_t>("nbins"), cfg.getParameter<double>("min"), cfg.getParameter<double>("max"),
104  0., 0., "")),
105  ycol_(cfg.getParameter<std::string>("ycolumn")), xcol_(cfg.getParameter<std::string>("xcolumn"))
106  {
107  }
T getParameter(std::string const &) const
MonitorElement * bookProfile(Args &&...args)
Definition: DQMStore.h:113
Plot(MonitorElement *me)
Definition: NanoAODDQM.cc:52
NanoAODDQM::Profile1D::~Profile1D ( )
inlineoverride

Definition at line 108 of file NanoAODDQM.cc.

108 {}

Member Function Documentation

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

Implements NanoAODDQM::Plot.

Definition at line 109 of file NanoAODDQM.cc.

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

109  {
110  int icolx = table.columnIndex(xcol_);
111  int icoly = table.columnIndex(ycol_);
112  if (icolx == -1) throw cms::Exception("LogicError", "Missing "+xcol_);
113  if (icoly == -1) throw cms::Exception("LogicError", "Missing "+ycol_);
114  for (unsigned int irow = 0, n = table.size(); irow < n; ++irow) {
115  if (rowsel[irow]) plot_->Fill(table.getAnyValue(irow,icolx), table.getAnyValue(irow,icoly));
116  }
117  }
void Fill(long long x)
MonitorElement * plot_
Definition: NanoAODDQM.cc:57

Member Data Documentation

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

Definition at line 119 of file NanoAODDQM.cc.

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

Definition at line 119 of file NanoAODDQM.cc.