source: trunk/MagicSoft/Simulation/Corsika/Mmcs/pair.f@ 5059

Last change on this file since 5059 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.9 KB
Line 
1 SUBROUTINE PAIR
2C VERSION 4.00 -- 26 JAN 1986/1900
3C******************************************************************
4C FOR A PHOTON ENERGY LESS THAN 2.1 MEV, THE APPROXIMATION IS
5C MADE THAT ONE PAIR ELECTRON (OR POSITRON) HAS ONLY ITS REST
6C MASS ENERGY. FOR PHOTON ENERGY BETWEEN 2.1 MEV AND 50 MEV THE
7C BETHE-HEITLER CROSS SECTION IS EMPLOYED. ABOVE 50 MEV THE
8C COULOMB CORRECTED BETHE-HEITLER CROSS SECTION IS USED.
9C (BUTCHER AND MESSEL, OP. CIT., P. 17-19, 22).
10C******************************************************************
11 DOUBLE PRECISION PEIG,PESE1,PESE2
12 COMMON/BREMPR/DL1(6),DL2(6),DL3(6),DL4(6),DL5(6),DL6(6),DELCM, ALP
13 *HI(2),BPAR(2),DELPOS(2),PWR2I(50)
14*KEEP,RANDPA.
15 COMMON /RANDPA/ FAC,U1,U2,RD,NSEQ,ISEED,KNOR
16 DOUBLE PRECISION FAC,U1,U2
17 REAL RD(3000)
18 INTEGER ISEED(103,10),NSEQ
19 LOGICAL KNOR
20*KEEP,RUNPAR.
21 COMMON /RUNPAR/ FIXHEI,THICK0,HILOECM,HILOELB,
22 * STEPFC,NRRUN,NSHOW,PATAPE,MONIIN,
23 * MONIOU,MDEBUG,NUCNUC,
24 * CETAPE,
25 * SHOWNO,ISHW,NOPART,NRECS,NBLKS,MAXPRT,NDEBDL,
26 * N1STTR,MDBASE,
27 * DEBDEL,DEBUG,FDECAY,FEGS,FIRSTI,FIXINC,FIXTAR,
28 * FIX1I,FMUADD,FNKG,FPRINT,FDBASE
29 * ,GHEISH,GHESIG
30 COMMON /RUNPAC/ DSN,HOST,USER
31 DOUBLE PRECISION FIXHEI,THICK0,HILOECM,HILOELB
32 REAL STEPFC
33 INTEGER NRRUN,NSHOW,PATAPE,MONIIN,MONIOU,MDEBUG,NUCNUC,
34 * SHOWNO,ISHW,NOPART,NRECS,NBLKS,MAXPRT,NDEBDL,
35 * N1STTR,MDBASE
36 INTEGER CETAPE
37 CHARACTER*79 DSN
38 CHARACTER*20 HOST,USER
39
40 LOGICAL DEBDEL,DEBUG,FDECAY,FEGS,FIRSTI,FIXINC,FIXTAR,
41 * FIX1I,FMUADD,FNKG,FPRINT,FDBASE
42 * ,GHEISH,GHESIG
43*KEEP,STACKE.
44 COMMON/STACKE/ E,TIME,X,Y,Z,U,V,W,DNEAR,IQ,IGEN,IR,IOBS,LPCTE,NP
45 DOUBLE PRECISION E(60),TIME(60)
46 REAL X(60),Y(60),Z(60),U(60),V(60),W(60),DNEAR(60)
47 INTEGER IQ(60),IGEN(60),IR(60),IOBS(60),LPCTE(60),NP
48*KEND.
49 COMMON/THRESH/RMT2,RMSQ,ESCD2,AP,API,AE,UP,UE,TE,THMOLL
50 COMMON/UPHIOT/THETA,SINTHE,COSTHE,SINPHI, COSPHI,PI,TWOPI,PI5D2
51 DOUBLE PRECISION PZERO,PRM,PRMT2,RMI,VC
52 COMMON/USEFUL/PZERO,PRM,PRMT2,RMI,VC,RM,MEDIUM,MEDOLD,IBLOBE,ICALL
53 COMMON/ACLOCK/NCLOCK,JCLOCK
54C_____IF (NCLOCK.GT.JCLOCK) THEN
55C______WRITE(MDEBUG,* )' PAIR: NP=',NP,' IR=',IR(NP),' IOBS=',IOBS(NP)
56C______CALL AUSGB2
57C_____END IF
58 PEIG=E(NP)
59 EIG=PEIG
60 IF (EIG.LE.2.1) THEN
61 ESE2=PRM
62 ELSE
63 IF (EIG.LT.50.) THEN
64 LVX=1
65 LVL0=0
66 ELSE
67 LVX=2
68 LVL0=3
69 END IF
70961 CONTINUE
71 CALL RMMAR(RD,2,2)
72 RNNO30=RD(1)
73 RNNO31=RD(2)
74 IF (RNNO31.GE.BPAR(LVX)) THEN
75 LVL=LVL0+1
76 CALL RMMAR(RD,2,2)
77 RNNO32=RD(1)
78 RNNO33=RD(2)
79 BR=0.5*(1.0-MAX(RNNO32,RNNO33,RNNO30))
80 ELSE
81 LVL=LVL0+3
82 BR=RNNO30*0.5
83 END IF
84 IF((BR.EQ.0.0))GO TO961
85 DEL=1.0/(EIG*BR*(1.0-BR))
86 IF((DEL.GE.DELPOS(LVX)))GO TO961
87 DELTA=DELCM*DEL
88 IF (DELTA.LT.1.0) THEN
89 REJF=DL1(LVL)+DELTA*(DL2(LVL)+DELTA*DL3(LVL))
90 ELSE
91 REJF=DL4(LVL)+DL5(LVL)*LOG(DELTA+DL6(LVL))
92 END IF
93 CALL RMMAR(RNSCRN,1,2)
94 IF((RNSCRN.LE.REJF))GO TO962
95 GO TO 961
96962 CONTINUE
97 ESE2=BR*EIG
98 END IF
99 PESE2=ESE2
100 PESE1=PEIG-PESE2
101 E(NP)=PESE1
102 E(NP+1)=PESE2
103 THETA=RM/EIG
104 CALL UPHI(1,1)
105 NP=NP+1
106 SINTHE=-SINTHE
107 CALL UPHI(3,2)
108 CALL RMMAR(RNNO34,1,2)
109 IF (RNNO34.LE.0.5) THEN
110 IQ(NP)=2
111 IQ(NP-1)=3
112 ELSE
113 IQ(NP)=3
114 IQ(NP-1)=2
115 END IF
116 RETURN
117 END
Note: See TracBrowser for help on using the repository browser.