Disabling some variables in a tree when loading the root file

Dear Experts,

I am loading a fat root file. I want to dasable all variables except the variable which I am drawing. Could you please tell me how to do it?


You can disable all branches using tree->SetBranchStatus("*", kFALSE);. Afterwards you can re-enable the branch you need with tree->SetBranchStatus("branch_name", kTRUE);.

Here is the relevant documentation:

Another common approach is to use the TTreeReader, see https://root.cern.ch/doc/master/classTTreeReader.html

1 Like

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