SUBROUTINE DPLOT IMPLICIT NONE #include #include INTEGER IFAIL,I,J,NHIT(24,2,50000) LOGICAL PRINT DATA PRINT/.FALSE./ CALL BATCH_LOG c unpacks the data from the SCT2 bank into the common block in rssc.cmn c SCNHIT - The number of unpacked hits c SCISEC(I) - The sector of the Ith hit (1-24) c SCILAY(I) - The layer of the Ith hit (0 or 1) c SCIWIR(I) - The "wire" of the Ith hit (0-23 for inner layer, c 0-27 for outer. This is actually a wire pair, since c two wires are read out on each TDC channel. Which wire c of the pair was struck is determined by the z measurement. c SCITIM(I) - The leading edge time fo the Ith hit c SCIWID(I) - The width of the Ith hit (used for z measurement) c SCXPOS(I) - The x position of the Ith hit. For a given wire, this can c be one of two values depending on the z measurement. c SCZPOS(I) - The calibrated z position of the Ith hit, determined from c the width of the hit. Returned as 9999. for bad calibration. CALL UNPRSC(IFAIL) IF (IFAIL.NE.0) RETURN c initialize array DO I=1,24 DO J=0,1 NHIT(I,J+1,1)=0 ENDDO ENDDO DO I=1,SCNHIT IF(PRINT)THEN WRITE (LOUT,10) I,SCISEC(I),SCILAY(I),SCIWIR(I),SCIWID(I), + SCITIM(I),SCZPOS(I),SCXPOS(I) 10 FORMAT (I5,' SEC: ',I2,' LAY: ',I2,' WIRE: ',I2, + ' WID: ',I6,' TIME: ',I6, ' ZP: ',F10.4,' XP: ',F10.4) END IF c counting the total hits for each layer. IF (SCISEC(I).NE.-1) THEN NHIT(SCISEC(I),SCILAY(I)+1,1)=NHIT(SCISEC(I),SCILAY(I)+1,1)+1 NHIT(SCISEC(I),SCILAY(I)+1,NHIT(SCISEC(I),SCILAY(I)+1,1)+1)=I ENDIF ENDDO DO I=1,24 !look for chambers with only one hit (Fe55) DO J=0,1 IF(PRINT)THEN WRITE (LOUT,20) I,J,NHIT(I,J+1,1) 20 FORMAT (4X,3I10) END IF IF (NHIT(I,J+1,1).EQ.1) THEN c time difference for each wire when there is only one hit. c Since x ray only activate electron in one straw, one can only c observe one tube hit per event. However, cross talk occurring c on both ends makes one more hits possible. CALL HF1(SCISEC(NHIT(I,J+1,2))*100+ + SCILAY(NHIT(I,J+1,2))*50+ + SCIWIR(NHIT(I,J+1,2)),FLOAT(SCIWID(NHIT(I,J+1,2))),1.) ENDIF ENDDO ENDDO DO I=1,SCNHIT ! plot all hits IF (SCISEC(I).NE.-1) THEN c occupancy for each wire CALL HF2(10+SCILAY(I),FLOAT(SCIWIR(I)),FLOAT(SCISEC(I)),1.) ENDIF ENDDO RETURN END SUBROUTINE DEFINE IMPLICIT NONE INTEGER I,J,K CHARACTER*30 TITLE COMMON /PAWC/H(8000000) CALL HLIMIT(8000000) CALL HBOOK2(10,'Wire vs Sect. (Inner)',30,0.,30.,26,0.,26.,0.) CALL HBOOK2(11,'Wire vs Sect. (Outer)',30,0.,30.,26,0.,26.,0.) DO I=1,24 DO J=0,1 DO K=0,23+J*4 WRITE (TITLE,19) I,J,K 19 FORMAT (' SECTOR ',I2,' I/O ',I2,' WIRE ',I2,' TIME') CALL HBOOK1(I*100+J*50+K,TITLE,4000,0.,4000.,0.) ENDDO ENDDO ENDDO RETURN END