Hi all,
I wrote a program simulating proton in solar magnetic field. It takes a long time to run the program. I pinpoint the issue due to the maximum particle step length is capped at 1km in the simulation, whose volume is on the order of (10^5 km)^3. The step length doesn’t depend on how I change the chord finder parameters, like min/max epsilon and min step. I have tried step limiter but it can only force max step limit not the minimum.
TL;DR: is there a cap to maximum step length in magnetic field set in geant4? Is there a way to force minimum step length in simulation?
Dear @Fongchingam
The user limit physics list allow to limit the maximum step length [1]
The integration accuracy is setup somewhere else [2]
I hope this helps.
Best,
Alvaro
[1] User Limits — Book For Application Developers 11.2 documentation
[2] Electromagnetic Field — Book For Application Developers 11.2 documentation
Hi Alvaro,
Thank you for your reply! I have tried changing accuracy parameters according to the procedure in the manual like so, but the maximum step lengths in the actual simulation are still capped at 1km when a particle is affected by B-field:
G4double minStep = 1000*km;
MagField = new GlobalField();
pFieldMgr = G4TransportationManager::GetTransportationManager()->GetFieldManager();
fEquation = new G4Mag_UsualEqRhs(MagField);
pFieldMgr → SetDetectorField(MagField);
pFieldMgr → CreateChordFinder(MagField);
fstepper = new G4DormandPrince745(fEquation);
pChordFinder = new G4ChordFinder(MagField, minStep, fstepper);
pFieldMgr->SetChordFinder(pChordFinder);
I am thoroughly confused, any help would be appreciated!