Dear ROOT-Community,
currently I am trying to combine TH3F-histograms from two Ttrees from two files generated by GATE. I do have a similar issue with 1D-histograms but I will just show the TH3F-example.
As already mentioned, I want to combine 3-dim-Histograms, which works but I do not get a proper statistics box. It is empty. I would like to know:
- How to combine the statistics-box of the two histograms and have the statistics box show the combined number of entries.
- Have two statistics-boxes for each histogram
So far my Code looks like this:
void plot_example(string arg1, string arg2)
{
const char* Infile1 = arg1.c_str();
const char* Infile2 = arg2.c_str();
auto mycanvas = new TCanvas();
TLegend *legend = new TLegend();
auto MyHist1= new TH3F("MyHist1","MyHist1",100,-400,100,100,-150,150,100,-150,150);
TFile *file0 = TFile::Open(Infile1);
TFile *file1 = TFile::Open(Infile2);
TTree *t1;
TTree *t2;
file0->GetObject("Singles", t1);
file1->GetObject("Singles", t2);
MyHist1->Draw();
mycanvas->Update();
t2->Draw("globalPosX:globalPosY:globalPosZ","","same");
mycanvas->Update();
t1->Draw("globalPosX:globalPosY:globalPosZ","","same");
mycanvas->Update();
}
Thanks a lot.
Best regards,
Andi
Compiler: gcc 4.8.5 g++5.4.0
OS: Ubuntu 16.04
ROOT 6.14/06