ECCE @ EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
gustep.F
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file gustep.F
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/gckine.inc"
8 #include "geant321/gcking.inc"
9 #include "geant321/gconst.inc"
10 #include "geant321/gctrak.inc"
11 #include "geant321/gctmed.inc"
12 #include "geant321/gcvolu.inc"
13 #include "calor.inc"
14 #include "celoss.inc"
15 #include "histo.inc"
16 *
17  data amev /1.e-3/
18 *
19 * *** Debug event and store tracks for drawing
20  IF (idebug.NE.0) CALL gpcxyz
21  IF ((iswit(1).EQ.1).AND.(charge.NE.0.)) CALL gsxyz
22  IF (iswit(1).EQ.2) CALL gsxyz
23 *
24 * *** Something generated ?
25  IF(ngkine.GT.0) CALL gsking(0)
26 *
27 * *** Energy deposited and charged track length
28  IF (numed.LE.nbabsor) THEN
29  if (destep.NE.0.) edepabs(numed) = edepabs(numed) + destep
30  if (charge*step.NE.0.) trckabs(numed) = trckabs(numed) + step
31 * longitudinal profile of Edep
32  layer = number(nlevel-1)
33  ih = maxabs + numed
34  if (histo(ih)) call hfill(ih,0.+layer,0.,destep/(amev*nevent))
35  ENDIF
36 *
37 * *** Energy flow : leaving an absorber ?
38  IF ((numed.LE.nbabsor).and.(inwvol.eq.2)) THEN
39  idnow = nbabsor*(layer-1) + numed
40  eflow = gekin
41  if (ipart.eq.2) eflow = gekin + 2*emass
42 *
43  if (max(abs(vect(2)),abs(vect(3))).ge.(0.5*caloryz)) then
44  eleaklat(idnow) = eleaklat(idnow) + eflow
45  elseif (vect(4).ge.0.) then
46  enerflow(idnow+1) = enerflow(idnow+1) + eflow
47  else
48  enerflow(idnow) = enerflow(idnow) - eflow
49  endif
50  ENDIF
51 *
52  END