File indexing completed on 2025-01-18 09:11:37
0001
0002
0003
0004
0005
0006
0007
0008
0009 #pragma once
0010
0011 #include "ActsExamples/EventData/SimParticle.hpp"
0012
0013 #include <memory>
0014
0015 #include <G4ParticleTable.hh>
0016 #include <G4SystemOfUnits.hh>
0017 #include <G4ThreeVector.hh>
0018 #include <G4VUserPrimaryGeneratorAction.hh>
0019 #include <globals.hh>
0020
0021 class G4ParticleGun;
0022 class G4Event;
0023
0024 namespace ActsExamples::Geant4::HepMC3 {
0025
0026
0027
0028
0029 class PrimaryGeneratorAction : public G4VUserPrimaryGeneratorAction {
0030 public:
0031
0032 PrimaryGeneratorAction(G4int randomSeed1 = 12345, G4int randomSeed2 = 23456);
0033
0034 ~PrimaryGeneratorAction() override;
0035
0036
0037 static PrimaryGeneratorAction* instance();
0038
0039
0040 void GeneratePrimaries(G4Event* event) override;
0041
0042
0043 void prepareParticleGun(const ActsExamples::SimParticle& part);
0044
0045 private:
0046
0047 static PrimaryGeneratorAction* s_instance;
0048
0049
0050 std::unique_ptr<G4ParticleGun> m_particleGun;
0051
0052 G4ParticleTable* m_particleTable;
0053 };
0054
0055 }