0001
0002
0003 close all
0004 clear all
0005
0006 addpath(genpath('/mntdirect/_machfs/liuzzo/CODE/LatticeTuningFunctions/correction/'));
0007 addpath(genpath('/mntdirect/_machfs/liuzzo/CODE/LatticeTuningFunctions/errors/'));
0008
0009
0010 s28d=load('/machfs/liuzzo/EBS/S28D/LATTICE/AT/S28Dmerged_PA.mat');
0011
0012 ring=s28d.LOW_EMIT_RING_INJ;
0013 [l,t,c]=atlinopt(ring,0,1);
0014 r0=ring;
0015
0016
0017
0018 indBPM=find(atgetcells(ring,'Class','Monitor'))';
0019 indHCor=find(atgetcells(ring,'iscorH','H'))';
0020 indVCor=find(atgetcells(ring,'iscorV','V'))';
0021 indSCor=find(atgetcells(ring,'iscorS','S'))';
0022 indQCor=find(atgetcells(ring,'Class','Quadrupole'))';
0023
0024 inCOD=zeros(6,1);
0025
0026
0027 bumph=1e-4;
0028 bumpv=1e-4;
0029 indBPMbump =indBPM([10]);
0030 indHCorbump=indHCor([8 9 10]);
0031 indVCorbump=indVCor([8 9 10]);
0032 doplot=1;
0033
0034 [rbump,hs,vs]=BumpAtBPM(...
0035 ring,...
0036 inCOD,...
0037 bumph,...
0038 bumpv,...
0039 indBPMbump,...
0040 indHCorbump,...
0041 indVCorbump);
0042
0043 s=findspos(rbump,[indBPMbump,indHCorbump]);
0044 figure;
0045 atplot(rbump,[min(s)-2 max(s)+2],'comment',[],@plClosedOrbitOnly);
0046 text(s(1)+0.1,bumph*1.01,{['hs:' num2str(hs')] ['vs:' num2str(vs') ]})
0047 hold on; plot([s(1) s(1)],[0 bumph],'k:');
0048 hold on; plot([s(1) s(1)],[0 bumpv],'r:');
0049
0050
0051 [rbump,hs,vs]=BumpAtBPM4D(...
0052 ring,...
0053 inCOD,...
0054 bumph,...
0055 bumpv,...
0056 indBPMbump,...
0057 indHCorbump,...
0058 indVCorbump);
0059
0060 s=findspos(rbump,[indBPMbump,indHCorbump]);
0061 figure;
0062 atplot(rbump,[min(s)-2 max(s)+2],'comment',[],@plClosedOrbitOnly);
0063 text(s(1)+0.1,bumph*1.01,{['hs:' num2str(hs')] ['vs:' num2str(vs') ]})
0064 hold on; plot([s(1) s(1)],[0 bumph],'k:');
0065 hold on; plot([s(1) s(1)],[0 bumpv],'r:');