Geant4.10
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions
B01PrimaryGeneratorAction Class Reference

#include <B01PrimaryGeneratorAction.hh>

Inheritance diagram for B01PrimaryGeneratorAction:
G4VUserPrimaryGeneratorAction

Public Member Functions

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

Detailed Description

Definition at line 39 of file B01PrimaryGeneratorAction.hh.

Constructor & Destructor Documentation

B01PrimaryGeneratorAction::B01PrimaryGeneratorAction ( )

Definition at line 46 of file B01PrimaryGeneratorAction.cc.

References python.hepunit::cm, python.hepunit::MeV, G4Neutron::NeutronDefinition(), G4ParticleGun::SetParticleDefinition(), G4ParticleGun::SetParticleEnergy(), G4ParticleGun::SetParticleMomentumDirection(), and G4VPrimaryGenerator::SetParticlePosition().

46  :
47  G4VUserPrimaryGeneratorAction(), fParticleGun(0)
48 {
49  G4int n_particle = 1;
50  fParticleGun = new G4ParticleGun(n_particle);
52  fParticleGun->SetParticleEnergy(10.0*MeV);
53  fParticleGun->SetParticlePosition(G4ThreeVector(0.0, 0.0, -90.0005*cm));
54  fParticleGun->SetParticleMomentumDirection(G4ThreeVector(0.0, 0.0, 1.0));
55 }
CLHEP::Hep3Vector G4ThreeVector
void SetParticleMomentumDirection(G4ParticleMomentum aMomentumDirection)
int G4int
Definition: G4Types.hh:78
void SetParticlePosition(G4ThreeVector aPosition)
void SetParticleEnergy(G4double aKineticEnergy)
static G4Neutron * NeutronDefinition()
Definition: G4Neutron.cc:99
void SetParticleDefinition(G4ParticleDefinition *aParticleDefinition)
B01PrimaryGeneratorAction::~B01PrimaryGeneratorAction ( )

Definition at line 59 of file B01PrimaryGeneratorAction.cc.

60 {
61  delete fParticleGun;
62 }

Member Function Documentation

void B01PrimaryGeneratorAction::GeneratePrimaries ( G4Event anEvent)
virtual

Implements G4VUserPrimaryGeneratorAction.

Definition at line 66 of file B01PrimaryGeneratorAction.cc.

References G4ParticleGun::GeneratePrimaryVertex().

67 {
68  fParticleGun->GeneratePrimaryVertex(anEvent);
69 }
virtual void GeneratePrimaryVertex(G4Event *evt)

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