Discussion:
Error bars with TH1:: Divide & TH1::Sumw2
Asif Saddique
2012-12-20 02:08:44 UTC
Permalink
Hi,

Can you please give some feedback on the following issue.

I have two weighted histograms, to take effects of weights into errors i
require Sumw2 before filling histograms.


h_2->Sumw2(); h_3->Sumw2();

EventLoop{
h_2->Fill(pT1,weight);
h_3->Fill(pT2,weight);
}

The error bars seems alright in h_2 and h_3 {smaller in high statistics
region and bigger in low statistics region} but when i divide them in
another histogram h_3to2 with same number of bins.

h_3to2->Sumw2(); // i think this line doesn't make any effect
h_3to2 ->Divide(h_3, h_2);

I was expecting smaller error bars in the starting bins(high stat.) and
then should get bigger and bigger with increasing bins but the error bars
look almost the same for all bins. Am i missing something ? or any other
suggestion to obtain ratio with correct error bars?


Cheers,
Asif
Asif Saddique
2012-12-20 02:40:13 UTC
Permalink
Hi,

Can you please give some feedback on the following issue.

I have two weighted histograms, to take effects of weights into errors i
require Sumw2 before filling histograms.


h_2->Sumw2(); h_3->Sumw2();

EventLoop{
h_2->Fill(pT1,weight);
h_3->Fill(pT2,weight);
}

The error bars seems alright in h_2 and h_3 {smaller in high statistics
region and bigger in low statistics region} but when i divide them in
another histogram h_3to2 with same number of bins.

h_3to2->Sumw2(); // i think this line doesn't make any effect
h_3to2 ->Divide(h_3, h_2);

On this ratio, i was expecting smaller error bars on starting bins(high
stat.) and then should get bigger and bigger with increasing bins(low
stat.) but the error bars look almost the same for all bins. Am i missing
something ? or any other suggestion to obtain ratio with correct error
bars?


Cheers,
Asif
Lorenzo Moneta
2012-12-20 09:16:42 UTC
Permalink
Hi,

Strange. I would need you send me the two histograms to look into your problem

Cheers

Lorenzo
Post by Asif Saddique
Hi,
Can you please give some feedback on the following issue.
I have two weighted histograms, to take effects of weights into errors i require Sumw2 before filling histograms.
h_2->Sumw2(); h_3->Sumw2();
EventLoop{
h_2->Fill(pT1,weight);
h_3->Fill(pT2,weight);
}
The error bars seems alright in h_2 and h_3 {smaller in high statistics region and bigger in low statistics region} but when i divide them in another histogram h_3to2 with same number of bins.
h_3to2->Sumw2(); // i think this line doesn't make any effect
h_3to2 ->Divide(h_3, h_2);
On this ratio, i was expecting smaller error bars on starting bins(high stat.) and then should get bigger and bigger with increasing bins(low stat.) but the error bars look almost the same for all bins. Am i missing something ? or any other suggestion to obtain ratio with correct error bars?
Cheers,
Asif
Asif Saddique
2012-12-20 18:57:07 UTC
Permalink
Hi Lorenzo,

Many thanks for your response. I have attached a pdf.

May be i misinterpreted my problem. The error bars on two histograms are
very small, its not obvious to see increasing error bar trend and now i am
pretty convinced that error bars on ratio look alright. I think it would be
good to ask other way around, do you agree the error bars on ratio look
good?

I have attached a small root file containing 3 histos h_2(cj_vT1TeV_2jet),
h_3(cj_vT1TeV_6jet) and h_3to2, in case if want to look into.

Thanks again for your help.

Cheers,
Asif
Post by Lorenzo Moneta
Hi,
Strange. I would need you send me the two histograms to look into your problem
Cheers
Lorenzo
Post by Asif Saddique
Hi,
Can you please give some feedback on the following issue.
I have two weighted histograms, to take effects of weights into errors i
require Sumw2 before filling histograms.
Post by Asif Saddique
h_2->Sumw2(); h_3->Sumw2();
EventLoop{
h_2->Fill(pT1,weight);
h_3->Fill(pT2,weight);
}
The error bars seems alright in h_2 and h_3 {smaller in high statistics
region and bigger in low statistics region} but when i divide them in
another histogram h_3to2 with same number of bins.
Post by Asif Saddique
h_3to2->Sumw2(); // i think this line doesn't make any effect
h_3to2 ->Divide(h_3, h_2);
On this ratio, i was expecting smaller error bars on starting bins(high
stat.) and then should get bigger and bigger with increasing bins(low
stat.) but the error bars look almost the same for all bins. Am i missing
something ? or any other suggestion to obtain ratio with correct error bars?
Post by Asif Saddique
Cheers,
Asif
Lorenzo Moneta
2012-12-21 21:14:39 UTC
Permalink
Hi Asif,

I don't see anything wrong with the resulting histogram. The error is computed (if you are not using option B) assuming that the histograms are not correlated and using just error propagation ,
see table in http://en.wikipedia.org/wiki/Propagation_of_uncertainty

Cheers

Lorenzo
On Dec 20, 2012, at 7:57 PM, Asif Saddique <***@ualberta.ca<mailto:***@ualberta.ca>>
wrote:

Hi Lorenzo,

Many thanks for your response. I have attached a pdf.

May be i misinterpreted my problem. The error bars on two histograms are very small, its not obvious to see increasing error bar trend and now i am pretty convinced that error bars on ratio look alright. I think it would be good to ask other way around, do you agree the error bars on ratio look good?

I have attached a small root file containing 3 histos h_2(cj_vT1TeV_2jet), h_3(cj_vT1TeV_6jet) and h_3to2, in case if want to look into.

Thanks again for your help.

Cheers,
Asif


On Thu, Dec 20, 2012 at 2:16 AM, Lorenzo Moneta <***@cern.ch<mailto:***@cern.ch>> wrote:
Hi,

Strange. I would need you send me the two histograms to look into your problem

Cheers

Lorenzo
Post by Asif Saddique
Hi,
Can you please give some feedback on the following issue.
I have two weighted histograms, to take effects of weights into errors i require Sumw2 before filling histograms.
h_2->Sumw2(); h_3->Sumw2();
EventLoop{
h_2->Fill(pT1,weight);
h_3->Fill(pT2,weight);
}
The error bars seems alright in h_2 and h_3 {smaller in high statistics region and bigger in low statistics region} but when i divide them in another histogram h_3to2 with same number of bins.
h_3to2->Sumw2(); // i think this line doesn't make any effect
h_3to2 ->Divide(h_3, h_2);
On this ratio, i was expecting smaller error bars on starting bins(high stat.) and then should get bigger and bigger with increasing bins(low stat.) but the error bars look almost the same for all bins. Am i missing something ? or any other suggestion to obtain ratio with correct error bars?
Cheers,
Asif
<h_3to2.pdf><output_h32.root>
Asif Saddique
2012-12-24 23:41:22 UTC
Permalink
Hi Lorenzo,

Sorry for late response.
Thanks for your confirmation. Yes, the two histo are uncorrelated and I am
not using option "B".

Cheers,
Asif
Post by Lorenzo Moneta
Hi Asif,
I don't see anything wrong with the resulting histogram. The error is
computed (if you are not using option B) assuming that the histograms are
not correlated and using just error propagation ,
see table in http://en.wikipedia.org/wiki/Propagation_of_uncertainty
Cheers
Lorenzo
Hi Lorenzo,
Many thanks for your response. I have attached a pdf.
May be i misinterpreted my problem. The error bars on two histograms are
very small, its not obvious to see increasing error bar trend and now i am
pretty convinced that error bars on ratio look alright. I think it would be
good to ask other way around, do you agree the error bars on ratio look
good?
I have attached a small root file containing 3 histos
h_2(cj_vT1TeV_2jet), h_3(cj_vT1TeV_6jet) and h_3to2, in case if want to
look into.
Thanks again for your help.
Cheers,
Asif
Post by Lorenzo Moneta
Hi,
Strange. I would need you send me the two histograms to look into your problem
Cheers
Lorenzo
Post by Asif Saddique
Hi,
Can you please give some feedback on the following issue.
I have two weighted histograms, to take effects of weights into errors
i require Sumw2 before filling histograms.
Post by Asif Saddique
h_2->Sumw2(); h_3->Sumw2();
EventLoop{
h_2->Fill(pT1,weight);
h_3->Fill(pT2,weight);
}
The error bars seems alright in h_2 and h_3 {smaller in high statistics
region and bigger in low statistics region} but when i divide them in
another histogram h_3to2 with same number of bins.
Post by Asif Saddique
h_3to2->Sumw2(); // i think this line doesn't make any effect
h_3to2 ->Divide(h_3, h_2);
On this ratio, i was expecting smaller error bars on starting bins(high
stat.) and then should get bigger and bigger with increasing bins(low
stat.) but the error bars look almost the same for all bins. Am i missing
something ? or any other suggestion to obtain ratio with correct error bars?
Post by Asif Saddique
Cheers,
Asif
<h_3to2.pdf><output_h32.root>
Loading...