Analysis Software
Documentation for sPHENIX simulation software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
pykcut.f
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file pykcut.f
1 
2 C*********************************************************************
3 
4 C...PYKCUT
5 C...Dummy routine, which the user can replace in order to make cuts on
6 C...the kinematics on the parton level before the matrix elements are
7 C...evaluated and the event is generated. The cross-section estimates
8 C...will automatically take these cuts into account, so the given
9 C...values are for the allowed phase space region only. MCUT=0 means
10 C...that the event has passed the cuts, MCUT=1 that it has failed.
11 
12  SUBROUTINE pykcut(MCUT)
13 
14 C...Double precision and integer declarations.
15  IMPLICIT DOUBLE PRECISION(a-h, o-z)
16  IMPLICIT INTEGER(i-n)
17  INTEGER pyk,pychge,pycomp
18 C...Commonblocks.
19  common/pydat1/mstu(200),paru(200),mstj(200),parj(200)
20  common/pyint1/mint(400),vint(400)
21  common/pyint2/iset(500),kfpr(500,2),coef(500,20),icol(40,4,2)
22  SAVE /pydat1/,/pyint1/,/pyint2/
23 
24 C...Set default value (accepting event) for MCUT.
25  mcut=0
26 
27 C...Read out subprocess number.
28  isub=mint(1)
29  istsb=iset(isub)
30 
31 C...Read out tau, y*, cos(theta), tau' (where defined, else =0).
32  tau=vint(21)
33  yst=vint(22)
34  cth=0d0
35  IF(istsb.EQ.2.OR.istsb.EQ.4) cth=vint(23)
36  taup=0d0
37  IF(istsb.GE.3.AND.istsb.LE.5) taup=vint(26)
38 
39 C...Calculate x_1, x_2, x_F.
40  IF(istsb.LE.2.OR.istsb.GE.5) THEN
41  x1=sqrt(tau)*exp(yst)
42  x2=sqrt(tau)*exp(-yst)
43  ELSE
44  x1=sqrt(taup)*exp(yst)
45  x2=sqrt(taup)*exp(-yst)
46  ENDIF
47  xf=x1-x2
48 
49 C...Calculate shat, that, uhat, p_T^2.
50  shat=tau*vint(2)
51  sqm3=vint(63)
52  sqm4=vint(64)
53  rm3=sqm3/shat
54  rm4=sqm4/shat
55  be34=sqrt(max(0d0,(1d0-rm3-rm4)**2-4d0*rm3*rm4))
56  rpts=4d0*vint(71)**2/shat
57  be34l=sqrt(max(0d0,(1d0-rm3-rm4)**2-4d0*rm3*rm4-rpts))
58  rm34=2d0*rm3*rm4
59  rsqm=1d0+rm34
60  rthm=(4d0*rm3*rm4+rpts)/(1d0-rm3-rm4+be34l)
61  that=-0.5d0*shat*max(rthm,1d0-rm3-rm4-be34*cth)
62  uhat=-0.5d0*shat*max(rthm,1d0-rm3-rm4+be34*cth)
63  pt2=max(vint(71)**2,0.25d0*shat*be34**2*(1d0-cth**2))
64 
65 C...Decisions by user to be put here.
66 
67 C...Stop program if this routine is ever called.
68 C...You should not copy these lines to your own routine.
69  WRITE(mstu(11),5000)
70  CALL pystop(6)
71 
72 C...Format for error printout.
73  5000 FORMAT(1x,'Error: you did not link your PYKCUT routine ',
74  &'correctly.'/1x,'Dummy routine in PYTHIA file called instead.'/
75  &1x,'Execution stopped!')
76 
77  RETURN
78  END