Hello Rooters,
I have two histograms called h_QSq_xBj and h_QSq_xBj_MC.
I applied Sumw2 option for these histograms.
Then I took the division of these two histograms
h_ratio= h_QSq_xBj_MC/h_QSq_xBj.
(not applied sumw2 option for this ratio histogram)
I need to copy the error of h_ratio histogram to a another histogram.
Could you please help me to draw it?
I have no idea how to calculate error of h_ratio and copy that errors to the another histogram.
{
//open 2D raw and simu histograms
TFile *hFile=TFile::Open("xBQ2binning.root");
TH2F *h_QSq_xBj; //added Sumw2() option
TH2F *h_QSq_xBj_MC; //added Sumw2() option
TH2F *h_ratio;
hFile->GetObject("h_QSq_xBj", h_QSq_xBj);
hFile->GetObject("h_QSq_xBj_MC", h_QSq_xBj_MC);
h_ratio = (TH2F*)h_QSq_xBj_MC->Clone();
h_ratio->GetXaxis()->SetTitle(" ");
h_ratio->GetYaxis()->SetTitle(" ");
h_ratio->SetTitle("h_QSq_xBj_MC(raw)/h_QSq_xBj(simu)");
h_ratio->Divide(h_QSq_xBj);
TCanvas* C_QSqxBj= new TCanvas();
C_QSqxBj->Divide(3,1);
C_QSqxBj->cd(1);
h_QSq_xBj->Draw("colz");
C_QSqxBj->cd(2);
h_QSq_xBj_MC->Draw("colz");
C_QSqxBj->cd(3);
h_ratio->Draw("colz");
}
Thank You
Dil