*********************************************************************** c SUBROUTINE WALLSTEP c c last modified on 5/10/2005 by F.Krizek 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 "walltuple.inc" INTEGER NH PARAMETER (NH=11) REAL HITS(NH) REAL XM(3), XD(3) CHARACTER*4 CHSET EQUIVALENCE (IHSET,CHSET) INTEGER I, IHIT INTEGER DETNR, MODUL REAL ELOS SAVE ELOS IF(CHSET.NE.'WLSC') RETURN ! are we in wall ? ! IDTYPE = set number from common GCSETS ! DETNR = IDTYPE ! 400 offset fixed in geometry routines ! whole FW has IDTYPE 400 IF(NUMED.EQ.NUMED_WLSC) THEN ! we are in plastic scintillator IF(INWVOL.EQ.1) ELOS = 0.0 ! clear, if new volume entered IF(DETNR.EQ.400.AND. DESTEP.GT.0.0) THEN ELOS = ELOS + DESTEP ! cumulate energy dep. in this volume ENDIF ENDIF IF(DETNR.EQ.400) THEN IF((INWVOL.EQ.2 .OR. INWVOL.EQ.1 .OR. ISTOP.EQ.2) .AND. & CHARGE.NE.0) THEN ! volume left or entered or particle went below thresh. MODUL = 0 !Modul number, wall has only one modul DO I=1,3 XM(I) = VECT(I) ENDDO ! set geometry tree for frame transformation 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) = FLOAT(MODUL) ! module number, is always zero HITS(9) = VECT(7) ! total momentum of particle HITS(10) = FLOAT(INWVOL) ! tracking flag (in common GCTRAK) HITS(11) = SLENG ! length of current track CALL GSAHIT(ISET,IDET,ITRA,NUMBV,HITS,IHIT) ! store hit for walldigi ENDIF ENDIF RETURN END