Analysis Software
Documentation for sPHENIX simulation software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
pylist.f
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file pylist.f
1 
2 C*********************************************************************
3 
4 C...PYLIST
5 C...Gives program heading, or lists an event, or particle
6 C...data, or current parameter values.
7 
8  SUBROUTINE pylist(MLIST)
9 
10 C...Double precision and integer declarations.
11  IMPLICIT DOUBLE PRECISION(a-h, o-z)
12  IMPLICIT INTEGER(i-n)
13  INTEGER pyk,pychge,pycomp
14 C...Parameter statement to help give large particle numbers.
15  parameter(ksusy1=1000000,ksusy2=2000000,ktechn=3000000,
16  &kexcit=4000000,kdimen=5000000)
17 
18 C...HEPEVT commonblock.
19  parameter(nmxhep=4000)
20  common/hepevt/nevhep,nhep,isthep(nmxhep),idhep(nmxhep),
21  &jmohep(2,nmxhep),jdahep(2,nmxhep),phep(5,nmxhep),vhep(4,nmxhep)
22  DOUBLE PRECISION phep,vhep
23  SAVE /hepevt/
24 
25 C...User process event common block.
26  INTEGER maxnup
27  parameter(maxnup=500)
28  INTEGER nup,idprup,idup,istup,mothup,icolup
29  DOUBLE PRECISION xwgtup,scalup,aqedup,aqcdup,pup,vtimup,spinup
30  common/hepeup/nup,idprup,xwgtup,scalup,aqedup,aqcdup,idup(maxnup),
31  &istup(maxnup),mothup(2,maxnup),icolup(2,maxnup),pup(5,maxnup),
32  &vtimup(maxnup),spinup(maxnup)
33  SAVE /hepeup/
34 
35 C...Commonblocks.
36  common/pyjets/n,npad,k(4000,5),p(4000,5),v(4000,5)
37  common/pydat1/mstu(200),paru(200),mstj(200),parj(200)
38  common/pydat2/kchg(500,4),pmas(500,4),parf(2000),vckm(4,4)
39  common/pydat3/mdcy(500,3),mdme(8000,2),brat(8000),kfdp(8000,5)
40  common/pyctag/nct,mct(4000,2)
41  SAVE /pyjets/,/pydat1/,/pydat2/,/pydat3/,/pyctag/
42 C...Local arrays, character variables and data.
43  CHARACTER chap*16,chac*16,chan*16,chad(5)*16,chdl(7)*4
44  dimension ps(6)
45  DATA chdl/'(())',' ','()','!!','<>','==','(==)'/
46 
47 C...Initialization printout: version number and date of last change.
48  IF(mlist.EQ.0.OR.mstu(12).EQ.1) THEN
49  CALL pylogo
50  mstu(12)=12345
51  IF(mlist.EQ.0) RETURN
52  ENDIF
53 
54 C...List event data, including additional lines after N.
55  IF(mlist.GE.1.AND.mlist.LE.4) THEN
56  IF(mlist.EQ.1) WRITE(mstu(11),5100)
57  IF(mlist.EQ.2) WRITE(mstu(11),5200)
58  IF(mlist.EQ.3) WRITE(mstu(11),5300)
59  IF(mlist.EQ.4) WRITE(mstu(11),5400)
60  lmx=12
61  IF(mlist.GE.2) lmx=16
62  istr=0
63  imax=n
64  IF(mstu(2).GT.0) imax=mstu(2)
65  DO 120 i=max(1,mstu(1)),max(imax,n+max(0,mstu(3)))
66  IF(i.GT.imax.AND.i.LE.n) goto 120
67  IF(mstu(15).EQ.0.AND.k(i,1).LE.0) goto 120
68  IF(mstu(15).EQ.1.AND.k(i,1).LT.0) goto 120
69 
70 C...Get particle name, pad it and check it is not too long.
71  CALL pyname(k(i,2),chap)
72  len=0
73  DO 100 lem=1,16
74  IF(chap(lem:lem).NE.' ') len=lem
75  100 CONTINUE
76  mdl=(k(i,1)+19)/10
77  ldl=0
78  IF(mdl.EQ.2.OR.mdl.GE.8) THEN
79  chac=chap
80  IF(len.GT.lmx) chac(lmx:lmx)='?'
81  ELSE
82  ldl=1
83  IF(mdl.EQ.1.OR.mdl.EQ.7) ldl=2
84  IF(len.EQ.0) THEN
85  chac=chdl(mdl)(1:2*ldl)//' '
86  ELSE
87  chac=chdl(mdl)(1:ldl)//chap(1:min(len,lmx-2*ldl))//
88  & chdl(mdl)(ldl+1:2*ldl)//' '
89  IF(len+2*ldl.GT.lmx) chac(lmx:lmx)='?'
90  ENDIF
91  ENDIF
92 
93 C...Add information on string connection.
94  IF(k(i,1).EQ.1.OR.k(i,1).EQ.2.OR.k(i,1).EQ.11.OR.k(i,1).EQ.12)
95  & THEN
96  kc=pycomp(k(i,2))
97  kcc=0
98  IF(kc.NE.0) kcc=kchg(kc,2)
99  IF(iabs(k(i,2)).EQ.39) THEN
100  IF(len+2*ldl+3.LE.lmx) chac(lmx-1:lmx-1)='X'
101  ELSEIF(kcc.NE.0.AND.istr.EQ.0) THEN
102  istr=1
103  IF(len+2*ldl+3.LE.lmx) chac(lmx-1:lmx-1)='A'
104  ELSEIF(kcc.NE.0.AND.(k(i,1).EQ.2.OR.k(i,1).EQ.12)) THEN
105  IF(len+2*ldl+3.LE.lmx) chac(lmx-1:lmx-1)='I'
106  ELSEIF(kcc.NE.0) THEN
107  istr=0
108  IF(len+2*ldl+3.LE.lmx) chac(lmx-1:lmx-1)='V'
109  ENDIF
110  ENDIF
111  IF((k(i,1).EQ.41.OR.k(i,1).EQ.51).AND.len+2*ldl+3.LE.lmx)
112  & chac(lmx-1:lmx-1)='I'
113 
114 C...Write data for particle/jet.
115  IF(mlist.EQ.1.AND.abs(p(i,4)).LT.9999d0) THEN
116  WRITE(mstu(11),5500) i,chac(1:12),(k(i,j1),j1=1,3),
117  & (p(i,j2),j2=1,5)
118  ELSEIF(mlist.EQ.1.AND.abs(p(i,4)).LT.99999d0) THEN
119  WRITE(mstu(11),5600) i,chac(1:12),(k(i,j1),j1=1,3),
120  & (p(i,j2),j2=1,5)
121  ELSEIF(mlist.EQ.1) THEN
122  WRITE(mstu(11),5700) i,chac(1:12),(k(i,j1),j1=1,3),
123  & (p(i,j2),j2=1,5)
124  ELSEIF(mstu(5).EQ.10000.AND.(k(i,1).EQ.3.OR.k(i,1).EQ.13.OR.
125  & k(i,1).EQ.14.OR.k(i,1).EQ.42.OR.k(i,1).EQ.52)) THEN
126  IF(mlist.NE.4) WRITE(mstu(11),5800) i,chac,(k(i,j1),j1=1,3),
127  & k(i,4)/100000000,mod(k(i,4)/10000,10000),mod(k(i,4),10000),
128  & k(i,5)/100000000,mod(k(i,5)/10000,10000),mod(k(i,5),10000),
129  & (p(i,j2),j2=1,5)
130  IF(mlist.EQ.4) WRITE(mstu(11),5900) i,chac,(k(i,j1),j1=1,3),
131  & k(i,4)/100000000,mod(k(i,4)/10000,10000),mod(k(i,4),10000),
132  & k(i,5)/100000000,mod(k(i,5)/10000,10000),mod(k(i,5)
133  & ,10000),mct(i,1),mct(i,2)
134  ELSE
135  IF(mlist.NE.4) WRITE(mstu(11),6000) i,chac,(k(i,j1),j1=1,5),
136  & (p(i,j2),j2=1,5)
137  IF(mlist.EQ.4) WRITE(mstu(11),6100) i,chac,(k(i,j1),j1=1,5)
138  & ,mct(i,1),mct(i,2)
139  ENDIF
140  IF(mlist.EQ.3) WRITE(mstu(11),6200) (v(i,j),j=1,5)
141 
142 C...Insert extra separator lines specified by user.
143  IF(mstu(70).GE.1) THEN
144  isep=0
145  DO 110 j=1,min(10,mstu(70))
146  IF(i.EQ.mstu(70+j)) isep=1
147  110 CONTINUE
148  IF(isep.EQ.1) THEN
149  IF(mlist.EQ.1) WRITE(mstu(11),6300)
150  IF(mlist.EQ.2.OR.mlist.EQ.3) WRITE(mstu(11),6400)
151  IF(mlist.EQ.4) WRITE(mstu(11),6500)
152  ENDIF
153  ENDIF
154  120 CONTINUE
155 
156 C...Sum of charges and momenta.
157  DO 130 j=1,6
158  ps(j)=pyp(0,j)
159  130 CONTINUE
160  IF(mlist.EQ.1.AND.abs(ps(4)).LT.9999d0) THEN
161  WRITE(mstu(11),6600) ps(6),(ps(j),j=1,5)
162  ELSEIF(mlist.EQ.1.AND.abs(ps(4)).LT.99999d0) THEN
163  WRITE(mstu(11),6700) ps(6),(ps(j),j=1,5)
164  ELSEIF(mlist.EQ.1) THEN
165  WRITE(mstu(11),6800) ps(6),(ps(j),j=1,5)
166  ELSEIF(mlist.LE.3) THEN
167  WRITE(mstu(11),6900) ps(6),(ps(j),j=1,5)
168  ELSE
169  WRITE(mstu(11),7000) ps(6)
170  ENDIF
171 
172 C...Simple listing of HEPEVT entries (mainly for test purposes).
173  ELSEIF(mlist.EQ.5) THEN
174  WRITE(mstu(11),7100)
175  DO 140 i=1,nhep
176  IF(isthep(i).EQ.0) goto 140
177  WRITE(mstu(11),7200) i,isthep(i),idhep(i),jmohep(1,i),
178  & jmohep(2,i),jdahep(1,i),jdahep(2,i),(phep(j,i),j=1,5)
179  140 CONTINUE
180 
181 
182 C...Simple listing of user-process entries (mainly for test purposes).
183  ELSEIF(mlist.EQ.7) THEN
184  WRITE(mstu(11),7300)
185  DO 150 i=1,nup
186  WRITE(mstu(11),7400) i,istup(i),idup(i),mothup(1,i),
187  & mothup(2,i),icolup(1,i),icolup(2,i),(pup(j,i),j=1,5)
188  150 CONTINUE
189 
190 C...Give simple list of KF codes defined in program.
191  ELSEIF(mlist.EQ.11) THEN
192  WRITE(mstu(11),7500)
193  DO 160 kf=1,80
194  CALL pyname(kf,chap)
195  CALL pyname(-kf,chan)
196  IF(chap.NE.' '.AND.chan.EQ.' ') WRITE(mstu(11),7600) kf,chap
197  IF(chan.NE.' ') WRITE(mstu(11),7600) kf,chap,-kf,chan
198  160 CONTINUE
199  DO 190 kfls=1,3,2
200  DO 180 kfla=1,5
201  DO 170 kflb=1,kfla-(3-kfls)/2
202  kf=1000*kfla+100*kflb+kfls
203  CALL pyname(kf,chap)
204  CALL pyname(-kf,chan)
205  WRITE(mstu(11),7600) kf,chap,-kf,chan
206  170 CONTINUE
207  180 CONTINUE
208  190 CONTINUE
209  DO 220 kmul=0,5
210  kfls=3
211  IF(kmul.EQ.0.OR.kmul.EQ.3) kfls=1
212  IF(kmul.EQ.5) kfls=5
213  kflr=0
214  IF(kmul.EQ.2.OR.kmul.EQ.3) kflr=1
215  IF(kmul.EQ.4) kflr=2
216  DO 210 kflb=1,5
217  DO 200 kflc=1,kflb-1
218  kf=10000*kflr+100*kflb+10*kflc+kfls
219  CALL pyname(kf,chap)
220  CALL pyname(-kf,chan)
221  WRITE(mstu(11),7600) kf,chap,-kf,chan
222  IF(kf.EQ.311) THEN
223  kfk=130
224  CALL pyname(kfk,chap)
225  WRITE(mstu(11),7600) kfk,chap
226  kfk=310
227  CALL pyname(kfk,chap)
228  WRITE(mstu(11),7600) kfk,chap
229  ENDIF
230  200 CONTINUE
231  kf=10000*kflr+110*kflb+kfls
232  CALL pyname(kf,chap)
233  WRITE(mstu(11),7600) kf,chap
234  210 CONTINUE
235  220 CONTINUE
236  kf=100443
237  CALL pyname(kf,chap)
238  WRITE(mstu(11),7600) kf,chap
239  kf=100553
240  CALL pyname(kf,chap)
241  WRITE(mstu(11),7600) kf,chap
242  DO 260 kflsp=1,3
243  kfls=2+2*(kflsp/3)
244  DO 250 kfla=1,5
245  DO 240 kflb=1,kfla
246  DO 230 kflc=1,kflb
247  IF(kflsp.EQ.1.AND.(kfla.EQ.kflb.OR.kflb.EQ.kflc))
248  & goto 230
249  IF(kflsp.EQ.2.AND.kfla.EQ.kflc) goto 230
250  IF(kflsp.EQ.1) kf=1000*kfla+100*kflc+10*kflb+kfls
251  IF(kflsp.GE.2) kf=1000*kfla+100*kflb+10*kflc+kfls
252  CALL pyname(kf,chap)
253  CALL pyname(-kf,chan)
254  WRITE(mstu(11),7600) kf,chap,-kf,chan
255  230 CONTINUE
256  240 CONTINUE
257  250 CONTINUE
258  260 CONTINUE
259  DO 270 kc=1,500
260  kf=kchg(kc,4)
261  IF(kf.LT.1000000) goto 270
262  CALL pyname(kf,chap)
263  CALL pyname(-kf,chan)
264  IF(chap.NE.' '.AND.chan.EQ.' ') WRITE(mstu(11),7600) kf,chap
265  IF(chan.NE.' ') WRITE(mstu(11),7600) kf,chap,-kf,chan
266  270 CONTINUE
267 
268 C...List parton/particle data table. Check whether to be listed.
269  ELSEIF(mlist.EQ.12) THEN
270  WRITE(mstu(11),7700)
271  DO 300 kc=1,mstu(6)
272  kf=kchg(kc,4)
273  IF(kf.EQ.0) goto 300
274  IF(kf.LT.mstu(1).OR.(mstu(2).GT.0.AND.kf.GT.mstu(2)))
275  & goto 300
276 
277 C...Find particle name and mass. Print information.
278  CALL pyname(kf,chap)
279  IF(kf.LE.100.AND.chap.EQ.' '.AND.mdcy(kc,2).EQ.0) goto 300
280  CALL pyname(-kf,chan)
281  WRITE(mstu(11),7800) kf,kc,chap,chan,(kchg(kc,j1),j1=1,3),
282  & (pmas(kc,j2),j2=1,4),mdcy(kc,1)
283 
284 C...Particle decay: channel number, branching ratios, matrix element,
285 C...decay products.
286  DO 290 idc=mdcy(kc,2),mdcy(kc,2)+mdcy(kc,3)-1
287  DO 280 j=1,5
288  CALL pyname(kfdp(idc,j),chad(j))
289  280 CONTINUE
290  WRITE(mstu(11),7900) idc,mdme(idc,1),mdme(idc,2),brat(idc),
291  & (chad(j),j=1,5)
292  290 CONTINUE
293  300 CONTINUE
294 
295 C...List parameter value table.
296  ELSEIF(mlist.EQ.13) THEN
297  WRITE(mstu(11),8000)
298  DO 310 i=1,200
299  WRITE(mstu(11),8100) i,mstu(i),paru(i),mstj(i),parj(i),parf(i)
300  310 CONTINUE
301  ENDIF
302 
303 C...Format statements for output on unit MSTU(11) (by default 6).
304  5100 FORMAT(///28x,'Event listing (summary)'//4x,'I particle/jet KS',
305  &5x,'KF orig p_x p_y p_z E m'/)
306  5200 FORMAT(///28x,'Event listing (standard)'//4x,'I particle/jet',
307  &' K(I,1) K(I,2) K(I,3) K(I,4) K(I,5) P(I,1)',
308  &' P(I,2) P(I,3) P(I,4) P(I,5)'/)
309  5300 FORMAT(///28x,'Event listing (with vertices)'//4x,'I particle/j',
310  &'et K(I,1) K(I,2) K(I,3) K(I,4) K(I,5) P(I,1)',
311  &' P(I,2) P(I,3) P(I,4) P(I,5)'/73x,
312  &'V(I,1) V(I,2) V(I,3) V(I,4) V(I,5)'/)
313  5400 FORMAT(///28x,'Event listing (no momenta)'//4x,'I particle/jet',
314  & ' K(I,1) K(I,2) K(I,3) K(I,4) K(I,5)',1x
315  & ,' C tag AC tag'/)
316  5500 FORMAT(1x,i4,1x,a12,1x,i2,i8,1x,i4,5f9.3)
317  5600 FORMAT(1x,i4,1x,a12,1x,i2,i8,1x,i4,5f9.2)
318  5700 FORMAT(1x,i4,1x,a12,1x,i2,i8,1x,i4,5f9.1)
319  5800 FORMAT(1x,i4,2x,a16,1x,i3,1x,i9,1x,i4,2(3x,i1,2i4),5f13.5)
320  5900 FORMAT(1x,i4,2x,a16,1x,i3,1x,i9,1x,i4,2(3x,i1,2i4),1x,2i8)
321  6000 FORMAT(1x,i4,2x,a16,1x,i3,1x,i9,1x,i4,2(3x,i9),5f13.5)
322  6100 FORMAT(1x,i4,2x,a16,1x,i3,1x,i9,1x,i4,2(3x,i9),1x,2i8)
323  6200 FORMAT(66x,5(1x,f12.3))
324  6300 FORMAT(1x,78('='))
325  6400 FORMAT(1x,130('='))
326  6500 FORMAT(1x,65('='))
327  6600 FORMAT(19x,'sum:',f6.2,5x,5f9.3)
328  6700 FORMAT(19x,'sum:',f6.2,5x,5f9.2)
329  6800 FORMAT(19x,'sum:',f6.2,5x,5f9.1)
330  6900 FORMAT(19x,'sum charge:',f6.2,3x,'sum momentum and inv. mass:',
331  &5f13.5)
332  7000 FORMAT(19x,'sum charge:',f6.2)
333  7100 FORMAT(/10x,'Event listing of HEPEVT common block (simplified)'
334  &//' I IST ID Mothers Daughters p_x p_y p_z',
335  &' E m')
336  7200 FORMAT(1x,i4,i2,i8,4i5,5f9.3)
337  7300 FORMAT(/10x,'Event listing of user process at input (simplified)'
338  &//' I IST ID Mothers Colours p_x p_y p_z',
339  &' E m')
340  7400 FORMAT(1x,i3,i3,i8,2i4,2i5,5f9.3)
341  7500 FORMAT(///20x,'List of KF codes in program'/)
342  7600 FORMAT(4x,i9,4x,a16,6x,i9,4x,a16)
343  7700 FORMAT(///30x,'Particle/parton data table'//8x,'KF',5x,'KC',4x,
344  &'particle',8x,'antiparticle',6x,'chg col anti',8x,'mass',7x,
345  &'width',7x,'w-cut',5x,'lifetime',1x,'decay'/11x,'IDC',1x,'on/off',
346  &1x,'ME',3x,'Br.rat.',4x,'decay products')
347  7800 FORMAT(/1x,i9,3x,i4,4x,a16,a16,3i5,1x,f12.5,2(1x,f11.5),
348  &1x,1p,e13.5,3x,i2)
349  7900 FORMAT(10x,i4,2x,i3,2x,i3,2x,f10.6,4x,5a16)
350  8000 FORMAT(///20x,'Parameter value table'//4x,'I',3x,'MSTU(I)',
351  &8x,'PARU(I)',3x,'MSTJ(I)',8x,'PARJ(I)',8x,'PARF(I)')
352  8100 FORMAT(1x,i4,1x,i9,1x,f14.5,1x,i9,1x,f14.5,1x,f14.5)
353 
354  RETURN
355  END