Hello, i'm using geant4 for a simulation of a magnetic spectrometer and i have the following questions: 1) Running 2000 protons with enrgy 5 GeV, 7 Gev and 10 GeV i obteined the following message G4PropagateInField: Warning: Looping particle. I did'n have that message for others running, from 100 MeV to 1000 GeV. What has happened?? 2)Which is the default value of the step length? I' ve looked on line but i didn't find anything. If i need, how can i change it? I sow two functions SetStepLength in G4Step and G4Track and i didn't understand which i should use. Can you help me, please?? Thanks so much, Annamaria Galante
Hello, 1) What has happenned is that for a particular track the propagation in the magnetic field is taking a large number of steps. Likely a low energy track is in an area of strong field -- and tried to do more than the current maximum number of integration steps during one Geant4 tracking step. I expect that you have large volumes with near-vacuum or low density gas in your setup and that it is occuring in one of these: interactions will occur at large intervals, and there is more chance for a low energy track to 'loop'. The message should also print out the energy of the particle in question. Please check to see that you do find this, and let me know whether there is other relevant information that you may wish to see when such a message is printed. Likely such a particle is not important for your application, in which case you can ignore the message - especially if it is not frequent. Otherwise you can set the maximum number of integration sub-steps that can be taken by a particle before it is abandoned as a 'looping particle'. To change this value, you can use the following method of G4PropagatorInField: void SetMaxLoopCount( G4int new_max ); // A maximum for the number of steps that a (looping) particle can take. 2) The methods in G4Step and G4Track are not for the user, but for the Geant4 system to set the current step size, once it is decided by the SteppingManager after polling applicable physics processes and the Transportation for moving the particle in the model geometry. If you wish to limit the size of steps in Geant4, please see the discussion of G4UserLimits in the documentation: http://geant4.web.cern.ch/geant4/G4UsersDocuments/UsersGuides/ForApplicationDeveloper/html/TrackingAndPhysics/thresholdVScut.html I hope that these suggestions will assist you. Regards, John Apostolakis