Set of values along the Y axis

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


Hi,

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)

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.