Re: [ROOT] Kolmogorov test

From: Rolf Dubitzky (R.Dubitzky@Physik.TU-Dresden.DE)
Date: Sun Nov 18 2001 - 16:22:51 MET


Hi Rene,

On Fri, 16 Nov 2001, Rene Brun wrote:
> Rolf,
> Could you send me a ROOT file containing your two histograms
> for which you obtain the error message ?

After some more testing I think the folowing is enough to trigger the 
error:

{
    TH1F h1("h1","h1",1,0,1);
    TH1F h2("h2","h2",1,0,1);
    h1.Fill( 0 );
    h2.Fill( 0 );
    h1.Fill( 1 );
    h2.Fill( 1 );
    h1.KolmogorovTest( &h2 , "O" )
}

I think the normalization is just not right in presence of under- or 
overflow entries. I am not sure, but maybe the following is already enough 
to fix it.


--- V_CVS/hist/src/TH1.cxx      Sun Nov 18 16:17:20 2001
+++ V_rd/hist/src/TH1.cxx       Sun Nov 18 16:16:47 2001
@@ -3571,8 +3571,8 @@
       }
    }
 
-   Double_t s1 = 1/sum1;
-   Double_t s2 = 1/sum2;
+   Double_t s1 = 1/tsum1;
+   Double_t s2 = 1/tsum2;
 
       // Find largest difference for Kolmogorov Test
    Double_t dfmax =0, rsum1 = 0, rsum2 = 0;


Cheers,
Rolf


> 
> Rene Brun
> 
> On Fri, 16 Nov 2001, Rolf Dubitzky wrote:
> 
> > 
> > Hi rooters,
> > 
> > I use TH1::KolmogorovTest(...) to automatically check the output of some 
> > test Histogramms/Trees on different platforms/systems.
> > Sometimes (~5% of histos) I get an error message (see below). The 
> > sourcecode comments:
> > 
> > // This numerical error condition should never occur:
> > 
> > What does that mean? How can I fix it?
> > 
> > OS: GNU/Linux RH7.2 & Solris8
> > ROOT:  *   Version   3.02/03  16 November 2001   *
> > 
> > Cheers,
> > Rolf
> > 
> > ------
> > 
> >  Kolmo Prob  h1 = pSlowPi_MCT, sum1=30534
> >  Kolmo Prob  h2 = pSlowPi_MCT, sum2=30534
> >  Kolmo Probabil = 1, Max Dist = 1.03433e-16
> >  Kolmo Probabil = 1.000000 for shape alone, =1.000000 for normalisation alone
> > Warning in <TH1D::KolmogorovTest>: Numerical problems with h1=pSlowPi_MCT
> > 
> > Warning in <TH1D::KolmogorovTest>: Numerical problems with h2=pSlowPi_MCT
> > 
> > 
> > 
> > ***************************************************************
> >  Rolf Dubitzky  
> >  e-mail: Rolf.Dubitzky@Physik.TU-Dresden.de
> >  s-mail see http://hep.phy.tu-dresden.de/~dubitzky/
> > ***************************************************************
> > 
> > 
> 
> 

-- 
Cheers,
Rolf

***************************************************************
 Rolf Dubitzky  
 e-mail: Rolf.Dubitzky@Physik.TU-Dresden.de
 s-mail see http://hep.phy.tu-dresden.de/~dubitzky/
***************************************************************



This archive was generated by hypermail 2b29 : Tue Jan 01 2002 - 17:51:08 MET