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.

User ActionsstackManager->ReClassify() method which, in turn, calls the ClassifyNewTrack() method. If nouser action is taken, all tracks in the waiting stack are transferred to the urgent stack. The user may also decideto abort the current event even though some tracks may remain in the waiting stack by calling stackManager->clear().This method is valid and safe only if it is called from the G4UserStackingAction class.A global method of event abortion isG4UImanager * UImanager = G4UImanager::GetUIpointer();UImanager->ApplyCommand("/event/abort");PrepareNewEvent() is invoked at the beginning of each event. At this point no primary particles have beenconverted to tracks, so the urgent and waiting stacks are empty. However, there may be tracks in the postponed-tonext-eventstack; <strong>for</strong> each of these the ClassifyNewTrack() method is called and the track is assigned tothe appropriate stack.Example 6.6. G4UserStackingAction#include "G4ClassificationOfNewTrack.hh"class G4UserStackingAction{public:G4UserStackingAction();virtual ~G4UserStackingAction();protected:G4StackManager * stackManager;public://---------------------------------------------------------------// virtual methods to be implemented by user//---------------------------------------------------------------//virtual G4ClassificationOfNewTrackClassifyNewTrack(const G4Track*);////---------------------------------------------------------------//virtual void NewStage();////---------------------------------------------------------------//virtual void PrepareNewEvent();////---------------------------------------------------------------};200

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

Saved successfully!

Ooh no, something went wrong!