tree->SetBranchStatus in one go

Dear experts,
tree->SetBranchStatus("*", 0); disabled all the branch, but how can I activate all of them in 1 line? I can do itree->SetBranchStatus(“var1”, 1); for each variables but I want to do that in 1 line.

logically, this:

tree->SetBranchStatus("*", 1);

should work, shouldn’t it?

Dear Sbinet,
indeed I tried this but does not work.

Dear experts,
any idea?

How does it fail?

A simple example works:

root [5] ntuple->GetBranch("px")->TestBit(kDoNotProcess) 
(bool) false
root [6] ntuple->SetBranchStatus("*",0)
root [7] ntuple->GetBranch("px")->TestBit(kDoNotProcess) 
(bool) true
root [8] ntuple->SetBranchStatus("*",1)
root [9] ntuple->GetBranch("px")->TestBit(kDoNotProcess) 
(bool) false
1 Like

Dear Sbinet and Pcanal,
thank you for your help, it worked.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.