--- DarthVader/TrackerLevel2/src/F77/readallparam.f 2006/05/30 16:30:37 1.2 +++ DarthVader/TrackerLevel2/src/F77/readallparam.f 2007/08/20 15:58:24 1.6 @@ -9,8 +9,8 @@ c2f_error = 0 -c if(C2F_DEBUG.eq.1)print * - if(verbose)print * +c if(C2F_DEBUG.EQ.1.eq.1)print * + if(verbose.eq.1)print * $ ,c2f_path(1:c2f_pathlen)//'trk-maskvk.dat' open(10, $ FILE=c2f_path(1:c2f_pathlen)//'trk-maskvk.dat' !<<<< C2F @@ -18,8 +18,8 @@ $ ,IOSTAT=iostat $ ) if(iostat.ne.0)then -c if(C2F_DEBUG.eq.1) - if(debug) +c if(C2F_DEBUG.EQ.1.eq.1) + if(debug.eq.1) $ print*,'READVKMASK: *** Error opening file ***' c2f_error = 1 return @@ -30,8 +30,8 @@ $ ) $ (mask_vk(iv,i),i=1,24) if(iostat.ne.0)then -c if(C2F_DEBUG.eq.1) - if(debug) +c if(C2F_DEBUG.EQ.1.eq.1) + if(debug.eq.1) $ print*,'READVKMASK: *** Error reading file ***' c2f_error = 1 goto 1000 @@ -56,8 +56,8 @@ 201 format('trk-LADDER',i1,'-mip.dat') do ilad=1,nladders_view write(fname_param,201)ilad -c if(C2F_DEBUG.eq.1)print * - if(VERBOSE)print * +c if(C2F_DEBUG.EQ.1.eq.1)print * + if(VERBOSE.EQ.1)print * $ ,c2f_path(1:c2f_pathlen)!<<<< C2F $ //fname_param(1:LNBLNK(fname_param)) open(10, @@ -67,8 +67,8 @@ $ ,IOSTAT=iostat $ ) if(iostat.ne.0)then -c if(C2F_DEBUG.eq.1)print* - if(DEBUG)print* +c if(C2F_DEBUG.EQ.1.eq.1)print* + if(DEBUG.EQ.1)print* $ ,'READMIPPARAM: *** Error opening file *** ' c2f_error = 1 return @@ -100,8 +100,8 @@ 201 format('charge-l',i1,'.dat') do ilad=1,nladders_view write(fname_param,201)ilad -c if(C2F_DEBUG.eq.1)print * - if(VERBOSE)print * +c if(C2F_DEBUG.EQ.1.eq.1)print * + if(VERBOSE.EQ.1)print * $ ,c2f_path(1:c2f_pathlen)!<<<< C2F $ //fname_param(1:LNBLNK(fname_param)) open(10, @@ -149,10 +149,12 @@ c2f_error = 0 -******retrieve ANGULAR BINNING info +* ====================================================== +* read ANGULAR BINNING info +* ====================================================== fname_binning='binning.dat' -c if(C2F_DEBUG.eq.1) - if(VERBOSE) +c if(C2F_DEBUG.EQ.1.eq.1) + if(VERBOSE.EQ.1) $ print * $ ,c2f_path(1:c2f_pathlen) !<<<< C2F $ //fname_binning(1:LNBLNK(fname_binning)) @@ -163,8 +165,8 @@ $ ,IOSTAT=iostat $ ) if(iostat.ne.0)then -c if(C2F_DEBUG.eq.1) - if(DEBUG) +c if(C2F_DEBUG.EQ.1.eq.1) + if(DEBUG.EQ.1) $ print*,'READETAPARAM: *** Error in opening file *** ' c2f_error = 1 return @@ -188,16 +190,19 @@ +* ====================================================== +* read eta2-eta3-eta4 parameters +* ====================================================== do ieta=2,4 !loop on eta 2,3,4 -******retrieve correction parameters 200 format(' Opening eta',i1,' files...') -c if(C2F_DEBUG.eq.1)write(*,200)ieta - if(VERBOSE)write(*,200)ieta +c if(C2F_DEBUG.EQ.1.eq.1)write(*,200)ieta + if(VERBOSE.EQ.1)write(*,200)ieta 201 format('eta',i1,'-bin',i1,'-l',i1,'.dat') 202 format('eta',i1,'-bin',i2,'-l',i1,'.dat') do iang=1,nangbin do ilad=1,nladders_view + if(iang.lt.10)write(fname_param,201)ieta,iang,ilad if(iang.ge.10)write(fname_param,202)ieta,iang,ilad open(10, @@ -208,13 +213,14 @@ $ ,IOSTAT=iostat $ ) if(iostat.ne.0)then -c if(C2F_DEBUG.eq.1) - if(DEBUG) +c if(DEBUG.EQ.1) + if(.true.) $ print*,'READETAPARAM: ** Error opening file ** ' $ ,c2f_path(1:c2f_pathlen) $ //fname_param(1:LNBLNK(fname_param)) c2f_error = 1 - return +c return + goto 2001 endif netaval=0 do ival=1,netavalmax @@ -235,8 +241,10 @@ $ (feta4(ival,iv,ilad,iang),iv=1,nviews) if(iostat.ne.0)then if(netaval.eq.0)then -c if(C2F_DEBUG.eq.1)print*,'READETAPARAM: ' - if(DEBUG)print*,'READETAPARAM: ' +c if(C2F_DEBUG.EQ.1.eq.1)print*,'READETAPARAM: ' +c if(DEBUG.EQ.1) + if(.true.) + $ print*,'READETAPARAM: ' $ //'*** Error reading file *** ' $ ,c2f_path(1:c2f_pathlen) $ //fname_param(1:LNBLNK(fname_param)) @@ -248,13 +256,66 @@ netaval=netaval+1 enddo 2000 close(10) + 2001 continue * print*,'... done' enddo enddo enddo !end loop on eta 2,3,4 +* ====================================================== +* read landi correction +* ====================================================== + if(VERBOSE.eq.1)print*,' Opening landi-correction files...' + + 301 format('lcorr-l',i1,'.dat') + do ilad=1,nladders_view + + write(fname_param,301)ilad + open(10, + $ FILE=c2f_path(1:c2f_pathlen) + $ //fname_param(1:LNBLNK(fname_param)) + $ ,STATUS='OLD' + $ ,IOSTAT=iostat + $ ) + if(iostat.ne.0)then + if(.true.) + $ print*,'READETAPARAM: ** Error opening file ** ' + $ ,c2f_path(1:c2f_pathlen) + $ //fname_param(1:LNBLNK(fname_param)) +c c2f_error = 1 !tolto solo temporaneamente +c return + goto 3001 + endif + + do iang=1,nangbin + + read(10,*,IOSTAT=iostat) + $ ii,aal,aar,(fcorr(iv,ilad,iang),iv=1,nviews) + +c write(*,*) +c $ ii,aal,aar,(fcorr(iv,ilad,iang),iv=1,nviews) + if(ii.ne.iang)print*,'parametri eta incasinati' + if(aal.ne.angl(iang))print*,'parametri eta incasinati' + if(aar.ne.angr(iang))print*,'parametri eta incasinati' + + if(iostat.ne.0)then + if(.true.) + $ print*,'READETAPARAM: ' + $ //'*** Error reading file *** ' + $ ,c2f_path(1:c2f_pathlen) + $ //fname_param(1:LNBLNK(fname_param)) + c2f_error = 1 + goto 3000 + endif + + enddo !end loop on angular bins + 3000 close(10) + 3001 continue + + enddo ! end loop on ladders + return end @@ -286,8 +347,8 @@ do is=1,2 write(fname_param,100)ilad,is -c if(C2F_DEBUG.eq.1)print * - if(VERBOSE)print * +c if(C2F_DEBUG.EQ.1.eq.1)print * + if(VERBOSE.EQ.1)print * $ ,c2f_path(1:c2f_pathlen) $ //fname_param @@ -363,8 +424,8 @@ c2f_error = 0 -c if(C2F_DEBUG.eq.1)print * - if(VERBOSE)print * +c if(C2F_DEBUG.EQ.1.eq.1)print * + if(VERBOSE.EQ.1)print * $ ,c2f_path(1:c2f_pathlen)//'mech_pos.dat' open(10 $ ,FILE=