geant4-B1-example  1.0
 All Classes Files Functions Variables Pages
B1PrimaryGeneratorAction Class Reference

to set up the beam. More...

#include <B1PrimaryGeneratorAction.hh>

Inheritance diagram for B1PrimaryGeneratorAction:
Collaboration diagram for B1PrimaryGeneratorAction:

Public Member Functions

 B1PrimaryGeneratorAction ()
 

set up our gamma beam

It is 6MeV gamma, moving toward (0,0,1) direction.
gamma's location will be set in GeneratePrimaries()
More...
 
virtual ~B1PrimaryGeneratorAction ()
 we must delete the fParticleGun when the B1PrimaryGeneratorAction obj is deleted. More...
 
virtual void GeneratePrimaries (G4Event *)
 

setup the gamma's location

to get the width and height of the 'Envelope' phyisclogic volume.
we set 0.8*width and 0.8*height as the area that the gamma will hit.
More...
 
const G4ParticleGun * GetParticleGun () const
 

Detailed Description

to set up the beam.

in this case: 6MeV gamma, moving toward (0,0,1) direction,
and 0.8*width and 0.8*height as the area that the gamma will hit

Definition at line 27 of file B1PrimaryGeneratorAction.hh.

Constructor & Destructor Documentation

B1PrimaryGeneratorAction::B1PrimaryGeneratorAction ( )

set up our gamma beam

It is 6MeV gamma, moving toward (0,0,1) direction.
gamma's location will be set in GeneratePrimaries()

  • run the G4VUserPrimaryGeneratorAction() constructor.
  • initial the fParticleGun = 0, fEnvelopeBox =0

Definition at line 23 of file B1PrimaryGeneratorAction.cc.

B1PrimaryGeneratorAction::~B1PrimaryGeneratorAction ( )
virtual

we must delete the fParticleGun when the B1PrimaryGeneratorAction obj is deleted.

Definition at line 54 of file B1PrimaryGeneratorAction.cc.

Member Function Documentation

void B1PrimaryGeneratorAction::GeneratePrimaries ( G4Event *  anEvent)
virtual

setup the gamma's location

to get the width and height of the 'Envelope' phyisclogic volume.
we set 0.8*width and 0.8*height as the area that the gamma will hit.

  • this is called at the begining of ecah event
  • In order to avoid dependence of DetectorConstruction class, we get Envelope volume from G4LogicalVolumeStore.

Definition at line 67 of file B1PrimaryGeneratorAction.cc.

const G4ParticleGun* B1PrimaryGeneratorAction::GetParticleGun ( ) const
inline

Definition at line 44 of file B1PrimaryGeneratorAction.hh.

Referenced by B1RunAction::EndOfRunAction().

Here is the caller graph for this function:


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