3 template <
typename Col>
7 std::vector<NamedBranchPtr> &branches) {
8 for (
const auto &
col : tabcols) {
9 auto *
br = tree.Branch(
col.name.c_str(), (
void *)
nullptr, (
col.name +
"/" + rootType).c_str());
10 br->SetTitle(
col.doc.c_str());
11 branches.emplace_back(
col.name,
br);
15 template <
typename Col>
19 std::vector<NamedVectorBranchPtr> &branches) {
20 for (
const auto &
col : tabcols) {
21 auto *cbr = tree.Branch((
"n" +
col.name).c_str(), (
void *)
nullptr, (
"n" +
col.name +
"/i").c_str());
22 auto *vbr = tree.Branch(
col.name.c_str(), (
void *)
nullptr, (
col.name +
"[n" +
col.name +
"]/" + rootType).c_str());
23 cbr->SetTitle((
"Number of entries in " +
col.name).c_str());
24 vbr->SetTitle(
col.doc.c_str());
25 branches.emplace_back(
col.name, cbr, vbr);
29 template <
typename Col>
31 std::vector<NamedBranchPtr> &branches) {
32 if (tabcols.size() != branches.size())
34 for (
unsigned int i = 0,
n = tabcols.size();
i <
n; ++
i) {
37 branches[
i].branch->SetAddress(const_cast<typename Col::value_type *>(&tabcols[
i].
value));
41 template <
typename Col>
43 std::vector<NamedVectorBranchPtr> &branches) {
44 if (tabcols.size() != branches.size())
46 for (
unsigned int i = 0,
n = tabcols.size();
i <
n; ++
i) {
49 branches[
i].count = tabcols[
i].values.size();
50 branches[
i].branch->SetAddress(const_cast<typename Col::element_type *>(&tabcols[
i].
values.front()));
62 vbp.counterBranch->SetAddress(&vbp.count);
64 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)