The program I am using is copied from the one given in ROOT tutorials and modified as per my use:
ROOT: tutorials/tree/copytree3.C File Reference by Rene Brun.
void copytree()
{
const auto filename = "./File.root" ;
TFile oldfile(filename);
TTree *oldtree;
oldfile.GetObject("TREE", oldtree);
// Deactivate all branches
oldtree->SetBranchStatus("*", 0);
// Activate only what you want
for (auto activeBranchName : {"MW1_TOF", "MW2_TOF"})
oldtree->SetBranchStatus(activeBranchName, 1);
// Create a new file + a clone of old tree in new file
TFile newfile("New.root", "recreate");
auto newtree = oldtree->CloneTree();
newtree->Print();
newfile.Write();
}
Now, for the branch ‘MW1_TOF’, I have range from 0 to 4096, and I want to put a condition to read only MW1_TOF <= 1000 for example.
How do I incorporate the same in the program?
ROOT Version: Not Provided
Platform: Ubuntu
Compiler: Not Provided