1 |
* |
2 |
* $Id: gpgaus.F,v 1.5 2009-06-12 18:39:58 pam-rm2 Exp $ |
3 |
* |
4 |
* $Log: gpgaus.F,v $ |
5 |
* Revision 1.5 2009-06-12 18:39:58 pam-rm2 |
6 |
* - Introduced user-defined names of output files and random seeds number. |
7 |
* Users can do it use options of PamVMCApplication constructor: |
8 |
* PamVMCApplication(const char* name, const char *title, const char* |
9 |
* filename="pamtest", Int_t seed=0). |
10 |
* The Random object that I use is TRandom3 object which has astronomical |
11 |
* large period (in case of default initialization 0). All random generators |
12 |
* in the code use this object by calling of gRandom singleton which keeps |
13 |
* it. |
14 |
* |
15 |
* - Corrected TOF digitization routine. No problems with TDC hits due to |
16 |
* hadronic interactions anymore. |
17 |
* |
18 |
* - Some small changes was done to compile code under Root 5.23. + |
19 |
* geant4_vmc v. 2.6 without any warnings |
20 |
* |
21 |
* - Some classes of PamG4RunConfiguartion was changed for geant4_vmc v. |
22 |
* 2.6.Some obsolete classes was deleted as soon as developers implemented |
23 |
* regions. |
24 |
* |
25 |
* - Navigation was changed from "geomRootToGeant4" to "geomRoot", because on |
26 |
* VMC web page written that as soon as Geant4 has no option ONLY/MANY |
27 |
* translation of overlapped geometry to Geant4 through VGM could be wrong. |
28 |
* I'd like to stay with Root navigation: |
29 |
* http://root.cern.ch/root/vmc/Geant4VMC.html. This should be default |
30 |
* option. |
31 |
* |
32 |
* - New Tracker digitization routine written by Sergio was implemented |
33 |
* |
34 |
* - PamVMC again became compatible with geant4_vmc v.2.5 and ROOT 5.20. |
35 |
* The problem was that ROOT developers introduced in TVirtualMC class a new |
36 |
* method SetMagField and new base class:TVirtualMagField from which |
37 |
* user-defined classes shoukd be derived |
38 |
* |
39 |
* Revision 1.1 2009-02-19 17:46:25 nikolas |
40 |
* Cleaning up before releasing |
41 |
* |
42 |
* Revision 3.1.1.1 2002/07/11 16:02:00 cafagna |
43 |
* First GPAMELA release on CVS |
44 |
* |
45 |
* |
46 |
*CMZ : 2.01/00 05/04/2000 14.35.18 by Marialuigia Ambriola |
47 |
*CMZ : 2.00/00 03/03/2000 15.39.05 by Francesco Cafagna |
48 |
*CMZ : 1.01/00 06/05/96 12.57.18 by Francesco Cafagna |
49 |
*-- Author : Francesco Cafagna 03/05/96 |
50 |
REAL FUNCTION GPGAUS(XDUMMY) |
51 |
************************************************************************ |
52 |
* * |
53 |
* To generate a normally distribute deviate with zero mean and unit variance * |
54 |
* From GASDEV, Numerical recepies $7.3. * |
55 |
* Variables definition: * |
56 |
* IN: * |
57 |
* XDUMMY, dummy argument * |
58 |
* * |
59 |
* Called by:<USER> * |
60 |
* Author: Francesco Cafagna, 03/05/96 17.11.14 * |
61 |
* * |
62 |
************************************************************************ |
63 |
INTEGER ISET |
64 |
REAL V1,V2,GAS1,RVAL(2),R |
65 |
* |
66 |
DATA ISET/0/ |
67 |
* |
68 |
* Generate a random number in the circle of radius 1 |
69 |
* |
70 |
IF (ISET.EQ.0) THEN |
71 |
c PRINT*,'GPGAUSS.F calls RNDM' |
72 |
10 CALL GRNDMC(RVAL,2) |
73 |
V1 = 2.*RVAL(1) -1. |
74 |
V2 = 2.*RVAL(2) -1. |
75 |
R = V1**2 + V2**2 |
76 |
IF(R.GE.1.) GO TO 10 |
77 |
GAS1 = V1 * SQRT(-2.*LOG(R)/R) |
78 |
GPGAUS = V2 * SQRT(-2.*LOG(R)/R) |
79 |
ISET = 1 |
80 |
ELSE |
81 |
GPGAUS = GAS1 |
82 |
ISET = 0 |
83 |
ENDIF |
84 |
* |
85 |
RETURN |
86 |
END |