Hello,
I have histograms in multiple files that I would like to add together, then write the summed histograms as one histogram to a new file. I do:
TFile *F1 = new TFile(“newfile.root”,“RECREATE”);
TFile f1(“path/to/file_0.root”);
TH2F h1 = (TH2F)f1.Get(“hist1”);
N=4;
for (int i=0; i<N; i++){
char Path[512];
sprintf(Path,"/path/to/file_%d.root",i);
TFile f(Path);
h= (TH2F*)f.Get(“hist1”);
h1->Add(h);
}
h1->SetDirectory(F1);
F1->Write();
F1->Close();
The output is an empty histogram, along with the following error messages:
Error in TStreamerInfo::WriteBuffer: The element TAxis::fTimeDisplay type 218 (Bool_t) is not supported yet
Any ideas as to what I am doing wrong/how to make it right? Thanks a lot.
-eric