Solenoid Particle Tracking

Solenoid Particle Tracking with Turtle type code 28 Solenoid Particle Tracking

Solenoid Particle Tracking The particle tracking is not done via the Turtle-native matrix formalism, but by solving the differential equation of motion in each short solenoid segment with the 4th order Runge-Kutta method (see F. Foroughi: Equation of motion of a charged particle in a magnetic and electrical field. PSI internal report, may 1990). The type code element 28 (Solenoid) is defined as following:

28. dz. Bz0. Bz1. Bz2. Br1. Br2. Br3. AR. /Labl/;

where dz is the length of the solenoid segment, and Bzi and Bri are the solenoid field expansion coefficients for the solenoid magnetic field in z- and r-direction at the beginning of each solenoid segment:

axial: Bz(r) = Bz0 + Bz1 * r**2 + Bz2 * r**4 for r<abs(AR) and Bz(r)=Bz(AR) for r>abs(AR)
radial: Br(r) = Br1 * r + Br2 * (exp(Br3 * r) - 1.) for r<abs(AR) and Br(r)=Br(AR) for r>abs(AR)

where AR is the aperture radius. If AR is negative, then the aperture constraint is not observed for this solenoid segment. The above formulas for the longitudinal and radial solenoid field expansions are empirical, but probably approximate values extracted from solenoid field maps of solenoids without iron shielding computed with TOSCA to an accuracy of better than a percent up to the aperture radius at all z-coordinates. Between the different type code 28. instructions there is no limitation on intervening instructions of any type code (e.g. histograms or a whole degrader. There are no checks; the user himself has to decide if these intervening instructions inside the solenoid are making sense.) In order to scale a given solenoid field-map computed for an arbitrary solenoid field strength (given by the values Bzi and Bri) to a desired strength the following type code 16 has been added:

16. 50. scaleB. ;

All used solenoid field strengths are multiplied with this factor. The coefficients Bzi and Bri may be computed with MINUIT-fits by using axial and radial distributions read out from a computed or measured (x,y,z)-map file.

Solenoid Particle Tracking As an example an ironless solenoid of 1 m length and 20 cm diameter is used for focusing protons of 0.1 GeV/c at a distance of 2.41 m (symmetric layout). The DOS-formatted solenoid field map sol10.mfo (has to be converted to binary form {sol10.map} with mfotomap.exe [Windows], mfotomap [Linux] or mfotomap.app [Mac OS X - X11]) was computed with the program TOSCA by V. Vrankovic (PSI), who also furnished the sample code mapread (for Linux), mapread.exe (for Windows) and mapread.app (for Mac OS X - X11) to read out the (Bx,By,Bz)-field vector at any (x,y,z)-point (view and download). The code mapread was modified (mapread2 for Linux, mapread2.exe for Windows or mapread2.app for Mac OS X - X11) to give either r- (= x-direction at y=0) or z-field distributions for different z-coordinates suitable as input files for MINUIT in order to fit the needed coefficients either in z- (view and download) or x- (view and download) direction. The tailored MINUIT routines fitx.exe / fitz.exe (for Windows), fitx / fitz (for Linux) or fitx.app / fitz.app (for Mac OS X -X11) was furnished by R. Scheuermann (PSI). For the different fitx.dat / fitz.dat (= xnnn.lis / znnn.lis) data files the input files fitx.in / fitz.in may have to be edited in order to adjust the 3 start values and step sizes for different z-coordinates.
(With ASCII files under Linux and Mac OS X - X11 pay attention to have only LF at the end of each line. The programs crlftolf.exe [Windows] crlftolf [Linux] and crlftolf.app [Mac OS X - X11] transform DOS/Windows ASCII-formatted files into UNIX-formatted ASCII files {without CR}, whereas the opposite is done with the program lftocrlf.exe under Windows.)

Sample run of the program mapread2 (mapread2.exe or mapread2.app):

$ crlftolf sol10.mfo (only needed for Linux and Mac OS X - X11)
sol10.mfo: initial length = 789002, new length = 772214
16788 <CR>s found in file
$ mfotomap sol10.mfo sol10.map
 conversion done.
$ mapread2 sol10.map

     Rotation angle      ->     0.0 (rot.all)
     Reflection indices  ->       1         1        -1
     Reference point  ->      0.000     0.000     0.000
     Starting point   ->   -140.000  -140.000  -118.000
     End point        ->    140.000   140.000   118.000
     Step size        ->      1.000     1.000     1.000

 Input direction x or z (def=x):
 Input z (def=   0.0): 55.
 Input x0, xmax, xinc (def=  0. 10.  1.)
  0.0      0.00    0.01
  1.0     12.91    0.13
  2.0     25.85    0.26
  3.0     38.81    0.39
  4.0     51.78    0.52
  5.0     64.67    0.65
  6.0     77.26    0.77
  7.0     89.18    0.89
  8.0     99.82    1.00
  9.0    108.30    1.08
 10.0    113.62    1.14
 Input direction x or z (def=x):
.
.
.

Turtle input file for the solenoid represented by the map sol10.map. Note that the z-field is symmetric to the midplane whereas the r-field is anti-symmetric to this plane (This means that the type-code 28 sequence starts with negative radial solenoid field values because the axial solenoid field values are positive).

/Test solenoid ray tracing tc28/

1000000

1. .1 150. .1 150. 0. 0.0 0.1 /BEAM/ ;
13. 10. ;
16. 190. 0. 100. ;

16. 50. 0.01445 /SCAL/ ;

28. 0.08   4.04 -0.0015  0.0      -0.0637  0.0    0.210 -10.0 /H1/ ;
28. 0.10   5.30 -0.0023  0.0      -0.0924  0.0    0.210 -10.0 /H2/ ;
28. 0.10   7.81 -0.0048  0.000002 -0.158   0.0    0.210 -10.0 /H3/ ;
28. 0.10  12.35 -0.0109  0.000006 -0.323   0.0416 0.224 -10.0 /H4/ ;
28. 0.10  21.73 -0.0306  0.000026 -0.730   0.168  0.210 -10.0 /H5/ ;
28. 0.05  45.11 -0.1093  0.000139 -2.096   0.832  0.202 -10.0 /H6/ ;
28. 0.05  71.26 -0.2295  0.000326 -3.959   1.868  0.203 -10.0 /H7/ ;
28. 0.05 121.50 -0.4844  0.000537 -7.514   2.007  0.252 -10.0 /H8/ ;
28. 0.03 172.70 -0.6834 -0.000026 -10.56   0.602  0.372 -10.0 /H9/ ;
28. 0.02 219.05 -0.7169 -0.00185  -12.98   0.0128 0.715 -10.0 /H10/ ;
28. 0.03 305.56 -0.0771 -0.009892 -16.37  -0.5038 0.483  10.0 /H11/ ;
28. 0.02 374.73  0.0     0.0      -17.01  -0.427  0.585  10.0 /H12/ ;
28. 0.03 474.34  0.4393  0.006371 -15.40  -0.5266 0.390  10.0 /H13/ ;
28. 0.02 530.47  0.7066  0.00197  -12.97   0.0129 0.715  10.0 /H14/ ;
28. 0.03 596.07  0.6185 -0.000278 -9.467   1.131  0.314  10.0 /H15/ ; 
28. 0.02 627.83  0.4838 -0.000523 -7.49    1.954  0.254  10.0 /H16/ ;
28. 0.05 677.88  0.2303 -0.000325 -3.889   1.600  0.213  10.0 /H17/ ;
28. 0.05 703.77  0.1104 -0.000140 -2.051   0.740  0.210  10.0 /H18/ ;
28. 0.05 718.03  0.0569 -0.000059 -1.150   0.343  0.210  10.0 /H19/ ;
28. 0.05 726.33  0.0321 -0.000027 -0.674   0.163  0.210  10.0 /H20/ ;
28. 0.05 731.32  0.0197 -0.000013 -0.403   0.0846 0.210  10.0 /H21/ ;
28. 0.05 734.28  0.0134 -0.000005 -0.230   0.0723 0.210  10.0 /H22/ ;
28. 0.05 735.85  0.0107 -0.000005 -0.1     0.0010 0.210  10.0 /H23/ ;
28. 0.05 736.34  0.0098 -0.000004  0.0     0.0    0.210  10.0 /H24/ ;
28. 0.05 735.85  0.0107 -0.000005  0.1    -0.0010 0.210  10.0 /H23/ ;
28. 0.05 734.28  0.0134 -0.000005  0.230  -0.0723 0.210  10.0 /H22/ ;
28. 0.05 731.32  0.0197 -0.000013  0.403  -0.0846 0.210  10.0 /H21/ ;
28. 0.05 726.33  0.0321 -0.000027  0.674  -0.163  0.210  10.0 /H20/ ;
28. 0.05 718.03  0.0569 -0.000059  1.150  -0.343  0.210  10.0 /H19/ ;
28. 0.05 703.77  0.1104 -0.000140  2.051  -0.740  0.210  10.0 /H18/ ;
28. 0.05 677.88  0.2303 -0.000325  3.889  -1.600  0.213  10.0 /H17/ ;
28. 0.02 627.83  0.4838 -0.000523  7.49   -1.954  0.254  10.0 /H16/ ;
28. 0.03 596.07  0.6185 -0.000278  9.467  -1.131  0.314  10.0 /H15/ ; 
28. 0.02 530.47  0.7066  0.00197  12.97   -0.0129 0.715  10.0 /H14/ ;
28. 0.03 474.34  0.4393  0.006371 15.40   +0.5266 0.390  10.0 /H13/ ;
28. 0.02 374.73  0.0     0.0      17.01   +0.427  0.585  10.0 /H12/ ;
28. 0.03 305.56 -0.0771 -0.009892 16.37   +0.5038 0.483  10.0 /H11/ ;
28. 0.02 219.05 -0.7169 -0.00185  12.98   -0.0128 0.715 -10.0 /H10/ ;
28. 0.03 172.70 -0.6834 -0.000026 10.56   -0.602  0.372 -10.0 /H9/ ;
28. 0.05 121.50 -0.4844  0.000537  7.514  -2.007  0.252 -10.0 /H8/ ;
28. 0.05  71.26 -0.2295  0.000326  3.959  -1.868  0.203 -10.0 /H7/ ;
28. 0.05  45.11 -0.1093  0.000139  2.096  -0.832  0.202 -10.0 /H6/ ;
28. 0.10  21.73 -0.0306  0.000026  0.730  -0.168  0.210 -10.0 /H5/ ;
28. 0.10  12.35 -0.0109  0.000006  0.323  -0.0416 0.224 -10.0 /H4/ ;
28. 0.10   7.81 -0.0048  0.000002  0.158   0.0    0.210 -10.0 /H3/ ;
28. 0.10   5.30 -0.0023  0.0       0.0924  0.0    0.210 -10.0 /H2/ ;
28. 0.08   4.04 -0.0015  0.0       0.0637  0.0    0.210 -10.0 /H1/ ;
28. 0.0    4.04 -0.0015  0.0       0.0637  0.0    0.210 -10.0 /H0/ ;

51. 1. -10. 10. 1. ;
52. 3. -10. 10. 1. ;

51. 1. -.5 .5 .025 ;
52. 3. -.5 .5 .025 ;

51. 1. -.5 .5 .025 ;
52. 2. -150. 150. 7.5 ;

51. 3. -.5 .5 .025 ;
52. 4. -150. 150. 7.5 ;
 
SENTINEL
SENTINEL

The following picture shows the 4 requested contour plots. Well recognizable are the spiraling shapes of the contour lines in the (x,x')- and (y,y')-phase space, which are due to higher order aberrations. The spot size diameter is almost 2 times larger than with first order computations only (see below). Solenoid Particle Tracking

In order to compare the above results with computations done for the same solenoid represented via the traditional type code 19 (1st order only), the following input code may be used:

/Test solenoid ray tracing tc19/

100000

1. .1 150. .1 150. .0 .0 0.1 /BEAM/ ;
16. 190. 0. 100. ;
13. 10. ;

3. .25 ;
3. .25 ;
3. .18 ;

6. 1. 10. 3. 10. ;
19. 0. 10.211 /H/ ;
19. .1 10.211 /H/ ;
19. .1 10.211 /H/ ;
19. .1 10.211 /H/ ;
19. .1 10.211 /H/ ;
19. .1 10.211 /H/ ;
6. 1. 10. 3. 10. ;
19. .1 10.211 /H/ ;
19. .1 10.211 /H/ ;
19. .1 10.211 /H/ ;
19. .1 10.211 /H/ ;
19. .1 10.211 /H/ ;
19. 0. 10.211 /H/ ;
6. 1. 10. 3. 10. ;

3. .25 ;
3. .25 ;
3. .18 /END/ ;

51. 1. -10. 10. 1. ;
52. 3. -10. 10. 1. ;

51. 1. -.5 .5 .025 ;
52. 3. -.5 .5 .025 ;

51. 1. -.5 .5 .025 ;
52. 2. -150. 150. 7.5 ;

51. 3. -.5 .5 .025 ;
52. 4. -150. 150. 7.5 ;

SENTINEL
SENTINEL

The following picture shows the 4 requested contour plots: Solenoid Particle Tracking

Addendum:
If paraxial rays represented with the beam- and shift-instructions:

  1.0 .001 .001 .001 .001 .0 .0 .1 /BEAM/ ;
  7.0 x0. 0. y0. 0. 0. 0. ;
are tracked through the solenoid, then the location of the picture points at the end of the solenoid field are rotated by about 90 degrees around the z-axis. This corresponds to the formula [see A. J. Dragt: Numerical third-order transfer map for solenoid in Nuclear Instruments and Methods in Physics Research A298 (1990) 441-459, formulas (15), (37) and (50)]:

Theta = Integral(Bz * dz) / (2 * Bero) = (735.85 * 0.01445 kG * 1 m) / (2. * 33.33 * 0.1 kGm) = 1.6 (=90 deg)

Solenoid Particle TrackingSolenoid Particle Tracking Back to:Solenoid Particle TrackingRecent Turtle modification history
Solenoid Particle TrackingSolenoid Particle Tracking Last updated by Urs Rohrer on 8-Feb-2006