I have ntuples (with more than 50 leafs) and I want to pass each event to other functions. I am not sure how to do this from ntuple. So, I thought to write ntuples in the form of class so that I can pass events to function and do some calculation.
While doing that I encountered a problem: My program read one file first using TFile and then get the name of the NTuple and leafs, and put all the NTuples in chain. My program do not know the name of the ntuple and leafs. Program has to get the name of the ntuple and name of all the leafs from the root file. How can I do that?
Now I want to get the data type of the leaf, i.e., Float_t or Int_t or other. How do I get that?
Here, Int_t type is written by defining a structure of integer types and writing the structure in ntuple.
that’s encoded in the inherited type, see root.cern.ch/root/html/TLeaf#TLeaf:Class_Charts i.e. TLeafF contains floats. You can compare using e.g. TLeafF::Class() add leaf->IsA(). You can also use TLeaf::GetTypeName().