Analysis Software
Documentation for sPHENIX simulation software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
pyupin.f
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file pyupin.f
1 
2 C*********************************************************************
3 
4 C...PYUPIN
5 C...Fills the HEPRUP commonblock with info on incoming beams and allowed
6 C...processes, and optionally stores that information on file.
7 
8  SUBROUTINE pyupin
9 
10 C...Double precision and integer declarations.
11  IMPLICIT DOUBLE PRECISION(a-h, o-z)
12  IMPLICIT INTEGER(i-n)
13 
14 C...Commonblocks.
15  common/pyjets/n,npad,k(4000,5),p(4000,5),v(4000,5)
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/pyint5/ngenpd,ngen(0:500,3),xsec(0:500,3)
19  SAVE /pyjets/,/pysubs/,/pypars/,/pyint5/
20 
21 C...User process initialization commonblock.
22  INTEGER maxpup
23  parameter(maxpup=100)
24  INTEGER idbmup,pdfgup,pdfsup,idwtup,nprup,lprup
25  DOUBLE PRECISION ebmup,xsecup,xerrup,xmaxup
26  common/heprup/idbmup(2),ebmup(2),pdfgup(2),pdfsup(2),
27  &idwtup,nprup,xsecup(maxpup),xerrup(maxpup),xmaxup(maxpup),
28  &lprup(maxpup)
29  SAVE /heprup/
30 
31 C...Store info on incoming beams.
32  idbmup(1)=k(1,2)
33  idbmup(2)=k(2,2)
34  ebmup(1)=p(1,4)
35  ebmup(2)=p(2,4)
36  pdfgup(1)=0
37  pdfgup(2)=0
38  pdfsup(1)=mstp(51)
39  pdfsup(2)=mstp(51)
40 
41 C...Event weighting strategy.
42  idwtup=3
43 
44 C...Info on individual processes.
45  nprup=0
46  DO 100 isub=1,500
47  IF(msub(isub).EQ.1) THEN
48  nprup=nprup+1
49  xsecup(nprup)=1d9*xsec(isub,3)
50  xerrup(nprup)=xsecup(nprup)/sqrt(max(1d0,dble(ngen(isub,3))))
51  xmaxup(nprup)=1d0
52  lprup(nprup)=isub
53  ENDIF
54  100 CONTINUE
55 
56 C...Write info to file.
57  IF(mstp(161).GT.0) THEN
58  WRITE(mstp(161),5100) idbmup(1),idbmup(2),ebmup(1),ebmup(2),
59  & pdfgup(1),pdfgup(2),pdfsup(1),pdfsup(2),idwtup,nprup
60  DO 110 ipr=1,nprup
61  WRITE(mstp(161),5200) xsecup(ipr),xerrup(ipr),xmaxup(ipr),
62  & lprup(ipr)
63  110 CONTINUE
64  ENDIF
65 
66 C...Formats for printout.
67  5100 FORMAT(1p,2i8,2e14.6,6i6)
68  5200 FORMAT(1p,3e14.6,i6)
69 
70  RETURN
71  END