]> git.uio.no Git - u/mrichter/AliRoot.git/blob - DPMJET/user3.0-5.f
changed the order of call of endofcycle so that images are produced
[u/mrichter/AliRoot.git] / DPMJET / user3.0-5.f
1 *$ CREATE DPMJET.FOR
2 *COPY DPMJET
3 *
4 *===program dpmjet=====================================================*
5 *
6       PROGRAM DPMJET
7
8       IMPLICIT DOUBLE PRECISION (A-H,O-Z)
9       SAVE
10
11 * block data in DPMJET library (uncomment these declarations if library
12 * option is used)
13 C     EXTERNAL DT_BDEVAP,DT_BDNOPT,DT_BDPREE,DT_HADPRP,DT_BLKD46,
14 C    &         DT_BLKD47,DT_RUNTT,DT_NONAME,DT_ZK,DT_BLKD43
15
16 C     EXTERNAL PYDATA
17
18 * event flag
19       COMMON /DTEVNO/ NEVENT,ICASCA
20
21 *-----------------------------------------------------------------------
22 * initialization
23
24 *   the following statement provides a call to DT_USRHIS(MODE=1) for
25 *   histogram initialization etc.
26       CALL DT_DTUINI(NEVTS,EPN,NPMASS,NPCHAR,NTMASS,NTCHAR,IDP,IEMU)
27
28 *-----------------------------------------------------------------------
29 * generation of events
30
31       DO 1 IEVT=1,NEVTS
32
33 *   some defaults, do not change!
34          NEVENT = IEVT
35          KKMAT  = -1
36          ELAB   = EPN
37 *   uncomment if dpmjet3 is linked to particle transport code
38 C        ICASCA = 1
39
40 ************************************************************************
41 * The following lines show how to select the target nucleus for runs
42 * with composite targets (and fixed projectile and energy!).
43 *
44 *   Sampling of the target nucleus (mass number NTMASS, charge NTCHAR)
45 *   according to the fractions defined with EMULSION input-cards.
46 *   The different nuclei are numbered as KKMAT = 1,2,3,...  according to
47 *   their appearance in the input-file.
48          IF (IEMU.GT.0) THEN
49 *   Replace this selection by your own one if needed.
50             CALL DT_GETEMU(NTMASS,NTCHAR,KKMAT,0)
51 *   Kkmat has to be negative for composite targets!
52             KKMAT = -KKMAT
53          ENDIF
54 ************************************************************************
55
56 ************************************************************************
57 * The following lines show how to define projectile, target and energy
58 * for this event in runs with Glauber-data file pre-initialized for a
59 * certain range of projectiles, targets and energies. The definitions
60 * have to be within the pre-initialized parameter range.
61 *
62 *   projectile-id (for hadron projectiles)
63 C        IDP    = 1
64 *   projectile mass and charge numbers
65 C        NPMASS = 12
66 C        NPCHAR = 6
67 *   target mass and charge numbers
68 C        NTMASS = 16
69 C        NTCHAR = 8
70 *   lab energy
71 C        ELAB = 200.0D0
72 ************************************************************************
73
74 ************************************************************************
75 * If an energy-range has been defined with the ENERGY input-card the
76 * laboratory energy ELAB can be set to any value within that range. For
77 * example:
78 C        ELO  = 10.0D0
79 C        EHI  = 1000.0D0
80 C        ELAB = DT_RNDM(ELAB)*(EHI-ELO)+ELO
81 ************************************************************************
82
83 *   sampling of one event
84          CALL DT_KKINC(NPMASS,NPCHAR,NTMASS,NTCHAR,IDP,ELAB,KKMAT,IREJ)
85          IF (IREJ.NE.0) GOTO 1
86
87 *   the following statement provides a call to DT_USRHIS(MODE=2) from
88 *   where the final state particles can be obtained
89
90          CALL PHO_PHIST(2000,DUM)
91
92     1 CONTINUE
93
94 *-----------------------------------------------------------------------
95 * output, statistics etc.
96
97 *   the following statement provides a call to DT_USRHIS(MODE=3) in
98 *   order to calculate histograms etc.
99       CALL DT_DTUOUT
100
101       END
102
103 *$ CREATE DT_USRHIS.FOR
104 *COPY DT_USRHIS
105 *
106 *===usrhis=============================================================*
107 *
108       SUBROUTINE DT_USRHIS(MODE)
109
110       IMPLICIT DOUBLE PRECISION (A-H,O-Z)
111       SAVE
112 *
113 * COMMON /DTEVT1/ :
114 *                   NHKK         number of entries in common block
115 *                   NEVHKK       number of the event
116 *                   ISTHKK(i)    status code for entry i
117 *                   IDHKK(i)     identifier for the entry
118 *                                (for particles: identifier according
119 *                                 to the PDG numbering scheme)
120 *                   JMOHKK(1,i)  pointer to the entry of the first mother
121 *                                of entry i
122 *                   JMOHKK(2,i)  pointer to the entry of the second mother
123 *                                of entry i
124 *                   JDAHKK(1,i)  pointer to the entry of the first daughter
125 *                                of entry i
126 *                   JDAHKK(2,i)  pointer to the entry of the second daughter
127 *                                of entry i
128 *                   PHKK(1..3,i) 3-momentum
129 *                   PHKK(4,i)    energy
130 *                   PHKK(5,i)    mass
131 *
132 * event history
133       PARAMETER (NMXHKK=200000)
134       COMMON /DTEVT1/ NHKK,NEVHKK,ISTHKK(NMXHKK),IDHKK(NMXHKK),
135      &                JMOHKK(2,NMXHKK),JDAHKK(2,NMXHKK),
136      &                PHKK(5,NMXHKK),VHKK(4,NMXHKK),WHKK(4,NMXHKK)
137 * extended event history
138       COMMON /DTEVT2/ IDRES(NMXHKK),IDXRES(NMXHKK),NOBAM(NMXHKK),
139      &                IDBAM(NMXHKK),IDCH(NMXHKK),NPOINT(10),
140      &                IHIST(2,NMXHKK)
141
142       GOTO (1,2,3) MODE
143
144 *------------------------------------------------------------------
145 *
146     1 CONTINUE
147 *
148 * initializations
149 *
150 *  Called with MODE=1 once at the beginning of the run.
151 *
152       RETURN
153 *
154 *------------------------------------------------------------------
155 *
156     2 CONTINUE
157 *
158 * scoring of the present event
159 *
160 *  Called with MODE=2 every time one event has been finished.
161 *
162 *  The final state particles from the actual event (number NEVHKK)
163 *  can be found in DTEVT1 and identified by their status:
164 *
165 *     ISTHKK(i) = 1    final state particle produced in
166 *                      photon-/hadron-/nucleon-nucleon collisions or
167 *                      in intranuclear cascade processes
168 *                -1    nucleons, deuterons, H-3, He-3, He-4 evaporated
169 *                      from excited nucleus and
170 *                      photons produced in nuclear deexcitation processes
171 *                1001  residual nucleus (ground state)
172 *
173 *  The types of these particles/nuclei are given in IDHKK as follows
174 *
175 *     all final state part. except nuclei :
176 *       IDHKK(i)=particle identifier according to PDG numbering scheme
177 *     nuclei (evaporation products, and residual nucleus) :
178 *       IDHKK(i)=80000, IDRES(i)=mass number, IDXRES(i)=charge number
179 *
180 *  The 4-momenta and masses can be found in PHKK (target nucleus rest frame):
181 *                   PHKK(1..3,i) 3-momentum (p_x,p_y,p_z)
182 *                   PHKK(4,i)    energy
183 *                   PHKK(5,i)    mass
184 *
185 *
186 *
187 *  Pick out the final state particles from DTEVT1 in each event for
188 *  instance by the following loop (NHKK=number of entries in the present
189 *  event) and fill your histograms
190 C     DO 20 I=1,NHKK
191 C        IF (ABS(ISTHKK(I)).EQ.1) THEN
192 C        ELSEIF (ABS(ISTHKK(I)).EQ.1001) THEN
193 C        ENDIF
194 C  20 CONTINUE
195
196 *  At any time during the run a list of the actual entries in DTEVT1 and
197 *  DTEVT2 can be obtained (output unit 6) by the following statement:
198 C     CALL DT_EVTOUT(4)
199
200       RETURN
201 *
202 *------------------------------------------------------------------
203 *
204     3 CONTINUE
205 *
206 * output/statistics/histograms etc.
207 *
208 *  Called with MODE=3 once after all events have been sampled.
209 *
210       RETURN
211
212       END