source: trunk/MagicSoft/Simulation/Corsika/Mmcs/ledeny.f@ 9338

Last change on this file since 9338 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: 6.5 KB
Line 
1 SUBROUTINE LEDENY( LEDEFL )
2
3C-----------------------------------------------------------------------
4C LE(A)D(ER'S) EN(ERG)Y
5C
6C SELECTS THE FEYNMAN X OF THE ANTILEADING PARTICLES FROM A THEORETICAL
7C DISTRIBUTION AND CALCULATES THE RAPIDITY FROM IT
8C CALCULATE THE RAPIDITY OF THE LEADER FROM THE REMAINDER OF ENERGY
9C THIS SUBROUTINE IS CALLED FROM HDPM
10C ARGUMENT:
11C LEDEFL = 0 CORRECT ENDING OF LEDENY
12C = 1 NOT CORRECT ENDING OF LEDENY
13C-----------------------------------------------------------------------
14
15 IMPLICIT DOUBLE PRECISION (A-H,O-Z)
16*KEEP,INTER.
17 COMMON /INTER/ AVCH,AVCH3,DC0,DLOG,DMLOG,ECMDIF,ECMDPM,ELAB,
18 * FNEUT,FNEUT2,GNU,PLAB,POSC2,POSC3,POSN2,POSN3,
19 * RC3TO2,S,SEUGF,SEUGP,SLOG,SLOGSQ,SMLOG,
20 * WIDC2,WIDC3,WIDN2,WIDN3,YCM,YY0,ZN,
21 * IDIF,ITAR
22 DOUBLE PRECISION AVCH,AVCH3,DC0,DLOG,DMLOG,ECMDIF,ECMDPM,ELAB,
23 * FNEUT,FNEUT2,GNU,PLAB,POSC2,POSC3,POSN2,POSN3,
24 * RC3TO2,S,SEUGF,SEUGP,SLOG,SLOGSQ,SMLOG,
25 * WIDC2,WIDC3,WIDN2,WIDN3,YCM,YY0,ZN
26 INTEGER IDIF,ITAR
27*KEEP,LEPAR.
28 COMMON /LEPAR/ LEPAR1,LEPAR2,LASTPI,NRESPC,NRESPN,NCPLUS
29 INTEGER LEPAR1,LEPAR2,LASTPI,NRESPC,NRESPN,NCPLUS
30*KEEP,NEWPAR.
31 COMMON /NEWPAR/ EA,PT2,PX,PY,TMAS,YR,ITYP,
32 * IA1,IA2,IB1,IB2,IC1,IC2,ID1,ID2,IE1,IE2,IF1,IF2,
33 * IG1,IG2,IH1,IH2,II1,II2,IJ1,NTOT
34 DOUBLE PRECISION EA(3000),PT2(3000),PX(3000),PY(3000),TMAS(3000),
35 * YR(3000)
36 INTEGER ITYP(3000),
37 * IA1,IA2,IB1,IB2,IC1,IC2,ID1,ID2,IE1,IE2,IF1,IF2,
38 * IG1,IG2,IH1,IH2,II1,II2,IJ1,NTOT
39*KEEP,PAM.
40 COMMON /PAM/ PAMA,SIGNUM
41 DOUBLE PRECISION PAMA(6000),SIGNUM(6000)
42*KEEP,PARPAR.
43 COMMON /PARPAR/ CURPAR,SECPAR,PRMPAR,OUTPAR,C,
44 * E00,E00PN,PTOT0,PTOT0N,THICKH,ITYPE,LEVL
45 DOUBLE PRECISION CURPAR(14),SECPAR(14),PRMPAR(14),OUTPAR(14),
46 * C(50),E00,E00PN,PTOT0,PTOT0N,THICKH
47 INTEGER ITYPE,LEVL
48*KEEP,PARPAE.
49 DOUBLE PRECISION GAMMA,COSTHE,PHI,H,T,X,Y,CHI,BETA,GCM,ECM
50 EQUIVALENCE (CURPAR(2),GAMMA), (CURPAR(3),COSTHE),
51 * (CURPAR(4), PHI ), (CURPAR(5), H ),
52 * (CURPAR(6), T ), (CURPAR(7), X ),
53 * (CURPAR(8), Y ), (CURPAR(9), CHI ),
54 * (CURPAR(10),BETA), (CURPAR(11),GCM ),
55 * (CURPAR(12),ECM )
56*KEEP,RANDPA.
57 COMMON /RANDPA/ FAC,U1,U2,RD,NSEQ,ISEED,KNOR
58 DOUBLE PRECISION FAC,U1,U2
59 REAL RD(3000)
60 INTEGER ISEED(103,10),NSEQ
61 LOGICAL KNOR
62*KEEP,RUNPAR.
63 COMMON /RUNPAR/ FIXHEI,THICK0,HILOECM,HILOELB,
64 * STEPFC,NRRUN,NSHOW,PATAPE,MONIIN,
65 * MONIOU,MDEBUG,NUCNUC,
66 * CETAPE,
67 * SHOWNO,ISHW,NOPART,NRECS,NBLKS,MAXPRT,NDEBDL,
68 * N1STTR,MDBASE,
69 * DEBDEL,DEBUG,FDECAY,FEGS,FIRSTI,FIXINC,FIXTAR,
70 * FIX1I,FMUADD,FNKG,FPRINT,FDBASE
71 * ,GHEISH,GHESIG
72 COMMON /RUNPAC/ DSN,HOST,USER
73 DOUBLE PRECISION FIXHEI,THICK0,HILOECM,HILOELB
74 REAL STEPFC
75 INTEGER NRRUN,NSHOW,PATAPE,MONIIN,MONIOU,MDEBUG,NUCNUC,
76 * SHOWNO,ISHW,NOPART,NRECS,NBLKS,MAXPRT,NDEBDL,
77 * N1STTR,MDBASE
78 INTEGER CETAPE
79 CHARACTER*79 DSN
80 CHARACTER*20 HOST,USER
81
82 LOGICAL DEBDEL,DEBUG,FDECAY,FEGS,FIRSTI,FIXINC,FIXTAR,
83 * FIX1I,FMUADD,FNKG,FPRINT,FDBASE
84 * ,GHEISH,GHESIG
85*KEEP,VKIN.
86 COMMON /VKIN/ BETACM
87 DOUBLE PRECISION BETACM
88*KEND.
89
90 DATA SL / 3.D0 /
91C-----------------------------------------------------------------------
92
93 IF ( DEBUG ) WRITE(MDEBUG,*) 'LEDENY: ITYPE,ITAR=',ITYPE,ITAR
94
95C BETACM IS AVAILABLE IN COMMON /VKIN/ BUT NOT FOR PHOTOPRODUCTION
96 IF ( ITYPE .EQ. 7 ) BETACM = SQRT( 1.D0 - 1.D0 / GCM**2 )
97
98C MOMENTUM OF INCOMING TARGET IN CM SYSTEM
99 PNT = PAMA(ITAR) * GCM * BETACM
100 IF ( DEBUG ) WRITE(MDEBUG,*) 'LEDENY: PNT=',SNGL(PNT)
101
102C GET FEYNMAN X FOR ANTILEADER DEPENDING ON ENERGY
103C DISCRIPTION OF THE FEYNMAN X DISTRIBUTION DEPENDING ON ENERGY
104C DN/DXF = SL*XF 0 < XF < X1
105C DN/DXF = SL*X1 X1 < XF < X2
106C DN/DXF = SL*X1 * EXP(-AL*(XF-X2)) X2 < XF < 1
107
108 IF ( ECMDPM .LT. 13.76D0 ) THEN
109 X1 = 0.20D0
110 X2 = 0.65D0
111 AL = 1.265D0
112 ELSEIF ( ECMDPM .LT. 5580.D0 ) THEN
113 X1 = 0.716D0 + 0.00543D0 * SMLOG
114 X2 = 0.8175D0 - 0.032D0 * SMLOG
115 AL = 1.14D0 + 0.022D0 * SMLOG
116 ELSE
117 X1 = 0.265D0
118 X2 = 0.265D0
119 AL = 1.14D0 + 0.022D0*SMLOG
120 ENDIF
121
122C CALCULATE THE INTEGRALS OVER THE THREE PARTS OF THE FUNCTION
123 AA = 0.5D0 * SL * X1**2
124 BB = SL * X1 * (X2 - X1)
125 CC = SL * X1 / AL * ( 1.D0 - EXP( AL*(X2-1.D0) ) )
126C NORMALIZE TO 1
127 TT = 1.D0 / (AA + BB + CC)
128 CC = CC * TT
129 AA = AA * TT
130 BB = BB * TT
131 AB = AA + BB
132
133 CALL RMMAR( RD,1,1 )
134C GET XF FOR ANTILEADER
135 IF ( RD(1) .LE. AA ) THEN
136 XF = SQRT( RD(1)*2.D0 / (SL*TT) )
137 ELSEIF ( RD(1) .LE. AB ) THEN
138 XF = (RD(1)-AA) / (SL*X1*TT) + X1
139 ELSE
140 XF = X2 - LOG( 1.D0 - (RD(1)-AB)*AL/(SL*X1*TT) ) / AL
141 ENDIF
142 IF ( DEBUG ) WRITE(MDEBUG,*) 'LEDENY: XF(TARGET)=',SNGL(XF)
143
144C CONVERT FEYNMAN X INTO RAPIDITY FOR ANTILEADER
145 PLAL = PNT * XF * PAMA(LEPAR2) / PAMA(ITAR)
146 EA(2) = SQRT(PLAL**2 + TMAS(2)**2)
147* YR(2) = -0.5D0 * LOG( (EA(2)+PLAL)/(EA(2)-PLAL) )
148 YR(2) = - LOG( (EA(2)+PLAL)/TMAS(2) )
149
150C CALCULATE THE REMAINDER OF ENERGY AND LONG. MOMENTUM OF LEADER
151C THIS HOLDS ALSO FOR MULTIPLE COLLISIONS (GNU > 1)
152 ESUM = 0.D0
153 DO 10 I = 2,NTOT
154 EA(I) = TMAS(I) * COSH( YR(I) + YCM )
155 ESUM = ESUM + EA(I)
156 10 CONTINUE
157 EA(1) = ELAB + PAMA(ITAR) - ESUM
158 IF ( EA(1) .LE. TMAS(1) ) THEN
159 LEDEFL = 1
160 RETURN
161 ENDIF
162 PLLBSQ = EA(1)**2 - TMAS(1)**2
163 PLLB = SQRT( PLLBSQ )
164* YR(1) = 0.5D0 * LOG( (EA(1) + PLLB) / (EA(1) - PLLB) ) - YCM
165 YR(1) = LOG( (EA(1) + PLLB) / TMAS(1) ) - YCM
166 IF ( DEBUG ) WRITE(MDEBUG,*) 'LEDENY: EA(1),YR(2),YR(1)=',
167 * SNGL(EA(1)),SNGL(YR(2)),SNGL(YR(1))
168 LEDEFL = 0
169 RETURN
170 END
Note: See TracBrowser for help on using the repository browser.