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

#include <GB01PrimaryGeneratorAction.hh>

Inheritance diagram for GB01PrimaryGeneratorAction:
Collaboration diagram for GB01PrimaryGeneratorAction:

Public Member Functions

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

Detailed Description

Definition at line 39 of file GB01PrimaryGeneratorAction.hh.

Constructor & Destructor Documentation

GB01PrimaryGeneratorAction::GB01PrimaryGeneratorAction ( )

Definition at line 40 of file GB01PrimaryGeneratorAction.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:

GB01PrimaryGeneratorAction::~GB01PrimaryGeneratorAction ( )
virtual

Definition at line 57 of file GB01PrimaryGeneratorAction.cc.

58 {
59  delete fParticleGun;
60 }

Member Function Documentation

void GB01PrimaryGeneratorAction::GeneratePrimaries ( G4Event anEvent)
virtual

Implements G4VUserPrimaryGeneratorAction.

Definition at line 62 of file GB01PrimaryGeneratorAction.cc.

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

Here is the call graph for this function:


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