| 9 |
|
|
| 10 |
c2f_error = 0 |
c2f_error = 0 |
| 11 |
|
|
| 12 |
c if(C2F_DEBUG.eq.1)print * |
|
| 13 |
if(verbose)print * |
c if(C2F_DEBUG.EQ.1.eq.1)print * |
| 14 |
|
if(verbose.eq.1)print * |
| 15 |
$ ,c2f_path(1:c2f_pathlen)//'trk-maskvk.dat' |
$ ,c2f_path(1:c2f_pathlen)//'trk-maskvk.dat' |
| 16 |
open(10, |
open(10, |
| 17 |
$ FILE=c2f_path(1:c2f_pathlen)//'trk-maskvk.dat' !<<<< C2F |
$ FILE=c2f_path(1:c2f_pathlen)//'trk-maskvk.dat' !<<<< C2F |
| 19 |
$ ,IOSTAT=iostat |
$ ,IOSTAT=iostat |
| 20 |
$ ) |
$ ) |
| 21 |
if(iostat.ne.0)then |
if(iostat.ne.0)then |
| 22 |
c if(C2F_DEBUG.eq.1) |
c if(C2F_DEBUG.EQ.1.eq.1) |
| 23 |
if(debug) |
if(debug.eq.1) |
| 24 |
$ print*,'READVKMASK: *** Error opening file ***' |
$ print*,'READVKMASK: *** Error opening file ***' |
| 25 |
c2f_error = 1 |
c2f_error = 1 |
| 26 |
return |
return |
| 31 |
$ ) |
$ ) |
| 32 |
$ (mask_vk(iv,i),i=1,24) |
$ (mask_vk(iv,i),i=1,24) |
| 33 |
if(iostat.ne.0)then |
if(iostat.ne.0)then |
| 34 |
c if(C2F_DEBUG.eq.1) |
c if(C2F_DEBUG.EQ.1.eq.1) |
| 35 |
if(debug) |
if(debug.eq.1) |
| 36 |
$ print*,'READVKMASK: *** Error reading file ***' |
$ print*,'READVKMASK: *** Error reading file ***' |
| 37 |
c2f_error = 1 |
c2f_error = 1 |
| 38 |
goto 1000 |
goto 1000 |
| 39 |
endif |
endif |
| 40 |
|
if(verbose.eq.1)print*,'view ',iv,': ',(mask_vk(iv,i),i=1,24) |
| 41 |
enddo |
enddo |
| 42 |
1000 close(10) |
1000 close(10) |
| 43 |
1001 continue |
c 1001 continue |
| 44 |
return |
return |
| 45 |
end |
end |
| 46 |
|
|
| 58 |
201 format('trk-LADDER',i1,'-mip.dat') |
201 format('trk-LADDER',i1,'-mip.dat') |
| 59 |
do ilad=1,nladders_view |
do ilad=1,nladders_view |
| 60 |
write(fname_param,201)ilad |
write(fname_param,201)ilad |
| 61 |
c if(C2F_DEBUG.eq.1)print * |
c if(C2F_DEBUG.EQ.1.eq.1)print * |
| 62 |
if(VERBOSE)print * |
if(VERBOSE.EQ.1)print * |
| 63 |
$ ,c2f_path(1:c2f_pathlen)!<<<< C2F |
$ ,c2f_path(1:c2f_pathlen)!<<<< C2F |
| 64 |
$ //fname_param(1:LNBLNK(fname_param)) |
$ //fname_param(1:LNBLNK(fname_param)) |
| 65 |
open(10, |
open(10, |
| 69 |
$ ,IOSTAT=iostat |
$ ,IOSTAT=iostat |
| 70 |
$ ) |
$ ) |
| 71 |
if(iostat.ne.0)then |
if(iostat.ne.0)then |
| 72 |
c if(C2F_DEBUG.eq.1)print* |
c if(C2F_DEBUG.EQ.1.eq.1)print* |
| 73 |
if(DEBUG)print* |
if(DEBUG.EQ.1)print* |
| 74 |
$ ,'READMIPPARAM: *** Error opening file *** ' |
$ ,'READMIPPARAM: *** Error opening file *** ' |
| 75 |
c2f_error = 1 |
c2f_error = 1 |
| 76 |
return |
return |
| 88 |
1000 close(10) |
1000 close(10) |
| 89 |
enddo |
enddo |
| 90 |
|
|
| 91 |
return |
return |
| 92 |
end |
end |
| 93 |
*** * * * *** * * * *** * * * *** * * * *** * * * *** * * * *** |
*** * * * *** * * * *** * * * *** * * * *** * * * *** * * * *** |
| 94 |
subroutine readchargeparam |
subroutine readchargeparam |
| 98 |
include 'calib.f' |
include 'calib.f' |
| 99 |
include 'common_c2f.f' !<<<< C2F |
include 'common_c2f.f' !<<<< C2F |
| 100 |
character*60 fname_param |
character*60 fname_param |
| 101 |
c2f_error = 0 |
c2f_error = 0 |
| 102 |
201 format('charge-l',i1,'.dat') |
201 format('charge-l',i1,'.dat') |
| 103 |
do ilad=1,nladders_view |
do ilad=1,nladders_view |
| 104 |
write(fname_param,201)ilad |
write(fname_param,201)ilad |
| 105 |
c if(C2F_DEBUG.eq.1)print * |
c if(C2F_DEBUG.EQ.1.eq.1)print * |
| 106 |
if(VERBOSE)print * |
if(VERBOSE.EQ.1)print * |
| 107 |
$ ,c2f_path(1:c2f_pathlen)!<<<< C2F |
$ ,c2f_path(1:c2f_pathlen)!<<<< C2F |
| 108 |
$ //fname_param(1:LNBLNK(fname_param)) |
$ //fname_param(1:LNBLNK(fname_param)) |
| 109 |
open(10, |
open(10, |
| 122 |
$ )pip, |
$ )pip, |
| 123 |
$ kch(ip,ilad),cch(ip,ilad),sch(ip,ilad) |
$ kch(ip,ilad),cch(ip,ilad),sch(ip,ilad) |
| 124 |
if(iostat.ne.0)then |
if(iostat.ne.0)then |
| 125 |
c2f_error = 1 |
c2f_error = 1 |
| 126 |
goto 1000 |
goto 1000 |
| 127 |
endif |
endif |
| 128 |
enddo |
enddo |
| 150 |
|
|
| 151 |
|
|
| 152 |
c2f_error = 0 |
c2f_error = 0 |
| 153 |
|
|
| 154 |
* ====================================================== |
* ====================================================== |
| 155 |
* read ANGULAR BINNING info |
* read ANGULAR BINNING info |
| 156 |
* ====================================================== |
* ====================================================== |
| 157 |
fname_binning='binning.dat' |
fname_binning='binning.dat' |
| 158 |
c if(C2F_DEBUG.eq.1) |
c if(C2F_DEBUG.EQ.1.eq.1) |
| 159 |
if(VERBOSE) |
if(VERBOSE.EQ.1) |
| 160 |
$ print * |
$ print * |
| 161 |
$ ,c2f_path(1:c2f_pathlen) !<<<< C2F |
$ ,c2f_path(1:c2f_pathlen) !<<<< C2F |
| 162 |
$ //fname_binning(1:LNBLNK(fname_binning)) |
$ //fname_binning(1:LNBLNK(fname_binning)) |
| 167 |
$ ,IOSTAT=iostat |
$ ,IOSTAT=iostat |
| 168 |
$ ) |
$ ) |
| 169 |
if(iostat.ne.0)then |
if(iostat.ne.0)then |
| 170 |
c if(C2F_DEBUG.eq.1) |
c if(C2F_DEBUG.EQ.1.eq.1) |
| 171 |
if(DEBUG) |
if(DEBUG.EQ.1) |
| 172 |
$ print*,'READETAPARAM: *** Error in opening file *** ' |
$ print*,'READETAPARAM: *** Error in opening file *** ' |
| 173 |
c2f_error = 1 |
c2f_error = 1 |
| 174 |
return |
return |
| 175 |
endif |
endif |
| 176 |
c print*,'---- ANGULAR BINNING ----' |
if(DEBUG.EQ.1)THEN |
| 177 |
c print*,'Bin - angL - angR' |
print*,'---- ANGULAR BINNING ----' |
| 178 |
|
print*,'Bin - angL - angR' |
| 179 |
|
endif |
| 180 |
101 format(i2,' ',f6.2,' ',f6.2) |
101 format(i2,' ',f6.2,' ',f6.2) |
| 181 |
xnn=0 |
xnn=0 |
| 182 |
do ibin=1,nangmax |
do ibin=1,nangmax |
| 184 |
$ ,IOSTAT=iostat |
$ ,IOSTAT=iostat |
| 185 |
$ )xnn,angL(ibin),angR(ibin) |
$ )xnn,angL(ibin),angR(ibin) |
| 186 |
if(iostat.ne.0)goto 1000 |
if(iostat.ne.0)goto 1000 |
| 187 |
c write(*,101)int(xnn),angL(ibin),angR(ibin) |
if(DEBUG.EQ.1)write(*,101)int(xnn),angL(ibin),angR(ibin) |
| 188 |
enddo |
enddo |
| 189 |
1000 nangbin=int(xnn) |
1000 nangbin=int(xnn) |
| 190 |
close(10) |
close(10) |
| 191 |
if(nangbin.eq.0)c2f_error = 1 |
if(nangbin.eq.0)c2f_error = 1 |
| 192 |
c print*,'-------------------------' |
if(DEBUG.EQ.1)THEN |
| 193 |
c print*,nangbin |
print*,'-------------------------' |
| 194 |
|
print*,nangbin |
| 195 |
|
endif |
| 196 |
|
|
| 197 |
|
|
| 198 |
|
|
| 201 |
* ====================================================== |
* ====================================================== |
| 202 |
do ieta=2,4 !loop on eta 2,3,4 |
do ieta=2,4 !loop on eta 2,3,4 |
| 203 |
200 format(' Opening eta',i1,' files...') |
200 format(' Opening eta',i1,' files...') |
| 204 |
c if(C2F_DEBUG.eq.1)write(*,200)ieta |
c if(C2F_DEBUG.EQ.1.eq.1)write(*,200)ieta |
| 205 |
if(VERBOSE)write(*,200)ieta |
if(VERBOSE.EQ.1)write(*,200)ieta |
| 206 |
|
|
| 207 |
201 format('eta',i1,'-bin',i1,'-l',i1,'.dat') |
201 format('eta',i1,'-bin',i1,'-l',i1,'.dat') |
| 208 |
202 format('eta',i1,'-bin',i2,'-l',i1,'.dat') |
202 format('eta',i1,'-bin',i2,'-l',i1,'.dat') |
| 209 |
do iang=1,nangbin |
do iang=1,nangbin |
| 210 |
do ilad=1,nladders_view |
do ilad=1,nladders_view |
| 211 |
|
|
| 212 |
if(iang.lt.10)write(fname_param,201)ieta,iang,ilad |
if(iang.lt.10)write(fname_param,201)ieta,iang,ilad |
| 213 |
if(iang.ge.10)write(fname_param,202)ieta,iang,ilad |
if(iang.ge.10)write(fname_param,202)ieta,iang,ilad |
| 214 |
open(10, |
open(10, |
| 219 |
$ ,IOSTAT=iostat |
$ ,IOSTAT=iostat |
| 220 |
$ ) |
$ ) |
| 221 |
if(iostat.ne.0)then |
if(iostat.ne.0)then |
| 222 |
c if(C2F_DEBUG.eq.1) |
c if(DEBUG.EQ.1) |
| 223 |
if(DEBUG) |
if(.true.) |
| 224 |
$ print*,'READETAPARAM: ** Error opening file ** ' |
$ print*,'READETAPARAM: ** Error opening file ** ' |
| 225 |
$ ,c2f_path(1:c2f_pathlen) |
$ ,c2f_path(1:c2f_pathlen) |
| 226 |
$ //fname_param(1:LNBLNK(fname_param)) |
$ //fname_param(1:LNBLNK(fname_param)) |
| 227 |
c2f_error = 1 |
c c2f_error = 1 !! COMMENTATO TEMPORANEAMENTE |
| 228 |
c return |
c return |
| 229 |
goto 2001 |
goto 2001 |
| 230 |
endif |
endif |
| 247 |
$ (feta4(ival,iv,ilad,iang),iv=1,nviews) |
$ (feta4(ival,iv,ilad,iang),iv=1,nviews) |
| 248 |
if(iostat.ne.0)then |
if(iostat.ne.0)then |
| 249 |
if(netaval.eq.0)then |
if(netaval.eq.0)then |
| 250 |
c if(C2F_DEBUG.eq.1)print*,'READETAPARAM: ' |
c if(C2F_DEBUG.EQ.1.eq.1)print*,'READETAPARAM: ' |
| 251 |
if(DEBUG)print*,'READETAPARAM: ' |
c if(DEBUG.EQ.1) |
| 252 |
|
if(.true.) |
| 253 |
|
$ print*,'READETAPARAM: ' |
| 254 |
$ //'*** Error reading file *** ' |
$ //'*** Error reading file *** ' |
| 255 |
$ ,c2f_path(1:c2f_pathlen) |
$ ,c2f_path(1:c2f_pathlen) |
| 256 |
$ //fname_param(1:LNBLNK(fname_param)) |
$ //fname_param(1:LNBLNK(fname_param)) |
| 272 |
* ====================================================== |
* ====================================================== |
| 273 |
* read landi correction |
* read landi correction |
| 274 |
* ====================================================== |
* ====================================================== |
| 275 |
if(VERBOSE)print*,' Opening landi-correction files...' |
if(VERBOSE.eq.1)print*,' Opening landi-correction files...' |
| 276 |
|
|
| 277 |
301 format('lcorr-l',i1,'.dat') |
301 format('lcorr-l',i1,'.dat') |
| 278 |
do ilad=1,nladders_view |
do ilad=1,nladders_view |
| 289 |
$ print*,'READETAPARAM: ** Error opening file ** ' |
$ print*,'READETAPARAM: ** Error opening file ** ' |
| 290 |
$ ,c2f_path(1:c2f_pathlen) |
$ ,c2f_path(1:c2f_pathlen) |
| 291 |
$ //fname_param(1:LNBLNK(fname_param)) |
$ //fname_param(1:LNBLNK(fname_param)) |
| 292 |
c2f_error = 1 |
c c2f_error = 1 !tolto solo temporaneamente |
| 293 |
c return |
c return |
| 294 |
goto 3001 |
goto 3001 |
| 295 |
endif |
endif |
| 299 |
read(10,*,IOSTAT=iostat) |
read(10,*,IOSTAT=iostat) |
| 300 |
$ ii,aal,aar,(fcorr(iv,ilad,iang),iv=1,nviews) |
$ ii,aal,aar,(fcorr(iv,ilad,iang),iv=1,nviews) |
| 301 |
|
|
| 302 |
write(*,*) |
c write(*,*) |
| 303 |
$ ii,aal,aar,(fcorr(iv,ilad,iang),iv=1,nviews) |
c $ ii,aal,aar,(fcorr(iv,ilad,iang),iv=1,nviews) |
| 304 |
|
|
| 305 |
if(ii.ne.iang)print*,'parametri eta incasinati' |
if(ii.ne.iang)print*,'parametri eta incasinati' |
| 306 |
if(aal.ne.angl(iang))print*,'parametri eta incasinati' |
if(aal.ne.angl(iang))print*,'parametri eta incasinati' |
| 312 |
$ //'*** Error reading file *** ' |
$ //'*** Error reading file *** ' |
| 313 |
$ ,c2f_path(1:c2f_pathlen) |
$ ,c2f_path(1:c2f_pathlen) |
| 314 |
$ //fname_param(1:LNBLNK(fname_param)) |
$ //fname_param(1:LNBLNK(fname_param)) |
| 315 |
c c2f_error = 1 !lo commento solo per il momento |
c2f_error = 1 |
| 316 |
goto 3000 |
goto 3000 |
| 317 |
endif |
endif |
| 318 |
|
|
| 321 |
3001 continue |
3001 continue |
| 322 |
|
|
| 323 |
enddo ! end loop on ladders |
enddo ! end loop on ladders |
| 324 |
|
|
| 325 |
return |
return |
| 326 |
end |
end |
| 327 |
|
|
| 338 |
c character*120 cmd1 |
c character*120 cmd1 |
| 339 |
c character*120 cmd2 |
c character*120 cmd2 |
| 340 |
|
|
| 341 |
c2f_error = 0 |
c2f_error = 0 |
| 342 |
call mech_sensor |
call mech_sensor |
| 343 |
do ip=1,nplanes |
do ip=1,nplanes |
| 344 |
fitz(ip)=z_mech_sensor(ip,1,1)*0.1 !cm |
fitz(ip)=z_mech_sensor(ip,1,1)*0.1 !cm |
| 353 |
do is=1,2 |
do is=1,2 |
| 354 |
|
|
| 355 |
write(fname_param,100)ilad,is |
write(fname_param,100)ilad,is |
| 356 |
c if(C2F_DEBUG.eq.1)print * |
c if(C2F_DEBUG.EQ.1.eq.1)print * |
| 357 |
if(VERBOSE)print * |
if(VERBOSE.EQ.1)print * |
| 358 |
$ ,c2f_path(1:c2f_pathlen) |
$ ,c2f_path(1:c2f_pathlen) |
| 359 |
$ //fname_param |
$ //fname_param |
| 360 |
|
|
| 365 |
$ ,STATUS='OLD',IOSTAT=iostat |
$ ,STATUS='OLD',IOSTAT=iostat |
| 366 |
$ ) |
$ ) |
| 367 |
if(iostat.ne.0)then |
if(iostat.ne.0)then |
| 368 |
c2f_error = 1 |
c2f_error = 1 |
| 369 |
return |
return |
| 370 |
endif |
endif |
| 371 |
|
|
| 428 |
|
|
| 429 |
real xvec(nladders_view),yvec(2),zvec(nplanes) |
real xvec(nladders_view),yvec(2),zvec(nplanes) |
| 430 |
|
|
| 431 |
c2f_error = 0 |
c2f_error = 0 |
| 432 |
|
|
| 433 |
c if(C2F_DEBUG.eq.1)print * |
c if(C2F_DEBUG.EQ.1.eq.1)print * |
| 434 |
if(VERBOSE)print * |
if(VERBOSE.EQ.1)print * |
| 435 |
$ ,c2f_path(1:c2f_pathlen)//'mech_pos.dat' |
$ ,c2f_path(1:c2f_pathlen)//'mech_pos.dat' |
| 436 |
open(10 |
open(10 |
| 437 |
$ ,FILE= |
$ ,FILE= |