Bugfix in AliPoints2Memory
[u/mrichter/AliRoot.git] / GEANT321 / gbase / ginit.F
CommitLineData
fe4da5cc 1*
2* $Id$
3*
4* $Log$
5* Revision 1.4 1996/09/30 14:25:31 ravndal
6* Windows NT related modifications
7*
8* Revision 1.3 1996/04/15 14:14:55 ravndal
9* PATCHY does not set date and time any more
10*
11* Revision 1.2 1996/03/13 17:20:42 ravndal
12* Mod's for the parallel version
13*
14* Revision 1.1.1.1 1995/10/24 10:20:10 cernlib
15* Geant
16*
17*
18#include "geant321/pilot.h"
19*CMZ : 3.21/04 22/02/95 16.02.44 by S.Giani
20*-- Author :
21 SUBROUTINE GINIT
22C.
23C. ******************************************************************
24C. * *
25C. * GEANT initialisation routine *
26C. * *
27C. * IFINIT(1)=1 free *
28C. * (2)=1 if GZINIT " " *
29C. * (3)=1 if GLUND or GLUNDI have been called *
30C. * (4)=1 if GHEINI or GPGHEI have been called *
31C. * (5)=1 if GHCASC has been called *
32C. * (6)=1 if GLUDKY has been called *
33C. * (7)=1 if GTAU " " *
34C. * (8)=1 if GPRELA *
35C. * (9)=1 if GPCXYZ *
36C. * (10)=1 if GDRAW *
37C. * (11)=1 if INIT_GMR *
38C. * (12)=1 if GET_GEANT_STRUCTURE *
39C. * (13)=1 if GPIONS *
40C. * (14)=1 if GDINIT *
41C. * *
42C. * ==>Called by : <USER>, UGINIT *
43C. * Author R.Brun ********* *
44C. * *
45C. ******************************************************************
46C.
47#include "geant321/gcbank.inc"
48#include "geant321/gclist.inc"
49#include "geant321/gcsets.inc"
50#include "geant321/gconsp.inc"
51#include "geant321/gcpush.inc"
52#include "geant321/gctime.inc"
53#include "geant321/gcphys.inc"
54#include "geant321/gcparm.inc"
55#include "geant321/gccuts.inc"
56#include "geant321/gcflag.inc"
57#include "geant321/gckine.inc"
58#include "geant321/gcking.inc"
59#include "geant321/gcmulo.inc"
60#include "geant321/gcscan.inc"
61#include "geant321/gcopti.inc"
62#include "geant321/gcnum.inc"
63#include "geant321/gcstak.inc"
64#include "geant321/gctrak.inc"
65#include "geant321/gcunit.inc"
66#include "geant321/gcvolu.inc"
67#include "geant321/gctmed.inc"
68#include "geant321/gcrz.inc"
69#if defined(CERNLIB_USRJMP)
70#include "geant321/gcjump.inc"
71#endif
72*
73* COMMON/GCONST/PI,TWOPI,PIBY2,DEGRAD,RADDEG,CLIGHT,BIG,EMASS
74* COMMON/GCONSX/EMMU,PMASS,AVO
75 COMMON/GCONST/CONS1(8)
76 COMMON/GCONSX/CONS2(3)
77#if defined(CERNLIB_USRJMP)
78 EXTERNAL GUDCAY, GUDIGI, GUDTIM, GUFLD , GUHADR, GUIGET,
79 + GUINME, GUINTI, GUKINE, GUNEAR, GUOUT , GUPHAD,
80 + GUSKIP, GUSTEP, GUSWIM, GUTRAK, GUTREV, GUVIEW,
81 + GUPARA
82#endif
83C
84C ZEBRA system common blocks
85C
86 COMMON /ZHEADP/IQHEAD(20),IQDATE,IQTIME,IQPAGE,NQPAGE(4)
87 COMMON /ZMACH/ NQBITW,NQBITC,NQCHAW,NQLNOR,NQLMAX,NQLPTH,NQRMAX
88 +, IQLPCT,IQNIL
89 COMMON /ZSTATE/QVERSN,NQPHAS,IQDBUG,NQDCUT,NQWCUT,NQERR
90 +, NQLOGD,NQLOGM,NQLOCK,NQDEVZ,NQAUGM(6)
91 COMMON /ZUNIT/ IQREAD,IQPRNT,IQPR2,IQLOG,IQPNCH,IQTTIN,IQTYPE
92C
93 CHARACTER*4 MEC(MAXMEC),MEC1(MAXME1),DFLT(2)
94 CHARACTER*8 CHVERS,CHDATE
95
96 CHARACTER*4 CDUMMY
97#if defined(CERNLIB_MONITOR)
98 CHARACTER*32 CHINFO
99#endif
100 PARAMETER (LEFTM1=MAXME1-9)
101 SAVE LOAD
102 DATA LOAD/0/
103 DATA DFLT /' ','XXXX'/
104 DATA MEC/'NEXT','MULS','LOSS','FIEL','DCAY','PAIR','COMP','PHOT'
105 + ,'BREM','DRAY','ANNI','HADR','ECOH','EVAP','FISS','ABSO'
106 + ,'ANNH','CAPT','EINC','INHE','MUNU','TOFM','PFIS','SCUT'
107 + ,'RAYL','PARA','PRED','LOOP','NULL','STOP'/
108 DATA MEC1/'LABS','LREF','SMAX','SCOR','CKOV','REFL','REFR',
109 + 'SYNC','STRA',LEFTM1*' '/
110C.
111C. ------------------------------------------------------------------
112C.
113C
114#if defined (CERNLIB_PARA)
115 CALL GPINIT()
116#endif
117 IDATQQ = 0
118 ITIMQQ = 0
119 CALL GETVER(CHVERS,CHDATE,GVERSN)
120 ZVERSN = QVERSN
121 IGDATE = IQDATE
122 IGTIME = IQTIME
123 LIN = IQREAD
124 IF(IQTTIN.NE.0) LIN=IQTTIN
125 LOUT = IQPRNT
126C
127 WRITE (CHMAIL,10100) CHVERS,CHDATE
128 CALL GMAIL(0,0)
129*
130 GVERSC = 0.0
131#include "geant321/gversc.inc"
132* Ignoring t=pass
133 IF (GVERSC.NE.0.0) THEN
134 WRITE (CHMAIL,10200) GVERSC
135 CALL GMAIL(0,0)
136 ENDIF
137#if defined(CERNLIB_MONITOR)
138*
139 WRITE(CHINFO,10000) GVERSN, GVERSC
14010000 FORMAT(' Version/Cradle: ',F7.4,'/',F7.4)
141 CALL GEAMON(1,CHINFO)
142#endif
143C Since conversion to CVS library handling, this
144C is ommitted because PATCHY does not anymore
145C set IDATQQ, ITIMQQ
146C
147C WRITE(CHMAIL,10300)IDATQQ,ITIMQQ
148C CALL GMAIL(0,1)
149C
150#if defined(CERNLIB_USRJMP)
151 JUDCAY = JUMPAD(GUDCAY)
152 JUDIGI = JUMPAD(GUDIGI)
153* GUDTIM is a function
154 JUFLD = JUMPAD(GUFLD)
155 JUHADR = JUMPAD(GUHADR)
156 JUIGET = JUMPAD(GUIGET)
157 JUINME = JUMPAD(GUINME)
158 JUINTI = JUMPAD(GUINTI)
159 JUKINE = JUMPAD(GUKINE)
160 JUNEAR = JUMPAD(GUNEAR)
161 JUOUT = JUMPAD(GUOUT)
162 JUPHAD = JUMPAD(GUPHAD)
163 JUSKIP = JUMPAD(GUSKIP)
164 JUSTEP = JUMPAD(GUSTEP)
165 JUSWIM = JUMPAD(GUSWIM)
166 JUTRAK = JUMPAD(GUTRAK)
167 JUTREV = JUMPAD(GUTREV)
168 JUVIEW = JUMPAD(GUVIEW)
169 JUPARA = JUMPAD(GUPARA)
170#endif
171C
172 CALL FFINIT(0)
173 NBIT = NQBITW
174 CALL UCTOH(DFLT,IDFLT,4,4)
175 CONS1( 1) = PI
176 CONS1( 2) = TWOPI
177 CONS1( 3) = PIBY2
178 CONS1( 4) = DEGRAD
179 CONS1( 5) = RADDEG
180 CONS1( 6) = CLIGHT
181 CONS1( 7) = BIG
182 CONS1( 8) = EMASS
183 CONS2( 1) = EMMU
184 CONS2( 2) = PMASS
185 CONS2( 3) = AVO
186 DO 10 J=1,MXGKIN
187 TOFD(J) = 0.
188 IFLGK(J) = 0
189 10 CONTINUE
190C
191 IGAUTO= 1
192 IPAIR = 1
193 ICOMP = 1
194 IPHOT = 1
195 IRAYL = 0
196 IBREM = 1
197 IHADR = 1
198 IANNI = 1
199 IDRAY = 1
200 IMUNU = 1
201 IPFIS = 0
202 IDCAY = 1
203 ILOSS = 2
204 IMULS = 1
205 ILABS = -1
206 ITCKOV = 0
207 ISYNC = 0
208 ISTRA = 0
209C
210 IABAN = 1
211 DPHYS1 = IABAN
212C
213 CUTGAM = 0.001
214 CUTELE = 0.001
215 CUTHAD = 0.01
216 CUTNEU = 0.01
217 CUTMUO = 0.01
218 TOFMAX = BIG
219 DO 20 J=1,5
220 GCUTS(J) = 0.
221 20 CONTINUE
222C
223C The following cuts can be changed by data card CUTS
224C If they are now changed, then the routine GPHYSI
225C will change them respectively to
226C BCUTE=CUTGAM,BCUTM=CUTGAM, DCUTE=CUTELE, DCUTM=CUTELE
227C and PPCUTM=4.*EMASS
228C
229 DCUTE = BIG
230 DCUTM = BIG
231 BCUTE = BIG
232 BCUTM = BIG
233 PPCUTM= BIG
234 ISTPAR= 1
235 IOPTIM= 0
236C
237 NCVERT = 5
238 NCKINE = 50
239 NCJXYZ = 100
240 NPVERT = 5
241 NPKINE = 10
242 NPJXYZ = 200
243C
244 IKINE = 0
245 DO 30 J=1,10
246 PKINE(J) = BIG
247 30 CONTINUE
248 CALL VZERO (IHSET,26)
249 CALL VZERO (NHSTA,9)
250 CALL VFILL (LHSTA, 180, IDFLT)
251 CALL VFILL (LRGET, 40, IDFLT)
252 CALL VZERO (NUNITS,6)
253 CALL VZERO (IDEBUG,42)
254 CALL VZERO (NMATE,9)
255 CALL VZERO (NLEVEL,306)
256 NALIVE = 0
257 NTMSTO = 0
258 NJTMAX = 0
259 NJTMIN = 0
260 NTSTKP = 500
261 NTSTKS = 100
262*
263*-------- Scan parameters defaults
264 SCANFL = .FALSE.
265 NPHI = 90
266 PHIMIN = 0.
267 PHIMAX = 360.
268 IPHI1 = 1
269 IPHIL = NPHI
270 NTETA = 90
271 TETMID(1) = -10.
272 TETMID(2) = 0.
273 TETMID(3) = -1.
274 TETMAD(1) = 10.
275 TETMAD(2) = 180.
276 TETMAD(3) = 1.
277 MODTET = 1
278 CALL VFILL (ISLIST,MSLIST,IDFLT)
279 CALL UCTOH(DFLT(2),ISLIST(1),4,4)
280 NSLIST = 1
281 VSCAN(1) = 0.
282 VSCAN(2) = 0.
283 VSCAN(3) = 0.
284 FACTX0 = 100.
285 FACTL = 10.
286 FACTSF = 100.
287 FACTR = 100.
288*--- Parametrization cut=0 means no parametrization
289 IPARAM = 0
290 DO 40 J=1,5
291 PACUTS(J) = 0.
292 40 CONTINUE
293*--- Size for the primary parametrization stak
294 MPSTAK = 1000
295*--- Number of particles generated for every shower
296 NPGENE = 20
297*-------- Scan parameters defaults
298C
299 RZTAGS(1)='STRUCTUR'
300 RZTAGS(2)='TRIG-NR '
301 RZTAGS(3)='RUNG-NRT '
302 RZTAGS(4)='USER-ID '
303 NRGET = 0
304 NRSAVE = 0
305 NRECRZ = 1000
306C
307 IPAOLD =-1
308 NUMOLD = 0
309C
310 IEVENT = 0
311 IDRUN = 1
312 NHEAD = 10
313 NTMED = 100
314 NMATE = 100
315 NROTM = 100
316 NPART = 100
317 NEVENT = 10000000
318C
319 TIMINT = 0.
320 TIMEND = 1.
321 ITIME = 1
322C
323 CALL UCTOH(MEC,NAMEC,4,MAXMEC*4)
324 CALL UCTOH(MEC1,NAMEC1,4,MAXME1*4)
325 MAXNST=10000
326C
327C Constants for energy loss and physics processes
328C
329 UPWGHT=1.
330 NEKBIN=90
331 NEK1=NEKBIN+1
332 EKMIN=1.E-5
333 EKMAX=1.E+4
334C
335C Initialize Random number generator
336C
337 NRNDM(1) = 0
338 NRNDM(2) = 0
339 CALL GRNDMQ(0,0,1,' ')
340#if defined (CERNLIB_PARA)
341 CALL GPDEFRNG(1)
342#endif
343C
344C Constants for multiple scattering (GMUL)
345C
346 DXM=TWOPI/100.
347 XM=-0.5*DXM
348 SQ=-0.0099999
349 DO 50 I=1,101
350 SQ=SQ+0.01
351 IF(I.LT.101)SQRMUL(I)=SQRT(-2.*LOG(SQ))
352 XM=XM+DXM
353 SINMUL(I)=SIN(XM)
354 50 COSMUL(I)=COS(XM)
355 SQRMUL(101)=0.01
356C
357C This piece of code to force loading of default
358C routines from the GEANG file on some machines
359C like VAX.
360C
361 IF(LOAD.NE.0)THEN
362 CALL GWORK (IP1)
363#if !defined(CERNLIB_USRJMP)
364 CALL GUDCAY
365 CALL GUDIGI
366 CALL GUDTIM( P2, P3,IP4, P4)
367 CALL GUFLD ( P1, P2)
368 CALL GUHADR
369 CALL GUIGET(IP1,IP2,IP3)
370 CALL GUINME( P1, P2, P3,IP4)
371 CALL GUINTI
372 CALL GUKINE
373 CALL GUNEAR(IP1,IP2, P3,IP4)
374 CALL GUOUT
375 CALL GUPHAD
376 CALL GUSKIP(IP1)
377 CALL GUSTEP
378 CALL GUSWIM( P1, P2, P3, P4)
379 CALL GUTRAK
380 CALL GUTREV
381 CALL GUVIEW(IP1,IP2,CDUMMY,IP4)
382 CALL GUPARA
383#endif
384 ENDIF
385C
38610100 FORMAT('1***** GEANT Version ',A8,' Released on ',A8)
38710200 FORMAT('0***** Correction Cradle Version ',F7.4)
38810300 FORMAT(' ***** Library compiled on ',I6,' at ',I4,' *****')
389 END