*********************************************************************** * -------------- subroutine filldstvars * -------------- ************************************************************************ implicit none #include "skparm.h" #include "skhead.h" #include "skbadc.h" #include "sktq.h" #include "geopmt.h" #include "appatsp.h" #include "apmring.h" #include "apbnkcntl.h" #include "apmue.h" #include "apbrow.h" #include "apversion.h" #include "skwaterlen.h" #include "ringcom.h" #include "skveto.h" #include "skprint.h" #include "vcwork.h" #include "nework.h" #include "fsihist.h" #include "pcstopthru.h" #include "spliTChanOut.h" #include "fitqunout.h" integer itmp(100) real rtmp(100) #ifdef IEEE_HANDLER #include #endif * auto fit result: bank 3 integer autobnk,icand,nrtest,compbnk2,compbnk3 real fdir(3),cdir(3),angfc INTEGER NH,LUN,IERR1,i,k,nfill,nread,ncur,apip2ip,lunver,n REAL wallsk integer idim parameter (idim=4000000) real zbs(idim) common/kzbs/zbs integer lunhbk,lrecl,icycle,ipx,sppatnum,ir,ir_isnan,ipmt,npt integer inputbnk,ibnknow,ninpmt,pcusedrun,ibadrun,ierr real eviserr,posnu(3),elapseday,real_max,r_max_normal,fact real ptmp,ptmporg,signmcdir(3),dirtmp(3) logical pcflag #include "fillnt.h" pcflag = .false. * clear commons and read AP bank apnring=0 call apclrall call aprstbnk(0) signmcdir(1) = 1. signmcdir(2) = 1. signmcdir(3) = 1. * set apip and apdir call set_apip() call set_apdir(PCFLAG) *------------------------------------------------------- fill dst * fill common for dst nrun = nrunsk nev = nevsk nsub = nsubsk nring = apnring cate = apidcate if ( apprmslg(6,1).eq.99. ) cate=20 potot = qismsk nhit = nqisk pomax = qimxsk potota = qasmsk nhita = nqask call odpc_2nd_s(nhitac) pomaxa = qamxsk wall = wallsk(appos) wlen = skwaterlen wgain = skwatergain nbadx = nbad nbadax = nbada do k=1,3 pos(k) = signmcdir(k)*appos(k) enddo rtmax = 0. rtsum = 0. evis = 0. call spdirtot(dirtot) dirtot(1)=signmcdir(1)*dirtot(1) dirtot(2)=signmcdir(2)*dirtot(2) dirtot(3)=signmcdir(3)*dirtot(3) do i=1,apnring do k=1,3 dir(k,i) = signmcdir(k)*apdir(k,i) enddo ip(i) = apip2ip(apip(i)) ang(i) = apangcer(i) rtot(i) = aprtot(i) amom(i) = apamom(i) ipx = sppatnum(apip(i)) rtote(i) = apmsrtot(2,i) amome(i) = apmsamom(2,i) rtotm(i) = apmsrtot(3,i) amomm(i) = apmsamom(3,i) rtsum = rtsum + rtot(i) if ( rtot(i).gt.rtmax ) rtmax = rtot(i) numpo(i) = apipnum(i) C add by K.I amomp(i)=apmsamom(4,i) ange(i)=apmsang(2,i) angm(i)=apmsang(3,i) angp(i)=apmsang(4,i) ntot(i)=apntot(i) do k=1,6 probth(k,i)=approbth(k,i) probpt(k,i)=approbpt(k,i) enddo C evis = evis + apmsamom(2,i) enddo C apevis is the same as apmsrtot(5,1) and not the same as apmsamom(5,1) C evis = apmsrtot(5,1) ! old defined Evis evis = apevis ! new defined Evis CKO call ptasmo70(11,rtsum,evis,eviserr) call ucopy(approb,probms,6*apnring) do i=1,apnring do k=1,6 msdir(k,1,i) = signmcdir(1)*apmsdir(k,1,i) msdir(k,2,i) = signmcdir(2)*apmsdir(k,2,i) msdir(k,3,i) = signmcdir(3)*apmsdir(k,3,i) prmslg(k,i) = apprmslg(k,i) enddo enddo call KZMNUM(nsube,ncur) nsube = nsube - 1 ndcy = 0 ngate = 0 nbye = 0 do i=1,min(apnmue,10) if (apmuetype(i).eq.1 .or. apmuetype(i).eq.4) ndcy = ndcy + 1 if (apmuetype(i).eq.2) ngate = ngate + 1 if (apmuetype(i).eq.3) nbye = nbye + 1 enddo date(1) = ndaysk(1) date(2) = ndaysk(2) date(3) = ndaysk(3) time(1) = ntimsk(1) time(2) = ntimsk(2) time(3) = ntimsk(3) time(4) = ntimsk(4) elpsday = elapseday(ndaysk,ntimsk) * fill common for mue decay nmue = min(apnmue,10) do i=1,nmue etype(i) = apmuetype(i) etime(i) = apmuetime(i) do k=1,3 epos(k,i) = signmcdir(k)*apmuepos(k,i) edir(k,i) = signmcdir(k)*apmuedir(k,i) enddo egood(i) = apmuegood(i) ehit(i) = apmuenhit(i) enddo return END