The hard code about limitting the step size did not work well?

The hard codes below were used to limit the step size in a projection:

  1. G4UImanager::GetUIpointer()->ApplyCommand(“/geant4e/limits/energyLoss 1e-6”);
  2. logic_target->SetUserLimits(new G4UserLimits(1e-10*mm)).

but they did not work well, why?

Dear Siyuan,

To enable User Limits in a Geant4 simulation, you need to register the process – G4StepLimiter process for the particle types for which you wish to apply it.
This is mentioned e.g. in the slides on UserLimits such as the one in last year’s Advanced Geant4 course entitled User Classes
In addition you can see how to activate it in the basic example B2a, in the main program

Regarding the “/geant4e/limits/energyLoss” command this relates to the error propagation package “Geant4e” - only if you using it to tasks similar to track reconstruction will it be relevant. If so please look in the Geant4e documentation for explanations.

@japost , thank you, the hard code “logic_target->SetUserLimits(new G4UserLimits(1e-10*mm))” was active through “physicsList->RegisterPhysics(new G4StepLimiterPhysics())”.

by the way, how to find the “Geant4e documentation”?