[ROOT] TMath::Poisson

From: Michael Gold (gold@dirac.phys.unm.edu)
Date: Sun Oct 19 2003 - 20:18:58 MEST


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



-- 
Michael Gold
Department of Physics and Astronomy
University of New Mexico
Albuquerque, NM 87131
cell : 505-238-6155
phone: 505-277-2086, 505-277-3604
fax:   505-277-1520
email: gold@phys.unm.edu



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