Re: [ROOT] TMath::Poisson

From: Rene Brun (Rene.Brun@cern.ch)
Date: Sun Oct 19 2003 - 22:42:57 MEST


Hi Michael,

I cannot reproduce this problem.

Which version are you using? which machine?
Did you compile yourself from the source?

Rene Brun

On Sun, 19 Oct 2003, Michael 
Gold wrote:

> 
> the function
>  Double_t TMath::Poisson(Double_t x, Double_t par)
> {
>   // compute the Poisson distribution function for (x,par)
> 
>   if (x<0) return 0;                                                         
>   if (x==0) return TMath::Exp(-par);                                                         
>   return TMath::Power(par,x)/TMath::Gamma(x+1)/TMath::Exp(par); 
> }                                                                              
>     
> 
> dosn't appear to work for x=0.... cannot imagine what the problem is!
> 
> 
> root [28] TMath::Poisson(0.,2.)
> (Double_t)0.00000000000000000e+00
> root [29] TMath::Poisson(1.,2.)
> (Double_t)2.70670566473225516e-01
> root [30] TMath::Poisson(2.,2.)
> (Double_t)2.70670566473225516e-01
> root [31] 
> 
> 
> 
> root [31] 
> root [31] TMath::Power(2,0)/TMath::Gamma(0+1)/TMath::Exp(2)
> (double)1.35335283236612702e-01
> root [32] TMath::Power(2,1)/TMath::Gamma(1+1)/TMath::Exp(2)
> (double)2.70670566473225516e-01
> root [33] TMath::Power(2,2)/TMath::Gamma(2+1)/TMath::Exp(2)
> (double)2.70670566473225516e-01
> 
> 
> 
> 



This archive was generated by hypermail 2b29 : Thu Jan 01 2004 - 17:50:16 MET