--- gpamela/gptof/gpdtof.F 2002/07/11 16:02:01 3.1 +++ gpamela/gptof/gpdtof.F 2006/05/02 11:46:13 3.2 @@ -1,7 +1,10 @@ * -* $Id$ +* $Id: gpdtof.F,v 3.1.1.1 2002/07/11 16:02:01 cafagna Exp $ +* +* $Log: gpdtof.F,v $ +* Revision 3.1.1.1 2002/07/11 16:02:01 cafagna +* First GPAMELA release on CVS * -* $Log$ * *CMZ : 2.01/00 06/03/2000 13.07.03 by Francesco Cafagna *CMZ : 2.00/00 25/02/2000 17.16.49 by Francesco Cafagna @@ -26,8 +29,8 @@ #include "gpsed.inc" * INTEGER IS,ID,NV,NVM,NNHM,INDEX,NPLANE - CHARACTER*4 CSET(7) - DATA CSET/'S11 ','S12 ','S21 ','S22 ','S31 ','S32 ','S4 '/ + CHARACTER*4 CSET(4) + DATA CSET/'S1 ','S2 ','S3A ','S4 '/ * * Vector zeroed * @@ -44,7 +47,7 @@ CALL VZERO(TIMETOF,NHM) CALL VZERO(PATHTOF,NHM) CALL VZERO(P0TOF,NHM) -* +* CALL VZERO(NUMD ,NVOL) * * Start with tof top @@ -54,77 +57,85 @@ IT = -1 NTHTOF = 0 INDEX = 0 - DO II=1,7 - IS= II - ID= 1 -* +cc DO II=1,7 + DO II=1,4 + DO III=1,2 + IF(II.EQ.4.AND.III.EQ.2) GOTO 100 + IS= II +cc ID= 1 + ID=III +* * Check on the volume level * - IF (NV.GT.NVM) THEN - WRITE(CHMAIL,10000) CSET,CNSED(IS,ID),NVOL,NVMAX, IDRUN, - + IDEVT - CALL GMAIL(1,0) - GO TO 10 - ENDIF - CALL VZERO(VHITS,NH*NHM) - CALL VZERO(ITRA ,NHM) - CALL VZERO(NUMBV,NVOL*NHM) - NHITS = -1 - CALL GPRHIT(CSET(II),CNSED(IS,ID),IS,ID,NVOL,NH,NHM,1, - + IT,NUMD,ITRA,NUMBV,VHITS,NHITS) -* -* If there was a problem in GPRHIT then exit -* - IF(NHITS.LT.0) THEN - WRITE(CHMAIL,10200) CSET(IS),CNSED(IS,ID),NHITS,NHM, - + IDRUN,IDEVT - CALL GMAIL(1,0) - GO TO 10 - ENDIF + IF (NV.GT.NVM) THEN + WRITE(CHMAIL,10000) CSET,CNSED(IS,ID),NVOL,NVMAX, IDRUN, + + IDEVT + CALL GMAIL(1,0) + GO TO 10 + ENDIF + CALL VZERO(VHITS,NH*NHM) + CALL VZERO(ITRA ,NHM) + CALL VZERO(NUMBV,NVOL*NHM) + NHITS = -1 + CALL GPRHIT(CSET(II),CNSED(IS,ID),IS,ID,NVOL,NH,NHM,1, + + IT,NUMD,ITRA,NUMBV,VHITS,NHITS) +* +* If there was a problem in GPRHIT then exit +* + IF(NHITS.LT.0) THEN + WRITE(CHMAIL,10200) CSET(IS),CNSED(IS,ID),NHITS,NHM, + + IDRUN,IDEVT + CALL GMAIL(1,0) + GO TO 10 + ENDIF * * Fill the CWN common * - NPLANE = II - NTHTOF = NHITS + NTHTOF - DO I=1,NHITS - INDEX = INDEX + 1 - IPLTOF(INDEX) = NPLANE +CC NPLANE = II + IF(III.EQ.1) NPLANE=2*II-1 + IF(III.EQ.2) NPLANE=2*II + NTHTOF = NHITS + NTHTOF + DO I=1,NHITS + INDEX = INDEX + 1 + IPLTOF(INDEX) = NPLANE *ML: - IPADDLE(INDEX) = NUMBV(NVTOF,I) - IF(II.EQ.7) THEN - IPADDLE(INDEX) = NUMBV(NVS4,I) - ENDIF + IPADDLE(INDEX) = NUMBV(NVTOF-1,I) + IF(II.EQ.4.AND.III.EQ.1) THEN + IPADDLE(INDEX)= NUMBV(NVS4,I) + ENDIF *END ML. #if defined(GPAMELA_INTER) - XAVTOF(INDEX) = VHITS(1,I) - YAVTOF(INDEX) = VHITS(2,I) - ZAVTOF(INDEX) = VHITS(3,I) - XOUTTOF(INDEX) = VHITS(4,I) - YOUTTOF(INDEX) = VHITS(5,I) - ZOUTTOF(INDEX) = VHITS(6,I) - XINTOF(INDEX) = 2*XAVTOF(INDEX) - XOUTTOF(INDEX) - YINTOF(INDEX) = 2*YAVTOF(INDEX) - YOUTTOF(INDEX) - ZINTOF(INDEX) = 2*ZAVTOF(INDEX) - ZOUTTOF(INDEX) + XAVTOF(INDEX) = VHITS(1,I) + YAVTOF(INDEX) = VHITS(2,I) + ZAVTOF(INDEX) = VHITS(3,I) + XOUTTOF(INDEX) = VHITS(4,I) + YOUTTOF(INDEX) = VHITS(5,I) + ZOUTTOF(INDEX) = VHITS(6,I) + XINTOF(INDEX) = 2*XAVTOF(INDEX) - XOUTTOF(INDEX) + YINTOF(INDEX) = 2*YAVTOF(INDEX) - YOUTTOF(INDEX) + ZINTOF(INDEX) = 2*ZAVTOF(INDEX) - ZOUTTOF(INDEX) #endif #if !defined(GPAMELA_INTER) - XINTOF(INDEX) = VHITS(1,I) - YINTOF(INDEX) = VHITS(2,I) - ZINTOF(INDEX) = VHITS(3,I) - XOUTTOF(INDEX) = VHITS(4,I) - YOUTTOF(INDEX) = VHITS(5,I) - ZOUTTOF(INDEX) = VHITS(6,I) - XAVTOF(INDEX) = (XINTOF(INDEX)+XOUTTOF(INDEX))/2. - YAVTOF(INDEX) = (YINTOF(INDEX)+YOUTTOF(INDEX))/2. - ZAVTOF(INDEX) = (ZINTOF(INDEX)+ZOUTTOF(INDEX))/2. + XINTOF(INDEX) = VHITS(1,I) + YINTOF(INDEX) = VHITS(2,I) + ZINTOF(INDEX) = VHITS(3,I) + XOUTTOF(INDEX) = VHITS(4,I) + YOUTTOF(INDEX) = VHITS(5,I) + ZOUTTOF(INDEX) = VHITS(6,I) + XAVTOF(INDEX) = (XINTOF(INDEX)+XOUTTOF(INDEX))/2. + YAVTOF(INDEX) = (YINTOF(INDEX)+YOUTTOF(INDEX))/2. + ZAVTOF(INDEX) = (ZINTOF(INDEX)+ZOUTTOF(INDEX))/2. #endif *ML: * ERELTOF(INDEX) = VHITS(7,I) - ERELTOF(INDEX) = VHITS(11,I) - TIMETOF(INDEX) = VHITS(8,I) - PATHTOF(INDEX) = VHITS(9,I) - IPARTOF(INDEX) = VHITS(10,I) -* P0TOF (INDEX) = VHITS(11,I) - P0TOF(INDEX) = VHITS(7,I) + ERELTOF(INDEX) = VHITS(11,I) + TIMETOF(INDEX) = VHITS(8,I) + PATHTOF(INDEX) = VHITS(9,I) + IPARTOF(INDEX) = VHITS(10,I) +* P0TOF (INDEX) = VHITS(11,I) + P0TOF(INDEX) = VHITS(7,I) + ENDDO + 100 CONTINUE ENDDO ENDDO *