3 template <
typename T,
typename Col>
7 std::vector<NamedBranchPtr> &branches) {
8 for (
const auto &
col : tabcols) {
10 return x.name ==
col.name;
11 }) == branches.end()) {
13 auto *
br = tree.Branch(
col.name.c_str(), &backFillValue, (
col.name +
"/" + rootType).c_str());
14 br->SetTitle(
col.doc.c_str());
17 branches.emplace_back(
col.name,
br);
22 template <
typename Col>
26 std::vector<NamedVectorBranchPtr> &branches) {
27 for (
const auto &
col : tabcols) {
29 return x.name ==
col.name;
30 }) == branches.end()) {
31 unsigned int backFillValue = 0;
32 auto *cbr = tree.Branch((
"n" +
col.name).c_str(), &backFillValue, (
"n" +
col.name +
"/i").c_str());
34 tree.Branch(
col.name.c_str(), (
void *)
nullptr, (
col.name +
"[n" +
col.name +
"]/" + rootType).c_str());
35 cbr->SetTitle((
"Number of entries in " +
col.name).c_str());
36 vbr->SetTitle(
col.doc.c_str());
41 branches.emplace_back(
col.name, cbr, vbr);
46 template <
typename Col>
48 std::vector<NamedBranchPtr> &branches) {
49 if (tabcols.size() != branches.size())
51 for (
unsigned int i = 0,
n = tabcols.size();
i <
n; ++
i) {
54 branches[
i].branch->SetAddress(const_cast<typename Col::value_type *>(&tabcols[
i].
value));
58 template <
typename Col>
60 std::vector<NamedVectorBranchPtr> &branches) {
61 if (tabcols.size() != branches.size())
63 for (
unsigned int i = 0,
n = tabcols.size();
i <
n; ++
i) {
66 branches[
i].count = tabcols[
i].values.size();
67 branches[
i].branch->SetAddress(const_cast<typename Col::element_type *>(&tabcols[
i].
values.front()));
81 vbp.counterBranch->SetAddress(&vbp.count);
83 vbp.counterBranch->SetAddress(&vbp.count);
85 vbp.counterBranch->SetAddress(&vbp.count);
void makeVectorBranches(const std::vector< Col > &tabcols, TTree &tree, const std::string &rootType, std::vector< NamedVectorBranchPtr > &branches)
std::vector< NamedVectorBranchPtr > m_vfloatWithNormBranches
const std::vector< FloatWithNormColumn > & floatWithNormCols() const
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< NamedBranchPtr > m_floatWithNormBranches
std::vector< NamedVectorBranchPtr > m_vintBranches
const std::vector< IntColumn > & intCols() const
void updateBranches(const nanoaod::MergeableCounterTable &tab, TTree &tree)
const std::vector< FloatColumn > & floatCols() const
void makeScalarBranches(const std::vector< Col > &tabcols, TTree &tree, const std::string &rootType, std::vector< NamedBranchPtr > &branches)
void fillScalarBranches(const std::vector< Col > &tabcols, std::vector< NamedBranchPtr > &branches)
const std::vector< VFloatWithNormColumn > & vfloatWithNormCols() const
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)