12.07.2015 Views

Geant4 User's Guide for Application Developers - Geant4 - CERN

Geant4 User's Guide for Application Developers - Geant4 - CERN

Geant4 User's Guide for Application Developers - Geant4 - CERN

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Tracking and Physics• Energy is exhausted• World boundary is reached• User-defined target is reachedIn case the defined target is not reached, G4ErrorPropagator::Propagate() returns a negative value.The propagation of a trajectory state until a user defined target can be done by invoking the method ofG4ErrorPropagatorManagerG4int Propagate( G4ErrorTrajState* currentTS, const G4ErrorTarget* target,G4ErrorMode mode = G4ErrorMode_PropForwards );You can get the pointer to the only instance of G4ErrorPropagatorManager withG4ErrorPropagatorManager* g4emgr = G4ErrorPropagatorManager::GetErrorPropagatorManager();Another possibility is to invoke the propagation step by step, returning control to the user after each step. Thiscan be done with the methodG4int PropagateOneStep( G4ErrorTrajState* currentTS,G4ErrorMode mode = G4ErrorMode_PropForwards );In this case you should register the target first with the commandG4ErrorPropagatorData::GetG4ErrorPropagatorData()->SetTarget( theG4eTarget );5.8.5.1. Error propagationAs in the GEANT3-based GEANE package, the error propagation is based on the equations of the European MuonCollaboration, that take into account:• Error from curved trajectory in magnetic field• Error from multiple scattering• Error from ionizationThe <strong>for</strong>mulas assume propagation along an helix. This means that it is necessary to make steps small enough toassure magnetic field constantness and not too big energy loss.5.8.6. Limiting the stepThere are three ways to limit the step. The first one is by using a fixed length value. This can be set by invokingthe user command :G4UImanager::GetUIpointer()->ApplyCommand("/geant4e/limits/stepLength MY_VALUE MY_UNIT");The second one is by setting the maximum percentage of energy loss in the step (or energy gain is propagation isbackwards). This can be set by invoking the user command :G4UImanager::GetUIpointer()->ApplyCommand("/geant4e/limits/energyLoss MY_VALUE");The last one is by setting the maximum difference between the value of the magnetic field at the beginning and atthe end of the step. Indeed what is limited is the curvature, or exactly the value of the magnetic field divided bythe value of the momentum transversal to the field. This can be set by invoking the user command :G4UImanager::GetUIpointer()->ApplyCommand("/geant4e/limits/magField MY_VALUE");193

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!