subroutine buncher(phase,iend,ibeg) c---transformation for zero-length buncher save c include 'param_sz.h' include 'constcom.h' include 'pcordcom.h' include 'syscom.h' include 'ucom.h' c-------------------------------------------------------------------------- c* ne=rne cay=el(8,ne) rsq=x*x+y*y dwm=el(4,ne) csrs=cay*cay*rsq bgzin=bgz dg=dwm*xi0(csrs)*sin(phase)/erest*sign(1.,bgzin) g=sqrt(1.+bgz**2)+dg c-----allow particle to go backward if (g.lt.1.) then g=1+(1-g) bgz=-sign(sqrt(g**2-1.),bgzin) else bgz=sign(sqrt(g**2-1.),bgzin) endif bgzb=.5*(bgzin+bgz) dbgr=dwm*cos(phase)*cay*xi1ox(csrs)/(bgzb*erest) bgx=bgx+dbgr*x bgy=bgy+dbgr*y gamma=sqrt(1.+bgx**2+bgy**2+bgz**2) if(bgz.lt.0.)then ibeg=1 else iend=1 endif return c 10 bgz=0 c return end c++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*