Reading TClonesArray as a TChain in pyroot

Dear, I have a rootfile with a set of TClonesArray’s, I was wondering how I can read it in a loop in the same way as for TChain:

chain = ROOT.TChain()
chain.Add("path_to_rootfile/tree")

TD_hist = ROOT.TH2F()

for iev in chain:
    TD_hist.Fill(iev.var2, iev.var1)

The tutorials/tree/tcl.C tutorial might help

Is there any pyroot version? many thanks !!

I don’t think so…

Is there any chance to just get one line of code that actually reads the TClonesArray in a loop similar to my example? I can’t get around TClonesArray for some reasons

Not sure how to do this in PyROOT. Maybe @vpadulan can help