subroutine fpp_init_param c implicit none c include 'fpp_local.h' c include 'parameter.h' include 'espace_type.h' include 'detector.h' include 'option.h' c integer*4 ii,jj,kk,ipl,iw,icut logical get_calib,get_front_align,get_rear_align real*4 tadd if(debug_fpp)write(25,*)'In fpp init param' c c T0 Calibration Setup c do ii=1,24 do jj=1,40 thits(ii,jj)=0.0 tsum(ii,jj)=0.0 t0(ii,jj)=0.0 enddo enddo c get_calib=.false. c if(calibration) then if(icalib.eq.1.or.icalib.eq.2) get_calib=.true. else get_calib=.true. endif c if(calibration) goto 1454 c if(alignment) then get_front_align=.false. get_rear_align=.false. else get_front_align=.true. get_rear_align=.true. endif c 1454 if(debug_fpp) write(25,*)calibration,alignment do ii=1,24 do kk=1,40 toff(ii,kk)=0.0 do jj=1,80 thist(ii,kk,jj)=0 enddo enddo enddo c if(get_calib) then if(debug_fpp)write(25,*)'Opening fpp_toffset_crude.calib' open(unit=1,file='fpp_toffset_crude.calib',type='old') do ii=1,24 do jj=1,40 read(1,*)toff(ii,jj) enddo enddo close(unit=1) if(calibration) then continue else if(debug_fpp)write(25,*)'Opening fpp_toffset_ref.calib' open(unit=1,file='fpp_toffset_ref.calib',type='old') do ii=1,24 do jj=1,40 read(1,*)tadd toff(ii,jj)=toff(ii,jj)-tadd if(toff(ii,jj).eq.0)toff(ii,jj)=775.0 if(debug_fpp)write(25,*)toff(ii,jj) enddo enddo close(unit=1) endif endif c c Alignment Calibration Setup - just for front chambers for now. c nc=2 nmax=2*nc-1 do ii=1,nc xsumy(ii)=0. ysumy(ii)=0. tsumy(ii)=0. psumy(ii)=0. xsumyr(ii)=0. ysumyr(ii)=0. tsumyr(ii)=0. psumyr(ii)=0. enddo do ii=1,4 do jj=1,nalipar m1front(ii,jj)=0.0d0 m1rear(ii,jj)=0.0d0 enddo enddo if(get_front_align) then write(*,*)'Opening fpp_alignment_matrix_front.dat' open(unit=1,file='fpp_alignment_matrix_front.dat',type='old') C SD do jj=1,4 read(1,*)(m1front(jj,ii),ii=1,6) enddo read(1,*) zfront write (*, 200) ((m1front(ii,jj),jj=1,6), ii=1,4) write (*,*) ' zfront =',zfront 200 format (4(6f13.6,/)) close(unit=1) endif if(get_rear_align) then write(*,*)'Opening fpp_alignment_matrix_rear.dat' open(unit=1,file='fpp_alignment_matrix_rear.dat',type='old') C SD do jj=1,4 read(1,*)(m1rear(jj,ii),ii=1,nalipar) enddo read(1,*) zrear write (*, 200) ((m1rear(ii,jj),jj=1,nalipar), ii=1,4) write (*,*) ' zrear = ',zrear close(unit=1) endif do ii=1,nmax xsumx(ii)=0. ysumx(ii)=0. tsumx(ii)=0. psumx(ii)=0. xsumxr(ii)=0. ysumxr(ii)=0. tsumxr(ii)=0. psumxr(ii)=0. enddo c c Read in per wiregroup demultiplexing cuts. c open(unit=1,file='fpp_demux_cuts.dat',type='old') do ipl=1,NFPP_PLANES do iw=1,NFPPWIRES read(1,*)(spdetector.l.fpp.plane(ipl). > wiregroup(iw).cut(icut),icut=1,9) do icut=1,8 phits(ipl,iw,icut)=0.0 psum(ipl,iw,icut)=0.0 pcentr(ipl,iw,icut)=(spdetector.l.fpp.plane(ipl). > wiregroup(iw).cut(icut)+spdetector.l.fpp. > plane(ipl).wiregroup(iw).cut(icut+1))/2.0 pwidth(ipl,iw,icut)=5.0 enddo enddo enddo close(unit=1) open(unit=1,file='fpp_drift_dist_fits.dat',type='old') do ipl=1,NFPP_PLANES do iw=1,6 spdetector.l.fpp.plane(ipl). > drift_dist_param(iw)=0.0 enddo enddo do ipl=1,NFPP_PLANES read(1,*)(spdetector.l.fpp.plane(ipl). > drift_dist_param(iw),iw=1,5) enddo close(unit=1) 1352 format(5(g12.5)) c return end