1 / 7

Generating Primary Particles

Generating Primary Particles. Each Geant4 Event starts with generation of one or multiple primary particles It is up to the user to define primary particle properties Particle type, e.g. electron, gamma, ion Initial kinetics, e.g. energy, momentum, origin and direction

edena
Download Presentation

Generating Primary Particles

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Generating Primary Particles • Each Geant4 Event starts with generation of one or multiple primary particles • It is up to the user to define primary particle properties • Particle type, e.g. electron, gamma, ion • Initial kinetics, e.g. energy, momentum, origin and direction • Additional properties, e.g. polarization • These properties can be divided into a primary vertex: starting point in space and time • Primary particle: initial momentum, polarization, PDG code, list of daughters for decay chains • A primary particle can be a particle which can notusually be tracked by Geant4

  2. The PrimaryGenerator • A primary generator is a class derived from G4VPrimaryGenerator which implements a GeneratePrimaryVertex() method • In this method the primary vertex and the primary particle are added to a Geant4 Event • Often it is practical to use an existing generator: • G4HEPEvtInterface • G4HEPMCInterface • G4GeneralParticleSource • G4ParticleGun Examples of experiment-specificgenerators. Control via text files More general purpose. Forvolume and surface sourcesAlso for beams. Can be used to produce a beam of particles

  3. PrimaryGeneratorAction • Mandatory user action which controls the generation of primary particles • It should not generate primaries itself. The primary generator does this. • Implement your particle “shot”, “rail”, or machine gun here. It can also be a particle bomb if you like. • By using e.g. the G4ParticleGun • Repeatedly for a single event • Sampling particle type and direction randomly • Or using one of the other event generators

  4. PrimaryGeneratorAction • Inherits from G4VUserPrimaryGeneratorAction • User should override GeneratePrimaries for particle generation PrimaryGeneratorAction::PrimaryGeneratorAction(const G4String & parName, G4double energy, G4ThreeVector pos, G4ThreeVector momDirection){ const G4int nParticles = 1; fParticleGun = new G4ParticleGun(nParticles); G4ParticleTable* parTable = G4ParticleTable::GetParticleTable(); G4ParticleDefinition* parDefinition = parTable->FindParticle(parName); fParticleGun->SetParticleDefinition(parDefinition); fParticleGun->SetParticleEnergy(energy); fParticleGun->SetParticlePosition(pos); fParticleGun->SetParticleMomentumDirection(momDirection); } The primary generator

  5. Class PrimaryGeneratorAction • Inherits from G4VUserPrimaryGeneratorAction • User should override GeneratePrimaries for particle generation PrimaryGeneratorAction::GeneratePrimaries(G4Event* evt){ //some additional random sampling here fParticleGun->GeneratePrimaryVertex(evt); }

  6. Alternative Method: GPS • The General Particle Source (GPS)1 provides a high-level interface to G4ParticleGun, mainly using macros • Define source types: point, beam, plane, surface, volume • Define angular distribution: isotropic, cosine-law, planar, 1d/2d beams, user defined • Define energy distribution: mono-energetic, linear, power-law, exponential, gaussian, Bremsstrahlung-spectrum, black body spectrum, cosmic diffuse gamma ray, user defined • Angular and energy distributions can be interpolated from histogrammed distributions • To use simply replace G4ParticleGun in PrimaryGeneratorAction with G4GeneralParticleSource

  7. Alternative Method: GPS • For full documentation:http://reat.space.qinetiq.com/gps/new_gps_sum_files/gps_sum.htm

More Related