Re: Division of Histograms

From: Stefan Piperov <piperov_at_fnal.gov>
Date: Wed, 13 Oct 2010 16:42:52 +0300

In the described case, the most logical "number of entries" for the resulting histogram is its number of bins. Because that is how the resulting histogram was actually filled - bin-by-bin. S.

On Wed, 13 Oct 2010, Rene Brun wrote:

> see below
>
>
> Harinder Singh Bawa wrote:
>> Dear experts,
>>
>> I may be missing something but I am trying to divide 2 histograms bin by
>> bin as follows
>>
>>
>> Declaring
>> ===========
>> TH1F *hist1=new TH1F("hist1","",40,0,2000);
>> TH1F *hist2=new TH1F("hist2","",40,0,2000);
>>
>> TH1F *histdiv=new TH1F("histdiv","",40,0,2000);
>>
>> Filling
>> =====
>>
>> hist1->Fill(some variable from input rootfile);
>> hist2->Fill(some variable from input rootfile);
>>
>> histdiv->Divide(hist1,hist2,1.,1.,"b");
>>
>> Is this correct.?
> yes it is
>>
>> The problem I am seeing is that though I am getting many points from
>> division in plot but in Stat it is showing only 1 entry. Can anyone say
>> why?
> What is the meaning of the number of entries in this case. Suppose h1 with
> 1000 and h2 with 2000 entries. what do you expect for histdiv. You can do
> something like
> histdiv->SetEntries(h1->GetEntries());
>
> see also the new class TEfficiency at :
> http://root.cern.ch/root/html/TEfficiency.html
>
> Rene
>
>

*---------------------------------------------------------------------*
  Stefan Piperov      Mail: FNAL P.O.Box 500, MS 205, Batavia, IL-60510
  Phone: (630) 840-5176                        E-Mail: piperov_at_fnal.gov
*---------------------------------------------------------------------*
"Give a skeptic an inch... and he'll measure it." Received on Wed Oct 13 2010 - 15:43:01 CEST

This archive was generated by hypermail 2.2.0 : Wed Oct 13 2010 - 23:50:02 CEST