Message: Re: Generated electron is not affected by static magnetic field? Not Logged In (login)
 Next-in-Thread Next-in-Thread
 Next-in-Forum Next-in-Forum

None Re: Generated electron is not affected by static magnetic field? 

Forum: Fields: Magnetic and Otherwise
Re: Question Generated electron is not affected by static magnetic field? (Kayo Matsuura)
Re: Idea Re: Generated electron is not affected by static magnetic field? (Michael H. Kelsey)
Re: Question Re: Generated electron is not affected by static magnetic field? (Kayo Matsuura)
Re: None Re: Generated electron is not affected by static magnetic field? (Tom Roberts)
Date: 04 Nov, 2014
From: John Apostolakis <John Apostolakis>

I confirm what Tom has surmised, and experimentally verified, regarding the propagation in unphysical or sharp fields.

In you wanted to simulate a field with a very sharp physical cutoff region, you would have to enclose it in a volume (solid). Only then could you guarantee that the propagation would stop at the (unphysical) edge of your field, and see the finite value inside it.

Put yourself in the shoes of the Geant4 class that deals with this.  At each step Geant4 must figure out what the value of the magnetic field is. To do this it samples the field at the initial step, the mid-point step of the proposed step and the endpoint.  Depending on the algorithm chosen for integration, it may also sample it at the quartile points and/or other intermediate points.  

If you have created a setup without fringe fields, there is no way for the propagation algorithm to know that a field exists at some "random"intermediate point on a (nearly straight line) trajectory.  The propagation will sample the value of the field at the few points selected - quartiles, midpoint and endpoint of the step.  If these all have zero field value, then the assumption is that there is no magnetic field at any point during the track.  

This has to be the case - if the propagation algorithm had to sample a large number of points between the starting point and the end point of a step, it would proceed very slowly even in regions where the field was really zero.  

If you want a fringe field within a limited region, you can reduce the maximum allowed step size within a particular volume. 

But as Tom found, even this will not be very stable if the field has a sharp discontinuity.  This is a bit harder to understand - but likely it is connected with the fragility mentioned above and the possibility that some steps will stop just inside the region of finite field (the effect of the field over a short segment is too small to be seen as a significant numerical error during the integration step which determines the endpoint of the step. )

John Apostolakis,  PH Department, CERN
SFT (SoFTware for Experiments) Group
Office: Building 32/ room R-003 (ground floor),  Mail: J27210
Email:       Office Tel:  +41-22-767-7239

On Oct 30, 2014, at 6:34 AM, Tom Roberts <> wrote:

> *** Discussion title: Fields: Magnetic and Otherwise
> This has to do with the difficulty of getting good results when
> attempting to simulate an unphysical world.
> A magnetic field as you describe, 6 mm wide with hard edges, cannot be
> constructed in the real world, and Geant4 has difficulty simulating it.
> There are two basic problems:
> 1) small features in the world require that steps be limited to comparable
>    size, or the features may be missed completely. Solids usually do not
>    have this problem, fields always do.
> 2) hard-edge fields always cause problems.
> You have mentioned (1), but not (2).
> To deal with (1) you need to limit steps to something less than 6 mm,
> perhaps a factor of 10 less.
> (2) can be seen this way: if a track happens to start a step right on
> the edge and remains in the field for the entire step, it will see
> nonzero field throughout the step and will get the result you expect. If
> the step spans the hard edge, the result can vary considerably,
> depending on how the integrator splits the step into integration points,
> and how those points just happen to fall relative to the hard edge of
> the field.
> The best way to avoid (2) is to not use hard-edge fields, use physical
> ones (i.e. satisfy Maxwell's equations, which rule out hard edges). A
> workaround that can work in some/many cases is to use a solid with a
> geometrical boundary right at the hard edge(s) -- this prevents any step
> from spanning the geometrical boundary, and thus spanning the hard edge
> of the field..
> In practice, without a boundary at the hard edge, (2) makes the result
> depend on stepsize. In a quick test I had to limit steps to 0.02 mm
> before the positions of tracks after the field had an accuracy of 0.1 mm
> (i.e. reducing stepsize further did not move them more than 0.1 mm).
> -------------------------------------------------------------
> Visit this GEANT4 at message (to reply or unsubscribe) at: 

 Add Message Add Message
to: "Re: Generated electron is not affected by static magnetic field?"

 Subscribe Subscribe

This site runs SLAC HyperNews version 1.11-slac-98, derived from the original HyperNews

[ Geant 4 Home | Geant 4 HyperNews | Search | Request New Forum | Feedback ]