--- DarthVader/ToFLevel2/src/rdtofcal.for 2006/06/17 12:14:56 1.1.1.1 +++ DarthVader/ToFLevel2/src/rdtofcal.for 2011/11/23 21:19:38 1.8 @@ -1,11 +1,12 @@ C------------------------------------------------ - FUNCTION RDTOFCAL(calname) + REAL FUNCTION RDTOFCAL(calname,cnlen) C------------------------------------------------ include 'input_tof.txt' c----- HBOOK INTEGER HMEM +c REAL RDTOFCAL parameter (NWPAWC=8500000) common/PAWC/HMEM(NWPAWC) @@ -15,7 +16,9 @@ c------------------------------------------------------------------------ character*250 calname character*250 calname1 - character ch +c character ch +c character*2 ch2 + integer cnlen c------------------------------------------------------------------ COMMON/QUEST/IQUEST(100) @@ -26,6 +29,8 @@ INTEGER lrec INTEGER istat, ierr, icycle + +c REAL x_coor_lin11(8,2),y_coor_lin12(6,2) PARAMETER (lrec=4096) C------------------------------------------------------------------------- @@ -34,18 +39,35 @@ c c------------------------------------------------------------------------ + RDTOFCAL = 0. call HLIMIT(NWPAWC) c------------------------------------------------------------------------ c--------------- open ToF calib rz file c------------------------------------------------------------------------ - do ii=1,250 - ch=calname(ii:ii) - if (ch.eq.'.') goto 100 - enddo -100 continue - calname1 = calname(1:ii)//'rz' +c do ii=1,250 +c ch=calname(ii:ii) +c if (ch.eq.'.') goto 100 +c enddo +c100 continue +c calname1 = calname(1:ii)//'rz' + +c do ii=1,250 +cc ch=calname(ii:ii) +c ch2=calname(ii:ii+1) +cc write(*,*) ii,ch +cc if (ch.eq.'.') goto 100 +c if (ch2.eq.'rz') goto 100 +c enddo +c100 continue +c calname1 = calname(1:ii)//'rz' +c calname1 = calname(1:ii+1) + + calname1 = calname(1:cnlen) + + + CALL HROPEN(59,'TOFK1131',calname1,'QP',4096,istat) @@ -77,6 +99,8 @@ call HBNAME(ntp_tofcalib,'TOFLIN11',y_coor_lin11,'$SET') call HBNAME(ntp_tofcalib,'TOFLIN12',x_coor_lin12,'$SET') +c call HBNAME(ntp_tofcalib,'TOFLIN11',x_coor_lin11,'$SET') +c call HBNAME(ntp_tofcalib,'TOFLIN12',y_coor_lin12,'$SET') call HBNAME(ntp_tofcalib,'TOFLIN21',x_coor_lin21,'$SET') call HBNAME(ntp_tofcalib,'TOFLIN22',y_coor_lin22,'$SET') call HBNAME(ntp_tofcalib,'TOFLIN31',y_coor_lin31,'$SET') @@ -102,12 +126,13 @@ do iev=1,iemax_cal call HGNT(ntp_tofcalib,iev,ierr) !reads an event +c print *,' ierr ',ierr enddo call hrout(ntp_tofcalib,icycle,' ') call hrend('TOFK1131') close(0) - return - end + return + end