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

#include <RE06PrimaryGeneratorAction.hh>

Inheritance diagram for RE06PrimaryGeneratorAction:
Collaboration diagram for RE06PrimaryGeneratorAction:

Public Member Functions

 RE06PrimaryGeneratorAction ()
 
virtual ~RE06PrimaryGeneratorAction ()
 
virtual void GeneratePrimaries (G4Event *)
 
void SetSerial (G4bool serial)
 
- Public Member Functions inherited from G4VUserPrimaryGeneratorAction
 G4VUserPrimaryGeneratorAction ()
 
virtual ~G4VUserPrimaryGeneratorAction ()
 

Detailed Description

Definition at line 41 of file RE06PrimaryGeneratorAction.hh.

Constructor & Destructor Documentation

RE06PrimaryGeneratorAction::RE06PrimaryGeneratorAction ( )

Definition at line 42 of file RE06PrimaryGeneratorAction.cc.

44  fParticleGun(0),
45  fSerial(false)
46 {
47  G4int n_particle = 1;
48  fParticleGun = new G4ParticleGun(n_particle);
49 
50  // default particle kinematic
52  G4String particleName;
53  G4ParticleDefinition* particle
54  = particleTable->FindParticle(particleName="mu-");
55  fParticleGun->SetParticleDefinition(particle);
56  fParticleGun->SetParticleMomentumDirection(G4ThreeVector(0.,0.,1.));
57  fParticleGun->SetParticleEnergy(100.*GeV);
58 }
G4ParticleDefinition * FindParticle(G4int PDGEncoding)
CLHEP::Hep3Vector G4ThreeVector
void SetParticleMomentumDirection(G4ParticleMomentum aMomentumDirection)
int G4int
Definition: G4Types.hh:78
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:

RE06PrimaryGeneratorAction::~RE06PrimaryGeneratorAction ( )
virtual

Definition at line 62 of file RE06PrimaryGeneratorAction.cc.

63 {
64  delete fParticleGun;
65 }

Member Function Documentation

void RE06PrimaryGeneratorAction::GeneratePrimaries ( G4Event anEvent)
virtual

Implements G4VUserPrimaryGeneratorAction.

Definition at line 69 of file RE06PrimaryGeneratorAction.cc.

70 {
71  if(fSerial)
72  {
73  fParticleGun->SetParticlePosition(G4ThreeVector(0.,0.,-3.5*m));
74  fParticleGun->GeneratePrimaryVertex(anEvent);
75  }
76  else
77  {
78  for(G4int i=0;i<3;i++)
79  {
80  fParticleGun
81  ->SetParticlePosition(G4ThreeVector(0.,G4double(i-1)*m,-1.5*m));
82  fParticleGun->GeneratePrimaryVertex(anEvent);
83  }
84  }
85 }
CLHEP::Hep3Vector G4ThreeVector
int G4int
Definition: G4Types.hh:78
virtual void GeneratePrimaryVertex(G4Event *evt)
void SetParticlePosition(G4ThreeVector aPosition)
static constexpr double m
Definition: G4SIunits.hh:129
double G4double
Definition: G4Types.hh:76

Here is the call graph for this function:

void RE06PrimaryGeneratorAction::SetSerial ( G4bool  serial)
inline

Definition at line 49 of file RE06PrimaryGeneratorAction.hh.

49 { fSerial = serial; }

Here is the caller graph for this function:


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