How to Specify Materials/Particles in Detector Geometry
How to Specify Particles[edit | edit source]
In our experiment we declared our particle which is a muon because we are interested in the particles withing cosmic ray's The G4ParticleTable class is provided as a dictionary of particles. Various utility methods are provided, such as:
FindParticle(G4String name); // find the particle by name FindParticle(G4int PDGencoding) // find the particle by PDG encoding .
G4ParticleTable is defined as a singleton object, and the static method G4ParticleTable::GetParticleTable() provides its pointer. However in our code we declared a muon by
G4ParticleTable* particleTable = G4ParticleTable::GetParticleTable(); G4String particleName; G4ParticleDefinition* particle = particleTable->FindParticle(particleName="mu+"); fParticleGun->SetParticleDefinition(particle); //fParticleGun->SetParticleMomentumDirection(G4ThreeVector(xcosine,ycosine,zcosine)); // fParticleGun->SetParticleEnergy(e0);
Particles are registered automatically during construction. The user has no control over particle registration.
Dictionary of Particles[edit | edit source]
The G4ParticleTable class is provided as a dictionary of particles. Various utility methods are provided, such as:
FindParticle(G4String name); // find the particle by name
FindParticle(G4int PDGencoding) // find the particle by PDG encoding . G4ParticleTable is defined as a singleton object, and the static method G4ParticleTable::GetParticleTable() provides its pointer.
As for heavy ions (including hyper-nuclei), objects are created dynamically by requests from users and processes. The G4ParticleTable class provides methods to create ions, such as:
G4ParticleDefinition* GetIon( G4int atomicNumber, G4int atomicMass, G4double excitationEnergy);