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

Constructor & Destructor Documentation

◆ Plot1D()

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

Definition at line 76 of file NanoAODDQM.cc.

77  : Plot(booker.book1D(cfg.getParameter<std::string>("name"),
78  cfg.getParameter<std::string>("title"),
79  cfg.getParameter<uint32_t>("nbins"),
80  cfg.getParameter<double>("min"),
81  cfg.getParameter<double>("max"))),
82  col_(cfg.getParameter<std::string>("column")) {}
std::string col_
Definition: NanoAODDQM.cc:110
Plot(MonitorElement *me)
Definition: NanoAODDQM.cc:52
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 83 of file NanoAODDQM.cc.

83 {}

Member Function Documentation

◆ fill()

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

Implements NanoAODDQM::Plot.

Definition at line 84 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.

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

◆ vfill()

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

Definition at line 112 of file NanoAODDQM.cc.

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

112  {
113  const auto &data = table.columnData<T>(icol);
114  for (unsigned int i = 0, n = data.size(); i < n; ++i) {
115  if (rowsel[i])
116  plot_->Fill(data[i]);
117  }
118  }
void Fill(long long x)
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:79
long double T
MonitorElement * plot_
Definition: NanoAODDQM.cc:58

Member Data Documentation

◆ col_

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

Definition at line 110 of file NanoAODDQM.cc.

Referenced by fill().