diff --git a/10.zip b/10.zip new file mode 100644 index 0000000..1c1aba1 Binary files /dev/null and b/10.zip differ diff --git a/15.zip b/15.zip new file mode 100644 index 0000000..be1ab5c Binary files /dev/null and b/15.zip differ diff --git a/20.zip b/20.zip new file mode 100644 index 0000000..85f2d5e Binary files /dev/null and b/20.zip differ diff --git a/FCCee_1_54GeV-6GeV.sad b/FCCee_1_54GeV-6GeV.sad deleted file mode 100644 index cf1eb41..0000000 --- a/FCCee_1_54GeV-6GeV.sad +++ /dev/null @@ -1,489 +0,0 @@ -! 12/01/93 303151459 MEMBER NAME *ILS11 *.FORT M SAD -! ATF LINAC WITH SINGLET LATTICE K. Oide 15-Mar-1993 -! Acceptance = 7 10^-3 m - -! Aperture = 14.2 mm at Q -! 10 mm at CA1 entrance -! 9.3 mm at CA1 exit -! However, cavity aperture is not tapered in the optics simulation -! lambda= 0.104970 m -! rf frequency = 2855.9822616 MHz -! Length of Cavity = 28 1/3 lambda = 2.97415 m - - - - -!!!!!! S. Ogur, K. Oide, F. Zimmermann FCC-ee Linac 2018, see https://cds.cern.ch/record/268525 - - -NPARA=8; -MOMENTUM= 1.54 GEV; -ON ECHO;OFF EMIT COD CTIME RAD RFSW; - LINE ATFLIN=(IP3 CX LCC CXX LCC QRTL1 LA3 - - CX LCC CXX LCC A1 CA1 A1 LA2 CX LCC CXX LCC A1 CA1 A1 LA2 CX LCC CXX LCC A1 CA1 A1 LA2 CX LCC CXX LCC A1 CA1 A1 LA2 QR1 LA2 - - CX LCC CXX LCC A1 CA1 A1 LA2 CX LCC CXX LCC A1 CA1 A1 LA2 CX LCC CXX LCC A1 CA1 A1 LA2 CX LCC CXX LCC A1 CA1 A1 LA2 CX LCC CXX LCC A1 CA1 A1 LA2 QR2 LA2 - - CX LCC CXX LCC A1 CA1 A1 LA2 CX LCC CXX LCC A1 CA1 A1 LA2 CX LCC CXX LCC A1 CA1 A1 LA2 CX LCC CXX LCC A1 CA1 A1 LA2 CX LCC CXX LCC A1 CA1 A1 LA2 QR3 LA3 - - CX LCC CXX LCC A1 CA1 A1 LA2 CX LCC CXX LCC A1 CA1 A1 LA2 CX LCC CXX LCC A1 CA1 A1 LA2 CX LCC CXX LCC A1 CA1 A1 LA2 CX LCC CXX LCC A1 CA1 A1 LA2 -CX LCC CXX LCC A1 CA1 A1 LA2 QR4 LA3 - - - - CX LCC CXX LCC A1 CA1 A1 LA2 CX LCC CXX LCC A1 CA1 A1 LA2 CX LCC CXX LCC A1 CA1 A1 LA2 CX LCC CXX LCC A1 CA1 A1 LA2 CX LCC CXX LCC A1 CA1 A1 LA2 -CX LCC CXX LCC A1 CA1 A1 LA2 QR5 LA2 - - CX LCC CXX LCC A1 CA1 A1 LA2 CX LCC CXX LCC A1 CA1 A1 LA2 CX LCC CXX LCC A1 CA1 A1 LA2 CX LCC CXX LCC A1 CA1 A1 LA2 -CX LCC CXX LCC A1 CA1 A1 LA2 CX LCC CXX LCC A1 CA1 A1 LA2 QR6 LA2 - - CX LCC CXX LCC A1 CA1 A1 LA2 CX LCC CXX LCC A1 CA1 A1 LA2 CX LCC CXX LCC A1 CA1 A1 LA2 CX LCC CXX LCC A1 CA1 A1 LA2 -CX LCC CXX LCC A1 CA1 A1 LA2 CX LCC CXX LCC A1 CA1 A1 LA2 QR7 LA2 - - CX LCC CXX LCC A1 CA1 A1 LA2 CX LCC CXX LCC A1 CA1 A1 LA2 CX LCC CXX LCC A1 CA1 A1 LA2 CX LCC CXX LCC A1 CA1 A1 LA2 -CX LCC CXX LCC A1 CA1 A1 LA2 CX LCC CXX LCC A1 CA1 A1 LA2 QR8 LA2 - - CX LCC CXX LCC A1 CA1 A1 LA2 CX LCC CXX LCC A1 CA1 A1 LA2 CX LCC CXX LCC A1 CA1 A1 LA2 CX LCC CXX LCC A1 CA1 A1 LA2 -CX LCC CXX LCC A1 CA1 A1 LA2 CX LCC CXX LCC A1 CA1 A1 LA2 CX LCC CXX LCC A1 CA1 A1 LA2 QR9 LA2 - - CX LCC CXX LCC A1 CA1 A1 LA2 CX LCC CXX LCC A1 CA1 A1 LA2 CX LCC CXX LCC A1 CA1 A1 LA2 CX LCC CXX LCC A1 CA1 A1 LA2 -CX LCC CXX LCC A1 CA1 A1 LA2 CX LCC CXX LCC A1 CA1 A1 LA2 CX LCC CXX LCC A1 CA1 A1 LA2 QR10 LA2 - CX LCC CXX LCC A1 CA1 A1 LA2 CX LCC CXX LCC A1 CA1 A1 LA2 CX LCC CXX LCC A1 CA1 A1 LA2 CX LCC CXX LCC A1 CA1 A1 LA2 - - IP4 - -! CX LCC CXX LCC A3 CA3 A3 LA2 CX LCC CXX LCC A3 CA3 A3 LA2 CX LCC CXX LCC A3 CA3 A3 LA2 CX LCC CXX LCC A3 CA3 A3 LA2 CX LCC CXX LCC A3 CA3 A3 LA2 CX LCC CXX LCC A3 CA3 A3 LA2 -! CX LCC CXX LCC A3 CA3 A3 LA2 CX LCC CXX LCC A3 CA3 A3 LA2 CX LCC CXX LCC A3 CA3 A3 LA2 CX LCC CXX LCC A3 CA3 A3 LA2 - - - - - - -) - - -!......................QM4 <---> QTX4 in BT - CELLA=(IP2 - CA1 LB CA1 LBPP LG M QS5 LX0 ZY LB - CA1 LB CA1 LBPP LG M QS6 LX0 ZX LB - ) - ; - APERT A1 =(AX=0.01 AY=0.01) - A2 =(AX=0.02 AY=0.02) - A3 =(AX=0.007 AY=0.007) -; - BEND ZX =(L = 0.075 ANGLE = 0 ) - ZY =(L = 0.075 ANGLE = 0 ROTATE = 90 DEG ) - ! B1 =(L = 0.05 ANGLE=0.001 ROTATE = 90 DEG) - B1 = (L = 1 ANGLE=3.8 DEG E2=1) - B2 = (L = 1 ANGLE=-3.8 DEG E1=1) - B3 = (L = 1 ANGLE=-3.8 DEG E2=1) - B4 = (L = 1 ANGLE=3.8 DEG E1=1) - ; - DRIFT LA2 =(L = .25 ) LX0 =(L = .2 ) - LA3 =(L = .3) LA5 =(L = .3015 ) LDBPM =(L = .18 ) - LT1 =(L = .2) LT2 =(L = .2) LT3 =(L = .1) - - LM3 =(L = .86155420781 ) LC= (L=0.3) LCC= (L=0.25) LR= (L=0.3) LCA2 =(L=0.3) - LQA1 =(L = .3) LQA2 =(L = .3) LQA3 =(L = .1) - -LSAL1 =(L=1) -LSAL2=(L=10) -LSAL3=(L=3) -LSAL4=(L=2) -LSAL5=(L=0.3) -; - MULT -CX = (L=0.1 )!K0=0.00025 SK0=-0.0002 ) -CXX = (L=0.1 ) -BFC1 = (L=0.06 K0=0.0001 SK0=0.0001 ) - - QRTL1 =(L = .2 K1 = .030949322394 ) - QRTL2 =(L = .1 K1 = -.07482052612 ) - QRTL3 =(L = .1 K1 = .0309322394 ) - - - -QR1 =(L = .2 K1 =-0.05602944681 ) -QR2 =(L = .2 K1 =0.0532944681 ) - -QR3 =(L = .1 K1 =-0.050490550602944681 ) -QR4 =(L = .1 K1 =0.0463402944681 ) - -QR5 =(L = .1 K1 =-0.04645203902944681 ) -QR6 =(L = .1 K1 =0.045305402390502944681 ) - -QR7 =(L = .1 K1 =-0.04675029302944681 ) -QR8 =(L = .1 K1 =0.0434029302944681 ) - -QR9 =(L = .2 K1 =-0.038602944681 ) -QR10 =(L = .2 K1=0.03802944681 ) - - - - - -QC1 =(L = .2 K1= 0.02102944681 ) -QC2 =(L = .2 K1= -0.01902944681 ) - -QC3 =(L = .2 K1= 0.0192944681 ) -QC4 =(L = .2 K1= -0.0192944681 ) - -QC5 =(L = .25 K1= 0.01902944681 ) -QC6 =(L = .25 K1= -0.018202944681 ) - -QC7 =(L = .25 K1= 0.01702944681 ) -QC8 =(L = .25 K1= -0.01802944681 ) - -QC9 =(L = .25 K1= 0.01502944681 ) - - - - -QFC1 =(L = .2 K1= 0.02102944681 ) -QDC1 =(L = .2 K1= -0.01902944681 ) - -QFC2 =(L = .2 K1= 0.0192944681 ) -QDC2 =(L = .2 K1= -0.0192944681 ) - - - - -; - - MARK IP3 =( EMIX = 2.0E-9 BETAX=39.52 ALPHAX=0.0 BETAY=15.56 ALPHAY=0.0 - EMIY = 1E-9 DP = 0.024 SIGZ = 0.4E-3 ) - IP4 =( EMIX = .5E-10 EMIY = .5E-10 ) - - IP5 =( EMIX = .5E-10 - EMIY = .5E-10 DP = 0.01 SIGZ = 5E-4 ) - - - IP6 =(ALPHAX = 0.5900004375 BETAX = 0.5110003945 - PSIX = 15.2039363595 ALPHAY = -1.6749999454 - BETAY = 1.2520003248 PSIY = 15.5343488224 - EMIX = 5.6E-5 EMIY = 5.6E-5 DP = 0.05 ) - IPZ =(ALPHAX = .59 BETAX = .511 - PSIX = 15.5007179836 ALPHAY = -1.675 - BETAY = 1.252 PSIY = 16.2975671381 EMIX = 4E-5 - EMIY = 4E-5 DP = .05 ) - ; - CAVI CA1 =(L=2.97415 - VOLT=74.25 MV FREQ=2855.9822616MHZ PHI=-92.0 DEG) - CA2 =(L=1.5032 - VOLT=40MV FREQ=2855.9822616MHZ PHI=-92 DEG) - - CA3 =(L=1.8020 - VOLT=80MV FREQ=5711.9645232MHZ PHI=-92 DEG) -; - ; - MONI M =() ; - ; -! FFS USE=CELLA; -! ring cell -! nx .21207 ny .21207 free q* go -! stop - FFS USE=ATFLIN; -NPARA=1; - ins trpt rfsw; - - - - (* bxmax=bymax=14; - fit IP1 $$$; bxm bxmax bym bymax; - - QFC* MIN 0; ! set the lower limit of K1 of QRF, QSF - QDC* MAX 0; ! set the upper limit of K1 of QRD, QSD - FREE QF* QD*; - -FREE LQ*; - GO; - dr; ! draw suppressor -*) - SAVE; - - - cal - EMITX= 2e-9;EMITY= 2e-9; - beamsize - save; - - WakeFunction[Longitudinal,_?(StringMatchQ[#,"CA1*"]&)]= -{{0.0,8.3553D+14},{ 2.0612D-04,5.6907D+14},{ 4.1224D-04,4.7835D+14}, -{ 6.1837D-04,4.1655D+14},{ 8.2449D-04,3.6971D+14},{ 1.0306D-03,3.3244D+14}, -{ 1.2367D-03,3.0196D+14},{ 1.4429D-03,2.7663D+14},{ 1.6490D-03,2.5538D+14}, -{ 1.8551D-03,2.3746D+14},{ 2.0612D-03,2.2232D+14},{ 2.2673D-03,2.0957D+14}, -{ 2.4735D-03,1.9888D+14},{ 2.6796D-03,1.8999D+14},{ 2.8857D-03,1.8271D+14}, -{ 3.0918D-03,1.7686D+14},{ 3.2980D-03,1.7230D+14},{ 3.5041D-03,1.6892D+14}, -{ 3.7102D-03,1.6661D+14},{ 3.9163D-03,1.6528D+14},{ 4.1224D-03,1.6486D+14}, -{ 4.3286D-03,1.6528D+14},{ 4.5347D-03,1.6648D+14},{ 4.7408D-03,1.6840D+14}, -{ 4.9469D-03,1.7101D+14},{ 5.1531D-03,1.7425D+14},{ 5.3592D-03,1.7809D+14}, -{ 5.5653D-03,1.8250D+14},{ 5.7714D-03,1.8745D+14},{ 5.9776D-03,1.9290D+14}, -{ 6.1837D-03,1.9883D+14},{ 6.3898D-03,2.0522D+14},{ 6.5959D-03,2.1204D+14}, -{ 6.8020D-03,2.1928D+14},{ 7.0082D-03,2.2691D+14},{ 7.2143D-03,2.3492D+14}, -{ 7.4204D-03,2.4330D+14},{ 7.6265D-03,2.5202D+14},{ 7.8327D-03,2.6107D+14}, -{ 8.0388D-03,2.7045D+14},{ 8.2449D-03,2.8013D+14},{ 8.4510D-03,2.9011D+14}, -{ 8.6571D-03,3.0037D+14},{ 8.8633D-03,3.1091D+14},{ 9.0694D-03,3.2172D+14}, -{ 9.2755D-03,3.3278D+14},{ 9.4816D-03,3.4409D+14},{ 9.6878D-03,3.5565D+14}, -{ 9.8939D-03,3.6743D+14},{ 1.0100D-02,3.7944D+14},{ 1.0306D-02,3.79D+14}, -{ 5.0000D-02,3.79D+14},{ 6D-2,0},{1D+20,0}}; - - - - WakeFunction[Transverse,_?(StringMatchQ[#,"CA1*"]&)]= - { -{ 0.0, 0.0 },{ 2.0612D-04, 1.8490D+15},{ 4.1224D-04, 3.3039D+15},{ - 6.1837D-04, 4.5307D+15},{ 8.2449D-04, 5.5889D+15},{ 1.0306D-03, 6.5126D+15},{ - 1.2367D-03, 7.3251D+15},{ 1.4429D-03, 8.0433D+15},{ 1.6490D-03, 8.6803D+15},{ - 1.8551D-03, 9.2467D+15},{ 2.0612D-03, 9.7513D+15},{ 2.2673D-03, 1.0201D+16},{ - 2.4735D-03, 1.0604D+16},{ 2.6796D-03, 1.0963D+16},{ 2.8857D-03, 1.1285D+16},{ - 3.0918D-03, 1.1574D+16},{ 3.2980D-03, 1.1833D+16},{ 3.5041D-03, 1.2067D+16},{ - 3.7102D-03, 1.2278D+16},{ 3.9163D-03, 1.2469D+16},{ 4.1224D-03, 1.2644D+16}}; - - -endwake; - - -(* Beam Parameters *) -SIGZ=0.00038; -!SIGZ=0.001; -DP=0.01; -NBUNCH=1; -PBUNCH=2.2E10; -sb=0* SpeedOfLight/2855.9822616e6; - - -NP=100000; - - - - -SeedRandom[FromDate[]]; -!SeedRandom[8]; -Element["PHI","CA1*"]=-92*Degree; -Element["PHI","CA3*"]=-96*Degree; - -(* Input Beam with offsets dx0 & dy0 *) - -dx0=0.1E-3*GaussRandom[]; -dy0=-0.1E-3*GaussRandom[]; -dpx0=0.1E-3*GaussRandom[]; -dpy0=0.1E-3*GaussRandom[]; - - -(* Misalignment of Quadrupoles *) -dxq=0.1e-3; -dyq=0.1e-3; -quoo=LINE["POSITION","Q*"]; -(LINE["DX",#]=dxq*GaussRandom[])&/@quoo; -(LINE["DY",#]=dyq*GaussRandom[])&/@quoo; -!ListPlot[LINE["DX","Q*"]]; -!Update[]; - - -(* Misalignment of Cavities *) -dxcc=0.1e-3; -dycc=0.1e-3; -cave=LINE["POSITION","CA*"]; -(LINE["DX",#]=dxcc*GaussRandom[])&/@cave; -(LINE["DY",#]=dycc*GaussRandom[])&/@cave; -(LINE["DX","A*"])=(LINE["DX","CA*"]); -(LINE["DY","A*"])=(LINE["DY","CA*"]); -!ListPlot[LINE["DX","C*"]]; -!Update[]; - - - -{ax0,bx0,ay0,by0}=Twiss[{"AX","BX","AY","BY"},"^^^"]; -{ex0,ex1,ey0,ey1}=GaussRandom[4,NP]*Sqrt[{EMITX,EMITX,EMITY,EMITY}]; - - - -!Draw DX; - -(* Orbit Corrector *) - -CALC NoExp; -pc1 = LINE["POSITION","CA*"]; ! entrance of rf cavities -pc2 = pc1+1; ! exit of rf cavities -pc = Union[pc1, pc2]; - -pkx = LINE["POSITION","CX*"]; ! horizontal correctors - -mx = Outer[Sqrt[ Twiss["BX", #] * Twiss["BX", #2] * Twiss["GAMMABETA", #2]/Twiss["GAMMABETA", #]] - * Sin[ Max[0, Twiss["NX", #] - Twiss["NX", #2]] ]&, pc, pkx]; ! response matrix - -!! offset of cavities !! - -{dxc,dyc}=LINE[{"DX","DY"},pc1]; -dxc=Flatten[Thread[{dxc,dxc}]]; -dyc=Flatten[Thread[{dyc,dyc}]]; - -dx = Twiss["DX", pc]-dxc+GaussRandom[]*0.00003; ! orbit at the BPM, can be obtained from the tracking later. - -tol = 0.004; ! best 0.004 - -dkx = LinearSolve[ mx, dx, Tolerance -> tol]; ! solve the linear equation. - -LINE["K0", pkx] += dkx; - -pky = LINE["POSITION","CX*"]; ! VERTICAL correctors - -my = Outer[Sqrt[ Twiss["BY", #] * Twiss["BY", #2] * Twiss["GAMMABETA", #2]/Twiss["GAMMABETA", #]] - * Sin[ Max[0, Twiss["NY", #] - Twiss["NY", #2]] ]&, pc, pky]; ! response matrix - -dy = Twiss["DY", pc]-dyc+GaussRandom[]*0.00003; ! orbit at the BPM, can be obtained from the tracking later. - - -dky = LinearSolve[ my, dy, Tolerance -> tol]; ! solve the linear equation. - -LINE["SK0", pky] -= dky; - -CALC NoExp; - -!Draw DX DY; - - -(* First Bunch *) -z1={Sqrt[bx0]*ex0+dx0*GaussRandom[NP], - -ax0/Sqrt[bx0]*ex0+ex1/Sqrt[bx0]+dpx0*GaussRandom[NP], - Sqrt[by0]*ey0+dy0*GaussRandom[NP], - -ay0/Sqrt[by0]*ey0+ey1/Sqrt[by0]+dpy0*GaussRandom[NP], - SIGZ*GaussRandom[NP], - DP*GaussRandom[NP], - Table[1,{NP}]}; - - -TWAKE; -LWAKE; - -z={1,z1}; - -z=Get["tesa_matched.sad"]; - - - -z[[2,6]]=z[[2,6]]; -z[[2,5]]=z[[2,5]]; - -(*Tracking to the end *) - -zout=TrackParticles[z]; ! up to n elements in the LINE so that the seed creating the particles kept constant - -zout={zout[[1]], SurvivedParticles[zout[[2]]]}; - - - alv=Plus@@zout[[2,7]]/Length[z[[2,7]]] - - - -zeet=zout; - - -emit[x_, px_]:=Module[{n=Length[x] (*ax,apx,axx,apxpx,axpx*)}, -ax=Plus@@x/n; -apx=Plus@@px/n; -axx=Plus@@((x-ax)^2)/n; -apxpx=Plus@@((px-apx)^2)/n; -axpx=Plus@@((x-ax)*(px-apx))/n; -Sqrt[axx*apxpx-axpx^2]]; - - -emx=emit[zout[[2,1]],zout[[2,2]]] - -emt[y_, py_]:=Module[{n=Length[y] (*ay,apy,ayy,apypy,aypy*)}, -ay=Plus@@y/n; -apy=Plus@@py/n; -ayy=Plus@@((y-ay)^2)/n; -apypy=Plus@@((py-apy)^2)/n; -aypy=Plus@@((y-ay)*(py-apy))/n; -Sqrt[ayy*apypy-aypy^2]]; - - -emy=emt[zout[[2,3]],zout[[2,4]]] - -emt[z_, pz_]:=Module[{n=Length[z] (*az,apz,azz,apzpz,azpz*)}, -az=Plus@@z/n; -apz=Plus@@pz/n; -azz=Plus@@((z-az)^2)/n; -apzpz=Plus@@((pz-apz)^2)/n; -azpz=Plus@@((z-az)*(pz-apz))/n; -Sqrt[azz*apzpz-azpz^2]]; - - -emz=emt[zout[[2,5]],zout[[2,6]]] - - - -(* Graphics to see the impact of Wakefields *) -gx=ListPlot[Thread[zout[[2,{5,1}]]*1000],GridLines->{Automatic,Automatic},DisplayFunction->Identity, - FrameLabel->{"z(mm)","x (mm)"}]; -gy=ListPlot[Thread[zout[[2,{5,3}]]*1000],GridLines->{Automatic,Automatic},DisplayFunction->Identity, - FrameLabel->{"z(mm)","y (mm)"}]; -gpx=ListPlot[Thread[zout[[2,{1,3}]]*{1000,1000}],GridLines->{Automatic,Automatic},DisplayFunction->Identity, - FrameLabel->{"x (mm)","y (mm)"}]; - -gz=ListPlot[Thread[zout[[2,{5,6}]]*{1000,100}],GridLines->{Automatic,Automatic},DisplayFunction->Identity, - FrameLabel->{"z (mm)","`fd`n (%)"}]; -ga=HistoPlot[zout[2,6]*100,GridLines->{Automatic,Automatic},DisplayFunction->Identity, - FrameLabel->{"`fd` (%)","Number of particles"}]; -gpz=HistoPlot[zout[2,5]*1000,GridLines->{Automatic,Automatic},DisplayFunction->Identity, - FrameLabel->{"z (mm)","Number of particles"}]; - - - - - - -ko:=FFS["draw sigx sigy Q*;"]; -so:=FFS["draw sigx sigy CA*;"]; -orb:=FFS["draw DX DY Q*;"]; -co:=FFS[" DRAW SIGX SIGY& DX DY & EX EY {BQ}*;"]; -bo:=FFS[" DRAW SIGX SIGY& BX BY {BQ}*;"]; -!co -bo - -emx -emy -alv - -!dr:OpticsPlot[{{"GAMMABETA"}}]; -MOMENTUM* - -bo - -!end; - - -Show[{ - Graphics[Rectangle[{-0.1,0.6},{0.2,1.1},gx]], - Graphics[Rectangle[{0.3,0.6},{0.6,1.1},gy]], - Graphics[Rectangle[{0.7,0.6},{1.0,1.1},gpx]], - Graphics[Rectangle[{-0.1,-0.1},{0.2,0.4},gz]], - Graphics[Rectangle[{0.3,-0.1},{0.6,0.4},gpz]], - Graphics[Rectangle[{0.7,-0.1},{1.0,0.4},ga]] - }];Update[]; - - -end; - - - -(* Graphics for Phase Spaces *) -gx=ListPlot[Thread[zout[[2,{1,2}]]*1000],GridLines->{Automatic,Automatic},DisplayFunction->Identity, - FrameLabel->{"x (mm)","px (mrad)"}]; -gy=ListPlot[Thread[zout[[2,{3,4}]]*1000],GridLines->{Automatic,Automatic},DisplayFunction->Identity, - FrameLabel->{"y (mm)","py (mrad)"}]; -gpx=ListPlot[Thread[zout[[2,{1,3}]]*{1000,1000}],GridLines->{Automatic,Automatic},DisplayFunction->Identity, - FrameLabel->{"x (mm)","y (mm)"}]; - -gz=ListPlot[Thread[zout[[2,{5,6}]]*{1000,100}],GridLines->{Automatic,Automatic},DisplayFunction->Identity, - FrameLabel->{"z (mm)","`fd`n (%)"}]; -ga=HistoPlot[zout[2,6]*100,GridLines->{Automatic,Automatic},DisplayFunction->Identity, - FrameLabel->{"`fd` (%)","Number of particles"}]; -gpz=HistoPlot[zout[2,5]*1000,GridLines->{Automatic,Automatic},DisplayFunction->Identity, - FrameLabel->{"z (mm)","Number of particles"}]; - - diff --git a/FCCee_1_54GeV.sad b/FCCee_1_54GeV.sad deleted file mode 100644 index 7ce6bab..0000000 --- a/FCCee_1_54GeV.sad +++ /dev/null @@ -1,491 +0,0 @@ -! 12/01/93 303151459 MEMBER NAME *ILS11 *.FORT M SAD -! ATF LINAC WITH SINGLET LATTICE K. Oide 15-Mar-1993 -! Acceptance = 7 10^-3 m - -! Aperture = 14.2 mm at Q -! 10 mm at CA1 entrance -! 9.3 mm at CA1 exit -! However, cavity aperture is not tapered in the optics simulation -! lambda= 0.104970 m -! rf frequency = 2855.9822616 MHz -! Length of Cavity = 28 1/3 lambda = 2.97415 m - - - - -!!!!!! S. Ogur, K. Oide, F. Zimmermann FCC-ee Linac 2018, see https://cds.cern.ch/record/268525 - - -NPARA=8; -MOMENTUM= 0.012 GEV; -ON ECHO;OFF EMIT COD CTIME RAD RFSW; - LINE ATFLIN=(IP1 - LS3 QA1 LS3 QA2 LS3 QA3 LS1 - CX LS1 CXX LS1 A1 CA1 A1 LS2 QA4 LA2 - CX LCC CXX LCC A1 CA1 A1 LA2 QF1 LA2 - CX LCC CXX LCC A1 CA1 A1 LA2 QD1 LX0 - CX LCC CXX LCC A1 CA1 A1 LA2 CX LCC CXX LCC A1 CA1 A1 LA2 QS0 LX0 - CX LCC CXX LCC A1 CA1 A1 LA2 CX LCC CXX LCC A1 CA1 A1 LA2 CX LCC CXX LCC A1 CA1 A1 LA2 QS2 LX0 QS3 LA3 - CX LCC CXX LCC A1 CA1 A1 LA2 CX LCC CXX LCC A1 CA1 A1 LA2 CX LCC CXX LCC A1 CA1 A1 LA2 QS4 LX0 QS5 LA3 - CX LCC CXX LCC A1 CA1 A1 LA2 CX LCC CXX LCC A1 CA1 A1 LA2 CX LCC CXX LCC A1 CA1 A1 LA2 QS6 LA3 - - - CX LCC CXX LCC A1 CA1 A1 LA2 CX LCC CXX LCC A1 CA1 A1 LA2 CX LCC CXX LCC A1 CA1 A1 LA2 CX LCC CXX LCC A1 CA1 A1 LA2 QS7 LX0 QS8 LA3 - CX LCC CXX LCC A1 CA1 A1 LA2 CX LCC CXX LCC A1 CA1 A1 LA2 CX LCC CXX LCC A1 CA1 A1 LA2 - IP2) - - -!......................QM4 <---> QTX4 in BT - CELLA=(IP2 - CA1 LB CA1 LBPP LG M QS5 LX0 ZY LB - CA1 LB CA1 LBPP LG M QS6 LX0 ZX LB - ) - ; - APERT A1 =(AX=0.01 AY=0.01) - A2 =(AX=0.02 AY=0.02) - ; - BEND ZX =(L = 0.075 ANGLE = 0 ) - ZY =(L = 0.075 ANGLE = 0 ROTATE = 90 DEG ) - ! B1 =(L = 0.05 ANGLE=0.001 ROTATE = 90 DEG) - B1 = (L = 1 ANGLE=3.8 DEG E2=1) - B2 = (L = 1 ANGLE=-3.8 DEG E1=1) - B3 = (L = 1 ANGLE=-3.8 DEG E2=1) - B4 = (L = 1 ANGLE=3.8 DEG E1=1) - ; - DRIFT LA1 =(L = .655 ) LA2 =(L = .35 ) LX0 =(L = .2 ) - LA3 =(L = .3) LA5 =(L = .3015 ) LDBPM =(L = .18 ) - LT1 =(L = .2) LT2 =(L = .2) LT3 =(L = .1) -LS1= (L=0.1 RADIUS=0.02) LS2= (L=0.2 RADIUS=0.02) LS3= (L=0.3 RADIUS=0.02) - - - LM3 =(L = .86155420781 ) LC= (L=0.10) LCC= (L=0.10) LR= (L=0.3) LCA2 =(L=0.3) - LQA1 =(L = .3) LQA2 =(L = .3) LQA3 =(L = .1) - -LSAL1 =(L=1) -LSAL2=(L=10) -LSAL3=(L=3) -LSAL4=(L=2) -LSAL5=(L=0.3) -; - MULT -CX = (L=0.05 )!K0=0.00025 SK0=-0.0002 ) -CXX = (L=0.05 ) -BFC1 = (L=0.06 K0=0.0001 SK0=0.0001 ) - - QA1 =(L = .1 K1 = .5949322394 ) - QA2 =(L = .1 K1 = -.6482052612 ) - QA3 =(L = .1 K1 = 0.5648208844 ) - QA4 =(L = .1 K1 = - .132053093321137 ) - - QF1 =(L = .1 K1 = .2124186339114 ) - QD1 =(L = .1 K1 = -.208468405978 ) - - -QS0 =(L = .1 K1 =.10910120925210021809514 ) -QS1 =(L = .1 K1 =- .101067040421809514 ) - -QS2 =(L = .1 K1 =-0.0524691692944681 ) -QS3 =(L = .1 K1 = 0.037451421372944681 ) - -QS4 =(L = .1 K1 =-0.17190524691692944681 ) -QS5 =(L = .1 K1 =0.11451421372944681 ) - -QS6 =(L = .1 K1 =-0.008113144681 ) - -QS7 =(L = .1 K1 =-0.0908243540044681 ) -QS8 =(L = .1 K1 =0.142274144681 ) - -QR1 =(L = .1 K1 =-0.0602944681 ) -QR2 =(L = .1 K1 =0.0602944681 ) - -QR3 =(L = .1 K1 =0.0670602944681 ) -QR4 =(L = .1 K1 =-0.10602944681 ) - -QR5 =(L = .1 K1 =0.0602944681 ) -QR6 =(L = .1 K1 =-0.0710402944681 ) - -QR7 =(L = .1 K1 =-0.0602944681 ) -QR8 =(L = .1 K1 =0.10402944681 ) - -QR9 =(L = .1 K1 =0.052402944681 ) -QR10 =(L = .1 K1=-0.11802944681 ) - -QT1 =(L = .1 K1 =0.0762944681 ) -QT2 =(L = .1 K1=0.09402944681 ) -QT3 =(L = .1 K1 =0.0362944681 ) -; - - MARK IP1 =(BETAX = 1.93 BETAY =1.37 EMIX = 3.0E-6 - EMIY = 3.5E-6 DP = 0.05 SIGZ = 1.2E-3 ) - IP2 =(BETAX = 0.703 BETAY = 0.703 EMIX = 4.0E-5 - EMIY = 4.0E-5 DP = 0.05 SIGZ = 8E-4 ) - IP6 =(ALPHAX = 0.5900004375 BETAX = 0.5110003945 - PSIX = 15.2039363595 ALPHAY = -1.6749999454 - BETAY = 1.2520003248 PSIY = 15.5343488224 - EMIX = 5.6E-5 EMIY = 5.6E-5 DP = 0.05 ) - IPZ =(ALPHAX = .59 BETAX = .511 - PSIX = 15.5007179836 ALPHAY = -1.675 - BETAY = 1.252 PSIY = 16.2975671381 EMIX = 4E-5 - EMIY = 4E-5 DP = .05 ) - ; - CAVI CA1 =(L=2.97415 - VOLT=74.25 MV FREQ=2855.9822616MHZ PHI=-92.0 DEG)!FOR 2E10,1.5 mm -! VOLT=80.63MV FREQ=2855.9822616MHZ PHI=-94.0 DEG)!FOR 3E10 -! -94 DEG FOR N=3E10, -92.5 DEG FOR N=2E10 91 DEG FOR N=1E10 - CA2 =(L=1.5032 - VOLT=40MV FREQ=2855.9822616MHZ PHI=-92 DEG) - - CA3 =(L=1.8020 - VOLT=80MV FREQ=2855.9822616MHZ PHI=-92 DEG) -; - ; - MONI M =() ; - ; -! FFS USE=CELLA; -! ring cell -! nx .21207 ny .21207 free q* go -! stop - FFS USE=ATFLIN; -NPARA=1; - ins trpt rfsw; - - - - - free q{fd}* qs* - free qa* - fix qm* - cal - EMITX= 0.35e-6;EMITY= 0.5e-6; - beamsize - save; - - WakeFunction[Longitudinal,_?(StringMatchQ[#,"CA1*"]&)]= -{{0.0,8.3553D+14},{ 2.0612D-04,5.6907D+14},{ 4.1224D-04,4.7835D+14}, -{ 6.1837D-04,4.1655D+14},{ 8.2449D-04,3.6971D+14},{ 1.0306D-03,3.3244D+14}, -{ 1.2367D-03,3.0196D+14},{ 1.4429D-03,2.7663D+14},{ 1.6490D-03,2.5538D+14}, -{ 1.8551D-03,2.3746D+14},{ 2.0612D-03,2.2232D+14},{ 2.2673D-03,2.0957D+14}, -{ 2.4735D-03,1.9888D+14},{ 2.6796D-03,1.8999D+14},{ 2.8857D-03,1.8271D+14}, -{ 3.0918D-03,1.7686D+14},{ 3.2980D-03,1.7230D+14},{ 3.5041D-03,1.6892D+14}, -{ 3.7102D-03,1.6661D+14},{ 3.9163D-03,1.6528D+14},{ 4.1224D-03,1.6486D+14}, -{ 4.3286D-03,1.6528D+14},{ 4.5347D-03,1.6648D+14},{ 4.7408D-03,1.6840D+14}, -{ 4.9469D-03,1.7101D+14},{ 5.1531D-03,1.7425D+14},{ 5.3592D-03,1.7809D+14}, -{ 5.5653D-03,1.8250D+14},{ 5.7714D-03,1.8745D+14},{ 5.9776D-03,1.9290D+14}, -{ 6.1837D-03,1.9883D+14},{ 6.3898D-03,2.0522D+14},{ 6.5959D-03,2.1204D+14}, -{ 6.8020D-03,2.1928D+14},{ 7.0082D-03,2.2691D+14},{ 7.2143D-03,2.3492D+14}, -{ 7.4204D-03,2.4330D+14},{ 7.6265D-03,2.5202D+14},{ 7.8327D-03,2.6107D+14}, -{ 8.0388D-03,2.7045D+14},{ 8.2449D-03,2.8013D+14},{ 8.4510D-03,2.9011D+14}, -{ 8.6571D-03,3.0037D+14},{ 8.8633D-03,3.1091D+14},{ 9.0694D-03,3.2172D+14}, -{ 9.2755D-03,3.3278D+14},{ 9.4816D-03,3.4409D+14},{ 9.6878D-03,3.5565D+14}, -{ 9.8939D-03,3.6743D+14},{ 1.0100D-02,3.7944D+14},{ 1.0306D-02,3.79D+14}, -{ 5.0000D-02,3.79D+14},{ 6D-2,0},{1D+20,0}}; - - - - WakeFunction[Transverse,_?(StringMatchQ[#,"CA1*"]&)]= - { -{ 0.0, 0.0 },{ 2.0612D-04, 1.8490D+15},{ 4.1224D-04, 3.3039D+15},{ - 6.1837D-04, 4.5307D+15},{ 8.2449D-04, 5.5889D+15},{ 1.0306D-03, 6.5126D+15},{ - 1.2367D-03, 7.3251D+15},{ 1.4429D-03, 8.0433D+15},{ 1.6490D-03, 8.6803D+15},{ - 1.8551D-03, 9.2467D+15},{ 2.0612D-03, 9.7513D+15},{ 2.2673D-03, 1.0201D+16},{ - 2.4735D-03, 1.0604D+16},{ 2.6796D-03, 1.0963D+16},{ 2.8857D-03, 1.1285D+16},{ - 3.0918D-03, 1.1574D+16},{ 3.2980D-03, 1.1833D+16},{ 3.5041D-03, 1.2067D+16},{ - 3.7102D-03, 1.2278D+16},{ 3.9163D-03, 1.2469D+16},{ 4.1224D-03, 1.2644D+16}}; - - WakeFunction[Longitudinal,_?(StringMatchQ[#,"CA2*"]&)]= ({1,1/15.814}*#)&/@ -{{0.0,8.3553D+14},{ 2.0612D-04,5.6907D+14},{ 4.1224D-04,4.7835D+14}, -{ 6.1837D-04,4.1655D+14},{ 8.2449D-04,3.6971D+14},{ 1.0306D-03,3.3244D+14}, -{ 1.2367D-03,3.0196D+14},{ 1.4429D-03,2.7663D+14},{ 1.6490D-03,2.5538D+14}, -{ 1.8551D-03,2.3746D+14},{ 2.0612D-03,2.2232D+14},{ 2.2673D-03,2.0957D+14}, -{ 2.4735D-03,1.9888D+14},{ 2.6796D-03,1.8999D+14},{ 2.8857D-03,1.8271D+14}, -{ 3.0918D-03,1.7686D+14},{ 3.2980D-03,1.7230D+14},{ 3.5041D-03,1.6892D+14}, -{ 3.7102D-03,1.6661D+14},{ 3.9163D-03,1.6528D+14},{ 4.1224D-03,1.6486D+14}, -{ 4.3286D-03,1.6528D+14},{ 4.5347D-03,1.6648D+14},{ 4.7408D-03,1.6840D+14}, -{ 4.9469D-03,1.7101D+14},{ 5.1531D-03,1.7425D+14},{ 5.3592D-03,1.7809D+14}, -{ 5.5653D-03,1.8250D+14},{ 5.7714D-03,1.8745D+14},{ 5.9776D-03,1.9290D+14}, -{ 6.1837D-03,1.9883D+14},{ 6.3898D-03,2.0522D+14},{ 6.5959D-03,2.1204D+14}, -{ 6.8020D-03,2.1928D+14},{ 7.0082D-03,2.2691D+14},{ 7.2143D-03,2.3492D+14}, -{ 7.4204D-03,2.4330D+14},{ 7.6265D-03,2.5202D+14},{ 7.8327D-03,2.6107D+14}, -{ 8.0388D-03,2.7045D+14},{ 8.2449D-03,2.8013D+14},{ 8.4510D-03,2.9011D+14}, -{ 8.6571D-03,3.0037D+14},{ 8.8633D-03,3.1091D+14},{ 9.0694D-03,3.2172D+14}, -{ 9.2755D-03,3.3278D+14},{ 9.4816D-03,3.4409D+14},{ 9.6878D-03,3.5565D+14}, -{ 9.8939D-03,3.6743D+14},{ 1.0100D-02,3.7944D+14},{ 1.0306D-02,3.79D+14}, -{ 5.0000D-02,3.79D+14},{ 6D-2,0},{1D+20,0}}; - - - - WakeFunction[Transverse,_?(StringMatchQ[#,"CA2*"]&)]=({1,1/3.9535}*#)&/@ - { -{ 0.0, 0.0 },{ 2.0612D-04, 1.8490D+15},{ 4.1224D-04, 3.3039D+15},{ - 6.1837D-04, 4.5307D+15},{ 8.2449D-04, 5.5889D+15},{ 1.0306D-03, 6.5126D+15},{ - 1.2367D-03, 7.3251D+15},{ 1.4429D-03, 8.0433D+15},{ 1.6490D-03, 8.6803D+15},{ - 1.8551D-03, 9.2467D+15},{ 2.0612D-03, 9.7513D+15},{ 2.2673D-03, 1.0201D+16},{ - 2.4735D-03, 1.0604D+16},{ 2.6796D-03, 1.0963D+16},{ 2.8857D-03, 1.1285D+16},{ - 3.0918D-03, 1.1574D+16},{ 3.2980D-03, 1.1833D+16},{ 3.5041D-03, 1.2067D+16},{ - 3.7102D-03, 1.2278D+16},{ 3.9163D-03, 1.2469D+16},{ 4.1224D-03, 1.2644D+16}}; - -WakeFunction[Longitudinal,_?(StringMatchQ[#,"CA3*"]&)]= ({1,1}*#)&/@ -{{0.0,8.3553D+14},{ 2.0612D-04,5.6907D+14},{ 4.1224D-04,4.7835D+14}, -{ 6.1837D-04,4.1655D+14},{ 8.2449D-04,3.6971D+14},{ 1.0306D-03,3.3244D+14}, -{ 1.2367D-03,3.0196D+14},{ 1.4429D-03,2.7663D+14},{ 1.6490D-03,2.5538D+14}, -{ 1.8551D-03,2.3746D+14},{ 2.0612D-03,2.2232D+14},{ 2.2673D-03,2.0957D+14}, -{ 2.4735D-03,1.9888D+14},{ 2.6796D-03,1.8999D+14},{ 2.8857D-03,1.8271D+14}, -{ 3.0918D-03,1.7686D+14},{ 3.2980D-03,1.7230D+14},{ 3.5041D-03,1.6892D+14}, -{ 3.7102D-03,1.6661D+14},{ 3.9163D-03,1.6528D+14},{ 4.1224D-03,1.6486D+14}, -{ 4.3286D-03,1.6528D+14},{ 4.5347D-03,1.6648D+14},{ 4.7408D-03,1.6840D+14}, -{ 4.9469D-03,1.7101D+14},{ 5.1531D-03,1.7425D+14},{ 5.3592D-03,1.7809D+14}, -{ 5.5653D-03,1.8250D+14},{ 5.7714D-03,1.8745D+14},{ 5.9776D-03,1.9290D+14}, -{ 6.1837D-03,1.9883D+14},{ 6.3898D-03,2.0522D+14},{ 6.5959D-03,2.1204D+14}, -{ 6.8020D-03,2.1928D+14},{ 7.0082D-03,2.2691D+14},{ 7.2143D-03,2.3492D+14}, -{ 7.4204D-03,2.4330D+14},{ 7.6265D-03,2.5202D+14},{ 7.8327D-03,2.6107D+14}, -{ 8.0388D-03,2.7045D+14},{ 8.2449D-03,2.8013D+14},{ 8.4510D-03,2.9011D+14}, -{ 8.6571D-03,3.0037D+14},{ 8.8633D-03,3.1091D+14},{ 9.0694D-03,3.2172D+14}, -{ 9.2755D-03,3.3278D+14},{ 9.4816D-03,3.4409D+14},{ 9.6878D-03,3.5565D+14}, -{ 9.8939D-03,3.6743D+14},{ 1.0100D-02,3.7944D+14},{ 1.0306D-02,3.79D+14}, -{ 5.0000D-02,3.79D+14},{ 6D-2,0},{1D+20,0}}; - - - - WakeFunction[Transverse,_?(StringMatchQ[#,"CA3*"]&)]=({1,1}*#)&/@ - { -{ 0.0, 0.0 },{ 2.0612D-04, 1.8490D+15},{ 4.1224D-04, 3.3039D+15},{ - 6.1837D-04, 4.5307D+15},{ 8.2449D-04, 5.5889D+15},{ 1.0306D-03, 6.5126D+15},{ - 1.2367D-03, 7.3251D+15},{ 1.4429D-03, 8.0433D+15},{ 1.6490D-03, 8.6803D+15},{ - 1.8551D-03, 9.2467D+15},{ 2.0612D-03, 9.7513D+15},{ 2.2673D-03, 1.0201D+16},{ - 2.4735D-03, 1.0604D+16},{ 2.6796D-03, 1.0963D+16},{ 2.8857D-03, 1.1285D+16},{ - 3.0918D-03, 1.1574D+16},{ 3.2980D-03, 1.1833D+16},{ 3.5041D-03, 1.2067D+16},{ - 3.7102D-03, 1.2278D+16},{ 3.9163D-03, 1.2469D+16},{ 4.1224D-03, 1.2644D+16}}; - - -endwake; - - -(* Beam Parameters *) -SIGZ=0.001; -DP=0.01; -NBUNCH=1; -PBUNCH=2.2E10; -sb=0* SpeedOfLight/2855.9822616e6; - - -NP=100000; - - -!TWAKE -!LWAKE - -SeedRandom[FromDate[]]; -!SeedRandom[3]; -Element["PHI","CA1*"]=-94*Degree; - - -(* Input Beam with offsets dx0 & dy0 *) - -dx0=0.1E-3*GaussRandom[]; -dy0=0.1E-3*GaussRandom[]; -dpx0=0.1E-3*GaussRandom[]; -dpy0=0.1E-3*GaussRandom[]; - - -(* Misalignment of Quadrupoles *) -dxq=0.1e-3; -dyq=0.1e-3; -quoo=LINE["POSITION","Q*"]; -(LINE["DX",#]=dxq*GaussRandom[])&/@quoo -(LINE["DY",#]=dyq*GaussRandom[])&/@quoo -!ListPlot[LINE["DX","Q*"]]; -!Update[]; - - -(* Misalignment of Cavities *) -dxcc=0.1e-3; -dycc=0.1e-3; -cave=LINE["POSITION","CA*"]; -(LINE["DX",#]=dxcc*GaussRandom[])&/@cave -(LINE["DY",#]=dycc*GaussRandom[])&/@cave -(LINE["DX","A*"])=(LINE["DX","CA*"]) -(LINE["DY","A*"])=(LINE["DY","CA*"]) -!ListPlot[LINE["DX","C*"]]; -!Update[]; - - - -{ax0,bx0,ay0,by0}=Twiss[{"AX","BX","AY","BY"},"^^^"]; -{ex0,ex1,ey0,ey1}=GaussRandom[4,NP]*Sqrt[{EMITX,EMITX,EMITY,EMITY}]; - - - -!Draw DX; - -(* Orbit Corrector *) - -CALC NoExp; -pc1 = LINE["POSITION","CA*"]; ! entrance of rf cavities -pc2 = pc1+1; ! exit of rf cavities -pc = Union[pc1, pc2]; - -pkx = LINE["POSITION","CX*"]; ! horizontal correctors - -mx = Outer[Sqrt[ Twiss["BX", #] * Twiss["BX", #2] * Twiss["GAMMABETA", #2]/Twiss["GAMMABETA", #]] - * Sin[ Max[0, Twiss["NX", #] - Twiss["NX", #2]] ]&, pc, pkx]; ! response matrix - -!! offset of cavities !! - -{dxc,dyc}=LINE[{"DX","DY"},pc1]; -dxc=Flatten[Thread[{dxc,dxc}]]; -dyc=Flatten[Thread[{dyc,dyc}]]; - -dx = Twiss["DX", pc]-dxc+0.00003*GaussRandom[]; ! orbit at the BPM, can be obtained from the tracking later. - -tol = 0.005; ! best 0.004 - -dkx = LinearSolve[ mx, dx, Tolerance -> tol] ! solve the linear equation. - -LINE["K0", pkx] += dkx; - -pky = LINE["POSITION","CX*"]; ! VERTICAL correctors - -my = Outer[Sqrt[ Twiss["BY", #] * Twiss["BY", #2] * Twiss["GAMMABETA", #2]/Twiss["GAMMABETA", #]] - * Sin[ Max[0, Twiss["NY", #] - Twiss["NY", #2]] ]&, pc, pky]; ! response matrix - -dy = Twiss["DY", pc]-dyc+0.00003*GaussRandom[]; ! orbit at the BPM, can be obtained from the tracking later. - - -dky = LinearSolve[ my, dy, Tolerance -> tol]; ! solve the linear equation. - -LINE["SK0", pky] -= dky; - -CALC NoExp; - -!Draw DX DY; - - -(* First Bunch *) -z1={Sqrt[bx0]*ex0+dx0*GaussRandom[NP], - -ax0/Sqrt[bx0]*ex0+ex1/Sqrt[bx0]+dpx0*GaussRandom[NP], - Sqrt[by0]*ey0+dy0*GaussRandom[NP], - -ay0/Sqrt[by0]*ey0+ey1/Sqrt[by0]+dpy0*GaussRandom[NP], - SIGZ*GaussRandom[NP], - DP*GaussRandom[NP], - Table[1,{NP}]}; - - -TWAKE; -LWAKE; - -SPAC; - -z={1,z1}; - -(*Tracking to the end *) -zout=TrackParticles[z]; ! up to n elements in the LINE so that the seed creating the particles kept constant -e -zout={zout[[1]], SurvivedParticles[zout[[2]]]}; - - sum=Plus@@zout[[2,7]]; !@@ means apply! - alv=sum/NP - - - - - - -emit[x_, px_]:=Module[{n=Length[x] (*ax,apx,axx,apxpx,axpx*)}, -ax=Plus@@x/n; -apx=Plus@@px/n; -axx=Plus@@((x-ax)^2)/n; -apxpx=Plus@@((px-apx)^2)/n; -axpx=Plus@@((x-ax)*(px-apx))/n; -Sqrt[axx*apxpx-axpx^2]]; - - -emx=emit[zout[[2,1]],zout[[2,2]]] - -emt[y_, py_]:=Module[{n=Length[y] (*ay,apy,ayy,apypy,aypy*)}, -ay=Plus@@y/n; -apy=Plus@@py/n; -ayy=Plus@@((y-ay)^2)/n; -apypy=Plus@@((py-apy)^2)/n; -aypy=Plus@@((y-ay)*(py-apy))/n; -Sqrt[ayy*apypy-aypy^2]]; - - -emy=emt[zout[[2,3]],zout[[2,4]]] - -emt[z_, pz_]:=Module[{n=Length[z] (*az,apz,azz,apzpz,azpz*)}, -az=Plus@@z/n; -apz=Plus@@pz/n; -azz=Plus@@((z-az)^2)/n; -apzpz=Plus@@((pz-apz)^2)/n; -azpz=Plus@@((z-az)*(pz-apz))/n; -Sqrt[azz*apzpz-azpz^2]]; - - -emz=emt[zout[[2,5]],zout[[2,6]]] - -!end; - - - - - - - - - -(* Graphics to see the impact of Wakefields *) -gx=ListPlot[Thread[zout[[2,{5,1}]]*1000],GridLines->{Automatic,Automatic},DisplayFunction->Identity, - FrameLabel->{"z(mm)","x (mm)"}]; -gy=ListPlot[Thread[zout[[2,{5,3}]]*1000],GridLines->{Automatic,Automatic},DisplayFunction->Identity, - FrameLabel->{"z(mm)","y (mm)"}]; -gpx=ListPlot[Thread[zout[[2,{1,3}]]*{1000,1000}],GridLines->{Automatic,Automatic},DisplayFunction->Identity, - FrameLabel->{"x (mm)","y (mm)"}]; - -gz=ListPlot[Thread[zout[[2,{5,6}]]*{1000,100}],GridLines->{Automatic,Automatic},DisplayFunction->Identity, - FrameLabel->{"z (mm)","`fd`n (%)"}]; -ga=HistoPlot[zout[2,6]*100,GridLines->{Automatic,Automatic},DisplayFunction->Identity, - FrameLabel->{"`fd` (%)","Number of particles"}]; -gpz=HistoPlot[zout[2,5]*1000,GridLines->{Automatic,Automatic},DisplayFunction->Identity, - FrameLabel->{"z (mm)","Number of particles"}]; - - - - - - -ko:=FFS["draw sigx sigy Q*;"]; -so:=FFS["draw sigx sigy CA*;"]; -orb:=FFS["draw DX DY Q*;"]; -co:=FFS[" DRAW SIGX SIGY& DX DY & EX EY {BQ}*;"]; -bo:=FFS[" DRAW SIGX SIGY& BX BY {BQ}*;"]; -!co -!bo -!ko - -emx -emy -alv - - -!dr:OpticsPlot[{{"GAMMABETA"}}]; -MOMENTUM* - -Show[{ - Graphics[Rectangle[{-0.1,0.6},{0.2,1.1},gx]], - Graphics[Rectangle[{0.3,0.6},{0.6,1.1},gy]], - Graphics[Rectangle[{0.7,0.6},{1.0,1.1},gpx]], - Graphics[Rectangle[{-0.1,-0.1},{0.2,0.4},gz]], - Graphics[Rectangle[{0.3,-0.1},{0.6,0.4},gpz]], - Graphics[Rectangle[{0.7,-0.1},{1.0,0.4},ga]] - }];Update[]; - - - - - - -end; - - - - diff --git a/README.md b/README.md index 35b096f..9b2df1c 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,3 @@ # FCC_ee -FCCee injector complex +FCCee final injector bypass design. +Password: my lal e-mail diff --git a/another_sad_example.sad b/another_sad_example.sad deleted file mode 100644 index 9a1d341..0000000 --- a/another_sad_example.sad +++ /dev/null @@ -1,142 +0,0 @@ -! -! This is an example of SAD/FFS to design a positron ring -! with unit cells and dispersion suppressors. Chromaticity correction -! and also a survey of dynamic aperture are also done. -! The result of execution of this example is available in -! /SAD/doc/design_example.sad.result -! -MOMENTUM= 1 GEV; -ON ECHO;ON CTIME; -! -! ***** DEFINITION OF ELEMENTS IN MAIN LEVEL ***** -! - ; - DRIFT L1 = (L = 1) - ; - BEND B = (L = 2) - ; - QUAD QF = (L = 1 K1 = 0.1 ) - QD = (L = 1 K1 = -0.1 ) - QSF = (L = 1 K1 = 0.1 ) - QSD = (L = 1 K1 = -0.1 ) - QRF = (L = 1 K1 = 0.1 ) - QRD = (L = 1 K1 = -0.1 ) - ; - SEXT SF =(L = 1 K2 = 0.1) - SD =(L = 1 K2 = -0.1) - ; - MARK IP1 =(BETAX = 10 BETAY =10 EMIX = 4.0E-7 - EMIY = 4.0E-7 DP = 0.01 ) - ; - CAVI CA1 = (L = 1 VOLT=1 MV HARM=100) - ; -! -! ***** DEFINITION OF UNIT CELL IN MAIN LEVEL ***** -! -! You need at least one LINE to start FFS, but -! other lines can be created in FFS. -! - ; - LINE CELL = (IP1 QF L1 SF L1 B 3*L1 QD L1 SD L1 B 3*L1) - ; - FFS USE=CELL; - Print[TimeUsed[]];! CPU Time used so far. -! -! Defining parameters: -! - nbends=24; ! number of bends per ring - nxcell=0.25; ! horizontal tune/cell - nycell=0.25; ! vertical tune/cell - Print[TimeUsed[]];! CPU Time used so far. -! -! ***** UNIT CELL MATCHING ***** -! - CELL; ! peridic condition - B 2*Pi/nbends; ! settin bending angle to the BEND B - FIT; ! set fit point at end of line - NX nxcell; ! set fit condition NX - NY nycell; ! set fit condition NY - FREE Q*; ! set Q* (in this case QF and QD) as the matching - ! variable - GO; ! start matching -! define dr as the drawing command (needs X-Window) - dr:=FFS["OUT 'a' DRAW BX BY & EX EY {BQ}*; TERM OUT; TDR 'a';"]; - dr; ! draw optics of unit cell - SAVE; ! save the matching result (values of QF, QD) to - ! keep them after swtch the beam line. - Print[TimeUsed[]];! CPU Time used so far. -! -! ***** DISPERSION SUPPRESSOR ***** -! - unitcell=ExtractBeamLine[]; ! get the current BeamLine -! define a dispersion suppressor to insert rf - supp=BeamLine[QSF, 8*L1, QSD, 3*L1, B, 3*L1, QRF, 3*L1, CA1, 3*L1, QRD]; - USE Join[unitcell, supp]; ! switch the beam line with suppressor - INS; ! now nonperiodic (a transport line) - QRD L 0.5; ! set the thickness of QD - FIT; - AX 0; ! set the end of line to be a symmetry point - AY 0; - EX 0; ! and dispersion-free - EPX 0; - Q*F MIN 0; ! set the lower limit of K1 of QRF, QSF - Q*D MAX 0; ! set the upper limit of K1 of QRD, QSD - FREE QS* QR*; - GO; - dr; ! draw suppressor - SAVE; - Print[TimeUsed[]];! CPU Time used so far. -! -! ***** TOTAL RING ***** -! - ncell=(nbends/2-2)/2; ! number of unitcells per half ring. -! Defining a half ring, removing the -! first QF and IP1 markers in unitcell - hring=BeamLine[IP1,-supp,Rest[ncell*Rest[unitcell]],supp]; - USE Join[hring,-hring]; ! switch to full ring - CELL; ! now periodic condition again - CAL NX NY; ! set to display NX and NY after CAL - CAL ! calculate the optics of ring - dr; ! draw ring - Print[TimeUsed[]];! CPU Time used so far. -! -! ***** CHROMATICITY CORRECTION ***** -! -! get the current tunes - {nx0, ny0}=Twiss[{"NX","NY"},"***"]/2/Pi; - FIT; - NX nx0 5; ! set the offmomentum tunes for 5 points - NY ny0 5; ! in -DP < dp/p0 < DP - DP=0.01; ! set the bandwidth |dp/p0|max = DP = 0.01 - FREE S*; ! set S* (SF and SD) sextupoles as variable - GO; - FITP 1; ! set the off-momentum points to 1 (on-momentum only). - ! - ! Define Functions to display tunes as functions of dp/p0 - nx[dp_]:=(DP0=dp;FFS["CALC"];Twiss["NX","***"]/2/Pi); - ny[dp_]:=(DP0=dp;FFS["CALC"];Twiss["NY","***"]/2/Pi); - ! - ! Plot tunes -3% < dp/p0 < 3%. - Plot[{nx[dp],ny[dp]}, {dp, -0.03, 0.03}, - PlotLabel->"Tune Chromaticity", - FrameLabel->{{"`fD`np/p`d0`n","F X X"},{"`fn`n`dx`n, `fn`n`dy`n","GX X GX X"}}]; - ! draw chromaticity - If[$DisplayFunction === CanvasDrawer, Update[]]; - TYPE; ! print out all elements - PrintBeamLine[ExtractBeamLine[]]; ! print out all beam line - Print[TimeUsed[]];! CPU Time used so far. -! -! ***** EMITTANCE CALCULATION ***** -! - EMIOUT; ! turn on the output of matrices by EMIT. - EMIT; ! This (or Emittance[]) is necessary before tracking - Print[TimeUsed[]];! CPU Time used so far. -! -! ***** DYNAMIC APERTURE ***** -! -! Dynamic aperture for 1000 turns, - DynamicApertureSurvey[{{0,100},{0,100},Range[-30,30,4]}, - 1000,Output->6]; -! - Print[TimeUsed[]];! CPU Time used so far. - ABORT ! stop SAD. diff --git a/bypass.madx b/bypass.madx deleted file mode 100644 index 24e4654..0000000 --- a/bypass.madx +++ /dev/null @@ -1,109 +0,0 @@ -title "Injector Bypass"; - -option, -echo, warn, info; - -// 1 -> dogleg, 2 -> chicane -flag = 1; -// flag = 2; - -call file = "parameter.madx"; - -dogleg: line = ( - D1, QF, D2, QD, D3, //first doublet - B1, - D4, Q1, D5, - B2, - D3, QD, D2, QF, D1 //second doublet - ); - -chicane: line = ( - D1, QF, D2, QD, D3, //first doublet - B1, L1, - B2, L2 - B2, L1, - B1, - D3, QD, D2, QF, D1 //second doublet - ); - -Beam, particle = electron, energy = e0, ex = emit_x, ey = emit_y, sigt = sigma_z, npart = n_e; - -if (flag == 1) { - - use, sequence = dogleg; - - betx0 = 196; - bety0 = 25; - alfx0 = -145; - alfy0 = 14.55; - - select, flag = twiss, column = name, s, betx, bety, alfx, alfy, mux, muy, dx, dpx, dy, dpy; - twiss, betx = betx0, bety = bety0, alfx = alfx0, alfy = alfy0, dx = dx0, dpx = dpx0, dy = dy0, dpy = dpy0; - - - match, sequence = dogleg, betx = betx0, bety =bety0, alfx = alfx0, alfy =alfy0; - constraint, sequence = dogleg, range = #s/#e, betx < 200, bety < 200; - constraint, sequence = dogleg, range = #e, betx = 35, bety = 25; - - vary, name = QF->k1, step = 1e-8, lower = -200.0, upper = 200.0; - vary, name = QD->k2, step = 1e-8, lower = -200.0, upper = 200.0; - vary, name = Q1->k3, step = 1e-8, lower = -200.0, upper = 200.0; - - lmdif, calls = 100000, tolerance = 1e-26; - endmatch; - - value, QF->k1; - value, QD->k2; - value, Q1->k3; - - //select, flag = twiss, clear = true; - //twiss, save, file = "twiss_bypass.tfs", betx = betx0, bety = bety0, alfx = alfx0, alfy = alfy0, dx = dx0, dpx = dpx0, dy = dy0, dpy = dpy0; - - select, flag = twiss, column = name, s, betx, bety, alfx, alfy, mux, muy, dx, dpx, dy, dpy; - //select, flag = twiss, full; - twiss, save, file = "twiss_bypass.dat"; - plot, haxis = s, vaxis1 = betx, bety, vaxis2 = dx, dpx, colour = 100, file = "twiss_bypass"; - - select, flag = survey, column = name, s, x, y, z; - survey, file = "survey_bypass.dat"; - - } - -elseif ( flag == 2 ) { - - use, sequence = chicane; - - betx0 = ; - bety0 = ; - alfx0 = ; - alfy0 = ; - - select, flag = twiss, column = name, s, betx, bety, alfx, alfy, mux, muy, dx, dpx, dy, dpy; - twiss, betx = betx0, bety = bety0, alfx = alfx0, alfy = alfy0, dx = dx0, dpx = dpx0, dy = dy0, dpy = dpy0; - - - match, sequence = dogleg, betx = betx0, bety =bety0, alfx = alfx0, alfy =alfy0; - constraint, sequence = dogleg, range = #s/#e, betx < , bety < ; - constraint, sequence = dogleg, range = #e, betx = , bety = ; - - vary, name = QF->k1, step = 1e-8, lower = -200.0, upper = 200.0; - vary, name = QD->k2, step = 1e-8, lower = -200.0, upper = 200.0; - - lmdif, calls = 100000, tolerance = 1e-26; - endmatch; - - value, QF->k1; - value, QD->k2; - - //select, flag = twiss, clear = true; - //twiss, save, file = "twiss_bypass.tfs", betx = betx0, bety = bety0, alfx = alfx0, alfy = alfy0, dx = dx0, dpx = dpx0, dy = dy0, dpy = dpy0; - - select, flag = twiss, column = name, s, betx, bety, alfx, alfy, mux, muy, dx, dpx, dy, dpy; - //select, flag = twiss, full; - twiss, save, file = "twiss_bypass.dat"; - plot, haxis = s, vaxis1 = betx, bety, vaxis2 = dx, dpx, colour = 100, file = "twiss_bypass"; - - select, flag = survey, column = name, s, x, y, z; - survey, file = "survey_bypass.dat"; - } - - diff --git a/parameter.madx b/parameter.madx deleted file mode 100644 index 468271b..0000000 --- a/parameter.madx +++ /dev/null @@ -1,41 +0,0 @@ -charge := 3.2e-9; // 3.2nC -e0 := 4.46; // GeV -emit_x := 6.4e-9; // m.rad -emit_y := 5.0e-9; // m.rad -sigma_z := 2.4e-3; // m (8ps) -n_e := 2.0e10; // 4.2e10 for 7nC - - -//dogleg -//drift -D1 : drift, l = ; // m -D2 : drift, l = ; // m -D3 : drift, l = ; // m -D4 : drift, l = ; // m -D5 : drift, l = ; // m - -//magnet -QF : quadrupole, l = , k1 := ; -QD : quadrupole, l = , k2 := -k1; - -Q1 : quadrupole, l = , k3 := ; - -B1 : sbend, l = , angle = *RADDEG; // rad/deg(pi/180) -B2 : sbend, l = , angle = *RADDEG; // rad/deg - - -//chicane -//drift -D1 : drift, l = ; // m -D2 : drift, l = ; // m -D3 : drift, l = ; // m - -L1 : drift, l = ; // m -L2 : drift, l = ; // m - -//magnet -QF : quadrupole, l = , k1 := ; -QD : quadrupole, l = , k2 := -k1; - -B1 : sbend, l = , angle = *RADDEG; // rad/deg(pi/180) -B2 : sbend, l = , angle = *RADDEG; // rad/deg diff --git a/sad_example_5.sad b/sad_example_5.sad deleted file mode 100644 index c5a0a37..0000000 --- a/sad_example_5.sad +++ /dev/null @@ -1,216 +0,0 @@ -! -! This is an example for SAD School 2015 -! -! Always begin with the MAIN level; you can define elements such as DRIFT, BEND, QUAD, etc., and beam lines by LINE. -! - OFF CTIME;ON ECHO; ! Flags ECHO: echo back the MAIN level input. CTIME cputime at each MAIN level command. -; -AAA =0.3; -BBB="aaa"; - - -! -DRIFT LX03 = ( L =AAA ) - LXSF = ( L =0.5 ) - LM6 = (L=2) - LM4 = (L=2) - LM3 = (L=2) - LM2 = (L=1) - LRF = (L=1.5) - LXX1 = (L=1) - LXX2=(L=2) -; -BEND B1 = (L=2 ANGLE = PI/2 /20) -; -QUAD QF=(L=0.5-AAA K1 = 0.1) - QD = (L=0.2 K1 = -0.1) - QM6=(L=0.2 k1=0.8) - QM5=(L=0.2 k1=-0.8) - QM4=(L=0.2 k1=0.5) - QM3=(L=0.2 k1=-0.5) - QM2=(L=0.2 k1=0.5) - QM1=(L=0.2 k1=-0.5) - QM4A=(L=0.2 k1=0.5) - QM3A=(L=0.2 k1=-0.5) - QM2A=(L=0.2 k1=0.5) - QKF=(L=0.2 k1=0.5) - QKD=(L=0.2 k1=-0.5) -; -CAVI CA1 = (FREQ=500e6) -; -; -COORD - CROT1 = (CHI3 = PI/4) - CROT2 = (CHI3 = -PI/4) -; -MARK P1=() - P2=() - P3=() - PX=() - PEND=() - PRF=() -; -LINE CELL1 = (P1 QF LXSF B1 LX03 QD LX03 B1 LXSF) - DSUPP = (P1 QM6 LM6 QM5 LX03 B1 LX03 QM4 LM4 QM3 LM3 QM2 LM2 P2) - DSUPPA = (P1 QM6 LM6 QM5 LX03 B1 LX03 QM4A LM4 QM3A LM3 QM2A LM2 P2) - XCHG1 = (P3 LXX1 QKF 2*LXX1 QKD LXX1 ) -; -FFS; ! enters the "FFS" level for optics calculation, matching, scripting, etc. -! -1+2 - -! -! -MOMENTUM=3e9; -CONVERGENCE=1e-20; -Brho:=MOMENTUM/SpeedOfLight; -! -use CELL1; -! -cell; -! -fit nx 0.375 ny 0.125; -free q*; -go; -end - -var -show -dr:=FFS["draw bx by & ex ey q*;"]; -dr; - -end - -FitFunction:=Module[ - {e=Emittance[]}, - {(Emittances/.e)[[1]]/emit0-1}]; - -emit0=1e-9; - -free b1 b1 l; - -go -end - -larc:=LINE["S","$$$"]/LINE["GCHI1","$$$"]*2*Pi; - -c0=400; -fit leng 10; -FitValue["$$$","LENG",_,v_,x_]:=Module[{l=c0/(2 Pi)*LINE["ANGLE","B1"]*2},If[xlsf}]; -SetElement["LXSF1","DRIFT",{"L"->(Element["L","LXSF"]-lsf)/2}]; -bsf=BeamLine[LXSF1,SF,LXSF1]; -!ps=Flatten[Table[{#[[k]],#[[k+8]]},{k,1,Length[#],10}]]&/@p4; -ps=Flatten[Table[{#[[k]],#[[k+2]]},{k,1,Length[#],4}]]&/@p4; -rings=ring; -(rings[[#]]=bsf)&/@Flatten[ps]; - -use rings; -ringsm=rings; -ps=Partition[LINE["POSITION","SF.*"],2]; -nsfam=Length[ps]; -Do[SetElement["SF"//k,"SEXT",{"L"->lsf}],{k,nsfam}]; -k=1; -Scan[((ringsm[[#]]="SF"//k)&/@#;k++)&,ps]; - -use rings; -cell cal; -save; - -DP=0.004; -fit pend nx @ 8 ny @ 8 ; -fit prf bx @ 8 ax @ 8 by @ 8 ay @ 8; -free sf* go; - -ca1 volt 300e3; -rfsw; -emit - -NPARA=4; -da:=DynamicApertureSurvey[{{0,50},{0,50},Range[-10,10]*2},1000,Output->6] - -end