Geant4  9.6.p02
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
gustep.F
Go to the documentation of this file.
1 
2  SUBROUTINE gustep
3 *
4 * User routine called at the end of each tracking step
5 *
6 #include "geant321/gcflag.inc"
7 #include "geant321/gconst.inc"
8 #include "geant321/gckine.inc"
9 #include "geant321/gcking.inc"
10 #include "geant321/gctmed.inc"
11 #include "geant321/gctrak.inc"
12 #include "geant321/gcvolu.inc"
13 #include "pvolum.inc"
14 #include "celoss.inc"
15 *
16 *
17 * *** Debug event and strore track for drawing
18  IF (idebug.NE.0) CALL gpcxyz
19  IF (iswit(1).EQ.1.AND.(charge.NE.0.)) CALL gsxyz
20  IF (iswit(1).EQ.2) CALL gsxyz
21 *
22 * *** Something generated ?
23  IF(ngkine.GT.0) CALL gsking(0)
24 *
25 * *** Energy deposited
26  IF (destep.GT.0.)THEN
27  radius = sqrt(vect(1)**2 + vect(2)**2)
28  nr = 1 + radius/(drx0*x0)
29  nl = 1 + (z1 + vect(3))/(dlx0*x0)
30  dedr(nr) = dedr(nr) + destep
31  dedl(nl) = dedl(nl) + destep
32  ENDIF
33 *
34 * *** track length and total energy deposit
35  IF (charge.NE.0.) THEN
36  strch = strch + step
37  edepch = edepch + destep
38  ELSE
39  strne = strne + step
40  edepne = edepne + destep
41  ENDIF
42 *
43 * *** energy of particles contributing to edep
44  IF ((destep).GT.0.)THEN
45  elog = log10((gekin+destep)/pkine(3))
46  call hfill(21,elog,0.,destep)
47  ENDIF
48  END