Hi,
I take the ratio of 2 histograms using the following as pasted below:
This show me Entries:16 in the stat box.
For sure I can count that I have several (100's) entries there.
Any trick or tip !
TH1F *h1 = new TH1F("h1", "h1", 16, 0, 16); TH1F *h2 = new TH1F("h2", "h2", 16, 0, 16); TH1F *ratio1 = new TH1F("ratio1", "ratio1", 16, 0, 16);
for (int i=1 ; i<=h1->GetNbinsX() ; i++ ) {
double u = 0;
for (int j=1 ; j<=h2->GetNbinsX() ; j++ ) {
u += h2->GetBinContent(j);
}
double t = h1->GetBinContent(i);
double e = 0; double Er = 0;
if (t!=0) {
e = u/t; Er = TMath::Sqrt(e);
}
ratio2->SetBinContent(i, e);
ratio2->SetBinError(i, (Er));
}
regards,
---saleem Received on Mon Nov 26 2007 - 17:58:59 CET
This archive was generated by hypermail 2.2.0 : Tue Nov 27 2007 - 05:50:02 CET