Hi, I’m using a class that inherits from the auto-generated code from MakeClass. The class takes as an argument a TTree, but if you pass a TChain, it correctly switches trees. However because it’s coded as a TTree, you don’t have access to the actual TChain inside the Loop() method (even though it’s called fChain, it’s of type TTree *).
My problem is that I’d like to retrieve the list of files used using fChain->GetListOfFiles() and following the instructions at http://root.cern.ch/root/html/TChain.html#TChain:AddFile, but the compiler tells me:
MydaqT.C:133:24: error: no member named 'GetListOfFiles' in 'TTree'
auto toa = fChain->GetListOfFiles();
because the fChain member pointer is of type TTree* instead of TChain*.
Can I just cast fChain to a TChain * to get around this? Is it safe to do? It compiles and seems to run, but I am wondering if I am introducing a subtle bug.
Jean-François