Commit d42e9d0a authored by Thomas Planche's avatar Thomas Planche

works with the 90 deg. TOSCA map from my no-up-to-date light model

parent f21cb44f
......@@ -7,21 +7,18 @@
0. 0. 0. 0. 0. 1. ’o’ !Y; T; Z; P; S; D; 'marker'
1 !1 or -9 (-9 disables the tracking of this particle)
'TOSCA' 3
'TOSCA' 2
0 2 !print the map (no print = 0); output along partile(s) trajectory(ies) = 2
1.0365 1. 1. 1. !Magnetic field scaling; X coordinate scaling; Y; Z
1.0365 1. 1. 1. !Magnetic field scaling (adjusted so that R at the center=120cm+60cm*sqrt(2), 120cm is reference radius of the HRS, 60cm is the amound by which the map has been enlarge to include fringe fields); X coordinate scaling; Y; Z
HEADER_2 ! Title
281 61 1 22. ! Nb of nodes in Theta; R; Z (=1 for 2D map); MOD(see manual, =0 for Cartesian, with mid-plane symmetry)
2D.map !File name
181 47 1 22. ! Nb of nodes in Theta; R; Z (=1 for 2D map); MOD(see manual, =0 for Cartesian, with mid-plane symmetry)
zgoubi_TOSCAMOD22.dat !File name
0 0 0 0. ! ID (see manual);
4 !IORDRE(=2, 4 or 25 if 2D, unused if 3D)
0.1 !Integration step size[cm]
2 !KPOS, normally=2
132.5586547 -0.436332313 132.5586547 0.436332313 !RE has been fitted to be =RS; TE=-25deg(in rad) whic is the distance between the effective edge and the edge of th efield map; RS=RE; TS=-TE
170.9440551 0. 170.9440551 0. !RE has been fitted to be =RS; TE=0 because the map opening = the bending angle = 90 deg; RS=RE; TS=-TE
'FAISTORE' 3
zgoubi.fai
1
'FIT' 4
1 !number of variables
......
This diff is collapsed.
......@@ -11,4 +11,4 @@ set title titletext
set key top left
cm2mm=10.0
plot "zgoubi.plt" using ($22/pi*180.):($25/10.) with p pt 0
plot "zgoubi.plt" using ($22/pi*180.):($25/10.) with p pt 0 notitle
** HSR using TOSCA map
'OBJET' 1
546.198 !60 keV U1+ = 546.198
1
1 121 1 1 1 1
0.0 1.0 0.0 0.0 0.0 1.
0.0 0.0 0.0 0.0 0.0 1.
! 'OBJET' 1
! 546.198 !60 keV U1+ = 546.198
! 5 !5: generate 11 particles used to calculate transfer matrix ('MATRIX')
! 0.01 0.01 0.01 0.01 .1 .001 !step size in Y; T; Z; P; S; D
! 0.0 0. 0. 0. 0. 1.
'FAISTORE'
entrance.fai
1
'DRIFT'
5.00
'FAISTORE'
entrance.fai
1
'DRIFT'
5.00
'FAISTORE'
entrance.fai
1
'DRIFT'
5.00
'FAISTORE'
entrance.fai
1
'DRIFT'
5.00
'FAISTORE'
entrance.fai
1
'DRIFT'
5.500
'FAISTORE'
entrance.fai
1
'TOSCA' 3
0 2E2 !print the map (no print = 0); output along partile(s) trajectory(ies) = 2
1.0365 1. 1. 1. !Magnetic field scaling; X coordinate scaling; Y; Z
HEADER_2 ! Title
281 61 1 22. ! Nb of nodes in Theta; R; Z (=1 for 2D map); MOD(see manual, =0 for Cartesian, with mid-plane symmetry)
2D.map !File name
0 0 0 0. ! ID (see manual);
4 !IORDRE(=2, 4 or 25 if 2D, unused if 3D)
0.1 !Integration step size[cm]
2 !KPOS, normally=2
132.5586547 -0.436332313 132.5586547 0.436332313 !RE has been fitted to be =RS; TE=-25deg(in rad) whic is the distance between the effective edge and the edge of th efield map; RS=RE; TS=-TE
'DRIFT' 4
24.0430
'DRIFT' 5
24.0430
'TOSCA' 6
0 0 !print the map (no print = 0); output along partile(s) trajectory(ies) = 2
1.0365 1. 1. 1. !Magnetic field scaling; X coordinate scaling; Y; Z
HEADER_2 ! Title
281 61 1 22. ! Nb of nodes in Theta; R; Z (=1 for 2D map); MOD(see manual, =0 for Cartesian, with mid-plane symmetry)
2D.map !File name
0 0 0 0. ! ID (see manual);
4 !IORDRE(=2, 4 or 25 if 2D, unused if 3D)
0.1 !Integration step size[cm]
2 !KPOS, normally=2
132.5586547 -0.436332313 132.5586547 0.436332313 !RE has been fitted to be =RS; TE=-25deg(in rad) whic is the distance between the effective edge and the edge of th efield map; RS=RE; TS=-TE
'FAISTORE'
exit.fai
1
'DRIFT'
5.00
'FAISTORE'
exit.fai
1
'DRIFT'
5.00
'FAISTORE'
exit.fai
1
'DRIFT'
5.00
'FAISTORE'
exit.fai
1
'DRIFT'
5.00
'FAISTORE'
exit.fai
1
'DRIFT'
5.500
'FAISTORE'
exit.fai
1
'FAISTORE'
zgoubi.fai
1
! 'MATRIX' 9
! 1 0 !order of the matrix/map; 0:means calculate the matrix here
! 'FIT' 10
! 1 !Number of physical parameters to be varied
! 2 1 7.001 0.5
! 2
! 1 1 2 9 0.0 1. 0 !transfer matrix;
! 1 2 1 9 0.0 1. 0 !transfer matrix;
'END' 11
......@@ -11,4 +11,4 @@ set title titletext
set key top left
cm2mm=10.0
plot "zgoubi.plt" using ($22/pi*180.):($10/100.) with p pt 0
plot "zgoubi.plt" using ($22/pi*180.):($10/100.) with p pt 0 notitle
......@@ -12,9 +12,5 @@ set key top left
cm2mm=10.0
set size ratio -1
th=pi/2.
#plot "zgoubi.plt" using ($10/100.*sin($22)):($10/100.*cos($22)) with p pt 0 notitle,\
plot "entrance.fai" using ($14/100.*cos(th/2.)-$10/100.*sin(th/2.)):($14/100.*sin(th/2.)+$10/100.*cos(th/2.)) w p pt 0 notitle,\
"zgoubi.plt" using ($10/100.*sin($22)):($10/100.*cos($22)) with p pt 0 notitle,\
plot "zgoubi.plt" using ($10/100.*sin($22-pi/4.)):($10/100.*cos($22-pi/4.)) with lp pt 0 notitle
THREED TYPE=SURFACE VECTOR=NO XORIGIN=0 YORIGIN=1200 ZORIGIN=106 ROTX=1.0E-04 ROTY=179.999 ROTZ=1.0E-04 XASPECT=1 YASPECT=1 ZASPECT=1 SIZE=704.188791082898 FACETANGLE=10 PERSPECTIVE=NO LINECOLOUR=YES OPTION=SETVIEW
/++ GRID X0=0 Y0=500 Z0=0 DXG=20 DYG=20 DZG=1 NXG=101 NYG=51 NZG=1 FILE='forZgoubi' BINARY=NO FORMAT=2 F1=Y UNIT1G=LENGU F2=Z UNIT2G=LENGU F3=X UNIT3G=LENGU F4=0 UNIT4G=FLUXU F5=Bz UNIT5G=FLUXU F6=0 UNIT6G=FLUXU UNIT7G=1 UNIT8G=1 UNIT9G=1 UNIT10G=1 UNIT11G=1 UNIT12G=1
/++ yes
THREED TYPE=SURFACE VECTOR=NO XORIGIN=0 YORIGIN=800 ZORIGIN=100 ROTX=-180 ROTY=0 ROTZ=-180 XASPECT=1 YASPECT=1 ZASPECT=1 SIZE=1000 FACETANGLE=10 PERSPECTIVE=NO LINECOLOUR=YES OPTION=SETVIEW
//global WCS
SET XLOCAL=0 YLOCAL=0 ZLOCAL=0 TLOCAL=0,PLOCAL=0,SLOCAL=0 LOOK=ANYWHERE ABORT=YES
......@@ -9,43 +8,50 @@ SET XLOCAL=0 YLOCAL=0 ZLOCAL=0 TLOCAL=0,PLOCAL=0,SLOCAL=0 LOOK=ANYWHERE
$const #mm2cm 0.1
$const #T2kG 10.
$const #pi ATAN(1)*4
$const #r0 90. |//cm
$const #Dr 1. |//cm
$const #Dtheta 0.5 |//deg
$const #Dz 0 |//cm
//open output file
$open 1 forZgoubi_MOD22.dat overwrite
$format 1 fixed 16 6
$format 2 character 16
$const #R 1200 |//[mm] reference radius of the HRS
$const #FFE 600 |//[mm] fringe field extend (after the effective edge of the magnet, for the reference radius)
$const #Dr 15 |//[mm] step size in R
$const #Dth 0.5 |//[deg] step size in theta
$const #rmap #R+#FFE/COS(#pi/4.)
$const #rmin #rmap-390.
$const #rmax #rmap+300.
/++ R0,DR,DTTA,DZ
$assign 1 1 1 1
$write 1 #r0 #Dr #Dtheta #Dz
$open 1 zgoubi_TOSCAMOD22.dat overwrite
$format 1 fixed 16 6
$format 2 character 16
//Write the header zgoubi wants:
// R0,DR,DTTA,DZ
$assign 1 1 1 1
$write 1 #rmin*#mm2cm #Dr*#mm2cm #Dth 0.0
$assign 2 2 2 2 2 2
$write 1 'Y[cm]' 'Z[cm]' 'X[cm]' 'Br[kG]' 'Bth[kG]' 'Bz[kG]'
$write 1 'Y[cm]' 'Z[cm]' 'X[cm]' 'BY[kG]' 'BZ[kG]' 'BX[kG]'
//Write the field map:
$assign 1 1 1 1 1 1
/++ $do #r 900 1500 20
$do #r #r0/#mm2cm 1500 #Dr/#mm2cm
$do #th -25 115 #Dtheta
$do #r #rmin #rmax #Dr
$do #th 0 90 #Dth
$const #x #r*SIND(-#th+45.0)
$const #y #r*COSD(-#th+45.0)
$const #y #r*COSD(-#th+45.0)-#FFE/COS(#pi/4.)
$const #z 0
POINT XP=#x YP=#y ZP=0 COMP=bz
$write 1 #y*#mm2cm #z*#mm2cm #x*#mm2cm 0.0 BZ*#T2kG 0.0
/++ $write 1 #r*#mm2cm #th*#pi/180. #z*#mm2cm 0.0 0.0 BZ*#T2kG
$end do
$const #testR #r
$const #testTh #th
$end do
$close 1
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment