Analysis Software
Documentation for sPHENIX simulation software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
pysave.f
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file pysave.f
1 
2 C*********************************************************************
3 
4 C...PYSAVE
5 C...Saves and restores parameter and cross section values for the
6 C...3 gamma-p and 6 (or 4, or 9, or 13) gamma-gamma alternatives.
7 C...Also makes random choice between alternatives.
8 
9  SUBROUTINE pysave(ISAVE,IGA)
10 
11 C...Double precision and integer declarations.
12  IMPLICIT DOUBLE PRECISION(a-h, o-z)
13  IMPLICIT INTEGER(i-n)
14  INTEGER pyk,pychge,pycomp
15 C...Commonblocks.
16  common/pysubs/msel,mselpd,msub(500),kfin(2,-40:40),ckin(200)
17  common/pypars/mstp(200),parp(200),msti(200),pari(200)
18  common/pyint1/mint(400),vint(400)
19  common/pyint2/iset(500),kfpr(500,2),coef(500,20),icol(40,4,2)
20  common/pyint5/ngenpd,ngen(0:500,3),xsec(0:500,3)
21  common/pyint7/sigt(0:6,0:6,0:5)
22  SAVE /pysubs/,/pypars/,/pyint1/,/pyint2/,/pyint5/,/pyint7/
23 C...Local arrays and saved variables.
24  dimension ncp(15),nsubcp(15,20),msubcp(15,20),coefcp(15,20,20),
25  &ngencp(15,0:20,3),xseccp(15,0:20,3),sigtcp(15,0:6,0:6,0:5),
26  &intcp(15,20),recp(15,20)
27  SAVE ncp,nsubcp,msubcp,coefcp,ngencp,xseccp,sigtcp,intcp,recp
28 
29 C...Save list of subprocesses and cross-section information.
30  IF(isave.EQ.1) THEN
31  icp=0
32  DO 120 i=1,500
33  IF(msub(i).EQ.0.AND.i.NE.96.AND.i.NE.97) goto 120
34  icp=icp+1
35  nsubcp(iga,icp)=i
36  msubcp(iga,icp)=msub(i)
37  DO 100 j=1,20
38  coefcp(iga,icp,j)=coef(i,j)
39  100 CONTINUE
40  DO 110 j=1,3
41  ngencp(iga,icp,j)=ngen(i,j)
42  xseccp(iga,icp,j)=xsec(i,j)
43  110 CONTINUE
44  120 CONTINUE
45  ncp(iga)=icp
46  DO 130 j=1,3
47  ngencp(iga,0,j)=ngen(0,j)
48  xseccp(iga,0,j)=xsec(0,j)
49  130 CONTINUE
50  DO 160 i1=0,6
51  DO 150 i2=0,6
52  DO 140 j=0,5
53  sigtcp(iga,i1,i2,j)=sigt(i1,i2,j)
54  140 CONTINUE
55  150 CONTINUE
56  160 CONTINUE
57 
58 C...Save various common process variables.
59  DO 170 j=1,10
60  intcp(iga,j)=mint(40+j)
61  170 CONTINUE
62  intcp(iga,11)=mint(101)
63  intcp(iga,12)=mint(102)
64  intcp(iga,13)=mint(107)
65  intcp(iga,14)=mint(108)
66  intcp(iga,15)=mint(123)
67  recp(iga,1)=ckin(3)
68  recp(iga,2)=vint(318)
69 
70 C...Save cross-section information only.
71  ELSEIF(isave.EQ.2) THEN
72  DO 190 icp=1,ncp(iga)
73  i=nsubcp(iga,icp)
74  DO 180 j=1,3
75  ngencp(iga,icp,j)=ngen(i,j)
76  xseccp(iga,icp,j)=xsec(i,j)
77  180 CONTINUE
78  190 CONTINUE
79  DO 200 j=1,3
80  ngencp(iga,0,j)=ngen(0,j)
81  xseccp(iga,0,j)=xsec(0,j)
82  200 CONTINUE
83 
84 C...Choose between allowed alternatives.
85  ELSEIF(isave.EQ.3.OR.isave.EQ.4) THEN
86  IF(isave.EQ.4) THEN
87  xsumcp=0d0
88  DO 210 ig=1,mint(121)
89  xsumcp=xsumcp+xseccp(ig,0,1)
90  210 CONTINUE
91  xsumcp=xsumcp*pyr(0)
92  DO 220 ig=1,mint(121)
93  iga=ig
94  xsumcp=xsumcp-xseccp(ig,0,1)
95  IF(xsumcp.LE.0d0) goto 230
96  220 CONTINUE
97  230 CONTINUE
98  ENDIF
99 
100 C...Restore cross-section information.
101  DO 240 i=1,500
102  msub(i)=0
103  240 CONTINUE
104  DO 270 icp=1,ncp(iga)
105  i=nsubcp(iga,icp)
106  msub(i)=msubcp(iga,icp)
107  DO 250 j=1,20
108  coef(i,j)=coefcp(iga,icp,j)
109  250 CONTINUE
110  DO 260 j=1,3
111  ngen(i,j)=ngencp(iga,icp,j)
112  xsec(i,j)=xseccp(iga,icp,j)
113  260 CONTINUE
114  270 CONTINUE
115  DO 280 j=1,3
116  ngen(0,j)=ngencp(iga,0,j)
117  xsec(0,j)=xseccp(iga,0,j)
118  280 CONTINUE
119  DO 310 i1=0,6
120  DO 300 i2=0,6
121  DO 290 j=0,5
122  sigt(i1,i2,j)=sigtcp(iga,i1,i2,j)
123  290 CONTINUE
124  300 CONTINUE
125  310 CONTINUE
126 
127 C...Restore various common process variables.
128  DO 320 j=1,10
129  mint(40+j)=intcp(iga,j)
130  320 CONTINUE
131  mint(101)=intcp(iga,11)
132  mint(102)=intcp(iga,12)
133  mint(107)=intcp(iga,13)
134  mint(108)=intcp(iga,14)
135  mint(123)=intcp(iga,15)
136  ckin(3)=recp(iga,1)
137  ckin(1)=2d0*ckin(3)
138  vint(318)=recp(iga,2)
139 
140 C...Sum up cross-section info (for PYSTAT).
141  ELSEIF(isave.EQ.5) THEN
142  DO 330 i=1,500
143  msub(i)=0
144  ngen(i,1)=0
145  ngen(i,3)=0
146  xsec(i,3)=0d0
147  330 CONTINUE
148  ngen(0,1)=0
149  ngen(0,2)=0
150  ngen(0,3)=0
151  xsec(0,3)=0
152  DO 350 ig=1,mint(121)
153  DO 340 icp=1,ncp(ig)
154  i=nsubcp(ig,icp)
155  IF(msubcp(ig,icp).EQ.1) msub(i)=1
156  ngen(i,1)=ngen(i,1)+ngencp(ig,icp,1)
157  ngen(i,3)=ngen(i,3)+ngencp(ig,icp,3)
158  xsec(i,3)=xsec(i,3)+xseccp(ig,icp,3)
159  340 CONTINUE
160  ngen(0,1)=ngen(0,1)+ngencp(ig,0,1)
161  ngen(0,2)=ngen(0,2)+ngencp(ig,0,2)
162  ngen(0,3)=ngen(0,3)+ngencp(ig,0,3)
163  xsec(0,3)=xsec(0,3)+xseccp(ig,0,3)
164  350 CONTINUE
165  ENDIF
166 
167  RETURN
168  END