--- DarthVader/TrackerLevel2/src/F77/fillpedsig.f 2006/05/19 13:15:55 1.1 +++ DarthVader/TrackerLevel2/src/F77/fillpedsig.f 2006/05/30 16:30:37 1.2 @@ -1,3 +1,107 @@ + subroutine fillpedsigfromdefault() + + include 'commontracker.f' + include 'calib.f' + include 'common_c2f.f' !<<<< C2F + + integer dsp(2,6) + character*60 fname_param + + c2f_error = 0 + + fname_param='cabling.dat' +c if(DEBUG)print * +c $ ,c2f_path(1:c2f_pathlen) !<<<< C2F +c $ //fname_param(1:LNBLNK(fname_param)) + open(10, + $ FILE=c2f_path(1:c2f_pathlen) !<<<< C2F + $ //fname_param(1:LNBLNK(fname_param)) + $ ,STATUS='OLD' + $ ,IOSTAT=iostat + $ ) + if(iostat.ne.0)then +c if(C2F_DEBUG.eq.1)print* + if(DEBUG)print* + $ ,'READPEDSIGFROMDEFAULT: *** Error opening file *** ' + c2f_error = 1 + return + endif + do iv=1,nviews + read(10,* + $ ,IOSTAT=iostat + $ )ilink,ipn,dsp(ilink,ipn+1) + if(iostat.ne.0)then + c2f_error = 1 + goto 100 + endif + enddo + 100 close(10) + + 300 format('link',i1,'/param2_',i1,'_',i1,'.dat') + do ilink=1,2 !loop over links + if(VERBOSE)print *,'Opening default calibration - link' + $ ,ilink + do ipn=0,5 !loop over peripheral numbers + do iladder=1,3 !loop over DSP + write(fname_param,300)ilink,ipn,iladder +c if(DEBUG)print*, +c $ ,c2f_path(1:c2f_pathlen) !<<<< C2F +c $ //fname_param(1:LNBLNK(fname_param)) + open(10, + $ FILE=c2f_path(1:c2f_pathlen) !<<<< C2F + $ //fname_param(1:LNBLNK(fname_param)) + $ ,STATUS='OLD' + $ ,IOSTAT=iostat + $ ) + if(iostat.ne.0)then +c if(C2F_DEBUG.eq.1)print* + if(DEBUG)print* + $ ,'READPEDSIGFROMDEFAULT:' + $ ,' *** Error opening file *** ' + c2f_error = 1 + return + endif +* PEDESTAL ---------------------- + do is=1,nstrips_ladder + read(10,* + $ ,IOSTAT=iostat) + $ pedestal_t( dsp(ilink,ipn+1) + $ ,(nvk(is)+(iladder-1)*nva1_ladder) + $ ,nst(is)) +c print*,ilink,ipn,is,' --- ',dsp(ilink,ipn+1) +c $ ,(nvk(is)+(iladder-1)*nva1_ladder) +c $ ,nst(is) + if(iostat.ne.0)then + c2f_error = 1 + print*,'ped ',is + goto 1000 + endif + enddo +* SIGMA ------------------------- + do is=1,nstrips_ladder + read(10,* + $ ,IOSTAT=iostat) + $ sigma_t( + $ dsp(ilink,ipn+1) + $ ,(nvk(is)+(iladder-1)*nva1_ladder) + $ ,nst(is)) + if(iostat.ne.0)then + c2f_error = 1 + print*,'sig ',is + goto 1000 + endif + enddo +* ------------------------------- + + 1000 close(10) + + enddo !end loop over DSP + enddo !end loop over peripheral numbers + enddo !end loop over links + return + end + + ************************************************************************* * * Subroutine fillpedsig.f @@ -22,7 +126,7 @@ ************************************************************************* - subroutine fillpedsigfromdefault() + subroutine fillpedsigfromdefaultrz() include 'commontracker.f' include 'common_reduction.f'