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 PhysicsTrajectory() methods of G4VTrajectory, respectively, from his/her G4UserEventAction::EndOfEventAction().The geometry must be drawn be<strong>for</strong>e the trajectory drawing. The color of the drawn trajectory depends on theparticle charge:• negative: red• neutral: green• positive: blueDue to improvements in G4Navigator, a track can execute more than one turn of its spiral trajectorywithout being broken into smaller steps as long as the trajectory does not cross a geometrical boundary.Thus a drawn trajectory may not be circular.Customizing trajectory and trajectory pointG4Track and G4Step are transient classes; they are not available at the end of the event. Thus, the concreteclasses G4VTrajectory and G4VTrajectoryPoint are the only ones a user may employ <strong>for</strong> end-of-event analysisor <strong>for</strong> persistency. As mentioned above, the default classes which <strong>Geant4</strong> provides, i.e. G4Trajectory andG4TrajectoryPoint, have only very primitive quantities. The user can customize his/her own trajectory and trajectorypoint classes by deriving directly from the respective base classes.To use the customized trajectory, the user must construct a concrete trajectory class object in theG4UserTrackingAction::PreUserTrackingAction() method and make its pointer available to G4TrackingManagerby using the SetTrajectory() method. The customized trajectory point class object must be constructed in the AppendStep()method of the user's implementation of the trajectory class. This AppendStep() method will be invokedby G4TrackingManager.To customize trajectory drawing, the user can override the DrawTrajectory() method in his/her own trajectoryclass.When a customized version of G4Trajectory declares any new class variables, operator new and operator deletemust be provided. It is also useful to check that the allocation size in operator new is equal to sizeof(G4Trajectory).These two points do not apply to G4VTrajectory because it has no operator new or operator delete.5.2. Physics ProcessesPhysics processes describe how particles interact with a material. Seven major categories of processes are providedby <strong>Geant4</strong>:1. electromagnetic ,2. hadronic ,3. decay ,4. photolepton-hadron ,5. optical ,6. parameterization and7. transportation .The generalization and abstraction of physics processes is a key issue in the design of <strong>Geant4</strong>. All physics processesare treated in the same manner from the tracking point of view. The <strong>Geant4</strong> approach enables anyone tocreate a process and assign it to a particle type. This openness should allow the creation of processes <strong>for</strong> novel,domain-specific or customised purposes by individuals or groups of users.Each process has two groups of methods which play an important role in tracking, GetPhysicalInteractionLength(GPIL) and DoIt. The GPIL method gives the step length from the current space-time point tothe next space-time point. It does this by calculating the probability of interaction based on the process's crosssection in<strong>for</strong>mation. At the end of this step the DoIt method should be invoked. The DoIt method implementsthe details of the interaction, changing the particle's energy, momentum, direction and position, and producingsecondary tracks if required. These changes are recorded as G4VParticleChange objects(see Particle Change).147

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

Saved successfully!

Ooh no, something went wrong!