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

Primary generator action for the GDML extension example. More...

#include <G03PrimaryGeneratorAction.hh>

Inheritance diagram for G03PrimaryGeneratorAction:
Collaboration diagram for G03PrimaryGeneratorAction:

Public Member Functions

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

Detailed Description

Primary generator action for the GDML extension example.

Definition at line 49 of file G03PrimaryGeneratorAction.hh.

Constructor & Destructor Documentation

G03PrimaryGeneratorAction::G03PrimaryGeneratorAction ( )

Definition at line 44 of file G03PrimaryGeneratorAction.cc.

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

G03PrimaryGeneratorAction::~G03PrimaryGeneratorAction ( )

Definition at line 70 of file G03PrimaryGeneratorAction.cc.

71 {
72  delete fParticleGun;
73 }

Member Function Documentation

void G03PrimaryGeneratorAction::GeneratePrimaries ( G4Event anEvent)
virtual

Implements G4VUserPrimaryGeneratorAction.

Definition at line 77 of file G03PrimaryGeneratorAction.cc.

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

Here is the call graph for this function:


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