TGraphAsymmErrors BayesDivide with weighted histograms

From: James Jackson <james.jackson_at_cern.ch>
Date: Mon, 23 Mar 2009 12:40:12 +0000


Hi,

I am attempting to compute some efficiencies from pass / total histograms which do not have unit weighting (i.e. they are constructed with hist->SetBinContent(bin, eventWeight), where weight is not guaranteed to be integer). TGraphAsymmErrors doesn't like this (and I assume this is linked to the option whereby it will check the weights of the source histograms):

root [0] TH1D *pass = new TH1D("pass", "", 1, 0, 1);
root [1] TH1D *all = new TH1D("all", "", 1, 0, 1);
root [2] pass->SetBinContent(1, 2.5);
root [3] all->SetBinContent(1, 5);
root [4] TGraphAsymmErrors a(pass, all);
root [5] Double_t x, y;
root [6] a.GetPoint(0, x, y)
root [7] x

(Double_t)5.00000000000000000e-01

root [10] y
(Double_t)4.00000000000000022e-01 <-- Should be 0.5!

Is there anyway around this?

Regards,
James. Received on Mon Mar 23 2009 - 13:40:16 CET

This archive was generated by hypermail 2.2.0 : Mon Mar 23 2009 - 17:50:01 CET