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

#include <Par01PrimaryGeneratorAction.hh>

Inheritance diagram for Par01PrimaryGeneratorAction:
Collaboration diagram for Par01PrimaryGeneratorAction:

Public Member Functions

 Par01PrimaryGeneratorAction ()
 
 ~Par01PrimaryGeneratorAction ()
 
virtual void GeneratePrimaries (G4Event *anEvent)
 
G4ParticleGunGetParticleGun ()
 
- Public Member Functions inherited from G4VUserPrimaryGeneratorAction
 G4VUserPrimaryGeneratorAction ()
 
virtual ~G4VUserPrimaryGeneratorAction ()
 

Detailed Description

Definition at line 41 of file Par01PrimaryGeneratorAction.hh.

Constructor & Destructor Documentation

Par01PrimaryGeneratorAction::Par01PrimaryGeneratorAction ( )

Definition at line 44 of file Par01PrimaryGeneratorAction.cc.

45 {
46  G4int n_particle = 1;
47  fParticleGun = new G4ParticleGun(n_particle);
48 
50  G4String particleName;
51  G4ParticleDefinition* particle
52  = particleTable->FindParticle(particleName="geantino");
53  fParticleGun->SetParticleDefinition(particle);
54 
55  fParticleGun->SetParticleMomentumDirection(G4ThreeVector(0.,1.,0.));
56  fParticleGun->SetParticleEnergy(100.*GeV);
57  fParticleGun->SetParticlePosition(G4ThreeVector(0.*cm,-300.*cm,0.*cm));
58 }
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 GeV
Definition: G4SIunits.hh:217
void SetParticleDefinition(G4ParticleDefinition *aParticleDefinition)

Here is the call graph for this function:

Par01PrimaryGeneratorAction::~Par01PrimaryGeneratorAction ( )

Definition at line 62 of file Par01PrimaryGeneratorAction.cc.

63 {
64  delete fParticleGun;
65 }

Member Function Documentation

void Par01PrimaryGeneratorAction::GeneratePrimaries ( G4Event anEvent)
virtual

Implements G4VUserPrimaryGeneratorAction.

Definition at line 69 of file Par01PrimaryGeneratorAction.cc.

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

Here is the call graph for this function:

G4ParticleGun * Par01PrimaryGeneratorAction::GetParticleGun ( void  )

Definition at line 76 of file Par01PrimaryGeneratorAction.cc.

77 {
78  return fParticleGun;
79 }

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