Analysis Software
Documentation for sPHENIX simulation software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
upveto.f
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file upveto.f
1 
2 C...Old example: handles a simple Pythia 6.4 event file.
3 
4 c SUBROUTINE UPEVNT
5 
6 C...Double precision and integer declarations.
7 c IMPLICIT DOUBLE PRECISION(A-H, O-Z)
8 c IMPLICIT INTEGER(I-N)
9 
10 C...Commonblocks.
11 c COMMON/PYDAT1/MSTU(200),PARU(200),MSTJ(200),PARJ(200)
12 c COMMON/PYPARS/MSTP(200),PARP(200),MSTI(200),PARI(200)
13 c SAVE /PYDAT1/,/PYPARS/
14 
15 C...User process event common block.
16 c INTEGER MAXNUP
17 c PARAMETER (MAXNUP=500)
18 c INTEGER NUP,IDPRUP,IDUP,ISTUP,MOTHUP,ICOLUP
19 c DOUBLE PRECISION XWGTUP,SCALUP,AQEDUP,AQCDUP,PUP,VTIMUP,SPINUP
20 c COMMON/HEPEUP/NUP,IDPRUP,XWGTUP,SCALUP,AQEDUP,AQCDUP,IDUP(MAXNUP),
21 c &ISTUP(MAXNUP),MOTHUP(2,MAXNUP),ICOLUP(2,MAXNUP),PUP(5,MAXNUP),
22 c &VTIMUP(MAXNUP),SPINUP(MAXNUP)
23 c SAVE /HEPEUP/
24 
25 C...Read info from file.
26 c IF(MSTP(162).GT.0) THEN
27 c READ(MSTP(162),*,END=110,ERR=110) NUP,IDPRUP,XWGTUP,SCALUP,
28 c & AQEDUP,AQCDUP
29 c DO 100 I=1,NUP
30 c READ(MSTP(162),*,END=110,ERR=110) IDUP(I),ISTUP(I),
31 c & MOTHUP(1,I),MOTHUP(2,I),ICOLUP(1,I),ICOLUP(2,I),
32 c & (PUP(J,I),J=1,5),VTIMUP(I),SPINUP(I)
33 c 100 CONTINUE
34 c RETURN
35 C...Special when reached end of file or other error.
36 c 110 NUP=0
37 
38 C...Else not implemented.
39 c ELSE
40 c WRITE(MSTU(11),5000)
41 c STOP
42 c ENDIF
43 
44 C...Format for error printout.
45 c 5000 FORMAT(1X,'Error: You have not implemented UPEVNT routine'/
46 c &1X,'Dummy routine in PYTHIA file called instead.'/
47 c &1X,'Execution stopped!')
48 
49 c RETURN
50 c END
51 
52 C*********************************************************************
53 
54 C...UPVETO
55 C...Dummy routine, to be replaced by user, to veto event generation
56 C...on the parton level, after parton showers but before multiple
57 C...interactions, beam remnants and hadronization is added.
58 C...If resonances like W, Z, top, Higgs and SUSY particles are handed
59 C...undecayed from UPEVNT, or are generated by PYTHIA, they will also
60 C...be undecayed at this stage; if decayed their decay products will
61 C...have been allowed to shower.
62 
63 C...All partons at the end of the shower phase are stored in the
64 C...HEPEVT commonblock. The interesting information is
65 C...NHEP = the number of such partons, in entries 1 <= i <= NHEP,
66 C...IDHEP(I) = the particle ID code according to PDG conventions,
67 C...PHEP(J,I) = the (p_x, p_y, p_z, E, m) of the particle.
68 C...All ISTHEP entries are 1, while the rest is zeroed.
69 
70 C...The user decision is to be conveyed by the IVETO value.
71 C...IVETO = 0 : retain current event and generate in full;
72 C... = 1 : abort generation of current event and move to next.
73 
74  SUBROUTINE upveto(IVETO)
75 
76 C...HEPEVT commonblock.
77  parameter(nmxhep=4000)
78  common/hepevt/nevhep,nhep,isthep(nmxhep),idhep(nmxhep),
79  &jmohep(2,nmxhep),jdahep(2,nmxhep),phep(5,nmxhep),vhep(4,nmxhep)
80  DOUBLE PRECISION phep,vhep
81  SAVE /hepevt/
82 
83 C...Next few lines allow you to see what info PYVETO extracted from
84 C...the full event record for the first two events.
85 C...Delete if you don't want it.
86  DATA nlist/0/
87  SAVE nlist
88  IF(nlist.LE.2) THEN
89  WRITE(*,*) ' Full event record at time of UPVETO call:'
90  CALL pylist(1)
91  WRITE(*,*) ' Part of event record made available to UPVETO:'
92  CALL pylist(5)
93  nlist=nlist+1
94  ENDIF
95 
96 C...Make decision here.
97  iveto = 0
98 
99  RETURN
100  END