subroutine hec_beam_getclust(mode) ************************************************************************* *** *** get mwpc clusters and fill the common clusters *** mode=0 takes all clusters *** mode=1 takes only the clusters from the beam region; takes into *** account the cryostat and movable table positions *** *** created 21-feb-1995 by a.minaenko *** modified 02-mar-1995 a.kiryunin *** modified 23-jun-1997 by a.minaenko *** ************************************************************************* implicit none c include 'hec_beam_sys_clusters.inc' include 'hec_beam_sys_shifts.inc' include 'hec_dwpc.inc' include 'hec_runh.inc' c integer mode c=== local variables logical first save first c integer i, icha, ixy c half sizes (cm) of the beam region real xrbeam, yrbeam save xrbeam,yrbeam real xbnd1,xbnd2,ybnd1,ybnd2 save xbnd1,xbnd2,ybnd1,ybnd2 real coor,ch_width c data first/.true./ data xrbeam/2./ data yrbeam/3./ c c=== calculate the bounderies of a beam region if (mode.ne.0.and.mode.ne.1) return if (first) then first=.false. xbnd1=xrbeam+beamx xbnd2=-xrbeam+beamx ybnd1=yrbeam+beamy ybnd2=-yrbeam+beamy endif c do i=1,5 nclux(i)=0 ncluy(i)=0 enddo call vzero(clux(1,1,1),100) call vzero(cluy(1,1,1),100) if (n_dwpc.le.0) return c=== fill output arrays do i=1,n_dwpc if (dwpc_words(i).ne.0) then call hec_beam_xymwpc(dwpc_words(i),icha,ixy,coor,ch_width) ccc ccc if (icha .eq. 5)then ccc print*,'*****icha,ixy ',icha,ixy ccc endif ccc if (icha.ge.1.and.icha.le.5) then if (ixy.eq.1.and.shiftx(icha).lt.1000.) then ! x-planes if (nclux(icha).lt.100) then coor=coor-shiftx(icha) ccc if (mode.eq.1.and.coor.lt.xbnd1.and.coor.gt.xbnd2 ! beam region ccc & .or.mode.eq.0) then nclux(icha)=nclux(icha)+1 clux(1,nclux(icha),icha)=coor if (mode.eq.1) clux(1,nclux(icha),icha)= = clux(1,nclux(icha),icha)+x_cryo clux(2,nclux(icha),icha)=ch_width ccc endif endif elseif (ixy.eq.-1.and.shifty(icha).lt.1000.) then ! y-planes if (ncluy(icha).lt.100) then coor=coor-shifty(icha) ccc if (mode.eq.1.and.coor.lt.ybnd1.and.coor.gt.ybnd2 ! beam region ccc & .or.mode.eq.0) then ncluy(icha)=ncluy(icha)+1 cluy(1,ncluy(icha),icha)=coor if (mode.eq.1.and.icha.lt.5) cluy(1,ncluy(icha),icha)= = cluy(1,ncluy(icha),icha)+y_tabl cluy(2,ncluy(icha),icha)=ch_width ccc endif endif endif ! ixy.eq.+-1... endif ! icha.ge.1.and.icha.le.5 endif ! dwpc_words(i).ne.0 enddo c return end