IntegratorQuadrupole gives NaNs and infinite loop for bunch tests in fieldmaps branch

Issue #149 resolved
Jochem Snuverink created an issue

2_bunchtest_Gauss (and some other bunch tests as well) produce NaNs in the QuadStepper:

61: -------- WWWW ------- G4Exception-START -------- WWWW -------
61: *** G4Exception : GeomField0003
61:       issued by : G4ChordFinder::FindNextChord()
61: Exceeded maximum number of trials= 300
61: Current sagita dist= nan
61: Step sizes (actual and proposed):
61: Last trial =         4.33911e-297
61: Next trial =         4.33911e-298
61: Proposed for chord = 8.67823e-297

Comments (3)

  1. Laurie Nevay

    The change that started this problem was that I moved the normalisation of field strengths from BDSComponentFactory into the integrator and field class constructors. This simplified the writing out of strengths and they represented what they were called. I forgot to move the normalisation to the integrator constructors. So, for example, the field gradient was 1e6 times too strong for the quadrupole for example.

    This appears to be fixed now, but I don't think nans should have been produced at all. It may be that this tended to a very small distance and led to poor calculations.

  2. Laurie Nevay

    This was due to a missing units factor in recent refactoring leading to a field 1M times stronger for quadrupoles.

  3. Log in to comment