title_gl 'bpm tg.kumac' set stat 101 set htyp 344 hi/del 0 * calculate target position using BPM in the sos ntuple cd //lun43 |sos ntuple hi/cr/1d 7011 'x' 100 -0.3 0.3 hi/cr/1d 7012 'y' 100 -0.3 0.3 ntuple/pro 7011 9020.(bpma_x+327.15*(bpmb_x-bpma_x)/(327.15-231.46)) ntuple/pro 7012 9020.(bpma_y+327.15*(bpmb_y-bpma_y)/(327.15-231.46)) tgx = $HINFO(7011,'MEAN') |raw bpm projected to tg tgy = $HINFO(7012,'MEAN') * add offsets * beamx = [tgx]-0.120 | offset using Dave's method run 51388 beamx = [tgx]-0.130 | offset using Dave's method * beamy = -[tgy]+0.0445 | offset using Dave's method run 50130 beamy = -[tgy]+0.158 | offset using Dave's method run 50124 mess BPM [beamx] [beamy] * calculate target position using BPM in the sos ntuple cd //lun42 |hms ntuple ntuple/plot 9010.(bpma_x+327.15*(bpmb_x-bpma_x)/(327.15-231.46))%(bpma_y+327.15*(bpmb_y-bpma_y)/(327.15-231.46)) charge<6470 hi/cr/1d 7001 'x' 100 -0.3 0.3 hi/cr/1d 7002 'y' 100 -0.3 0.3 ntuple/pro 7001 9010.(bpma_x+327.15*(bpmb_x-bpma_x)/(327.15-231.46)) ntuple/pro 7002 9010.(bpma_y+327.15*(bpmb_y-bpma_y)/(327.15-231.46)) tgx = $HINFO(7001,'MEAN') |raw bpm projected to tg tgy = $HINFO(7002,'MEAN') * add offsets * beamx = [tgx]-0.120 | offset using Dave's method run 51388 beamx = [tgx]-0.130 | offset using Dave's method * beamy = -[tgy]+0.0445 | offset using Dave's method run 50130 beamy = -[tgy]+0.158 | offset using Dave's method run 50124 mess BPM [beamx] [beamy] 1dhist 7005 'hsxptar' 300 -0.01 0.01 ntu/pro 7005 9010.hsxptar hcer_npe>2..and.abs(hsyptar)<0.04.and.abs(hsxptar)<0.07.and.abs(hsdelta)<8.0 vec/cr par(6) r set plci 2 hi/fit 7005(-0.008:0.008) G QS0 0 par(1:3) |fit the peak and find the mean hi/fit 7005(-0.008:0.008) G+P1 QS 5 par(1:5) |fit the peak and find the mean meanxptar = par(2) meanxptar=[meanxptar]*1000. xtar = [meanxptar]/(-1.73) |mm laby= -[xtar]/10. |cm, true beam vertical position htheta_lab=18.0 survey=0.01 |survey offset at 18.0 deg htheta_lab=[htheta_lab]*3.14159265358/180. stheta=$RSIGMA(sin([htheta_lab])) ctheta=$RSIGMA(cos([htheta_lab])) ttheta=[stheta]/[ctheta] 1dhist 7006 'hsytar' 300 -3. 3. ntu/pro 7006 9010.hsytar hcer_npe>2. meanytar=$HINFO(7006,'MEAN') corr_ytar = [meanytar]+[survey] ztarg=0.23 |z=0 target offset in the lab (cm) labx=[ztarg]*[ttheta]-[corr_ytar]*[stheta]*[ttheta]-[corr_ytar]*[ctheta] mess HMS [labx] [laby]