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

#include <eRositaPrimaryGeneratorAction.hh>

Inheritance diagram for eRositaPrimaryGeneratorAction:
Collaboration diagram for eRositaPrimaryGeneratorAction:

Public Member Functions

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

Detailed Description

Definition at line 44 of file eRositaPrimaryGeneratorAction.hh.

Constructor & Destructor Documentation

eRositaPrimaryGeneratorAction::eRositaPrimaryGeneratorAction ( eRositaDetectorConstruction myDC)

Definition at line 44 of file eRositaPrimaryGeneratorAction.cc.

46 :myDetector(myDC)
47 {
48  G4int n_particle = 1;
49 // G4int n_particle = 1000;
50  particleGun = new G4ParticleGun(n_particle);
51 
52 // default particle
53 
55 
56  G4ParticleDefinition* particle = particleTable->FindParticle("proton");
57 
58  particleGun->SetParticleDefinition(particle);
59  xdirection = 0.0; // x component of initial momentum vector
60  ydirection = -0.5; // y -"-
61  zdirection = -1.0; // z -"-
62  particleGun->SetParticleMomentumDirection(G4ThreeVector(xdirection,ydirection,zdirection));
63  particleGun->SetParticleEnergy(100.0*MeV);
64 
65 }
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 MeV
Definition: G4SIunits.hh:214
void SetParticleDefinition(G4ParticleDefinition *aParticleDefinition)

Here is the call graph for this function:

eRositaPrimaryGeneratorAction::~eRositaPrimaryGeneratorAction ( )

Definition at line 69 of file eRositaPrimaryGeneratorAction.cc.

70 {
71  delete particleGun;
72 }

Member Function Documentation

void eRositaPrimaryGeneratorAction::GeneratePrimaries ( G4Event anEvent)
virtual

Implements G4VUserPrimaryGeneratorAction.

Definition at line 76 of file eRositaPrimaryGeneratorAction.cc.

77 {
78 
79  xposition = 0.0*cm;
80  yposition = 2.25*cm;
81  zposition = 4.0*cm;
82 
83  particleGun->SetParticlePosition(G4ThreeVector(xposition,yposition,zposition));
84 
85  particleGun->GeneratePrimaryVertex(anEvent);
86 }
CLHEP::Hep3Vector G4ThreeVector
virtual void GeneratePrimaryVertex(G4Event *evt)
void SetParticlePosition(G4ThreeVector aPosition)
static constexpr double cm
Definition: G4SIunits.hh:119

Here is the call graph for this function:


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