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

Primary generator action used in GDML read/write example. More...

#include <G02PrimaryGeneratorAction.hh>

Inheritance diagram for G02PrimaryGeneratorAction:
Collaboration diagram for G02PrimaryGeneratorAction:

Public Member Functions

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

Detailed Description

Primary generator action used in GDML read/write example.

Definition at line 51 of file G02PrimaryGeneratorAction.hh.

Constructor & Destructor Documentation

G02PrimaryGeneratorAction::G02PrimaryGeneratorAction ( )

Definition at line 44 of file G02PrimaryGeneratorAction.cc.

46  fParticleGun(0),
47  fParticleTable(0)
48 
49 {
50  // Particle gun and particle table
51  //
52  fParticleGun = new G4ParticleGun();
53  fParticleTable = G4ParticleTable::GetParticleTable();
54 
55  // Default particle
56  //
57  fParticleGun->SetParticleDefinition(fParticleTable->FindParticle("geantino"));
58  fParticleGun->SetParticleEnergy( 1.0*MeV );
59 
60  G4ThreeVector err1=G4ThreeVector(-1260,-560,40); // outside
61  G4ThreeVector err2=G4ThreeVector(100,-240,120); // inside
62  G4ThreeVector err2v=(err2-err1).unit();
63 
64  fParticleGun->SetParticleMomentumDirection(err2v);
65  fParticleGun->SetParticlePosition(err1);
66 
67 }
G4ParticleDefinition * FindParticle(G4int PDGEncoding)
CLHEP::Hep3Vector G4ThreeVector
void SetParticleMomentumDirection(G4ParticleMomentum aMomentumDirection)
void SetParticlePosition(G4ThreeVector aPosition)
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:

G02PrimaryGeneratorAction::~G02PrimaryGeneratorAction ( )

Definition at line 71 of file G02PrimaryGeneratorAction.cc.

72 {
73  delete fParticleGun;
74 }

Member Function Documentation

void G02PrimaryGeneratorAction::GeneratePrimaries ( G4Event anEvent)
virtual

Implements G4VUserPrimaryGeneratorAction.

Definition at line 78 of file G02PrimaryGeneratorAction.cc.

79 {
80  fParticleGun->GeneratePrimaryVertex(anEvent);
81 }
virtual void GeneratePrimaryVertex(G4Event *evt)

Here is the call graph for this function:


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