Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-02-23 09:20:58

0001 
0002       SUBROUTINE GUSTEP                                                         
0003 *                                                                               
0004 *     User routine called at the end of each tracking step           
0005 *                                                               
0006 #include "geant321/gcflag.inc"
0007 #include "geant321/gckine.inc"
0008 #include "geant321/gcking.inc"
0009 #include "geant321/gconst.inc"
0010 #include "geant321/gctrak.inc"
0011 #include "geant321/gctmed.inc"
0012 #include "geant321/gcvolu.inc"
0013 #include "calor.inc"
0014 #include "celoss.inc"
0015 #include "histo.inc"
0016 *
0017       data aMeV /1.e-3/
0018 *
0019 * *** Debug event and store tracks for drawing
0020       IF (IDEBUG.NE.0)   CALL GPCXYZ      
0021       IF ((ISWIT(1).EQ.1).AND.(CHARGE.NE.0.)) CALL GSXYZ
0022       IF  (ISWIT(1).EQ.2)                     CALL GSXYZ
0023 *
0024 * *** Something generated ?
0025       IF(NGKINE.GT.0) CALL GSKING(0)
0026 *
0027 * *** Energy deposited and charged track length
0028       IF (NUMED.LE.NbAbsor) THEN
0029         if (DESTEP.NE.0.)      EdepAbs(NUMED) = EdepAbs(NUMED) + DESTEP
0030         if (CHARGE*STEP.NE.0.) TrckAbs(NUMED) = TrckAbs(NUMED) + STEP
0031 *       longitudinal profile of Edep
0032         layer = number(nlevel-1)
0033         ih = MaxAbs + numed
0034         if (histo(ih)) call hfill (ih,0.+layer,0.,destep/(aMeV*nevent))         
0035       ENDIF
0036 *
0037 * *** Energy flow : leaving an absorber ?
0038       IF ((NUMED.LE.NbAbsor).and.(INWVOL.eq.2)) THEN
0039         Idnow = NbAbsor*(layer-1) + numed
0040         Eflow = gekin
0041         if (ipart.eq.2) Eflow = gekin + 2*emass
0042 *                     
0043         if (max(abs(vect(2)),abs(vect(3))).ge.(0.5*calorYZ)) then
0044           EleakLat(Idnow)   = EleakLat(Idnow)   + Eflow
0045         elseif (vect(4).ge.0.) then
0046           EnerFlow(Idnow+1) = EnerFlow(Idnow+1) + Eflow
0047         else
0048           EnerFlow(Idnow)   = EnerFlow(Idnow)   - Eflow   
0049         endif
0050       ENDIF          
0051 *
0052       END