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

Primary generator action. More...

#include <ExP02PrimaryGeneratorAction.hh>

Inheritance diagram for ExP02PrimaryGeneratorAction:
Collaboration diagram for ExP02PrimaryGeneratorAction:

Public Member Functions

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

Detailed Description

Primary generator action.

Definition at line 47 of file ExP02PrimaryGeneratorAction.hh.

Constructor & Destructor Documentation

ExP02PrimaryGeneratorAction::ExP02PrimaryGeneratorAction ( )

Definition at line 42 of file ExP02PrimaryGeneratorAction.cc.

44  fParticleGun(0)
45 
46 {
47  G4int n_particle = 1;
48  fParticleGun = new G4ParticleGun(n_particle);
49 
51  G4String particleName;
52  // particleGun->SetParticleDefinition(particleTable->FindParticle(particleName="pi+"));
53  fParticleGun->SetParticleDefinition(particleTable->FindParticle(particleName="geantino"));
54  fParticleGun->SetParticleEnergy(1.0*GeV);
55  fParticleGun->SetParticlePosition(G4ThreeVector(0.0, 0.0, 0.0));
56 }
G4ParticleDefinition * FindParticle(G4int PDGEncoding)
CLHEP::Hep3Vector G4ThreeVector
int G4int
Definition: G4Types.hh:78
void SetParticlePosition(G4ThreeVector aPosition)
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:

ExP02PrimaryGeneratorAction::~ExP02PrimaryGeneratorAction ( )

Definition at line 60 of file ExP02PrimaryGeneratorAction.cc.

61 {
62  delete fParticleGun;
63 }

Member Function Documentation

void ExP02PrimaryGeneratorAction::GeneratePrimaries ( G4Event anEvent)
virtual

Implements G4VUserPrimaryGeneratorAction.

Definition at line 67 of file ExP02PrimaryGeneratorAction.cc.

68 {
69  G4ThreeVector v(1.0,0.1,0.1);
70 
71  fParticleGun->SetParticleMomentumDirection(v);
72  fParticleGun->GeneratePrimaryVertex(anEvent);
73 }
void SetParticleMomentumDirection(G4ParticleMomentum aMomentumDirection)
virtual void GeneratePrimaryVertex(G4Event *evt)
tuple v
Definition: test.py:18

Here is the call graph for this function:


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