I am working on a specific simulation that is modified from the Magnetic Monopole code in Geant4 (/extended/exoticphysics/monopole). This simulation contains the geometry of a long (2-3m), thin (~1mm) cylindrical pipe made from Beryllium. I am propagating monopoles, initially from vacuum, towards the pipe. The simulation has a strong magnetic field of a few teslas along the z direction. The trajectories are curved due to the magnetic field. I understand that in vacuum, the monopole is expected to take a very long steps, if any. However, when it enters the beryllium volume (1mm thickness), I should be able to control the step length and the number of steps it takes in the volume, before the particle exits. However, no amount of stepping parameters that I change has any effect on the step-size.
I have attached
the stepping verbose of two monopoles, which take 3-4 steps in the pipe volume before they exit. I would like to decrease the step size and have the particles take a larger number of steps in the simulation (sure, it will increase the simulation time, but also the accuracy of results).
For decreasing the step-size, thus far, I’ve tried the following (but the modification does not affect the simulation).
In the FieldSetup source file (attached), I have changed the fMinStep value of 1mm (default) to a much lower value.
I included other parameters (from the application developers guide) such as deltaChord, deltaOneStep, deltaIntersection, epsMin, epsMax.
I have also written a DetectorMessenger with a function SetMaxStepSize (defined in DetectorConstruction) and set it to 0.0001mm using a macro file.
In the G4mplIonisationWithDeltaModel source code (for monopole ionization), I have changed the emin (LowEnergyLimit) to a very low value ~eV to lower the thresholds in the simulation.
Similarly, in G4MonopoleTransportation, I had lower the value of fThreshold_Warning_Energy to a few eVs to lower thresholds. G4MonopoleFieldSetup.cc (4.6 KB)
If anyone could guide me further regarding the changes I could make in the simulation to control (lower) the step-size, I would be very thankful. Let me know if you have any questions.
Thank you for your suggestions.
I have, however, already included these in my simulation.
The volume is a gdml model that is parsed into Geant4. In the DetectorConstruction, I have defined a function SetMaxStepSize as follows, and set the step size to a small value (either by calling this function in RunAction or through the macro);
Thanks for your reply. However, including those lines still does not modify the step limits. I’m not sure if the issue is inherent to the Geant4 geometry that is in the form of a gdml file, with thickness of the pipe around 1mm, surrounded in vacuum.
Thank you for your comments. Just to update this discussion, I am able to increase the # of steps a particle takes in the geometry by setting the deltaChord, deltaOneStep, deltaIntersection and epsilon parameters to very low values. (the deltas are set to 1e-7mm, and epsilon is 1e-10mm). In the attached picture, I was able to increase the number of steps a particle takes in the 1mm geometry. It seems, with these parameters I have reached the highest possible precision for this geometry. I say this because, if I decrease epsilon to 1e-12mm (while keeping the rest of the parameters constant), I get warning from G4IntegrationDriver - “Stepsize underflow in Stepper!”. On the other hand, if I decrease deltaChord to 1e-8mm, I get calls from the TransportationManager that it is killing the track that’s looping or stuck. The modification of these field parameters is the only thing that worked, thus far, to increase the number of steps a particle takes in the geometry.