/[PAMELA software]/gpamela/gptrd/npoiss.F
ViewVC logotype

Annotation of /gpamela/gptrd/npoiss.F

Parent Directory Parent Directory | Revision Log Revision Log


Revision 3.1 - (hide annotations) (download)
Thu Jul 11 16:02:01 2002 UTC (22 years, 5 months ago) by cafagna
Branch: MAIN
Branch point for: v3r0
Initial revision

1 cafagna 3.1 *
2     * $Id$
3     *
4     * $Log$
5     *
6     *CMZ : 3.00/00 06/04/2001 11.21.19 by Marialuigia Ambriola
7     *-- Author : Marialuigia Ambriola 05/04/2001
8     INTEGER FUNCTION NPOISS(X)
9     **************************************
10     * Simulate the Poisson distribution
11     * From data particle book vol. 15 2000
12     **************************************
13     REAL U,A,X
14     INTEGER K,N
15     NPOISS=0
16     K=1
17     A=1.
18     100 U=RNDM(1)
19     A=U*A
20     IF(A.LT.EXP(-X)) THEN
21     N=K-1
22     ELSE
23     K=K+1
24     GOTO 100
25     ENDIF
26     NPOISS=N
27     RETURN
28     END

  ViewVC Help
Powered by ViewVC 1.1.23