Hello,
I have a very big dataset…
I have a branch with several leafs among which I find “energy” and “eventID”
I can display the energy for a certain eventID like this
which shows me all the energies for the eventID X
I can also draw that
Now I’m trying to do something like
meaning that it would be like a vectorized sum of the energies of eventID X which will be stored in a variable “totalenergy”
I have tried looking in the documentation and the forum but still haven’t been successful with this…
anyone can give me some advice on how to do it?
Thank you very much
You can Draw or Scan the special function Sum$ of the branch. So something like:
t.Draw("Sum$(energy)","eventID==X");
A list of the special “" functions can be found here: [url]http://root.cern.ch/root/html/TTree.html#TTree:Draw@1[/url]. There is no direct link to the actual section that talks about them, so use your browser's search function to look for "Entry ” (with the dollar-sign) to find the list.
Other ref:
I have a TTree in a file which contains signals obtained from an oscilloscope.
I can draw traces with
for example, since the events have a unique index stored in the tree. The signals are stored as [1024]/F in the tree.
I would like to be able to draw what I mean when I try:
mytree->Draw("TMath::Mean(1024,V3)"),
namely, draw the histogram of the average voltage per event. But I get an error:
Any ideas about how to use the very nice tree drawing function to do this (or other TMath funct…
Jean-François
Thank you for your reply Jean-François.
So yes I was able to draw and display the sum however, I want to know if I can store that sum in a variable
and then be able to use that sum for some other analysis…for example
if(totalenergy < X){
fill histogram
}
Is it possible?
thanks again