CMS 3D CMS Logo

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

Public Member Functions

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

Protected Member Functions

template<typename T >
void vfill (const FlatTable &table, int icol, const std::vector< bool > &rowsel)
 

Protected Attributes

std::string col_
 
- Protected Attributes inherited from NanoAODDQM::Plot
MonitorElementplot_
 

Detailed Description

Definition at line 73 of file NanoAODDQM.cc.

Constructor & Destructor Documentation

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

Definition at line 75 of file NanoAODDQM.cc.

76  : Plot(booker.book1D(cfg.getParameter<std::string>("name"),
77  cfg.getParameter<std::string>("title"),
78  cfg.getParameter<uint32_t>("nbins"),
79  cfg.getParameter<double>("min"),
80  cfg.getParameter<double>("max"))),
81  col_(cfg.getParameter<std::string>("column")) {}
T getParameter(std::string const &) const
std::string col_
Definition: NanoAODDQM.cc:104
Plot(MonitorElement *me)
Definition: NanoAODDQM.cc:51
NanoAODDQM::Plot1D::~Plot1D ( )
inlineoverride

Definition at line 82 of file NanoAODDQM.cc.

82 {}

Member Function Documentation

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

Implements NanoAODDQM::Plot.

Definition at line 83 of file NanoAODDQM.cc.

References nanoaod::FlatTable::BoolColumn, nanoaod::FlatTable::columnIndex(), nanoaod::FlatTable::columnType(), nanoaod::FlatTable::FloatColumn, nanoaod::FlatTable::IntColumn, TableParser::table, and nanoaod::FlatTable::UInt8Column.

83  {
84  int icol = table.columnIndex(col_);
85  if (icol == -1)
86  return; // columns may be missing (e.g. mc-only)
87  switch (table.columnType(icol)) {
89  vfill<float>(table, icol, rowsel);
90  break;
92  vfill<int>(table, icol, rowsel);
93  break;
95  vfill<uint8_t>(table, icol, rowsel);
96  break;
98  vfill<uint8_t>(table, icol, rowsel);
99  break;
100  }
101  }
std::string col_
Definition: NanoAODDQM.cc:104
template<typename T >
void NanoAODDQM::Plot1D::vfill ( const FlatTable table,
int  icol,
const std::vector< bool > &  rowsel 
)
inlineprotected

Definition at line 106 of file NanoAODDQM.cc.

References nanoaod::FlatTable::columnData(), data, dqm::impl::MonitorElement::Fill(), mps_fire::i, dqmiodumpmetadata::n, and NanoAODDQM::Plot::plot_.

106  {
107  const auto &data = table.columnData<T>(icol);
108  for (unsigned int i = 0, n = data.size(); i < n; ++i) {
109  if (rowsel[i])
110  plot_->Fill(data[i]);
111  }
112  }
void Fill(long long x)
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:79
long double T
MonitorElement * plot_
Definition: NanoAODDQM.cc:57

Member Data Documentation

std::string NanoAODDQM::Plot1D::col_
protected

Definition at line 104 of file NanoAODDQM.cc.