INFN homepage
FLUKA: MGNFIELD Previous Index Next


     sets the tracking conditions for transport in magnetic fields and
     also may define an homogeneous magnetic field.


= largest angle in degrees that a charged particle is allowed to travel in a single step
= 57 deg (but a maximum of 30 deg is recommended!)
= upper limit to the error of the boundary iteration in cm (minimum accuracy accepted in determining a boundary intersection). It also sets the minimum radius of curvature for stepping according to
= 0.05 cm
= minimum step length if the step is forced to be smaller because the angle is larger than
= 0.1 cm
= Bx, By, Bz components of magnetic field on the coordinate axes (in tesla).
(Bx = By = Bz = 0.0): user-supplied subroutine MAGFLD is assumed to provide the actual values (see Notes 2 and 3 below)
= RUNGKUTT the 4th order Runge-Kutta-Gill algorithm is used for dis-homogeneous magnetic fields in vacuum instead of the standard, arc-like, algorithm
= no
(option MGNFIELD not given): the defaults indicated for WHAT(1-6) apply if a magnetic field exists in the current region because of an ASSIGNMA command.
1) If Bx = By = Bz = 0, the user-written subroutine MAGFLD is called at each step to get the direction cosines and the module (in tesla) of the magnetic field as a function of region or of coordinates. A sample subroutine is provided with the FLUKA code; instructions on how to write user-supplied routines can be found in 13}. 2) Note that the argument list of subroutine MAGFLD is ( X, Y, Z, T, BTX, BTY, BTZ, B, NREG, IDISC ) where BTX, BTY, BTZ are the DIRECTION COSINES of the magnetic field at point X, Y, Z, at time T (NOT the components of the field! The field magnitude is given by B). For this reason, it is imperative that MAGFLD returns normalised values of BTX, BTY and BTZ such that the sum of their squares is = 1.0 IN DOUBLE PRECISION. Three zero values are not accepted: if the field is zero at the point in question, you must return for instance 0, 0, 1 and B = 0. On the contrary, note that Bx, By, Bz in the MGNFIELD option, given by
as described above, are the field components and not the cosines. 3) Magnetic field tracking is performed only in regions defined as magnetic field regions by command ASSIGNMAt. It is strongly recommended to define as such only regions where a magnetic field effectively exists, due to the less efficient and accurate tracking algorithm used in magnetic fields. To define a region as having a magnetic field and to return systematically B = 0 in that region via subroutine MAGFLD, is not allowed. 4) The maximum error on the boundary iteration,
, must be compatible with the minimum linear dimension of any region. 5) It is recommended to activate also option STEPSIZE inside and close to regions where a magnetic field is present. That option can be used to set a minimum and a maximum step size (in cm) for every region. 6) In case of conflict,
overrides the step size requested by option STEPSIZE. Therefore, it is suggested to set it not larger than the latter. The purpose of this constraint is to avoid tracking in detail low-energy particles along a helix of very small radius, by forcing several tours into a single step (all the energy will be deposited at the same point). Example (number based):
ASSIGNMAT 2.0 15.0 30.0 5.0 1.0 0.0
* A magnetic field is present in vacuum regions 15, 20, 25 and 30.
MGNFIELD 20.0 0.2 0.10 0.0 0.0 0.0 STEPSIZE -0.05 0.0 20.0 25.0 0.0 0.0 STEPSIZE 0.3 0.0 15.0 0.0 0.0 0.0
* The maximum deviation angle due to magnetic field in any step is set
* = 20 degrees, and boundary crossings must be identified with an error
* not larger than 2 mm. If the max. angle constraint forces the step to
* be shorter than 10 cm, the step will be set = 10 cm in region 20, 25, 30,
* but will be set = 3 mm in region 15 (
of STEPSIZE overrides the
* general setting due to
of MGNFIELD). Whatever the size of the
* step, however, the accuracy of the boundary crossing position must be
* equal or better than 0.5 mm in regions 20 and 25 (probably contiguous,
* since the same accuracy must be set for regions on either side of a
* boundary). The value of the magnetic field will be provided at each
* step by the user routine MAGFLD.
The same example, name based:
ASSIGNMAT VACUUM Reg15th Reg30th 5.0 1.0 0.0 MGNFIELD 20.0 0.2 0.10 0.0 0.0 0.0 STEPSIZE -0.05 0.0 Reg20th Reg25th 0.0 0.0 STEPSIZE 0.3 0.0 Reg15th 0.0 0.0 0.0

Previous Index Next