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

#include <RE04PrimaryGeneratorAction.hh>

Inheritance diagram for RE04PrimaryGeneratorAction:
Collaboration diagram for RE04PrimaryGeneratorAction:

Public Member Functions

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

Detailed Description

User primary particle generator class

  • void GeneratePrimaries(G4Event*) an incident particle is mu- with 10 GeV energy at the position (-75 cm,y,0) toward the (1,0,0) direction. The y position is uniformly varied from 95.5 cm to 96.5 cm.

Definition at line 48 of file RE04PrimaryGeneratorAction.hh.

Constructor & Destructor Documentation

RE04PrimaryGeneratorAction::RE04PrimaryGeneratorAction ( )

Definition at line 41 of file RE04PrimaryGeneratorAction.cc.

43  fParticleGun(0)
44 {
45  G4int n_particle = 1;
46  fParticleGun = new G4ParticleGun(n_particle);
47 
48  // default particle kinematic
50  G4String particleName;
51  G4ParticleDefinition* particle
52  = particleTable->FindParticle(particleName="mu-");
53  fParticleGun->SetParticleDefinition(particle);
54  fParticleGun->SetParticleMomentumDirection(G4ThreeVector(1.,0.,0.));
55  fParticleGun->SetParticlePosition(G4ThreeVector(-75.*cm,0.,0.));
56  fParticleGun->SetParticleEnergy(10.*GeV);
57 }
G4ParticleDefinition * FindParticle(G4int PDGEncoding)
CLHEP::Hep3Vector G4ThreeVector
void SetParticleMomentumDirection(G4ParticleMomentum aMomentumDirection)
int G4int
Definition: G4Types.hh:78
void SetParticlePosition(G4ThreeVector aPosition)
static constexpr double cm
Definition: G4SIunits.hh:119
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:

RE04PrimaryGeneratorAction::~RE04PrimaryGeneratorAction ( )
virtual

Definition at line 60 of file RE04PrimaryGeneratorAction.cc.

61 {
62  delete fParticleGun;
63 }

Member Function Documentation

void RE04PrimaryGeneratorAction::GeneratePrimaries ( G4Event anEvent)
virtual

Implements G4VUserPrimaryGeneratorAction.

Definition at line 66 of file RE04PrimaryGeneratorAction.cc.

67 {
68  G4double y = 96.0*cm*(G4UniformRand()-0.5);
69  fParticleGun->SetParticlePosition(G4ThreeVector(-75.*cm,y,0.));
70  fParticleGun->GeneratePrimaryVertex(anEvent);
71 }
CLHEP::Hep3Vector G4ThreeVector
virtual void GeneratePrimaryVertex(G4Event *evt)
void SetParticlePosition(G4ThreeVector aPosition)
#define G4UniformRand()
Definition: Randomize.hh:97
static constexpr double cm
Definition: G4SIunits.hh:119
double G4double
Definition: G4Types.hh:76

Here is the call graph for this function:


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