15 |
c------------------------------------------------------------------------ |
c------------------------------------------------------------------------ |
16 |
character*250 calname |
character*250 calname |
17 |
character*250 calname1 |
character*250 calname1 |
18 |
character ch |
c character ch |
19 |
character*2 ch2 |
character*2 ch2 |
20 |
c------------------------------------------------------------------ |
c------------------------------------------------------------------ |
21 |
|
|
41 |
c--------------- open ToF calib rz file |
c--------------- open ToF calib rz file |
42 |
c------------------------------------------------------------------------ |
c------------------------------------------------------------------------ |
43 |
|
|
44 |
do ii=1,250 |
c do ii=1,250 |
45 |
|
c ch=calname(ii:ii) |
46 |
|
c if (ch.eq.'.') goto 100 |
47 |
|
c enddo |
48 |
|
c100 continue |
49 |
|
c calname1 = calname(1:ii)//'rz' |
50 |
|
|
51 |
|
do ii=1,250 |
52 |
c ch=calname(ii:ii) |
c ch=calname(ii:ii) |
53 |
ch2=calname(ii:ii+1) |
ch2=calname(ii:ii+1) |
54 |
c write(*,*) ii,ch |
c write(*,*) ii,ch |
55 |
c if (ch.eq.'.') goto 100 |
c if (ch.eq.'.') goto 100 |
56 |
if (ch2.eq.'rz') goto 100 |
if (ch2.eq.'rz') goto 100 |
57 |
enddo |
enddo |
58 |
100 continue |
100 continue |
59 |
c calname1 = calname(1:ii)//'rz' |
c calname1 = calname(1:ii)//'rz' |
60 |
calname1 = calname(1:ii+1) |
calname1 = calname(1:ii+1) |
61 |
|
|
62 |
c print*,'__________ opening TOF calib rz file __________' |
|
63 |
c print*,calname |
|
|
c print*,calname1 |
|
64 |
|
|
65 |
CALL HROPEN(59,'TOF K1A',calname1,'QP',4096,istat) |
CALL HROPEN(59,'TOFK1131',calname1,'QP',4096,istat) |
66 |
|
|
67 |
if (istat.ne.0) then ! check if HROPEN was OK |
if (istat.ne.0) then ! check if HROPEN was OK |
68 |
write(*,*) 'Can''t open correct ToF calibration File !!!' |
write(*,*) 'Can''t open correct ToF calibration File !!!' |
69 |
stop |
stop |
70 |
endif |
endif |
71 |
|
|
|
c print*,' reading TOF CALIB n-tuple...' |
|
|
|
|
72 |
call HRIN(ntp_tofcalib,9999,0) |
call HRIN(ntp_tofcalib,9999,0) |
73 |
|
|
74 |
call HBNAME(ntp_tofcalib,' ',0,'$CLEAR') |
call HBNAME(ntp_tofcalib,' ',0,'$CLEAR') |
75 |
|
|
76 |
call HBNAME(ntp_tofcalib,'TOFKA',k_s11s31,'$SET') |
call HBNAME(ntp_tofcalib,'TOFK1131',k_s11s31,'$SET') |
77 |
call HBNAME(ntp_tofcalib,'TOFKB',k_s12s32,'$SET') |
call HBNAME(ntp_tofcalib,'TOFK1132',k_s11s32,'$SET') |
78 |
call HBNAME(ntp_tofcalib,'TOFKC',k_s21s31,'$SET') |
call HBNAME(ntp_tofcalib,'TOFK1231',k_s12s31,'$SET') |
79 |
call HBNAME(ntp_tofcalib,'TOFKD',k_s22s32,'$SET') |
call HBNAME(ntp_tofcalib,'TOFK1232',k_s12s32,'$SET') |
80 |
|
|
81 |
|
call HBNAME(ntp_tofcalib,'TOFK2131',k_s21s31,'$SET') |
82 |
|
call HBNAME(ntp_tofcalib,'TOFK2132',k_s21s32,'$SET') |
83 |
|
call HBNAME(ntp_tofcalib,'TOFK2231',k_s22s31,'$SET') |
84 |
|
call HBNAME(ntp_tofcalib,'TOFK2232',k_s22s32,'$SET') |
85 |
|
|
86 |
|
call HBNAME(ntp_tofcalib,'TOFK1121',k_s11s21,'$SET') |
87 |
|
call HBNAME(ntp_tofcalib,'TOFK1122',k_s11s22,'$SET') |
88 |
|
call HBNAME(ntp_tofcalib,'TOFK1221',k_s12s21,'$SET') |
89 |
|
call HBNAME(ntp_tofcalib,'TOFK1222',k_s12s22,'$SET') |
90 |
|
|
91 |
|
C-------------- |
92 |
|
|
93 |
call HBNAME(ntp_tofcalib,'TOFLIN11',y_coor_lin11,'$SET') |
call HBNAME(ntp_tofcalib,'TOFLIN11',y_coor_lin11,'$SET') |
94 |
call HBNAME(ntp_tofcalib,'TOFLIN12',x_coor_lin12,'$SET') |
call HBNAME(ntp_tofcalib,'TOFLIN12',x_coor_lin12,'$SET') |
114 |
c call HPRNTU(ntp_tofcalib) |
c call HPRNTU(ntp_tofcalib) |
115 |
|
|
116 |
call HNOENT(ntp_tofcalib,iemax_cal) |
call HNOENT(ntp_tofcalib,iemax_cal) |
|
c write(*,*) 'Number of Events CALIB ',iemax_cal |
|
117 |
|
|
118 |
do iev=1,iemax_cal |
do iev=1,iemax_cal |
119 |
call HGNT(ntp_tofcalib,iev,ierr) !reads an event |
call HGNT(ntp_tofcalib,iev,ierr) !reads an event |
|
c write(34,*)iev,k1_s11s31,y_coor_lin11,tw11 |
|
120 |
enddo |
enddo |
121 |
|
|
122 |
call hrout(ntp_tofcalib,icycle,' ') |
call hrout(ntp_tofcalib,icycle,' ') |
123 |
call hrend('TOF K1A') |
call hrend('TOFK1131') |
124 |
close(0) |
close(0) |
125 |
|
|
126 |
return |
return |