source: trunk/MagicSoft/Simulation/Corsika/Mmcs/single.f@ 10099

Last change on this file since 10099 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: 5.6 KB
Line 
1 SUBROUTINE SINGLE( E,KIND,AMASS,ASMASS )
2
3C-----------------------------------------------------------------------
4C SINGLE (PARTICLE)
5C
6C NUCLEON, ANTINUCLEON, PION OR KAON INITIATED
7C HANDLES SINGLE PARTICLE CASE
8C THIS SUBROUTINE IS CALLED FROM MANY BOX ROUTINES
9C ARGUMENTS:
10C E = AVAILABLE ENERGY IN CM
11C KIND = 1 BACKWARD PARTICLE
12C = 0 FORWARD PARTICLE
13C AMASS = MASS OF SINGLE PARTICLE
14C ASMASS = MASS TO BE LEFT OVER FOR OTHER PARTICLES
15C-----------------------------------------------------------------------
16
17 IMPLICIT DOUBLE PRECISION (A-H,O-Z)
18*KEEP,CONST.
19 COMMON /CONST/ PI,PI2,OB3,TB3,ENEPER
20 DOUBLE PRECISION PI,PI2,OB3,TB3,ENEPER
21*KEEP,ELASTY.
22 COMMON /ELASTY/ ELAST,IELIS,IELHM,IELNU,IELPI
23 DOUBLE PRECISION ELAST
24 INTEGER IELIS(20),IELHM(20),IELNU(20),IELPI(20)
25*KEEP,PAM.
26 COMMON /PAM/ PAMA,SIGNUM
27 DOUBLE PRECISION PAMA(6000),SIGNUM(6000)
28*KEEP,PARPAR.
29 COMMON /PARPAR/ CURPAR,SECPAR,PRMPAR,OUTPAR,C,
30 * E00,E00PN,PTOT0,PTOT0N,THICKH,ITYPE,LEVL
31 DOUBLE PRECISION CURPAR(14),SECPAR(14),PRMPAR(14),OUTPAR(14),
32 * C(50),E00,E00PN,PTOT0,PTOT0N,THICKH
33 INTEGER ITYPE,LEVL
34*KEEP,PARPAE.
35 DOUBLE PRECISION GAMMA,COSTHE,PHI,H,T,X,Y,CHI,BETA,GCM,ECM
36 EQUIVALENCE (CURPAR(2),GAMMA), (CURPAR(3),COSTHE),
37 * (CURPAR(4), PHI ), (CURPAR(5), H ),
38 * (CURPAR(6), T ), (CURPAR(7), X ),
39 * (CURPAR(8), Y ), (CURPAR(9), CHI ),
40 * (CURPAR(10),BETA), (CURPAR(11),GCM ),
41 * (CURPAR(12),ECM )
42*KEEP,RANDPA.
43 COMMON /RANDPA/ FAC,U1,U2,RD,NSEQ,ISEED,KNOR
44 DOUBLE PRECISION FAC,U1,U2
45 REAL RD(3000)
46 INTEGER ISEED(103,10),NSEQ
47 LOGICAL KNOR
48*KEEP,RUNPAR.
49 COMMON /RUNPAR/ FIXHEI,THICK0,HILOECM,HILOELB,
50 * STEPFC,NRRUN,NSHOW,PATAPE,MONIIN,
51 * MONIOU,MDEBUG,NUCNUC,
52 * CETAPE,
53 * SHOWNO,ISHW,NOPART,NRECS,NBLKS,MAXPRT,NDEBDL,
54 * N1STTR,MDBASE,
55 * DEBDEL,DEBUG,FDECAY,FEGS,FIRSTI,FIXINC,FIXTAR,
56 * FIX1I,FMUADD,FNKG,FPRINT,FDBASE
57 * ,GHEISH,GHESIG
58 COMMON /RUNPAC/ DSN,HOST,USER
59 DOUBLE PRECISION FIXHEI,THICK0,HILOECM,HILOELB
60 REAL STEPFC
61 INTEGER NRRUN,NSHOW,PATAPE,MONIIN,MONIOU,MDEBUG,NUCNUC,
62 * SHOWNO,ISHW,NOPART,NRECS,NBLKS,MAXPRT,NDEBDL,
63 * N1STTR,MDBASE
64 INTEGER CETAPE
65 CHARACTER*79 DSN
66 CHARACTER*20 HOST,USER
67
68 LOGICAL DEBDEL,DEBUG,FDECAY,FEGS,FIRSTI,FIXINC,FIXTAR,
69 * FIX1I,FMUADD,FNKG,FPRINT,FDBASE
70 * ,GHEISH,GHESIG
71*KEEP,VKIN.
72 COMMON /VKIN/ BETACM
73 DOUBLE PRECISION BETACM
74*KEND.
75
76C-----------------------------------------------------------------------
77
78 IF ( DEBUG ) WRITE(MDEBUG,201)E,KIND,AMASS,ASMASS
79 201 FORMAT(' SINGLE: E,KIND,AMASS,ASMASS=',1P,E10.4,I3,2E10.4)
80
81 IF ( KIND .NE. 0 ) GOTO 100
82
83C - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
84C FORWARD PARTICLE
85C NUCLEON, ANTINUCLEON, PION, OR KAON
86C PIONS AND / OR KAONS ARE ALWAYS FORWARD
87
88 GFCM = ( E**2 + AMASS**2 - ASMASS**2 ) * 0.5D0 / (E*AMASS)
89 GFCM = MAX( 1.D0, GFCM )
90 BEFCM = SQRT( GFCM**2 - 1.D0 ) / GFCM
91 GFLAB = GCM * GFCM * ( 1.D0 + BETACM * BEFCM )
92 PT = PTRANS(DUMMY)
93 PLLAB2 = MAX( 1.D-6, AMASS**2*(GFLAB**2-1.D0) )
94 CTHETA = SQRT( PLLAB2 / (PT**2+PLLAB2) )
95 IF ( CTHETA .LT. C(27) ) GOTO 3
96 CALL RMMAR( RD,2,1 )
97 CALL ADDANG( COSTHE,PHI, CTHETA,RD(1)*PI2, SECPAR(3),SECPAR(4) )
98 IF ( SECPAR(3) .LT. C(29) ) GOTO 3
99
100C CHARGE ASSIGNMENT
101 IF ( ITYPE .EQ. 10 .OR. ITYPE .EQ. 11 .OR.
102 * ITYPE .EQ. 12 .OR. ITYPE .EQ. 16 ) THEN
103 SECPAR(1) = CURPAR(1)
104 ELSE
105 IF ( RD(2) .LT. 0.5 ) THEN
106 IADD = 1
107 ELSE
108 IADD = 0
109 ENDIF
110 IF ( ITYPE .EQ. 13 .OR. ITYPE .EQ. 14 ) THEN
111 SECPAR(1) = 13 + IADD
112 ELSEIF ( ITYPE .EQ. 8 .OR. ITYPE .EQ. 9 ) THEN
113 SECPAR(1) = 8 + IADD
114 ELSEIF ( ITYPE .EQ. 15 .OR. ITYPE .EQ. 25 ) THEN
115 SECPAR(1) = 15 + IADD * 10
116 ENDIF
117 ENDIF
118 SECPAR(2) = GFLAB
119 DO 1 J = 5,8
120 SECPAR(J) = CURPAR(J)
121 1 CONTINUE
122 CALL TSTACK
123
124 3 CONTINUE
125
126C STATISTICS ON ELASTICITY
127 IN = 1.D0 + SECPAR(2) / GAMMA * 20.D0
128 IN = MIN( IN, 20 )
129 IF ( ITYPE .EQ. 13 .OR. ITYPE .EQ. 14 .OR.
130 * ITYPE .EQ. 15 .OR. ITYPE .EQ. 25 ) THEN
131 IELNU(IN) = IELNU(IN) + 1
132 ELSE
133 IELPI(IN) = IELPI(IN) + 1
134 ENDIF
135 RETURN
136
137C - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
138C RECOIL PARTICLE, NUCLEON ONLY
139C FROM SIMPLE RECOIL SPECTRUM COMPUTED
140 100 CONTINUE
141 HELP = MIN( C(10), GAMMA*0.5D0 )
142 CALL RMMAR( RD,3,1 )
143 GRLAB = RD(1)*(HELP-1.D0)+ 1.D0
144 PT = PTRANS(DUMMY)
145 PLLAB2 = MAX( 1.D-6, PAMA(14)**2*(GRLAB**2-1.D0) )
146 CTHETA = SQRT( PLLAB2 / (PT**2+PLLAB2) )
147 IF ( CTHETA .LT. C(27) ) RETURN
148 CALL ADDANG( COSTHE,PHI, CTHETA,RD(2)*PI2, SECPAR(3),SECPAR(4) )
149 IF ( SECPAR(3) .LT. C(29) ) RETURN
150 SECPAR(2)=GRLAB
151
152C CHARGE ASSIGNEMENT
153 IF ( RD(3) .GE. 0.5 ) THEN
154 SECPAR(1) = 14.D0
155 ELSE
156 SECPAR(1) = 13.D0
157 ENDIF
158
159 DO 103 J = 5,8
160 SECPAR(J) = CURPAR(J)
161 103 CONTINUE
162 CALL TSTACK
163
164 RETURN
165 END
Note: See TracBrowser for help on using the repository browser.