How can I access a tree with a whitespace in the name?

Hi everyone,

I’m trying to access a tree “Tree 1” that has a whitespace in the name.
“Tree 1->Scan()” is not working and google only returned a post from 6 years ago, so I was hoping there would be a fix by now. Cloning and renaming the tree is not convenient since I’m trying to peek at the data inside many large datasets that I’m not analyzing.
Bonus question: Another issue I ran into is trees with the same name (e.g: Tree;1 Tree;2 Tree;3…). When doing “Tree->Scan()” I can only access the first tree. Is there a way to access the other trees?

Thank you,

TTree *t;
gFile->GetObject("Tree 1", t); // or your_file->GetObject(...)

Bonus answer: See: Aux;1 aux;2 aux3;


Thank you for the reply, this fix solved my problem.


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