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

Constructor & Destructor Documentation

◆ Plot1D()

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

Definition at line 74 of file NanoAODDQM.cc.

75  : Plot(booker.book1D(cfg.getParameter<std::string>("name"),
76  cfg.getParameter<std::string>("title"),
77  cfg.getParameter<uint32_t>("nbins"),
78  cfg.getParameter<double>("min"),
79  cfg.getParameter<double>("max"))),
80  col_(cfg.getParameter<std::string>("column")) {}

◆ ~Plot1D()

NanoAODDQM::Plot1D::~Plot1D ( )
inlineoverride

Definition at line 81 of file NanoAODDQM.cc.

81 {}

Member Function Documentation

◆ fill()

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

Implements NanoAODDQM::Plot.

Definition at line 82 of file NanoAODDQM.cc.

82  {
83  int icol = table.columnIndex(col_);
84  if (icol == -1)
85  return; // columns may be missing (e.g. mc-only)
86  switch (table.columnType(icol)) {
88  vfill<float>(table, icol, rowsel);
89  break;
91  vfill<int>(table, icol, rowsel);
92  break;
94  vfill<uint8_t>(table, icol, rowsel);
95  break;
97  vfill<bool>(table, icol, rowsel);
98  break;
99  default:
100  throw cms::Exception("LogicError", "Unsupported type");
101  }
102  }

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

◆ vfill()

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

Definition at line 107 of file NanoAODDQM.cc.

107  {
108  const auto &data = table.columnData<T>(icol);
109  for (unsigned int i = 0, n = data.size(); i < n; ++i) {
110  if (rowsel[i])
111  plot_->Fill(data[i]);
112  }
113  }

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

Member Data Documentation

◆ col_

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

Definition at line 105 of file NanoAODDQM.cc.

Referenced by fill().

nanoaod::FlatTable::ColumnType::Float
mps_fire.i
i
Definition: mps_fire.py:428
dqmiodumpmetadata.n
n
Definition: dqmiodumpmetadata.py:28
NanoAODDQM::Plot::Plot
Plot(MonitorElement *me)
Definition: NanoAODDQM.cc:50
NanoAODDQM::Plot1D::col_
std::string col_
Definition: NanoAODDQM.cc:105
NanoAODDQM::Plot::plot_
MonitorElement * plot_
Definition: NanoAODDQM.cc:56
dqm::impl::MonitorElement::Fill
void Fill(long long x)
Definition: MonitorElement.h:290
nanoaod::FlatTable::ColumnType::UInt8
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
looper.cfg
cfg
Definition: looper.py:297
nanoaod::FlatTable::ColumnType::Int
T
long double T
Definition: Basic3DVectorLD.h:48
Exception
Definition: hltDiff.cc:245
data
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:79
TableParser.table
table
Definition: TableParser.py:111
nanoaod::FlatTable::ColumnType::Bool
dqm::implementation::IBooker::book1D
MonitorElement * book1D(TString const &name, TString const &title, int const nchX, double const lowX, double const highX, FUNC onbooking=NOOP())
Definition: DQMStore.h:98