Hello all,
I have a Tree that looks like:
I now how to extract, for each event, all the data with a for loop:
E = np.array( [] ) #store the Energy
for event in tree: #for each event, store the desired values
E = np.append(E, tree.Energy)
I want to make coincidence plots (if the time difference between event X and event X+1, store its energies values). I could do this in the fashion showed above, first stored all the values, then compared them, but it is very time consumig, so I wonder if I could do it more neatly.
With C++ you could do it using Tree->GetEntry(n)
; in a loop throught all the events, I can get the energy of the event n and n+1 (the following) and then compare it, and if they are in coincidence store the energy (plot it), but I do not know how I could do this with pyROOT.
Thank you so much in advance,
Dani
Please read tips for efficient and successful posting and posting code
ROOT Version: 6.24/00
Python version: 3.8.5