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

Constructor & Destructor Documentation

◆ Plot1D()

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

Definition at line 86 of file NanoAODDQM.cc.

87  : Plot(booker.book1D(cfg.getParameter<std::string>("name"),
88  cfg.getParameter<std::string>("title"),
89  cfg.getParameter<uint32_t>("nbins"),
90  cfg.getParameter<double>("min"),
91  cfg.getParameter<double>("max"))),
92  col_(cfg.getParameter<std::string>("column")),
93  bitset_(cfg.getParameter<bool>("bitset")) {}
std::string col_
Definition: NanoAODDQM.cc:130
Plot(MonitorElement *me)
Definition: NanoAODDQM.cc:62
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 94 of file NanoAODDQM.cc.

94 {}

Member Function Documentation

◆ fill()

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

Implements NanoAODDQM::Plot.

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

95  {
96  int icol = table.columnIndex(col_);
97  if (icol == -1)
98  return; // columns may be missing (e.g. mc-only)
99  switch (table.columnType(icol)) {
101  vfill<uint8_t>(table, icol, rowsel);
102  break;
104  vfill<int16_t>(table, icol, rowsel);
105  break;
107  vfill<uint16_t>(table, icol, rowsel);
108  break;
110  vfill<int32_t>(table, icol, rowsel);
111  break;
113  vfill<uint32_t>(table, icol, rowsel);
114  break;
116  vfill<bool>(table, icol, rowsel);
117  break;
119  vfill<float>(table, icol, rowsel);
120  break;
122  vfill<double>(table, icol, rowsel);
123  break;
124  default:
125  throw cms::Exception("LogicError", "Unsupported type");
126  }
127  }
std::string col_
Definition: NanoAODDQM.cc:130

◆ vfill()

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

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

133  {
134  const auto &data = table.columnData<T>(icol);
135  for (unsigned int i = 0, n = data.size(); i < n; ++i) {
136  if (rowsel[i]) {
137  const T val = data[i];
139  if (bitset_) {
140  for (unsigned int b = 0; b < std::numeric_limits<T>::digits; b++) {
141  if ((val >> b) & 0b1)
142  plot_->Fill(b);
143  }
144  } else {
145  plot_->Fill(val);
146  }
147  } else {
148  plot_->Fill(val);
149  }
150  }
151  }
152  }
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:68
static constexpr float b1

Member Data Documentation

◆ bitset_

bool NanoAODDQM::Plot1D::bitset_
protected

Definition at line 131 of file NanoAODDQM.cc.

Referenced by vfill().

◆ col_

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

Definition at line 130 of file NanoAODDQM.cc.

Referenced by fill().