generating primary particles

7
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 1

Upload: edena

Post on 05-Jan-2016

36 views

Category:

Documents


0 download

DESCRIPTION

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 - PowerPoint PPT Presentation

TRANSCRIPT

Page 1: Generating Primary Particles

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

Page 2: Generating Primary Particles

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-specific generators. Control via text files

More general purpose. Forvolume and surface sourcesAlso for beams.

Can be used to produce a beam of particles

Page 3: Generating Primary 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

Page 4: Generating Primary Particles

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

Page 5: Generating Primary Particles

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);

}

Page 6: Generating Primary Particles

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