Analysis Software
Documentation for sPHENIX simulation software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
ActsExamples::Geant4::HepMC3::PrimaryGeneratorAction Class Reference

#include <acts/blob/sPHENIX/Examples/Algorithms/Geant4HepMC/src/PrimaryGeneratorAction.hpp>

+ Inheritance diagram for ActsExamples::Geant4::HepMC3::PrimaryGeneratorAction:
+ Collaboration diagram for ActsExamples::Geant4::HepMC3::PrimaryGeneratorAction:

Public Member Functions

 PrimaryGeneratorAction (G4int randomSeed1=12345, G4int randomSeed2=23456)
 Constructor.
 
 ~PrimaryGeneratorAction () override
 Destructor.
 
void GeneratePrimaries (G4Event *event) override
 Interface method to generate the primary.
 
void prepareParticleGun (const ActsExamples::SimParticle &part)
 Prepare the particle gun with initial parameters.
 

Static Public Member Functions

static PrimaryGeneratorActioninstance ()
 Static access method.
 

Private Attributes

std::unique_ptr< G4ParticleGun > m_particleGun
 Pointer to the G4 particle gun.
 
G4ParticleTable * m_particleTable
 The Geant4 particle table.
 

Static Private Attributes

static PrimaryGeneratorActions_instance = nullptr
 Instance of the PrimaryGeneratorAction.
 

Detailed Description

The PrimaryGeneratorAction is the implementation of the Geant4 class G4VUserPrimaryGeneratorAction. It generates a random direction and shoots a particle.

Definition at line 31 of file PrimaryGeneratorAction.hpp.

View newest version in sPHENIX GitHub at line 31 of file PrimaryGeneratorAction.hpp

Constructor & Destructor Documentation

ActsExamples::Geant4::HepMC3::PrimaryGeneratorAction::PrimaryGeneratorAction ( G4int  randomSeed1 = 12345,
G4int  randomSeed2 = 23456 
)

Constructor.

Definition at line 26 of file PrimaryGeneratorAction.cpp.

View newest version in sPHENIX GitHub at line 26 of file PrimaryGeneratorAction.cpp

References m_particleGun, m_particleTable, and s_instance.

ActsExamples::Geant4::HepMC3::PrimaryGeneratorAction::~PrimaryGeneratorAction ( )
override

Destructor.

Definition at line 47 of file PrimaryGeneratorAction.cpp.

View newest version in sPHENIX GitHub at line 47 of file PrimaryGeneratorAction.cpp

References s_instance.

Member Function Documentation

void ActsExamples::Geant4::HepMC3::PrimaryGeneratorAction::GeneratePrimaries ( G4Event *  event)
override

Interface method to generate the primary.

Definition at line 72 of file PrimaryGeneratorAction.cpp.

View newest version in sPHENIX GitHub at line 72 of file PrimaryGeneratorAction.cpp

References m_particleGun.

PrimaryGeneratorAction * ActsExamples::Geant4::HepMC3::PrimaryGeneratorAction::instance ( )
static

Static access method.

Definition at line 51 of file PrimaryGeneratorAction.cpp.

View newest version in sPHENIX GitHub at line 51 of file PrimaryGeneratorAction.cpp

References s_instance.

Referenced by ActsExamples::EventRecording::execute().

+ Here is the caller graph for this function:

void ActsExamples::Geant4::HepMC3::PrimaryGeneratorAction::prepareParticleGun ( const ActsExamples::SimParticle part)

Prepare the particle gun with initial parameters.

Definition at line 56 of file PrimaryGeneratorAction.cpp.

View newest version in sPHENIX GitHub at line 56 of file PrimaryGeneratorAction.cpp

References ActsFatras::Particle::absoluteMomentum(), ActsFatras::Particle::direction(), Acts::UnitConstants::GeV, m_particleGun, m_particleTable, Acts::UnitConstants::mm, particle, ActsFatras::Particle::pdg(), Acts::Test::pos, and ActsFatras::Particle::position().

Referenced by ActsExamples::EventRecording::execute().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

Member Data Documentation

std::unique_ptr<G4ParticleGun> ActsExamples::Geant4::HepMC3::PrimaryGeneratorAction::m_particleGun
private

Pointer to the G4 particle gun.

Definition at line 52 of file PrimaryGeneratorAction.hpp.

View newest version in sPHENIX GitHub at line 52 of file PrimaryGeneratorAction.hpp

Referenced by GeneratePrimaries(), prepareParticleGun(), and PrimaryGeneratorAction().

G4ParticleTable* ActsExamples::Geant4::HepMC3::PrimaryGeneratorAction::m_particleTable
private

The Geant4 particle table.

Definition at line 54 of file PrimaryGeneratorAction.hpp.

View newest version in sPHENIX GitHub at line 54 of file PrimaryGeneratorAction.hpp

Referenced by prepareParticleGun(), and PrimaryGeneratorAction().

PrimaryGeneratorAction * ActsExamples::Geant4::HepMC3::PrimaryGeneratorAction::s_instance = nullptr
staticprivate

Instance of the PrimaryGeneratorAction.

Definition at line 49 of file PrimaryGeneratorAction.hpp.

View newest version in sPHENIX GitHub at line 49 of file PrimaryGeneratorAction.hpp

Referenced by instance(), PrimaryGeneratorAction(), and ~PrimaryGeneratorAction().


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