Geant4  10.03.p03
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
ExG4PrimaryGeneratorAction01 Class Reference

The primary generator class with particle gun. More...

#include <ExG4PrimaryGeneratorAction01.hh>

Inheritance diagram for ExG4PrimaryGeneratorAction01:
Collaboration diagram for ExG4PrimaryGeneratorAction01:

Public Member Functions

 ExG4PrimaryGeneratorAction01 (const G4String &particleName="geantino", G4double energy=1.*CLHEP::MeV, G4ThreeVector position=G4ThreeVector(0, 0, 0), G4ThreeVector momentumDirection=G4ThreeVector(0, 0, 1))
 
 ~ExG4PrimaryGeneratorAction01 ()
 
virtual void GeneratePrimaries (G4Event *)
 
 ExG4PrimaryGeneratorAction01 (const G4String &particleName="geantino", G4double energy=1.*CLHEP::MeV, G4ThreeVector position=G4ThreeVector(0, 0, 0), G4ThreeVector momentumDirection=G4ThreeVector(0, 0, 1))
 
 ~ExG4PrimaryGeneratorAction01 ()
 
virtual void GeneratePrimaries (G4Event *)
 
 ExG4PrimaryGeneratorAction01 (const G4String &particleName="geantino", G4double energy=1.*CLHEP::MeV, G4ThreeVector position=G4ThreeVector(0, 0, 0), G4ThreeVector momentumDirection=G4ThreeVector(0, 0, 1))
 
 ~ExG4PrimaryGeneratorAction01 ()
 
virtual void GeneratePrimaries (G4Event *)
 
- Public Member Functions inherited from G4VUserPrimaryGeneratorAction
 G4VUserPrimaryGeneratorAction ()
 
virtual ~G4VUserPrimaryGeneratorAction ()
 

Detailed Description

The primary generator class with particle gun.

Author
I. Hrivnacova; IPN Orsay

Definition at line 48 of file ExG4PrimaryGeneratorAction01.hh.

Constructor & Destructor Documentation

ExG4PrimaryGeneratorAction01::ExG4PrimaryGeneratorAction01 ( const G4String particleName = "geantino",
G4double  energy = 1.*CLHEP::MeV,
G4ThreeVector  position = G4ThreeVector(0,0,0),
G4ThreeVector  momentumDirection = G4ThreeVector(0,0,1) 
)

Definition at line 40 of file ExG4PrimaryGeneratorAction01.cc.

46  fParticleGun(0)
47 {
48  G4int nofParticles = 1;
49  fParticleGun = new G4ParticleGun(nofParticles);
50 
51  // default particle kinematic
53  G4ParticleDefinition* particle
54  = particleTable->FindParticle(particleName);
55  fParticleGun->SetParticleDefinition(particle);
56  fParticleGun->SetParticleEnergy(energy);
57  fParticleGun->SetParticlePosition(position);
58  fParticleGun->SetParticleMomentumDirection(momentumDirection);
59 }
G4ParticleDefinition * FindParticle(G4int PDGEncoding)
void SetParticleMomentumDirection(G4ParticleMomentum aMomentumDirection)
int G4int
Definition: G4Types.hh:78
void SetParticlePosition(G4ThreeVector aPosition)
void SetParticleEnergy(G4double aKineticEnergy)
static G4ParticleTable * GetParticleTable()
G4double energy(const ThreeVector &p, const G4double m)
void SetParticleDefinition(G4ParticleDefinition *aParticleDefinition)

Here is the call graph for this function:

ExG4PrimaryGeneratorAction01::~ExG4PrimaryGeneratorAction01 ( )

Definition at line 63 of file ExG4PrimaryGeneratorAction01.cc.

64 {
65  delete fParticleGun;
66 }
ExG4PrimaryGeneratorAction01::ExG4PrimaryGeneratorAction01 ( const G4String particleName = "geantino",
G4double  energy = 1.*CLHEP::MeV,
G4ThreeVector  position = G4ThreeVector(0, 0, 0),
G4ThreeVector  momentumDirection = G4ThreeVector(0, 0, 1) 
)
ExG4PrimaryGeneratorAction01::~ExG4PrimaryGeneratorAction01 ( )
ExG4PrimaryGeneratorAction01::ExG4PrimaryGeneratorAction01 ( const G4String particleName = "geantino",
G4double  energy = 1.*CLHEP::MeV,
G4ThreeVector  position = G4ThreeVector(0, 0, 0),
G4ThreeVector  momentumDirection = G4ThreeVector(0, 0, 1) 
)
ExG4PrimaryGeneratorAction01::~ExG4PrimaryGeneratorAction01 ( )

Member Function Documentation

void ExG4PrimaryGeneratorAction01::GeneratePrimaries ( G4Event anEvent)
virtual

Implements G4VUserPrimaryGeneratorAction.

Definition at line 70 of file ExG4PrimaryGeneratorAction01.cc.

71 {
72  // this function is called at the begining of event
73 
74  fParticleGun->GeneratePrimaryVertex(anEvent);
75 }
virtual void GeneratePrimaryVertex(G4Event *evt)

Here is the call graph for this function:

virtual void ExG4PrimaryGeneratorAction01::GeneratePrimaries ( G4Event )
virtual
virtual void ExG4PrimaryGeneratorAction01::GeneratePrimaries ( G4Event )
virtual

The documentation for this class was generated from the following files: