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

#include <GB03PrimaryGeneratorAction.hh>

Inheritance diagram for GB03PrimaryGeneratorAction:
Collaboration diagram for GB03PrimaryGeneratorAction:

Public Member Functions

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

Detailed Description

Definition at line 40 of file GB03PrimaryGeneratorAction.hh.

Constructor & Destructor Documentation

GB03PrimaryGeneratorAction::GB03PrimaryGeneratorAction ( )

Definition at line 41 of file GB03PrimaryGeneratorAction.cc.

43 {
44  G4int n_particle = 1;
45  fParticleGun = new G4ParticleGun(n_particle);
46 
47  // default particle kinematic
49  G4String particleName;
50  G4ParticleDefinition* particle
51  = particleTable->FindParticle(particleName="neutron");
52  fParticleGun->SetParticleDefinition(particle);
53  fParticleGun->SetParticleMomentumDirection(G4ThreeVector(0.,0.,1.));
54  fParticleGun->SetParticlePosition(G4ThreeVector(0.,0.,-3.5*m));
55  fParticleGun->SetParticleEnergy(100.*MeV);
56 }
G4ParticleDefinition * FindParticle(G4int PDGEncoding)
CLHEP::Hep3Vector G4ThreeVector
void SetParticleMomentumDirection(G4ParticleMomentum aMomentumDirection)
int G4int
Definition: G4Types.hh:78
void SetParticlePosition(G4ThreeVector aPosition)
static constexpr double m
Definition: G4SIunits.hh:129
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:

GB03PrimaryGeneratorAction::~GB03PrimaryGeneratorAction ( )
virtual

Definition at line 60 of file GB03PrimaryGeneratorAction.cc.

61 {
62  delete fParticleGun;
63 }

Member Function Documentation

void GB03PrimaryGeneratorAction::GeneratePrimaries ( G4Event anEvent)
virtual

Implements G4VUserPrimaryGeneratorAction.

Definition at line 67 of file GB03PrimaryGeneratorAction.cc.

68 {
69  fParticleGun->GeneratePrimaryVertex(anEvent);
70 }
virtual void GeneratePrimaryVertex(G4Event *evt)

Here is the call graph for this function:


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