Dear ROOT experts,
I have a root file with several histograms in it. I am trying to access those histograms and plot them, but getting the error attempt to access a null pointer
. I opened the file with TBrowser
and all TH1F histograms can be displayed. Here is part of the code and below the error message.
histo_file = ru.TFile(outfile, "READ")
# call each histo
h0 = ru.TH1F()
h0 = histo_file.Get("ZZ4Mu")
final_histo = ru.TFile("final_histo.root", "RECREATE")
# define canvas
cnv = ru.TCanvas("canv", "canv", 400, 400)
final_histo.cd()
cnv.cd()
h0.Draw("HIST")
Error message:
File "plotHisto.py", line 156, in <module>
h0.Draw("HIST")
ReferenceError: attempt to access a null-pointer
Thanks in advance,
Aya
_ROOT Version: 6.18.04
_Platform: Ubuntu.18.04