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

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

Detailed Description

Definition at line 91 of file NanoAODDQM.cc.

Constructor & Destructor Documentation

◆ Plot1D()

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

Definition at line 93 of file NanoAODDQM.cc.

94  : Plot(booker.book1D(cfg.getParameter<std::string>("name"),
95  cfg.getParameter<std::string>("title"),
96  cfg.getParameter<uint32_t>("nbins"),
97  cfg.getParameter<double>("min"),
98  cfg.getParameter<double>("max"))),
99  col_(cfg.getParameter<std::string>("column")),
100  bitset_(cfg.getParameter<bool>("bitset")) {}
std::string col_
Definition: NanoAODDQM.cc:137
Plot(MonitorElement *me)
Definition: NanoAODDQM.cc:69
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 101 of file NanoAODDQM.cc.

101 {}

Member Function Documentation

◆ fill()

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

Implements NanoAODDQM::Plot.

Definition at line 102 of file NanoAODDQM.cc.

References nanoaod::FlatTable::Bool, col_, nanoaod::FlatTable::Double, Exception, nanoaod::FlatTable::Float, nanoaod::FlatTable::Int16, nanoaod::FlatTable::Int32, TableParser::table, nanoaod::FlatTable::UInt16, nanoaod::FlatTable::UInt32, and nanoaod::FlatTable::UInt8.

102  {
103  int icol = table.columnIndex(col_);
104  if (icol == -1)
105  return; // columns may be missing (e.g. mc-only)
106  switch (table.columnType(icol)) {
108  vfill<uint8_t>(table, icol, rowsel);
109  break;
111  vfill<int16_t>(table, icol, rowsel);
112  break;
114  vfill<uint16_t>(table, icol, rowsel);
115  break;
117  vfill<int32_t>(table, icol, rowsel);
118  break;
120  vfill<uint32_t>(table, icol, rowsel);
121  break;
123  vfill<bool>(table, icol, rowsel);
124  break;
126  vfill<float>(table, icol, rowsel);
127  break;
129  vfill<double>(table, icol, rowsel);
130  break;
131  default:
132  throw cms::Exception("LogicError", "Unsupported type");
133  }
134  }
std::string col_
Definition: NanoAODDQM.cc:137

◆ vfill()

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

Definition at line 140 of file NanoAODDQM.cc.

References b, b1, bitset_, ALPAKA_ACCELERATOR_NAMESPACE::brokenline::constexpr(), data, dqm::impl::MonitorElement::Fill(), mps_fire::i, dqmiodumpmetadata::n, NanoAODDQM::Plot::plot_, TableParser::table, heppy_batch::val, and relativeConstraints::value.

140  {
141  const auto &data = table.columnData<T>(icol);
142  for (unsigned int i = 0, n = data.size(); i < n; ++i) {
143  if (rowsel[i]) {
144  const T val = data[i];
146  if (bitset_) {
147  for (unsigned int b = 0; b < std::numeric_limits<T>::digits; b++) {
148  if ((val >> b) & 0b1)
149  plot_->Fill(b);
150  }
151  } else {
152  plot_->Fill(val);
153  }
154  } else {
155  plot_->Fill(val);
156  }
157  }
158  }
159  }
void Fill(long long x)
double b
Definition: hdecay.h:120
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:80
long double T
MonitorElement * plot_
Definition: NanoAODDQM.cc:75
static constexpr float b1

Member Data Documentation

◆ bitset_

bool NanoAODDQM::Plot1D::bitset_
protected

Definition at line 138 of file NanoAODDQM.cc.

Referenced by vfill().

◆ col_

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

Definition at line 137 of file NanoAODDQM.cc.

Referenced by fill().