This is an example illustrating the use of the error propagation utility.
A G4ErrorFreeTrajState is created to simulate a muon track of 20 GeV along the X axis. Then the track is propagated until the target is reached.
The geometry is a simplified typical HEP detector:
It is inmersed in a magnetic field along the Z axis with default value -1 kilogauss. This value can be changed with the command "/exerror/setField. The type of target can be chosen with the enviromental variable G4ERROR_TARGET: - PLANE_SURFACE : use a G4ErrorPlaneSurfaceTarget perpendicular to X at (2241. mm, 0, 0) - CYL_SURFACE : use a G4ErrorCylSurfaceTarget parallel to Z of radius 2220 mm - VOLUME : use a G4ErrorGeomVolumeTarget with volume name "MUON"
The user may also choose if the propagation is done forwards (the natural way, loosing energy) or backwards (in opposite direction, gaining energy), with the enviromental variable G4ERROR_MODE:
There are also two modes of propagation, that can be chosen with the enviromental variable G4ERROR_PROP