Hello there.
I have a file in the branches of which there are graphs of 10230 points. You need to get a set of values along the Y axis. So far, there is a code that gives the maximum of the graph itself. Dec01031235.root (120.3 KB)
c = ROOT.TCanvas()
f = ROOT.TFile(“Dec01031235.root”)
tree = f.Get(“FADCData 939”)
tree.Draw(“Channel1”)
myh = ROOT.gPad.GetPrimitive(“htemp”);
print(myh.GetMaximum())
ROOT Version: Not Provided Platform: Not Provided Compiler: Not Provided
I guess you are looking for something like the following:
import ROOT
c = ROOT.TCanvas()
f = ROOT.TFile("Dec01031235.root")
tree = f.Get("FADCData 939")
tree.Draw("Channel1")
myh = ROOT.gPad.GetPrimitive("htemp")
#print "Maximum of the histogram is", myh.GetMaximum()
for bin in range(1, myh.GetNbinsX()+1):
print "\tBin #", bin, ": x=", myh.GetBinCenter(bin), ", y=", myh.GetBinContent(bin)