Hello everybody,
i’m quite new to python and pyROOT. I have used ROOT with CINT a little, but decided that for future learing i want to use pyroot, which seems to me a lot more comfortable in some ways.
I found my problem to fit in this thread, so i thought it best to post here.
My problem is the following:
I have root files like the one attached, and want to add them to a Chain and access the leafs in a loop.
With CINT i needed to define doubles x1 and x2 and use
TChain *c1 = new TChain("t1");
c1->Add("data.root");
c1->SetBranchAddress("x1",&x1);
c1->SetBranchAddress("x2",&x2);
for (int i=0; i<(c1->GetEntries());++i){
c1->GetEntry(i);
atgraph->SetPoint(i,x1,x2);
}
I want to use c1.GetEntry() with pyroot likewise, but can’t get it to work.
This thread hasn’t helped me too much.
In this one however:
is a solution quite related to what i need, it’s a bit complicated though …
if someone could help, i’d be delighted
. regards,
Martin
edit: attachment added
data.root (15.5 KB)