16 #include <G4ParticleDefinition.hh>
17 #include <G4ParticleGun.hh>
18 #include <G4RandomDirection.hh>
19 #include <G4UnitsTable.hh>
20 #include <Randomize.hh>
22 namespace ActsExamples::Geant4::HepMC3 {
28 : G4VUserPrimaryGeneratorAction(), m_particleGun(nullptr) {
31 throw std::logic_error(
"Attempted to duplicate a singleton");
37 G4int nofParticles = 1;
38 m_particleGun = std::make_unique<G4ParticleGun>(nofParticles);
44 CLHEP::HepRandom::getTheEngine()->setSeed(randomSeed1, randomSeed2);
69 m_particleGun->SetParticleMomentumDirection({dir[0], dir[1], dir[2]});