ROOT Version: 5.34/36
Platform: Centos7
Compiler: Not Provided
Hi everyone,
I’m trying to read some information from a root file using pyroot. It also uses some object types from RAT dataframe.
I can access the information in C++, but cannot do the same using pyroot. I have attached a sample root file.Veto.root (218.2 KB) This is the C++ code that works:
TFile *F = new TFile("Veto.root");
T0 = (TTree*)F->Get("T");
RAT::DS::Root *ds = NULL;
T0->SetBranchAddress("ds",&ds);
RAT::DS::TS *ts;
int nentries = T0->GetEntries();
for (int i=0; i<nentries; ++i)
{
T0->GetEntry(i);
ts = ds->GetTS(0);
Int_t EventId = ts->GetEventID();
cout << EventId << endl;
}
In TBrowser, both ds and ts are TBranchElement. But eventID which is stored under ts is a TNonSplitBrowsable. Any ideas how I can read these information?
P.S There are two TLeafElement’s saved under ds and I can access them with pyroot. But anything else saved under branches under ds is not accessible.
I have the following part of the python script if it helps:
File = TFile("Veto.root");#TFile
T = File.Get("T");
nentries = T.GetEntries();
for i in range (nentries):
T.GetEntry(i);
print T.ds.runID
print T.GetLeaf("runID").GetValue()
Thank you very much in advance.
Sina