Loading an array of histograms

Hi all,

I have saved into a root file an array of histograms (let say hist[0], hist[1], etc.) and now I am trying to plot some of these histograms.

When I open my root file using a TBrowser, I can draw these histograms simply by clicking on the corresponding icons.

However, when I try to plot these histograms from a macro or from an interactive root session (after opening the histogram file, via the command hist[0].Draw(); ) I am not able to draw the histograms. The strange thing is that in my root file I saved not only histogram arrays, but also some “simple” histograms, and I can plot these histograms via the command histogram.Draw().

Can somebody help me?

You do not provide enough information. Anyhow, to read histograms from a file, do:
TFile f(“myfile.root”);
TH1 h1 = (TH1)f.Get(“myhistoname”);


Thank you very much for your help. Now it works perfectly!