Hi,
i’ve created a ROOT file with some TTree file in it, and i need to retrieve the same TTree later, using this command
Sometime, however, the TTree is not created due to some conditions present in the code. In this case, when the last command is executed, the program exits with a segmentation fault.
Is there a way to ask the file if a given TTree is present inside the file?
The problem is the assignment.
If the “t” is not in the file, the pointer returned is null
root [12] TObject *ob=f->Get("t");
root [13] ob
(class TObject*)0x0
root [14] TTree *tr=(Tree *)f->Get("t");
Error: class,struct,union or type Tree not defined (tmpfile):1:
Error: tr already declared as different type. Switch to new type
*** Interpreter error recovered ***
Try checking for null first, then do the assignment.