CMS 3D CMS Logo

List of all members | Public Member Functions | Private Member Functions | Static Private Member Functions | Private Attributes
SummaryTableOutputFields Class Reference

#include <SummaryTableOutputFields.h>

Public Member Functions

void fill (const nanoaod::MergeableCounterTable &tab)
 
 SummaryTableOutputFields ()=default
 
 SummaryTableOutputFields (const nanoaod::MergeableCounterTable &tab, RNTupleModel &model)
 

Private Member Functions

template<typename T , typename Col >
std::vector< RNTupleFieldPtr< T > > makeFields (const std::vector< Col > &tabcols, RNTupleModel &model)
 

Static Private Member Functions

template<typename T , typename Col >
static void fillScalarFields (const std::vector< Col > &tabcols, std::vector< RNTupleFieldPtr< T >> fields)
 
template<typename T , typename Col >
static void fillVectorFields (const std::vector< Col > &tabcols, std::vector< RNTupleFieldPtr< T >> fields)
 

Private Attributes

std::vector< RNTupleFieldPtr< double > > m_floatFields
 
std::vector< RNTupleFieldPtr< double > > m_floatWithNormFields
 
std::vector< RNTupleFieldPtr< std::uint64_t > > m_intFields
 
std::vector< RNTupleFieldPtr< std::vector< double > > > m_vfloatFields
 
std::vector< RNTupleFieldPtr< std::vector< double > > > m_vfloatWithNormFields
 
std::vector< RNTupleFieldPtr< std::vector< std::uint64_t > > > m_vintFields
 

Detailed Description

Definition at line 8 of file SummaryTableOutputFields.h.

Constructor & Destructor Documentation

◆ SummaryTableOutputFields() [1/2]

SummaryTableOutputFields::SummaryTableOutputFields ( )
default

◆ SummaryTableOutputFields() [2/2]

SummaryTableOutputFields::SummaryTableOutputFields ( const nanoaod::MergeableCounterTable tab,
RNTupleModel &  model 
)

Definition at line 47 of file SummaryTableOutputFields.cc.

References nanoaod::MergeableCounterTable::floatCols(), nanoaod::MergeableCounterTable::floatWithNormCols(), nanoaod::MergeableCounterTable::intCols(), m_floatFields, m_floatWithNormFields, m_intFields, m_vfloatFields, m_vfloatWithNormFields, m_vintFields, isotrackApplyRegressor::model, nanoaod::MergeableCounterTable::vfloatCols(), nanoaod::MergeableCounterTable::vfloatWithNormCols(), and nanoaod::MergeableCounterTable::vintCols().

47  {
48  // TODO use std::int64_t when supported
49  m_intFields = makeFields<std::uint64_t>(tab.intCols(), model);
50  m_floatFields = makeFields<double>(tab.floatCols(), model);
51  m_floatWithNormFields = makeFields<double>(tab.floatWithNormCols(), model);
52  m_vintFields = makeFields<std::vector<std::uint64_t>>(tab.vintCols(), model);
53  m_vfloatFields = makeFields<std::vector<double>>(tab.vfloatCols(), model);
54  m_vfloatWithNormFields = makeFields<std::vector<double>>(tab.vfloatWithNormCols(), model);
55 }
std::vector< RNTupleFieldPtr< std::uint64_t > > m_intFields
const std::vector< VFloatColumn > & vfloatCols() const
std::vector< RNTupleFieldPtr< std::vector< double > > > m_vfloatWithNormFields
const std::vector< FloatWithNormColumn > & floatWithNormCols() const
const std::vector< IntColumn > & intCols() const
const std::vector< VFloatWithNormColumn > & vfloatWithNormCols() const
std::vector< RNTupleFieldPtr< std::vector< double > > > m_vfloatFields
std::vector< RNTupleFieldPtr< double > > m_floatWithNormFields
const std::vector< FloatColumn > & floatCols() const
std::vector< RNTupleFieldPtr< double > > m_floatFields
std::vector< RNTupleFieldPtr< std::vector< std::uint64_t > > > m_vintFields
const std::vector< VIntColumn > & vintCols() const

Member Function Documentation

◆ fill()

void SummaryTableOutputFields::fill ( const nanoaod::MergeableCounterTable tab)

Definition at line 57 of file SummaryTableOutputFields.cc.

References fillScalarFields(), fillVectorFields(), nanoaod::MergeableCounterTable::floatCols(), nanoaod::MergeableCounterTable::floatWithNormCols(), nanoaod::MergeableCounterTable::intCols(), m_floatFields, m_floatWithNormFields, m_intFields, m_vfloatFields, m_vfloatWithNormFields, m_vintFields, nanoaod::MergeableCounterTable::vfloatCols(), nanoaod::MergeableCounterTable::vfloatWithNormCols(), and nanoaod::MergeableCounterTable::vintCols().

57  {
64 }
std::vector< RNTupleFieldPtr< std::uint64_t > > m_intFields
const std::vector< VFloatColumn > & vfloatCols() const
std::vector< RNTupleFieldPtr< std::vector< double > > > m_vfloatWithNormFields
const std::vector< FloatWithNormColumn > & floatWithNormCols() const
const std::vector< IntColumn > & intCols() const
const std::vector< VFloatWithNormColumn > & vfloatWithNormCols() const
std::vector< RNTupleFieldPtr< std::vector< double > > > m_vfloatFields
std::vector< RNTupleFieldPtr< double > > m_floatWithNormFields
const std::vector< FloatColumn > & floatCols() const
std::vector< RNTupleFieldPtr< double > > m_floatFields
std::vector< RNTupleFieldPtr< std::vector< std::uint64_t > > > m_vintFields
const std::vector< VIntColumn > & vintCols() const
static void fillVectorFields(const std::vector< Col > &tabcols, std::vector< RNTupleFieldPtr< T >> fields)
static void fillScalarFields(const std::vector< Col > &tabcols, std::vector< RNTupleFieldPtr< T >> fields)

◆ fillScalarFields()

template<typename T , typename Col >
void SummaryTableOutputFields::fillScalarFields ( const std::vector< Col > &  tabcols,
std::vector< RNTupleFieldPtr< T >>  fields 
)
staticprivate

Definition at line 16 of file SummaryTableOutputFields.cc.

References Exception, l1GtPatternGenerator_cfi::fields, mps_fire::i, and mergeVDriftHistosByStation::name.

Referenced by fill().

17  {
18  if (tabcols.size() != fields.size()) {
19  throw cms::Exception("LogicError", "Mismatch in table columns");
20  }
21  for (std::size_t i = 0; i < tabcols.size(); ++i) {
22  if (tabcols[i].name != fields[i].getFieldName()) {
23  throw cms::Exception("LogicError", "Mismatch in table columns");
24  }
25  fields[i].fill(tabcols[i].value);
26  }
27 }
Definition: value.py:1

◆ fillVectorFields()

template<typename T , typename Col >
void SummaryTableOutputFields::fillVectorFields ( const std::vector< Col > &  tabcols,
std::vector< RNTupleFieldPtr< T >>  fields 
)
staticprivate

Definition at line 30 of file SummaryTableOutputFields.cc.

References data, Exception, l1GtPatternGenerator_cfi::fields, mps_fire::i, and mergeVDriftHistosByStation::name.

Referenced by fill().

31  {
32  if (tabcols.size() != fields.size()) {
33  throw cms::Exception("LogicError", "Mismatch in table columns");
34  }
35  for (std::size_t i = 0; i < tabcols.size(); ++i) {
36  if (tabcols[i].name != fields[i].getFieldName()) {
37  throw cms::Exception("LogicError", "Mismatch in table columns");
38  }
39  auto data = tabcols[i].values;
40  // TODO remove this awful hack when std::int64_t is supported
41  // -- turns std::vector<int64_t> into std::vector<uint64_t>
42  T casted_data(data.begin(), data.end());
43  fields[i].fill(casted_data);
44  }
45 }
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:80
long double T

◆ makeFields()

template<typename T , typename Col >
std::vector< RNTupleFieldPtr< T > > SummaryTableOutputFields::makeFields ( const std::vector< Col > &  tabcols,
RNTupleModel &  model 
)
private

Definition at line 4 of file SummaryTableOutputFields.cc.

References cuy::col, l1GtPatternGenerator_cfi::fields, and isotrackApplyRegressor::model.

5  {
6  std::vector<RNTupleFieldPtr<T>> fields;
7  fields.reserve(tabcols.size());
8  for (const auto &col : tabcols) {
9  // TODO field description
10  fields.emplace_back(RNTupleFieldPtr<T>(col.name, col.doc, model));
11  }
12  return fields;
13 }
col
Definition: cuy.py:1009

Member Data Documentation

◆ m_floatFields

std::vector<RNTupleFieldPtr<double> > SummaryTableOutputFields::m_floatFields
private

Definition at line 23 of file SummaryTableOutputFields.h.

Referenced by fill(), and SummaryTableOutputFields().

◆ m_floatWithNormFields

std::vector<RNTupleFieldPtr<double> > SummaryTableOutputFields::m_floatWithNormFields
private

Definition at line 24 of file SummaryTableOutputFields.h.

Referenced by fill(), and SummaryTableOutputFields().

◆ m_intFields

std::vector<RNTupleFieldPtr<std::uint64_t> > SummaryTableOutputFields::m_intFields
private

Definition at line 22 of file SummaryTableOutputFields.h.

Referenced by fill(), and SummaryTableOutputFields().

◆ m_vfloatFields

std::vector<RNTupleFieldPtr<std::vector<double> > > SummaryTableOutputFields::m_vfloatFields
private

Definition at line 25 of file SummaryTableOutputFields.h.

Referenced by fill(), and SummaryTableOutputFields().

◆ m_vfloatWithNormFields

std::vector<RNTupleFieldPtr<std::vector<double> > > SummaryTableOutputFields::m_vfloatWithNormFields
private

Definition at line 26 of file SummaryTableOutputFields.h.

Referenced by fill(), and SummaryTableOutputFields().

◆ m_vintFields

std::vector<RNTupleFieldPtr<std::vector<std::uint64_t> > > SummaryTableOutputFields::m_vintFields
private

Definition at line 27 of file SummaryTableOutputFields.h.

Referenced by fill(), and SummaryTableOutputFields().