*********************************************************************** c SUBROUTINE STARTSTEP c c last modified on: 11/02/2014 by I. Koenig c *********************************************************************** IMPLICIT NONE #include "geant321/gcflag.inc" #include "geant321/gckine.inc" #include "geant321/gcsets.inc" #include "geant321/gctmed.inc" #include "geant321/gctrak.inc" #include "geant321/gcvolu.inc" #include "starttuple.inc" INTEGER NH PARAMETER (NH=10) REAL HITS(NH) REAL XM(3), XD(3) CHARACTER*4 CHSET EQUIVALENCE (IHSET,CHSET) INTEGER I, IHIT REAL ELOS SAVE ELOS IF(CHSET.NE.'STAR') RETURN ! are we in start detector? ! IDTYPE = set number from common GCSETS IF(NUMED.EQ.NUMED_START) THEN ! we are in diamond IF(INWVOL.EQ.1) ELOS = 0.0 ! clear, if new volume entered IF(DESTEP.GT.0.0) THEN ELOS = ELOS + DESTEP ! cumulate energy dep. in this volume ENDIF ENDIF IF((INWVOL.EQ.2 .OR. INWVOL.EQ.1 .OR. ISTOP.EQ.2) .AND. & CHARGE.NE.0) THEN ! volume left or entered or particle stopped or decayed DO I=1,3 XM(I) = VECT(I) ENDDO CALL GMTOD(XM,XD,1) ! transform coordinates into detector frame HITS(1) = XD(1) ! x of hit in detector coordinates HITS(2) = XD(2) ! y " HITS(3) = XD(3) ! z " HITS(4) = TOFG ! tof of current hit HITS(5) = FLOAT(IPART) ! GEANT particle ID HITS(6) = FLOAT(ITRA) ! track nb. HITS(7) = ELOS ! deposited energy HITS(8) = VECT(7) ! total momentum of particle HITS(9) = FLOAT(INWVOL) ! tracking flag (in common GCTRAK) HITS(10) = SLENG ! length of current track CALL GSAHIT(ISET,IDET,ITRA,NUMBV,HITS,IHIT) ! store hit for startdigi ENDIF RETURN END