I have two histograms called h_simu and h_gen(2D hist). Applied SumW2 option before filling the histograms.Then I took the ratio of these two histograms.
h_ratio= h_simu/h_gen
I need to calculate the “relative error of this ratio histogram”.
Could you please check if my way is correct?
h_ratio_error=(TH2F *)h_ratio->Clone("h_ratio_error");
for(int i=0; i < h_ratio->GetSize();i++){
h_ratio_error>GetArray()[i]= h_ratio_error->GetBinError(i)/(h_ratio_error->GetBinContent(i)+0.1);
h_ratio_error->Sumw2(kFALSE);
h_ratio_error->ResetStats();
h_ratio_error->SetTitle("Relative Error of the ratio histogram CsHS vs mpipi");
h_ratio_error->Draw("COLZ ");
}
Thank you.
What about my calculation?
The reason I was worring my calculation is, my errors are too big.
When I commented out h_ratio_error->Sumw2(kFALSE);
I got reasonable errors.
Need to know my calculation is okay without h_ratio_error->Sumw2(kFALSE);
I already applied sumw2 options for the h_simu and h_gen histograms.