Hello,
I was wondering if it’s possible to edit a single entry of one branch of a tree on the fly, without it affecting other entries. Here’s a sample of what I’m trying to accomplish:
def scale(t):
t.SomeVariable *= 1.5
for i in xrange(tree.GetEntries()):
tree.GetEntry(i)
scale(tree)
# do something with tree.SomeVariable
print tree.SomeVariable
I tried the above code, but the problem is once I do t.SomeVariable *= 1.5, tree.SomeVariable no longer changes value as I loop over all entries. Eg., suppose SomeVariable has values 2, 4, 6, 8 for the 4 first events, then the output of the above macro will be:
3
4.5
6.75
10.125
instead of what I would like it to be:
3
6
9
12
Ideas?