c******************************************************************* subroutine showstep c c SHOWER hits are stored if gas volume S1AI, S2AI or S3AI is either c entered (inwvol=1), left (inwvol=2) or particle stops (istop=1). c The energy loss is integrated over the track inside of volume (elos). c In order to avoid problems with entering or leaving the daughter SxSW c flag infrom (common GCVOLU) is tested: c infrom = 0: current volume has been entered from mother volume c 1: current volume has been entered from one of its daughters c c designed by Jacek Otwinowski c last modified on: 16/7/99 by R. Holzmann c******************************************************************* implicit none #include "geant321/gcflag.inc" #include "geant321/gckine.inc" #include "geant321/gcking.inc" #include "geant321/gcsets.inc" #include "geant321/gctmed.inc" #include "geant321/gctrak.inc" #include "geant321/gcvolu.inc" #include "showtups.inc" #include "showerdconst.inc" integer i, ihit, nh, detnr parameter (nh=14) real hits(nh) real xm(3), xd(3), pm(3), pd(3) character*4 chset equivalence (ihset,chset) real elos, elos1, elos2, elos3 save elos1 save elos2 save elos3 if(chset.ne.'SHOW') return ! nothing to do here detnr = idtype - 50 ! offset 50 is fixed in geometry routines if(detnr.lt.1 .or. detnr.gt.3) return ! this should not happen if(charge.eq.0) return ! neutral particle makes no signal if(numed.eq.numed_driftgas) then if(inwvol.eq.1 .and. infrom.eq.0) then ! volume entered from elos1 = 0.0 ! outside SxAI, and not elos2 = 0.0 ! from daughter SxSW elos3 = 0.0 endif if(destep.gt.0.) then if(detnr.eq.1) elos1 = elos1 + destep if(detnr.eq.2) elos2 = elos2 + destep if(detnr.eq.3) elos3 = elos3 + destep endif if(showershape(1:4).ne.'TRAP') + write(6,*) ' SHOWSTEP: Wrong shape: ', showershape endif if((inwvol.eq.1 .and. infrom.eq.0) .or. ! SxAI entered from outside + (inwvol.eq.2 .and. infrom.eq.1) .or. ! SxAI left to outside + (istop.eq.2)) then ! track stopped inside SxAI do i=1,3 xm(i) = vect(i) pm(i) = vect(i+3) enddo call gmtod(xm,xd,1) ! go to detector frame with position call gmtod(pm,pd,2) ! and momentum components c write(6,*) itra, detnr, inwvol, infrom, xd(3) if(detnr.eq.1) elos = elos1 if(detnr.eq.2) elos = elos2 if(detnr.eq.3) elos = elos3 hits(1) = -xd(1)+showerdx(detnr) ! x of hit in HADES reference ! coordinate system hits(2) = -xd(2)+showerdy(detnr) ! y hits(3) = xd(3) ! z hits(4) = getot ! total energy of particle c hits(4) = tofg ! tof of hit hits(5) = float(ipart) ! particle ID hits(6) = float(detnr) ! plane number hits(7) = float(itra) ! track number hits(8) = elos ! deposited energy hits(9) = float(infrom) ! entered from daughter (common GCVOLU) hits(10) = vect(7) ! total momentum of particle hits(11) = float(inwvol) ! tracking flag (from common GCTRAK) hits(12) = -pd(1) ! momentum components in detector frame hits(13) = -pd(2) hits(14) = pd(3) call gsahit(iset,idet,itra,numbv,hits,ihit) if(ihit.eq.0) write (6,*) 'SHOWER hit has not been stored' endif return end