Code Comparison – Single Particles
Henry Nebrensky
Brunel University
(Preliminary, v. 0.5)
Motivation
MICE beamline simulations have been done using two codes:
• PSI Graphic TURTLE and TRANSPORT (1st, 2nd and 3rd order matrix ray tracing and beam propagation)
– Fast (min/Mpion), well-known
• Tom Roberts’ G4beamline (Geant4 based)
• Tom Roberts’ G4beamline (Geant4 based)
– New, has comprehensive scattering and trajectory physics, but slow (hours/Mpion)
For the same lattice, the output beam from Turtle in 3rd order was found to have emittance of 7.1 mm rad, while that from G4beamline (G4BL) was 11.7 mm rad . Also differences in profiles:
Common 30 mrad beam after B2
-2 -1 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
0 2 4 6 8 10 12 14 16
Q9 Q7 Q8
Q6 Q5
Q4 B2
1. http://www.isis.rl.ac.uk/accelerator/MICE/Task%20Notes%20and%20Specifications/beamline%20-%20optics/2007-06-07/TTlvG4BL_1stStage_JustNoDecData.xls -20
-19 -18 -17 -16 -15 -14 -13 -12 -11 -10 -9 -8 -7 -6 -5 -4 -3
-2 0 2 4 6 8 10 12 14 16
TTL NoDecIP + Qd Sli xrms(from 16599) TTL NoDecIP + Qd Sli yrms (from 16599) G4BL NoDec xms G4BL NoDec yrms
Identical input beams, scattering elements removed
Common 10 mrad beam after B2
-2 -1 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
0 2 4 6 8 10 12 14 16
Q9 Q7 Q8
Q5 Q6 Q4
B2
1. http://www.isis.rl.ac.uk/accelerator/MICE/Task%20Notes%20and%20Specifications/beamline%20-%20optics/2007-06-07/TTlvG4BL_1stStage_JustNoDecData.xls
-20 -19 -18 -17 -16 -15 -14 -13 -12 -11 -10 -9 -8 -7 -6 -5 -4 -3 -2
G4BL NoDec xrms G4BL NoDec yrms TTL NoDecIP + Qd Sli xrms (from 16599) TTL NoDecIP + Qd Sli yrms (from 16599)
Stopping down the beam removes differences
Common 30 mrad beam after B2 (rev. pol.)
-1 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
0 2 4 6 8 10 12 14 16
Q9 Q7 Q8
Q5 Q6 Q4
B2
1. http://www.isis.rl.ac.uk/accelerator/MICE/Task%20Notes%20and%20Specifications/beamline%20-%20optics/2007-07-24/TTlvG4BL_1stStage_JustNoDecData_postCM18_2.xls -20
-19 -18 -17 -16 -15 -14 -13 -12 -11 -10 -9 -8 -7 -6 -5 -4 -3 -2
-1 0 2 4 6 8 10 12 14 16
G4BL NoDec xrms p_rev G4BL NoDec yrms p_rev TTL NoDec QdSli prev xrms (from 16599) TTL NoDec QdSli prev yrms (from 16599)
N.B.Graph upside-down as quad polarities reversed (not the point… )
Turtle only in 2
ndorder (rev. pol.)
-2 -1 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
0 2 4 6 8 10 12 14 16
Q9 Q7 Q8
Q5 Q6 B2 Q4
1. http://www.isis.rl.ac.uk/accelerator/MICE/Task%20Notes%20and%20Specifications/beamline%20-%20optics/2007-07-24/TTlvG4BL_1stStage_JustNoDecData_postCM18_2.xls -20
-19 -18 -17 -16 -15 -14 -13 -12 -11 -10 -9 -8 -7 -6 -5 -4 -3 -2
G4BL NoDec xrms p_rev G4BL NoDec yrms p_rev TTL NoDe QS pr 1st&2nd xrms (fr 16599) TTL NoDe QS pr 1st&2nd yrms (fr 16599)
Dropping higher-order term removes differences
Single particle tracks - quadrupoles
Have sent groups of single particles through a single
MICE quad (Q4) with correct aperture, field strength, muon momentum etc.
But: no fringe fields, and no air.
Tested a series of input cases starting 2m before the quad, and looked at transverse momentum after the quad.
and looked at transverse momentum after the quad.
For “focussing”, the muon trajectories are confined to the focussing (x) plane, and the values of x’ after the quad are compared with a reference x’.
For “defocussing” the inbound muons start from the corresponding locations along the y axis, and their eventual y’ is compared with a reference y’.
Code comparison - quadrupoles
Have compared Turtle1 running in 1st and in 3rd order mode with Microsoft Excel implementations of the 1st order equations (e.g. Carey or Banford book) and of the 3rd order equations, both Smith’s2 as printed (incorrect) and the corrected versions3
1. Turtle: TurtleNT.exe computational part for Turtle Framework, v.
2.45 compiled by U. Rohrer (PSI), 22-Mar-2005 2.45 compiled by U. Rohrer (PSI), 22-Mar-2005
2. D.L. Smith: “Focusing Properties of Electric and Magnetic Quadrupole Lenses” NIM 79 pp.144-164 (1970)
3. G.E. Lee-Whiting: “Third-order aberrations of a magnetic quadrupole lens” NIM 83 pp.232-244 (1970);
G.E. Lee-Whiting: “Comparison of calculated third-order
aberrations of a magnetic quadrupole lens” NIM 99 pp.609-610 (1972)
Input Cases
In the following slides, the geometry for each case is
illustrated by the trajectories in just the focussing plane (from 3rd order Turtle), followed by a graph showing the differences in x’ (or y’ for defocussing) using the Excel 1st order model as the reference (an arbitrary choice).
choice).
It will be seen that cases B and H have been chosen such that the initial values of x or x’ (or y or y’) are zero, which drastically simplifies the 3rd order calculations, allowing Excel’s results to be confirmed by hand.
Case B - Collimated axial beam
5 10 15 20 25
x [cm]
-15 -10 -5 0
0.00 0.50 1.00 1.50 2.00 2.50 3.00 3.50 4.00 4.50 5.00
z [m]
Q4
Case B - Difference in final x' as we go off axis
0.50%
1.00%
1.50%
2.00%
Diff x' / x'
Smith’s formulae correct for case B
-0.50%
0.00%
0 2 4 6 8 10 12 14 16 18 20
Initial particle offset x [cm]
TTL_3 vs Excel 1st Order Focusing Excel 3rd vs Excel 1st Order Focusing TTL_1 vs Excel 1st Order Focusing TTL_3 vs Excel 1st Order Defocusing Excel 3rd vs Excel 1st Order Defocusing TTL_1 vs Excel 1st Order Defocusing Smith3rd vs Excel 1st Order Focusing
correct for case B
Case H - fan-in
0 20 40 60 80 100
x [cm]
Case H - Converging group, x’ 0 to 432 mrad
-100 -80 -60 -40 -20 0
0.00 0.50 1.00 1.50 2.00 2.50 3.00 3.50 4.00 4.50 5.00
z [m]
x [cm]
Q4
Converging group, x’ 0 to 432 mrad
Difference in final x' as we increase x' at entry
1.00%
2.00%
3.00%
4.00%
Diff x' / x'
Outermost muon not scraped in 3rd
order Turtle Smith formulae
already known to be wrong for case H
-4.00%
-3.00%
-2.00%
-1.00%
0.00%
0 50 100 150 200 250 300 350 400
Initial x'
Diff x' / x'
TTL_3 vs 1st (f) 3rd vs 1st (f) TTL_1 vs 1st (f) Smith3 vs 1st (f) TTL_3 vs 1st (d) 3rd vs 1st (d) TTL_1 vs 1st (d)
Case I - Off axis beam – x’ in is 400 mrad
Case I - off-axis beam
0 50 100 150
x [cm]
-150 -100 -50
0.00 0.50 1.00 1.50 2.00 2.50 3.00 3.50 4.00 4.50 5.00
z [m]
x [cm]
Q4
Difference in final x' across beam
0.00%
1.00%
2.00%
3.00%
4.00%
-5 -3 -1 1 3 5 7 9 11 13 15
Diff x' / x'
(Asymmetric beam scraping)
Off axis beam – x’ in is 400 mrad
-5.00%
-4.00%
-3.00%
-2.00%
-1.00% Offset across input beam
(i.e., x - 87 cm)[cm]
TTL_3 vs 1st (f) 3rd vs 1st (f) TTL_1 vs 1st (f) TTL_3 vs 1st (d) 3rd vs 1st (d) TTL_1 vs 1st (d)