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

#include <GB02PrimaryGeneratorAction.hh>

Inheritance diagram for GB02PrimaryGeneratorAction:
Collaboration diagram for GB02PrimaryGeneratorAction:

Public Member Functions

 GB02PrimaryGeneratorAction ()
 
virtual ~GB02PrimaryGeneratorAction ()
 
virtual void GeneratePrimaries (G4Event *)
 
- Public Member Functions inherited from G4VUserPrimaryGeneratorAction
 G4VUserPrimaryGeneratorAction ()
 
virtual ~G4VUserPrimaryGeneratorAction ()
 

Detailed Description

Definition at line 39 of file GB02PrimaryGeneratorAction.hh.

Constructor & Destructor Documentation

GB02PrimaryGeneratorAction::GB02PrimaryGeneratorAction ( )

Definition at line 40 of file GB02PrimaryGeneratorAction.cc.

41 {
42  G4int n_particle = 1;
43  fParticleGun = new G4ParticleGun(n_particle);
44 
45  // default particle kinematic
47  G4String particleName;
48  G4ParticleDefinition* particle = particleTable->FindParticle(particleName="gamma");
49  fParticleGun->SetParticleDefinition(particle);
50  fParticleGun->SetParticleMomentumDirection(G4ThreeVector(0.,0.,1.));
51  fParticleGun->SetParticleEnergy(100.*MeV);
52  fParticleGun->SetParticlePosition(G4ThreeVector(0.,0.,-50*cm));
53 }
G4ParticleDefinition * FindParticle(G4int PDGEncoding)
CLHEP::Hep3Vector G4ThreeVector
void SetParticleMomentumDirection(G4ParticleMomentum aMomentumDirection)
int G4int
Definition: G4Types.hh:78
void SetParticlePosition(G4ThreeVector aPosition)
static constexpr double cm
Definition: G4SIunits.hh:119
void SetParticleEnergy(G4double aKineticEnergy)
static G4ParticleTable * GetParticleTable()
static constexpr double MeV
Definition: G4SIunits.hh:214
void SetParticleDefinition(G4ParticleDefinition *aParticleDefinition)

Here is the call graph for this function:

GB02PrimaryGeneratorAction::~GB02PrimaryGeneratorAction ( )
virtual

Definition at line 57 of file GB02PrimaryGeneratorAction.cc.

58 {
59  delete fParticleGun;
60 }

Member Function Documentation

void GB02PrimaryGeneratorAction::GeneratePrimaries ( G4Event anEvent)
virtual

Implements G4VUserPrimaryGeneratorAction.

Definition at line 64 of file GB02PrimaryGeneratorAction.cc.

65 {
66  fParticleGun->GeneratePrimaryVertex(anEvent);
67 }
virtual void GeneratePrimaryVertex(G4Event *evt)

Here is the call graph for this function:


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