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

Constructor & Destructor Documentation

◆ Plot1D()

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

Definition at line 82 of file NanoAODDQM.cc.

83  : Plot(booker.book1D(cfg.getParameter<std::string>("name"),
84  cfg.getParameter<std::string>("title"),
85  cfg.getParameter<uint32_t>("nbins"),
86  cfg.getParameter<double>("min"),
87  cfg.getParameter<double>("max"))),
88  col_(cfg.getParameter<std::string>("column")) {}
std::string col_
Definition: NanoAODDQM.cc:116
Plot(MonitorElement *me)
Definition: NanoAODDQM.cc:58
MonitorElement * book1D(TString const &name, TString const &title, int const nchX, double const lowX, double const highX, FUNC onbooking=NOOP())
Definition: DQMStore.h:98

◆ ~Plot1D()

NanoAODDQM::Plot1D::~Plot1D ( )
inlineoverride

Definition at line 89 of file NanoAODDQM.cc.

89 {}

Member Function Documentation

◆ fill()

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

Implements NanoAODDQM::Plot.

Definition at line 90 of file NanoAODDQM.cc.

References nanoaod::FlatTable::Bool, col_, Exception, nanoaod::FlatTable::Float, nanoaod::FlatTable::Int, nanoaod::FlatTable::Int8, TableParser::table, and nanoaod::FlatTable::UInt8.

90  {
91  int icol = table.columnIndex(col_);
92  if (icol == -1)
93  return; // columns may be missing (e.g. mc-only)
94  switch (table.columnType(icol)) {
96  vfill<float>(table, icol, rowsel);
97  break;
99  vfill<int>(table, icol, rowsel);
100  break;
102  vfill<int8_t>(table, icol, rowsel);
103  break;
105  vfill<uint8_t>(table, icol, rowsel);
106  break;
108  vfill<bool>(table, icol, rowsel);
109  break;
110  default:
111  throw cms::Exception("LogicError", "Unsupported type");
112  }
113  }
std::string col_
Definition: NanoAODDQM.cc:116

◆ vfill()

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

Definition at line 118 of file NanoAODDQM.cc.

References data, dqm::impl::MonitorElement::Fill(), mps_fire::i, dqmiodumpmetadata::n, NanoAODDQM::Plot::plot_, and TableParser::table.

118  {
119  const auto &data = table.columnData<T>(icol);
120  for (unsigned int i = 0, n = data.size(); i < n; ++i) {
121  if (rowsel[i])
122  plot_->Fill(data[i]);
123  }
124  }
void Fill(long long x)
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:79
long double T
MonitorElement * plot_
Definition: NanoAODDQM.cc:64

Member Data Documentation

◆ col_

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

Definition at line 116 of file NanoAODDQM.cc.

Referenced by fill().