6 for (
const auto &
col : tabcols) {
7 auto *
br = tree.Branch(
col.name.c_str(), (
void*)
nullptr, (
col.name+
"/"+rootType).c_str());
8 br->SetTitle(
col.doc.c_str());
9 branches.emplace_back(
col.name,
br);
13 template<
typename Col>
16 for (
const auto &
col : tabcols) {
17 auto * cbr = tree.Branch((
"n"+
col.name).c_str(), (
void*)
nullptr, (
"n"+
col.name+
"/i").c_str());
18 auto * vbr = tree.Branch(
col.name.c_str(), (
void*)
nullptr, (
col.name+
"[n"+
col.name+
"]/"+rootType).c_str());
19 cbr->SetTitle((
"Number of entries in "+
col.name).c_str());
20 vbr->SetTitle(
col.doc.c_str());
21 branches.emplace_back(
col.name, cbr, vbr);
25 template<
typename Col>
28 if (tabcols.size() != branches.size())
throw cms::Exception(
"LogicError",
"Mismatch in table columns");
29 for (
unsigned int i = 0,
n = tabcols.size();
i <
n; ++
i) {
31 branches[
i].branch->SetAddress( const_cast<typename Col::value_type *>(& tabcols[
i].
value) );
35 template<
typename Col>
38 if (tabcols.size() != branches.size())
throw cms::Exception(
"LogicError",
"Mismatch in table columns");
39 for (
unsigned int i = 0,
n = tabcols.size();
i <
n; ++
i) {
41 branches[
i].count = tabcols[
i].values.size();
42 branches[
i].branch->SetAddress( const_cast<typename Col::element_type *>(& tabcols[
i].
values.front()) );
57 for (
auto & vbp :
m_vintBranches) vbp.counterBranch->SetAddress( & vbp.count );
58 for (
auto & vbp :
m_vfloatBranches) vbp.counterBranch->SetAddress( & vbp.count );
void makeVectorBranches(const std::vector< Col > &tabcols, TTree &tree, const std::string &rootType, std::vector< NamedVectorBranchPtr > &branches)
const std::vector< VIntColumn > & vintCols() const
BasicHandle getByToken(EDGetToken token, TypeID const &typeID) const
void fillVectorBranches(const std::vector< Col > &tabcols, std::vector< NamedVectorBranchPtr > &branches)
std::vector< NamedVectorBranchPtr > m_vintBranches
const std::vector< IntColumn > & intCols() const
void makeScalarBranches(const std::vector< Col > &tabcols, TTree &tree, const std::string &rootType, std::vector< NamedBranchPtr > &branches)
const std::vector< FloatColumn > & floatCols() const
void defineBranchesFromFirstEvent(const nanoaod::MergeableCounterTable &tab, TTree &tree)
void fillScalarBranches(const std::vector< Col > &tabcols, std::vector< NamedBranchPtr > &branches)
std::vector< NamedVectorBranchPtr > m_vfloatBranches
const std::vector< VFloatColumn > & vfloatCols() const
std::vector< NamedBranchPtr > m_intBranches
std::vector< NamedBranchPtr > m_floatBranches
void fill(const edm::OccurrenceForOutput &iWhatever, TTree &tree)