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

#include <GB06PrimaryGeneratorAction.hh>

Inheritance diagram for GB06PrimaryGeneratorAction:
Collaboration diagram for GB06PrimaryGeneratorAction:

Public Member Functions

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

Detailed Description

Definition at line 39 of file GB06PrimaryGeneratorAction.hh.

Constructor & Destructor Documentation

GB06PrimaryGeneratorAction::GB06PrimaryGeneratorAction ( )

Definition at line 41 of file GB06PrimaryGeneratorAction.cc.

43 {
44  G4int n_particle = 1;
45  fParticleGun = new G4ParticleGun(n_particle);
46 
47  // default particle kinematic
49  G4String particleName;
50  G4ParticleDefinition* particle = particleTable->FindParticle(particleName="neutron");
51  fParticleGun->SetParticleDefinition(particle);
52  fParticleGun->SetParticleMomentumDirection(G4ThreeVector(0.,0.,1.));
53  fParticleGun->SetParticleEnergy(100.*MeV);
54  fParticleGun->SetParticlePosition(G4ThreeVector(0.,0.,-50*cm));
55 }
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:

GB06PrimaryGeneratorAction::~GB06PrimaryGeneratorAction ( )
virtual

Definition at line 59 of file GB06PrimaryGeneratorAction.cc.

60 {
61  delete fParticleGun;
62 }

Member Function Documentation

void GB06PrimaryGeneratorAction::GeneratePrimaries ( G4Event anEvent)
virtual

Implements G4VUserPrimaryGeneratorAction.

Definition at line 65 of file GB06PrimaryGeneratorAction.cc.

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

Here is the call graph for this function:


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