Re: [fluka-discuss]: Magfld file problem

From: Paola Sala <paola.sala_at_mi.infn.it>
Date: Mon, 6 Jan 2014 15:20:30 +0100

Dear Dilek

the magfield routine should returrn the direction and MODULE of the
magnetic field, where the module is a non-negative number. In your
routine, you set B to a negative value, that is ignored by the tracking
routines. You should instead provide a POSITIVE B , and set BTY=-ONEONE to
have it directed in the negative y direction.
Besides this, you used the "transform" directives in the geometry to place
and tilt your magnets, but you do not apply any transformation in the
magfld.f routine, thus your calculation of the field will not correspond
to the position in the magnets. The magfld routine and the tracking
routines use the coordinates of the particle in the global geometry ,
while you are calculating the fields as if the magnet axis were on the z
axis, in a non-rotated frame. Both the modulus and the direction of the
field are coming out wrong.
 To do things correctly, you can do, for instance,
* define local coordinates
      Xs = X
      Ys = Y
      Zs = Z
* transform them to the system where the magnet is along z-axis
* applying the inverse of the rotation applied to the magnet
* (where krotat is the number of the transformation used for this magnet)
      CALL UNDOTR (1, Xs, Ys, Zs, KROTAT)
*** ...
 *** here calculate B, Btx, Bty, BtZ using xs,ys,zs
** ...
* now transform the cosines of the field to the global system, using the
*rotation only, not the full roto-translation
      CALL DORTNO ( 1, BTX, BTY, BTZ, KROTAT)


( for your information, the full direct transformation is obtained by
calling the DOTRSF routine)


Another issue: in the comments of the magfld you wite "p=30 MeV" , but in
the input you set the kinetic energy equal to 30 MeV , that is not the
same.


Hope it helps
Paola

> Dear Fluka experts,
> I am a fluka beginner and I have a problem with bendưng of particles in a
> magnetic field in my design.
>
> I want to bend particles by using dipoles and I want to enlarge the beam
> by using quadrupoles. However after the first dipole, the direction of
> particles remain same and varying the magnitude of magnetic field in
> dipole doesn't have any effect.
>
> I attached my input file and magfld.f file.
>
> Any suggestions or comments will be appreciated.
>
> Thank you very much in advance.
> Best Regards,
>
>
> Dilek
>
>


Paola Sala
INFN Milano
tel. Milano +39-0250317374
tel. CERN +41-227679148
Received on Mon Jan 06 2014 - 16:21:00 CET

This archive was generated by hypermail 2.3.0 : Mon Jan 06 2014 - 16:21:01 CET