Dear All,
I’ve just encountered what is possibly a PyROOT bug. An instance obtained from a TChain with GetBranch() is no longer the same branch (get dereferenced?) after TChain::Draw(). I did not encounter this behaviour with a single TTree or in C++.
Here is the PyROOT code that shows the bug:
#!/usr/bin/python
import ROOT
c = ROOT.TChain("tefield", "tefield")
c.Add("efield_1683733523-869645459_L0_0000.root")
c.Add("efield_3950562315-861740959_L0_0000.root")
c.Add("efield_3952437815-3952437815_L0_0000.root")
c.Add("efield_861745459-3951652315_L0_0000.root")
br = c.GetBranch("du_id")
print(br)
count = c.Draw("du_id", "", "goff")
print(br)
The first and last print usually shows a different branch, and the first shows the correct one.
Here are the tree files that I’ve used:
I also attach the C++ code that prints the same branch address before and after a Draw.
test_draw_getbranch.C (378 Bytes)
ROOT Version: 6.30.06
Platform: Fedora 40
Compiler: Not Provided