I know this is a bit remedial subject but help would be greatly appreciated. So I have number of historgrams that I would like to superimpose on each other. I thought such would be sufficient:
In general I have 2 histograms, the 1st i want to make the base and I would like to superimpose the other on it. Is there some thing that I am doing wrong here? Any Suggestions? Thanks
Those error indicates that you have not been successful in retrieving the histogram from the file (and/or you close the files). Try:
TFile *f1 = TFile::Open("Histogram1.root");
if (f1==0) {
cout << "Humm no file named Histogram1.root in the current directory.\n";
} else {
TH1 *h1; f1->GetObject("histo1",h1);
if (h1==0) {
cout << "humm no histo named histo1 in the file!\nlet's see what's in it:\n";
f1->ls();
}
}
Cheers,
Philippe.