Analysis Software
Documentation for sPHENIX simulation software
|
#include <acts/blob/sPHENIX/Examples/Algorithms/Geant4HepMC/src/PrimaryGeneratorAction.hpp>
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 PrimaryGeneratorAction * | instance () |
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 PrimaryGeneratorAction * | s_instance = nullptr |
Instance of the PrimaryGeneratorAction. | |
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
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.
|
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.
|
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.
|
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().
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().
|
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().
|
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().
|
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().