Commit 7393f29b authored by Thomas Planche's avatar Thomas Planche

straighted out the TOSCA directory

parent 9d09e53a
......@@ -35,7 +35,7 @@ zgoubi HRS tuto: DIPOLE
1 0
'FIT'
'FIT'
1 !Number of physical parameters to be varied
3 36 -3.020 0.1 !element#4 (DIPOLE); parameter #36 (exit edge angle); inverse (minus sign) correlation with element#4 parameter#20 (entrance edge angle); relative range
2 1e-11 100 !Number of constraints; Convergence threshold; maximum number of iterations
......
This diff is collapsed.
**HRS FIT TOSCA map radial position, and adjust map scaling factor
'OBJET'
543.687 !60 keV U1+ = 546.198
5 !5: generate 11 particles used to calculate transfer matrix ('MATRIX')
0.1 10. 0.1 10. 0.01 0.01 !step size in Y; T; Z; P; S; D
0.0 0. 0. 0. 0. 1.
'DRIFT'
21.551546
'TOSCA'
0 2 !print the map (no print = 0); output along partile(s) trajectory(ies) = 2 (no print = 0)
1.0318 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
181 93 1 22. ! Nb of nodes in Theta; R; Z (=1 for 2D map); MOD(see manual, =0 for Cartesian, with mid-plane symmetry)
TOSCAMOD22.map !File name
0 0 0 0. ! ID (see manual);
4 !IORDRE(=2, 4 or 25 if 2D, unused if 3D)
0.5 !Integration step size[cm]
2 !KPOS, normally=2
180.12461 0. 180.12461 0. !RE fitted to be equal to RS; TE=0 because the map opening = the bending angle = 90 deg; RS=RE; TS=-TE
'DRIFT'
20.0
'MATRIX'
1 0 !order of the matrix/map; 0:means calculate the matrix here
'FIT'
2 !Number of physical parameters to be varied
2 1 0.0 0.5 !element#2 (DRIFT); parameter #1; correlation set so that RE=RS (which is parameters#72 of element #2); allowed variation +/- 50%
3 70 3.072 0.5 !element#3 (TOSCA); parameter #70 (RE); correlation set so that RE=RS (which is parameters#72 of element #2)
3 1e-11 100 !Number of constraints; Convergence threshold; maximum number of iterations
1 1 1 5 0.0 10. 0 !transfer matrix; matrix element 1 1; FIT after element#12 ('MATRIX');Wanted value(=0.0); Weigth ; 0:no additional parameters
1 2 2 5 0.0 10. 0 !transfer matrix; matrix element 2 2; FIT after element#12 ('MATRIX');Wanted value(=0.0); Weigth ; 0:no additional parameters
3 1 2 5 0.0 1. 0 !3:particle coordinate; 1: particle #1; 2: Y(i.e. R); where?:at the end of element #2; wanted value=0.0; weight; 0:no additional parameters
'END'
This diff is collapsed.
set term postscript eps color enhanced "Times-Roman" 18 lw 2
set output "RThplot.eps"
set xlabel 'Theta/deg.'
set ylabel 'R/cm'
set key top left
cm2mm=10.0
set xrange[-45:45]
set yrange[180:215]
set key at -25, 190
plot "Bscale1_zgoubi.plt" using ($22/pi*180.):($10) with p pt 7 ps 0.35 lc 1 notitle,\
"" with l lc 1 lw 2 title "B scale = 1",\
"zgoubi.plt" using ($22/pi*180.):($10) with p pt 7 ps 0.35 lc 2 notitle,\
"" with l lc 2 lw 2 title "B scale = 1.0318",\
120+60*sqrt(2) w l lw 0.5 lt 2 lc 0
../TOSCAMOD22.map
\ No newline at end of file
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
/home/tplanche/text/designs/HRS/opera/dipole_notFinalModel/geneMap.comi
\ No newline at end of file
//set global coordinate system
SET XLOCAL=0 YLOCAL=0 ZLOCAL=0 TLOCAL=0,PLOCAL=0,SLOCAL=0 LOOK=ANYWHERE ABORT=YES
//calculate a bunch of constants
$const #mm2cm 0.1
$const #T2kG 10.
$const #pi ATAN(1)*4
$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/2. |//[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.
//Open output file
$open 1 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]' 'BY[kG]' 'BZ[kG]' 'BX[kG]'
//Write the field map:
$assign 1 1 1 1 1 1 1 1
$do #r #rmin #rmax #Dr
$do #th 0 90 #Dth
$const #x #r*SIND(-#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 #r Sqrt(#x**2+#y**2)
$end do
$const #testR #r
$const #testTh #th
$end do
//Close output file
$close 1
../TOSCAMOD22.map
\ No newline at end of file
This diff is collapsed.
** HSR using TOSCA, FIT drift length
'OBJET'
'OBJET'
546.198 !546.198, 554.660 for a 3% mass difference (for plotting)
2 !2: All the initial coordinates must be entered explicitly
1 1 !total number of particles; number of distinct momenta
0. 0.1 0. 0. 0. 1. ’o’ !Y; T; Z; P; S; D; 'marker'
1 !1 or -9 (-9 disables the tracking of this particle)
'FAISTORE'
'FAISTORE'
ref_entrance.fai
1
'DRIFT'
21.468637
'DRIFT'
21.516804
'FAISTORE'
'FAISTORE'
ref_entrance.fai
1
'TOSCA'
0 2 !print the map (no print = 0); output along partile(s) trajectory(ies) = 2
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
'TOSCA'
0 0 !print the map (no print = 0); output along partile(s) trajectory(ies) = 2 (no print = 0)
1.0318 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
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)
../TOSCAMOD22.dat !File name
181 93 1 22. ! Nb of nodes in Theta; R; Z (=1 for 2D map); MOD(see manual, =0 for Cartesian, with mid-plane symmetry)
TOSCAMOD22.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
180.13967 0. 180.13967 0. !RE has been fitted to be =RS; TE=0 because the map opening = the bending angle = 90 deg; RS=RE; TS=-TE
180.12483 0. 180.12483 0. !RE fitted to be equal to RS; TE=0 because the map opening = the bending angle = 90 deg; RS=RE; TS=-TE
'FAISTORE'
'FAISTORE'
ref_mid.fai
1
'DRIFT'
'DRIFT'
20.
'FAISTORE'
'FAISTORE'
ref_mid.fai
1
'DRIFT'
'DRIFT'
20.
'FAISTORE'
'FAISTORE'
ref_mid.fai
1
'TOSCA'
0 0 !print the map (no print = 0); output along partile(s) trajectory(ies) = 2
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
'TOSCA'
0 0 !print the map (no print = 0); output along partile(s) trajectory(ies) = 2 (no print = 0)
1.0318 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
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)
../TOSCAMOD22.dat !File name
181 93 1 22. ! Nb of nodes in Theta; R; Z (=1 for 2D map); MOD(see manual, =0 for Cartesian, with mid-plane symmetry)
TOSCAMOD22.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
180.13967 0. 180.13967 0. !RE has been fitted to be =RS; TE=0 because the map opening = the bending angle = 90 deg; RS=RE; TS=-TE
180.12483 0. 180.12483 0. !RE fitted to be equal to RS; TE=0 because the map opening = the bending angle = 90 deg; RS=RE; TS=-TE
'FAISTORE'
ref_exit.fai
1
'DRIFT'
21.468637
'DRIFT'
21.516804
'FAISTORE'
......
../TOSCAMOD22.map
\ No newline at end of file
zgoubi HRS tutorial: TOSCA
'OBJET'
543.687 !543.687 or 543.701 and not 543.714, since we are aiming for a mass resolution of 20000 and not momentum resolution of 20000
3.01 !read from particles from
1 3000 1 !IP1; IP2; IPStep (Read particles numbered IT1 to IT2, step ITStep)
1 1 1 !not used here
1. 1. 2. 0.25 1. 1. 1. * !scaling factors on Y,T,Z,P,S,DP
0 0 0 0 0 0 0 ! not used here
0 ! not sure what this one does
noEspread.beam ! name of the input file
'DRIFT'
21.516804
'TOSCA'
0 0 !print the map (no print = 0); output along partile(s) trajectory(ies) = 2 (no print = 0)
1.0318 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
181 93 1 22. ! Nb of nodes in Theta; R; Z (=1 for 2D map); MOD(see manual, =0 for Cartesian, with mid-plane symmetry)
TOSCAMOD22.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
180.12483 0. 180.12483 0. !RE fitted to be equal to RS; TE=0 because the map opening = the bending angle = 90 deg; RS=RE; TS=-TE
'DRIFT'
20.0
'DRIFT'
20.0
'TOSCA'
0 0 !print the map (no print = 0); output along partile(s) trajectory(ies) = 2 (no print = 0)
1.0318 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
181 93 1 22. ! Nb of nodes in Theta; R; Z (=1 for 2D map); MOD(see manual, =0 for Cartesian, with mid-plane symmetry)
TOSCAMOD22.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
180.12483 0. 180.12483 0. !RE fitted to be equal to RS; TE=0 because the map opening = the bending angle = 90 deg; RS=RE; TS=-TE
'DRIFT'
21.516804
'FAISCNL'
twomasses.fai
'REBELOTE'
1 0.1 0 1
1
1 1 543.701
'END'
This source diff could not be displayed because it is too large. You can view the blob instead.
This diff is collapsed.
set term postscript eps color enhanced "Times-Roman" 18 lw 2
set output "twomasses.eps"
set xlabel 'X/mm'
set ylabel "X'/mrad"
#set grid
titletext="Horizontal and vertical emittance: 3{/Symbol m}m, no DE/E, m/Dm=20000 \n"
set title titletext
cm2mm=10.0
set key at -0.15, 5
set xrange [-1.:1.0]
set yrange [-60:60]
plot "twomasses.fai" u ($10*cm2mm):($37==543.687 ? $11:1/0) w points pt 7 ps 0.2 lc 1 notitle, \
"" w points pt 7 ps 0.7 lc 1 title "^{238}U mass ", \
"" u ($10*cm2mm):($37==543.701 ? $11:1/0) w points pt 7 ps 0.2 lc 2 notitle ,\
"" w points pt 7 ps 0.7 lc 2 title "^{238}U mass*20001/20000"
../TOSCAMOD22.map
\ No newline at end of file
This diff is collapsed.
set term postscript eps color enhanced "Times-Roman" 18 lw 2
set output "thinBeam.eps"
set xlabel "X/mm"
set ylabel "X'/mrad"
set grid
titletext="HRS 'pure separetor'"
plot "zgoubi.fai" u 10:11 with points lc 0 pt 5 ps 0.5 title "Multipole OFF"
'OBJET'
543.687 !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.
'DRIFT'
21.516804
'TOSCA'
0 0 !print the map (no print = 0); output along partile(s) trajectory(ies) = 2 (no print = 0)
1.0318 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
181 93 1 22. ! Nb of nodes in Theta; R; Z (=1 for 2D map); MOD(see manual, =0 for Cartesian, with mid-plane symmetry)
TOSCAMOD22.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
180.12483 0. 180.12483 0. !RE fitted to be equal to RS; TE=0 because the map opening = the bending angle = 90 deg; RS=RE; TS=-TE
'DRIFT'
20.0
'DRIFT'
20.0
'TOSCA'
0 0 !print the map (no print = 0); output along partile(s) trajectory(ies) = 2 (no print = 0)
1.0318 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
181 93 1 22. ! Nb of nodes in Theta; R; Z (=1 for 2D map); MOD(see manual, =0 for Cartesian, with mid-plane symmetry)
TOSCAMOD22.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
180.12483 0. 180.12483 0. !RE fitted to be equal to RS; TE=0 because the map opening = the bending angle = 90 deg; RS=RE; TS=-TE
'DRIFT'
21.516804
'FAISTORE'
zgoubi.fai
1
'END'
../../DIPOLE/edge-curvature/twomasses.eps
\ No newline at end of file
../../DIPOLE/curved-edge/twomasses.eps
\ No newline at end of file
../../DIPOLE/plot-multiparticles/twomasses.eps
\ No newline at end of file
../../DIPOLE/multiparticle-straight-edge/twomasses.eps
\ No newline at end of file
No preview for this file type
......@@ -323,12 +323,15 @@
'END'
\end{lstlisting}
Figure~\ref{fig:twomassesCurv} is obtained by plotting the output file output-particles.fai for two masses different by 1 part in 2$\cdot10^4$ (i.e.\ $B\rho$ different by 1 part in 4$\cdot10^4$), see~\href{https://gitlab.triumf.ca/beamphys/hrs/tree/master/DIPOLE/edge-curvature}{link}.
\begin{figure}[htb]
\centering
\includegraphics*[width=1.0 \linewidth]{figure/twomasses-edgeCurvature}
\caption{Two beams with a relative mass difference of 1/20\,000 through the HRS, with a pole edge curvature of 227.0\,cm.}\label{fig:twomassesCurv}
\end{figure}
\end{figure}\FloatBarrier
Figure~\ref{fig:twomassesCurv} is obtained by plotting the output file output-particles.fai for two masses different by 1 part in 2$\cdot10^4$ (i.e.\ $B\rho$ different by 1 part in 4$\cdot10^4$), see~\href{https://gitlab.triumf.ca/beamphys/hrs/tree/master/DIPOLE/curved-edge}{link}.
Figures~\ref{fig:twomassesInit} and~\ref{fig:twomassesCurv} are plotted with the same scale for easy comparison. With the dipole edge curvature, the two beam are almost separated: it is only for the angles larger than 40\,mrad that the two beam still overlap. Higher order correction is needed to achieve complete separation: this is going to be the topic of the next tutorial.
......
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