Commit 5c4bf8a8 authored by Lynn Garren's avatar Lynn Garren

merge Mark's changes

parent 82bf60f0
Tue May 11 2004 Mark Fischler <mf@fnal.gov>
* RandPoissonT.cc
* RandPoissonQ.cc
Repaired misbehavior when mean is precisely 100.0 in these routines.
Thu Apr 29 2004 Mark Fischler <mf@fnal.gov>
* LorentzVectorK.cc
......
// $Id: RandPoissonQ.cc,v 1.4 2003/08/13 20:00:12 garren Exp $
// $Id: RandPoissonQ.cc,v 1.4.4.1 2004/05/11 14:48:43 garren Exp $
// -*- C++ -*-
//
// -----------------------------------------------------------------------
......@@ -13,6 +13,8 @@
// - Implemented "quick()" methods, shich are the same as the
// new methods for mu < 100 and are a skew-corrected gaussian
// approximation for large mu.
// M. Fischler - Removed mean=100 from the table-driven set, since it
// uses a value just off the end of the table. (April 2004)
//
// =======================================================================
......@@ -114,7 +116,7 @@ long RandPoissonQ::fire(double mean) {
}
long RandPoissonQ::fire() {
if ( defaultMean <= LAST_MU + S ) {
if ( defaultMean < LAST_MU + S ) {
return poissonDeviateSmall ( getLocalEngine(), defaultMean );
} else {
return poissonDeviateQuick ( getLocalEngine(), a0, a1, a2, sigma );
......@@ -134,7 +136,7 @@ long RandPoissonQ::shoot(HepRandomEngine* anEngine, double mean) {
static double lastA2;
static double lastSigma;
if ( mean <= LAST_MU + S ) {
if ( mean < LAST_MU + S ) {
return poissonDeviateSmall ( getTheEngine(), mean );
} else {
if ( mean != lastLargeMean ) {
......
// $Id: RandPoissonT.cc,v 1.4 2003/08/13 20:00:12 garren Exp $
// $Id: RandPoissonT.cc,v 1.4.4.1 2004/05/11 14:48:43 garren Exp $
// -*- C++ -*-
//
// -----------------------------------------------------------------------
......@@ -13,6 +13,9 @@
// implementation of RandPoisson.
// M. Fischler - Moved the table driven algorithms into RandPoissonT (here)
// 1/26/00.
// M. Fischler - Removed mean=100 from the table-driven set, since it
// uses a value just off the end of the table. (April 2004)
//
// =======================================================================
#include "CLHEP/Random/defs.h"
......@@ -63,7 +66,7 @@ long RandPoissonT::fire(double mean) {
long RandPoissonT::fire() {
if ( defaultMean <= RandPoissonQ::tableBoundary() ) {
if ( defaultMean < RandPoissonQ::tableBoundary() ) {
return RandPoissonQ::shoot ( getLocalEngine(), defaultMean );
} else {
return RandPoisson::shoot(getLocalEngine(), defaultMean);
......@@ -73,7 +76,7 @@ long RandPoissonT::fire() {
long RandPoissonT::shoot(HepRandomEngine* anEngine, double mean) {
if ( mean <= RandPoissonQ::tableBoundary() ) {
if ( mean < RandPoissonQ::tableBoundary() ) {
return RandPoissonQ::shoot ( anEngine, mean );
} else {
return RandPoisson::shoot( anEngine, mean );
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment