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.

Getting Started with <strong>Geant4</strong>- Running a Simple ExampleIn examples/novice/N03/N03DetectorConstruction.cc, you will find examples of all possibleways to build a material.2.4. How to Specify ParticlesG4VuserPhysicsList is one of the mandatory user base classes described in Section 2.1. Within this classall particles and physics processes to be used in your simulation must be defined. The range cut-off parametershould also be defined in this class.The user must create a class derived from G4VuserPhysicsList and implement the following pure virtualmethods:ConstructParticle();ConstructProcess();SetCuts();// construction of particles// construct processes and register them to particles// setting a range cut value <strong>for</strong> all particlesThis section provides some simple examples of the ConstructParticle() and SetCuts() methods. Forin<strong>for</strong>mation on ConstructProcess() methods, please see Section 2.5.2.4.1. Particle Definition<strong>Geant4</strong> provides various types of particles <strong>for</strong> use in simulations:• ordinary particles, such as electrons, protons, and gammas• resonant particles with very short lifetimes, such as vector mesons and delta baryons• nuclei, such as deuteron, alpha, and heavy ions (including hyper-nuclei)• quarks, di-quarks, and gluonEach particle is represented by its own class, which is derived from G4ParticleDefinition. (Exception:G4Ions represents all heavy nuclei. Please see Section 5.3.) Particles are organized into six major categories:• lepton,• meson,• baryon,• boson,• shortlived and• ion,each of which is defined in a corresponding sub-directory under geant4/source/particles. There is alsoa corresponding granular library <strong>for</strong> each particle category.2.4.1.1. The G4ParticleDefinition ClassG4ParticleDefinition has properties which characterize individual particles, such as, name, mass,charge, spin, and so on. Most of these properties are "read-only" and can not be changed directly.G4ParticlePropertyTable is used to retrieve (load) particle property of G4ParticleDefinition into(from) G4ParticlePropertyData.2.4.1.2. How to Access a ParticleEach particle class type represents an individual particle type, and each class has a single object. This object canbe accessed by using the static method of each class. There are some exceptions to this rule; please see Section 5.3<strong>for</strong> details.For example, the class G4Electron represents the electron and the member G4Electron::theInstancepoints its only object. The pointer to this object is available through the static methodsG4Electron::ElectronDefinition(). G4Electron::Definition().10

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

Saved successfully!

Ooh no, something went wrong!