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

Constructor & Destructor Documentation

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

Definition at line 73 of file NanoAODDQM.cc.

73  :
74  Plot(booker.book1D(cfg.getParameter<std::string>("name"), cfg.getParameter<std::string>("title"), cfg.getParameter<uint32_t>("nbins"), cfg.getParameter<double>("min"), cfg.getParameter<double>("max"))),
75  col_(cfg.getParameter<std::string>("column"))
76  {
77  }
T getParameter(std::string const &) const
std::string col_
Definition: NanoAODDQM.cc:90
MonitorElement * book1D(Args &&...args)
Definition: DQMStore.h:115
Plot(MonitorElement *me)
Definition: NanoAODDQM.cc:52
NanoAODDQM::Plot1D::~Plot1D ( )
inlineoverride

Definition at line 78 of file NanoAODDQM.cc.

78 {}

Member Function Documentation

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

Implements NanoAODDQM::Plot.

Definition at line 79 of file NanoAODDQM.cc.

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

79  {
80  int icol = table.columnIndex(col_);
81  if (icol == -1) return; // columns may be missing (e.g. mc-only)
82  switch(table.columnType(icol)) {
83  case FlatTable::FloatColumn: vfill<float>(table,icol,rowsel); break;
84  case FlatTable::IntColumn: vfill<int>(table,icol,rowsel); break;
85  case FlatTable::UInt8Column: vfill<uint8_t>(table,icol,rowsel); break;
86  case FlatTable::BoolColumn: vfill<uint8_t>(table,icol,rowsel); break;
87  }
88  }
std::string col_
Definition: NanoAODDQM.cc:90
template<typename T >
void NanoAODDQM::Plot1D::vfill ( const FlatTable table,
int  icol,
const std::vector< bool > &  rowsel 
)
inlineprotected

Definition at line 92 of file NanoAODDQM.cc.

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

92  {
93  const auto & data = table.columnData<T>(icol);
94  for (unsigned int i = 0, n = data.size(); i < n; ++i) {
95  if (rowsel[i]) plot_->Fill(data[i]);
96  }
97  }
void Fill(long long x)
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:82
long double T
MonitorElement * plot_
Definition: NanoAODDQM.cc:57

Member Data Documentation

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

Definition at line 90 of file NanoAODDQM.cc.