* phi_scan.kumac - scan the beam centroid offset across the face * of the collimator and map out how a beam property * like net intensity or average polarization depends * on beam position. macro make id=10 idin=100 idcrop=990 thetamax=0.5 Emax=12 dist=75 v/del vfr* v/cre vfr(10,10) do i=1,10 t=$sigma([thetamax]*([i]-5.5)/10) do j=1,10 p=$sigma(3.1416*([j]-0.5)/10) x0=$sigma(([t])*0.511e-3/[Emax]*[dist]*cos([p])) y0=$sigma(([t])*0.511e-3/[Emax]*[dist]*sin([p])) h/del [idcrop] exec phi_crop#make id=[idcrop] x0=[x0] y0=[y0] opt=' ' exec phi_crop#sum id=[idin] idcrop=[idcrop] verbose=0 sigma hintpl=hinteg h/del [idcrop] exec phi_crop#make id=[idcrop] x0=[x0] y0=$sigma(-([y0])) opt=' ' exec phi_crop#sum id=[idin] idcrop=[idcrop] verbose=0 v/inp vfr([i],[j]) $sigma((hinteg+hintpl)/2) message vfr([i],[j]) is $sigma((hinteg+hintpl)/2) enddo enddo 2dhist [id] '' 10 0 [thetamax] 10 0 3.1416 put/con [id] vfr return