Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
CLHEP
CLHEP
Commits
0f787999
Commit
0f787999
authored
May 11, 2004
by
Mark Fishcler
Browse files
Repaired misbehavior when mean is precisely 100.0 (wrong use of table)
parent
cbcb047c
Changes
3
Hide whitespace changes
Inline
Side-by-side
ChangeLog
View file @
0f787999
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
...
...
Random/src/RandPoissonQ.cc
View file @
0f787999
// $Id: RandPoissonQ.cc,v 1.4 200
3
/0
8
/1
3 20:00:12 garren
Exp $
// $Id: RandPoissonQ.cc,v 1.4
.2.1
200
4
/0
5
/1
1 14:09:21 fischler
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
)
{
...
...
Random/src/RandPoissonT.cc
View file @
0f787999
// $Id: RandPoissonT.cc,v 1.4 200
3
/0
8
/1
3 20:00:12 garren
Exp $
// $Id: RandPoissonT.cc,v 1.4
.2.1
200
4
/0
5
/1
1 14:09:21 fischler
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
);
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment