Hi,
I’m trying to add 2 histograms that I extracted from a TFile, meaning that I do not get to define the axis limits/bins.
This is my C++ code:
NumHist_d04->Add(HHist_ggf_d04);
NumHist_d04->Divide(ZeeHist_d04);
TCanvas *c16 = new TCanvas(“c16”, “RMISS d04”, 700,500);
NumHist_d04->Draw();
This is the error that comes up on the terminal:
Info in TH1F::Add: Attempt to add histograms with different axis limits - trying to use TH1::Merge
Error in TH1F::Merge: Cannot merge histograms - limits are inconsistent:
first: (6, 0.000000, 3.141593), second: (6, 0.000000, 3.141593)
I tried to set the axis limits using
->GetXaxis()->SetRangeUser(0,TMath::Pi());
and also tried the SetUser and SetLimits() functions for the 2 histograms I am trying to add, but the same error comes up.
Please let me know if you can think of what the issue is, and how to fix it - thanks!