EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
dpmjetint.f
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file dpmjetint.f
1 *
2 *===program crint======================================================*
3 *
4 C OPTIONS/ EXTEND_SOURCE
5 C SUBROUTINE CRINT
6  SUBROUTINE dt_produceevent(ENERGY_SL, NPARTICLES)
7 
8 
9  IMPLICIT DOUBLE PRECISION (a-h,o-z)
10  REAL energy_sl
11  INTEGER init
12  REAL ne,etest,prob,slump
13  SAVE
14 
15 * Call the init sub routine in the first event
16  DATA init /0/
17 
18  parameter(nmxhkk=200000)
19 
20  COMMON /dtiont/ linp,lout,ldat
21 
22  COMMON /dtevt1/ nhkk,nevhkk,isthkk(nmxhkk),idhkk(nmxhkk),
23  & jmohkk(2,nmxhkk),jdahkk(2,nmxhkk),
24  & phkk(5,nmxhkk),vhkk(4,nmxhkk),whkk(4,nmxhkk)
25 
26 * event flag
27  COMMON /dtevno/ nevent, icasca
28 
29  IF(init.EQ.0) THEN
30  OPEN (unit = 50, file = "my.input")
31  linp = 50
32  CALL dt_dtuini(nevts,epn,npmass,npchar,ntmass,ntchar,idp,iemu)
33 * Init called, make sure it's not called again
34  init = 1
35  ENDIF
36 *-----------------------------------------------------------------------
37 * generation of one event
38  nevent = 1
39  kkmat = -1
40 
41 * If an energy-range has been defined with the ENERGY input-card the
42 * laboratory energy ELAB can be set to any value within that range,..
43 C ELAB = DT_RNDM(EPN)*(EPN-0.5D7)+0.5D7
44 
45 * ..otherwise it has to coincide with EPN.
46 C ELAB = EPN
47 
48  elab = energy_sl
49 
50 * sampling of one event
51 
52 * TEST
53 
54  CALL dt_kkinc(npmass,npchar,ntmass,ntchar,idp,elab,kkmat,irej)
55 
56  IF (irej.NE.0) RETURN
57 
58 c Return the number of particles produced
59 
60 c Fill the particle info
61  CALL dt_getparticles(nparticles)
62 
63  END
64 
65 
66  SUBROUTINE dt_getparticles(NPARTICLES)
67 
68  IMPLICIT DOUBLE PRECISION (a-h,o-z)
69  INTEGER pid,qch,q_sum,ntpc,nfinal,naccept,ipart,res
70  DOUBLE PRECISION yrap,pt,mass,mt,etot
71  DOUBLE PRECISION pt_cut_tpc
72  parameter(pt_cut_tpc=0.050)
73 
74  SAVE
75 *
76 * COMMON /DTEVT1/ :
77 * NHKK number of entries in common block
78 * NEVHKK number of the event
79 * ISTHKK(i) status code for entry i
80 * IDHKK(i) identifier for the entry
81 * (for particles: identifier according
82 * to the PDG numbering scheme)
83 * JMOHKK(1,i) pointer to the entry of the first mother
84 * of entry i
85 * JMOHKK(2,i) pointer to the entry of the second mother
86 * of entry i
87 * JDAHKK(1,i) pointer to the entry of the first daughter
88 * of entry i
89 * JDAHKK(2,i) pointer to the entry of the second daughter
90 * of entry i
91 * PHKK(1..3,i) 3-momentum
92 * PHKK(4,i) energy
93 * PHKK(5,i) mass
94 *
95 * event history
96 
97  parameter(nmxhkk=200000)
98 
99  COMMON /dtevt1/ nhkk,nevhkk,isthkk(nmxhkk),idhkk(nmxhkk),
100  & jmohkk(2,nmxhkk),jdahkk(2,nmxhkk),
101  & phkk(5,nmxhkk),vhkk(4,nmxhkk),whkk(4,nmxhkk)
102 
103 * extended event history
104  COMMON /dtevt2/ idres(nmxhkk),idxres(nmxhkk),nobam(nmxhkk),
105  & idbam(nmxhkk),idch(nmxhkk),npoint(10),
106  & ihist(2,nmxhkk)
107 
108  DOUBLE PRECISION slpx, slpy, slpz, sle, slm
109  INTEGER slpid, slcharge
110  COMMON /dpmjetparticle/ slpx(nmxhkk), slpy(nmxhkk), slpz(nmxhkk),
111  & sle(nmxhkk), slm(nmxhkk), slpid(nmxhkk), slcharge(nmxhkk)
112 
113 
114 C >> Set Counter to Zero
115 
116  nfinal=0
117 
118  DO 42 i=1, nhkk
119 c I = IPART
120 
121 CC >> Remove all non-final-state particles
122  IF(.not.(isthkk(i).eq.1.or.isthkk(i).eq.-1.or.
123  $isthkk(i).eq.1001)) goto 42
124 
125 C >> Find Particle Charge, qch
126  IF((abs(isthkk(i)).eq.1).and.(idhkk(i).ne.80000))THEN
127 C >> final state ptcles except nuclei
128 
129  qch=ipho_chr3(idhkk(i),1)/3
130  ELSEIF(idhkk(i).eq.80000)THEN
131 C >> final state nuclei
132  qch=idxres(i)
133  ELSE
134 C >> not a final state particle, qch not interesting
135  qch=-999
136  ENDIF
137 
138  nfinal = nfinal + 1
139  slpx(nfinal) = phkk(1,i)
140  slpy(nfinal) = phkk(2,i)
141  slpz(nfinal) = phkk(3,i)
142  sle(nfinal) = phkk(4,i)
143  slm(nfinal) = phkk(5,i)
144  slpid(nfinal) = idhkk(i)
145  slcharge(nfinal) = qch
146 
147  42 CONTINUE
148  nparticles = nfinal
149 
150  END
151 
152  SUBROUTINE dt_usrhis(MODE)
153 c Dummy to make the linker happy
154  END
155