| Summary: | Energy conservation of tracking in magnetic field | ||
|---|---|---|---|
| Product: | Geant4 | Reporter: | Michel.Maire |
| Component: | geometry/magneticfield | Assignee: | John Apostolakis <John.Apostolakis> |
| Status: | RESOLVED FIXED | ||
| Severity: | normal | ||
| Priority: | P2 | ||
| Version: | 5.1 | ||
| Hardware: | PC | ||
| OS: | Linux | ||
|
Description
Michel.Maire
2003-05-28 11:52:04 CEST
The problem is under investigation. The root cause for the sizable imprecision is the 'lax' set of default
parameters for the precision of integration/tracking in a field. This combines
with the very large number of steps required for low energy electrons in a
sizable field, and causes the dependence on the step size and the overall
imprecision.
These lax defaults will need to be reviewed and changed in the Geant4 code.
Nevertheless it is possible for a user to improve the performance of his/her
program already - by utilising the code segment below in the detector
construction or main program.
......................................................................
G4PropagatorInField* globalPropagatorInFld;
G4TransportationManager *transportMgr=
G4TransportationManager::GetTransportationManager();
globalPropagatorInFld= transportMgr->GetPropagatorInField();
G4double minEps= 1.0e-5;
G4double maxEps= 1.0e-6;
globalPropagatorInFld->SetMinimumEpsilonStep( minEps );
globalPropagatorInFld->SetMaximumEpsilonStep( maxEps );
G4cout << "EpsilonStep: set min= " << minEps << " max= " << maxEps << G4endl;
.......................................................................
By choosing minEps and maxEps to be small, you can minimise the main of the
sources of the error. A simple proposal would be to set them equal, and to try
a value of 1.0e-6 or 1.0e-7. You can then try increase the value, to 1.0e-5 or
1.0e-4 to investigate whether these provide reasonable stability for your case.
I note that values which are smaller than 1.0e-7 have not been tested. It is
unclear whether these value improve the precision, due to the limited
precisions of arithmetic operations for double precision floating point
numbers.
The recipe above will limit, but does not eliminate altogether the depedence
on the step size for the lowest energy electrons. Further investigation is
ongoing.
An additional protection for conserving energy has been included in patch 1 of Geant4 5.2 (end August 2003). Nevertheless the suggested actions outlined above remain an important way of limitting the errors made -- and review their acceptable levels is important for obtaining an appropriate level of accuracy and performance. Further improvements taking into account 'best initial values' will be undertaken in the coming months. The default values for these parameters, have been revised: fEpsilonMinDefault(5.0e-5), fEpsilonMaxDefault(0.001), These values have been provided since Geant4 6.0 |