Dear Root Wizards,
I have a problem with ROOTPY. I just started using Python.
I want to open an existing root file with defined tree and add now entries to that tree. However, every time I reopen the file and add new events, they create their own tree in a given file. As a result I have one root file with many trees.
This is my code (part where I open a file , add events and saves everything):
f = root_open(‘test.root’, ‘update’)
tree = f.test
for event in tree:
for i in range (0, num):
tree.idd = 2
tree.number_of_events = num
tree.event_number = events_numbers[i]
tree.xpos = xs[i]
tree.ypos = ys[i]
tree.integral = peak_flux[i]