68 template <
typename T> Int_t
SetBranchAddress(
const char *bname, T **add, TBranch **ptr = 0);
76 auto *branches = GetListOfBranches();
77 bool firstCall =
true;
78 for (
int iBranch = 0; iBranch < branches->GetEntries(); ++iBranch) {
79 auto *branch = (TBranch *)(branches->UncheckedAt(iBranch));
80 if (branch->TestBit(kDoNotProcess)) {
86 SetBranchStatus(
"*", 0);
89 auto *branch = GetBranch(bname);
92 std::function<void(TBranch *)> ActivateBranch = [&ActivateBranch](TBranch *branch) {
93 auto *subBranches = branch->GetListOfBranches();
94 for (
int iBranch = 0; iBranch < subBranches->GetEntries(); ++iBranch) {
95 ActivateBranch((TBranch *)(subBranches->UncheckedAt(iBranch)));
99 auto *leaves = branch->GetListOfLeaves();
100 for (
int iLeaf = 0; iLeaf < leaves->GetEntries(); ++iLeaf) {
101 auto *leaf = (TLeaf *)(leaves->UncheckedAt(iLeaf));
102 leaf->GetBranch()->SetStatus(1);
103 auto *leafCount = leaf->GetLeafCount();
105 leafCount->GetBranch()->SetStatus(1);
111 ActivateBranch(branch);
114 return TTree::SetBranchAddress<T>(bname, add, ptr);
Int_t SetBranchAddress(const char *bname, T **add, TBranch **ptr=0)
Set branch address and enable the branch.
Definition: SparseTree.h:73
IncludeFileExc.h IncludeFileExc class declaration.
Definition: Algorithm.h:21
A tree that reads only branches which have an address.
Definition: SparseTree.h:54