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

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Tracking and Physics• AddSecondary( G4Track* aSecondary )• AddSecondary( G4DynamicParticle* aSecondary )• AddSecondary( G4DynamicParticle* aSecondary, G4ThreeVector position )• AddSecondary( G4DynamicParticle* aSecondary, G4double time)In all but the first, the construction of G4Track is done in the methods using in<strong>for</strong>mation given by the arguments.5.1.4. User ActionsThere are two classes which allow the user to intervene in the tracking. These are:• G4UserTrackingAction, and• G4UserSteppingAction.Each provides methods which allow the user access to the <strong>Geant4</strong> kernel at specific points in the tracking. Fordetails, see the Software Reference Manual.Note-1: Users SHOULD NOT (and CAN NOT) change G4Track in UserSteppingAction. Only the exceptionis the TrackStatus.Note-2: Users have to be cautious to implement an unnatural/unphysical action in these user actions. See thesection Killing Tracks in User Actions and Energy Conservation <strong>for</strong> more details.5.1.5. Verbose OutputsThe verbose in<strong>for</strong>mation output flag can be turned on or off. The amount of in<strong>for</strong>mation printed about the track/step, from brief to very detailed, can be controlled by the value of the verbose flag, <strong>for</strong> example,G4UImanager* UI = G4UImanager::GetUIpointer();UI->ApplyCommand("/tracking/verbose 1");5.1.6. Trajectory and Trajectory PointG4Trajectory and G4TrajectoryPointG4Trajectory and G4TrajectoryPoint are default concrete classes provided by <strong>Geant4</strong>, which are derived fromthe G4VTrajectory and G4VTrajectoryPoint base classes, respectively. A G4Trajectory class object is created byG4TrackingManager when a G4Track is passed from the G4EventManager. G4Trajectory has the following datamembers:• ID numbers of the track and the track's parent• particle name, charge, and PDG code• a collection of G4TrajectoryPoint pointersG4TrajectoryPoint corresponds to a step point along the path followed by the track. Its position is given by aG4ThreeVector. A G4TrajectoryPoint class object is created in the AppendStep() method of G4Trajectory and thismethod is invoked by G4TrackingManager at the end of each step. The first point is created when the G4Trajectoryis created, thus the first point is the original vertex.The creation of a trajectory can be controlled by invoking G4TrackingManager::SetStoreTrajectory(G4bool). TheUI command /tracking/storeTrajectory _bool_ does the same. The user can set this flag <strong>for</strong> each individual trackfrom his/her G4UserTrackingAction::PreUserTrackingAction() method.The user should not create trajectories <strong>for</strong> secondaries in a shower due to the large amount of memoryconsumed.All the created trajectories in an event are stored in G4TrajectoryContainer class object and this object will be keptby G4Event. To draw or print trajectories generated in an event, the user may invoke the DrawTrajectory() or Show-146

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

Saved successfully!

Ooh no, something went wrong!