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);