source: trunk/MagicSoft/Simulation/Corsika/Mmcs/ptram.f@ 10100

Last change on this file since 10100 was 286, checked in by harald, 25 years ago
This is the start point for further developments of the Magic Monte Carlo Simulation written by Jose Carlos Gonzales. Now it is under control of one CVS repository for the whole collaboration. Everyone should use this CVS repository for further developments.
File size: 3.4 KB
Line 
1 SUBROUTINE PTRAM( ZN,FACT,PTX,PTY )
2
3C-----------------------------------------------------------------------
4C TRA(NSVERSE MOMENTUM FROM) M(IMI EXPERIMENT)
5C
6C GENERATION OF TRANSVERSE MOMENTUM FOR PARTICLES IN HDPM GENERATOR
7C SEE RESULTS FROM UA1/MIMI/96
8C SOME CONSTANTS CHANGED FROM MATHEMATICAL SOLUTION BY DICHOTOMY TO
9C TO TAKE INTO ACCOUNT EFFECT OF REJECTIONS. (TESTIFIED AT VS=630 GEV
10C ONLY) SEE J.N. CAPDEVIELLE, 24TH ICRC, ROMA 1995
11C AND J.N. CAPDEVIELLE, 9TH ISVHECRI, KARLSRUHE 1996
12C THIS SUBROUTINE IS CALLED FROM PPARAM
13C ARGUMENTS:
14C ZN = POWER OF TRANSV. MOMENTUM FUNCTION, DEP. ON CENT.RAP.DENSITY
15C FACT = FACTOR TAKING INTO ACCOUNT PARTICLE SPECIFIC TRANSV.MOMENTUM
16C PTX = TRANSVERSE MOMENTUM IN X DIRECTION
17C PTY = TRANSVERSE MOMENTUM IN Y DIRECTION
18C
19C DESIGN : J.N. CAPDEVIELLE CDF PARIS
20C CHANGES : D. HECK IK3 FZK KARLSRUHE
21C-----------------------------------------------------------------------
22
23 IMPLICIT DOUBLE PRECISION (A-H,O-Z)
24*KEEP,CONST.
25 COMMON /CONST/ PI,PI2,OB3,TB3,ENEPER
26 DOUBLE PRECISION PI,PI2,OB3,TB3,ENEPER
27*KEEP,RANDPA.
28 COMMON /RANDPA/ FAC,U1,U2,RD,NSEQ,ISEED,KNOR
29 DOUBLE PRECISION FAC,U1,U2
30 REAL RD(3000)
31 INTEGER ISEED(103,10),NSEQ
32 LOGICAL KNOR
33*KEEP,RUNPAR.
34 COMMON /RUNPAR/ FIXHEI,THICK0,HILOECM,HILOELB,
35 * STEPFC,NRRUN,NSHOW,PATAPE,MONIIN,
36 * MONIOU,MDEBUG,NUCNUC,
37 * CETAPE,
38 * SHOWNO,ISHW,NOPART,NRECS,NBLKS,MAXPRT,NDEBDL,
39 * N1STTR,MDBASE,
40 * DEBDEL,DEBUG,FDECAY,FEGS,FIRSTI,FIXINC,FIXTAR,
41 * FIX1I,FMUADD,FNKG,FPRINT,FDBASE
42 * ,GHEISH,GHESIG
43 COMMON /RUNPAC/ DSN,HOST,USER
44 DOUBLE PRECISION FIXHEI,THICK0,HILOECM,HILOELB
45 REAL STEPFC
46 INTEGER NRRUN,NSHOW,PATAPE,MONIIN,MONIOU,MDEBUG,NUCNUC,
47 * SHOWNO,ISHW,NOPART,NRECS,NBLKS,MAXPRT,NDEBDL,
48 * N1STTR,MDBASE
49 INTEGER CETAPE
50 CHARACTER*79 DSN
51 CHARACTER*20 HOST,USER
52
53 LOGICAL DEBDEL,DEBUG,FDECAY,FEGS,FIRSTI,FIXINC,FIXTAR,
54 * FIX1I,FMUADD,FNKG,FPRINT,FDBASE
55 * ,GHEISH,GHESIG
56*KEND.
57
58C-----------------------------------------------------------------------
59
60CC IF ( DEBUG ) WRITE(MDEBUG,*) 'PTRAM : ZN=',SNGL(ZN)
61
62C TWO RANDOM NUMBERS
63 CALL RMMAR( RD,2,1 )
64C GENERATE <P_T>
65 ALFA = -0.05D0
66 B = ZN-1.D0
67 A = RD(1)/B
68 U = 0.D0
69 DO 5 J = 1,1000
70 F1 = A * (U+1.D0)**B - 1.D0/B
71 IF ( F1 .GE. U ) GOTO 15
72 U = U + 0.05D0
73 5 CONTINUE
74 15 BETA = U
75 ALFA = U - 0.05D0
76 IF ( F1-U .EQ. 0.D0 ) GOTO 30
77 I = 0
78 14 U = 0.5D0 * (ALFA+BETA)
79 I = I + 1
80 F = A * (U+1.D0)**B - 1.D0/B - U
81 IF ( F .EQ. 0.D0 ) GO TO 30
82 IF ( ABS(U-BETA) .LE. 1.D-4 ) GOTO 30
83 FA = A * (ALFA+1.D0)**B - ALFA - 1.D0/B
84 FB = B * (BETA+1.D0)**B - BETA - 1.D0/B
85 IF ( F*FA .GE. 0.D0 ) THEN
86 ALFA = U
87 ELSE
88 BETA = U
89 ENDIF
90 GO TO 14
91
92 30 XPT = 0.9154D0 * U
93C 2*PI*RANDOM NUMBER FOR ANGLE PHI
94 Z = PI2 * RD(2)
95 PTX = XPT * FACT * COS(Z)
96 PTY = XPT * FACT * SIN(Z)
97
98CC IF ( DEBUG ) WRITE(MDEBUG,*) 'PTRAM : RD(1,2),XPT=',
99CC * RD(1),RD(2),SNGL(XPT)
100
101 RETURN
102 END
Note: See TracBrowser for help on using the repository browser.