EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
eASTPrimaryGeneratorAction.hh
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file eASTPrimaryGeneratorAction.hh
1 // ********************************************************************
2 //
3 // eASTPrimaryGeneratorAction.hh
4 // Header file of primary generator action class
5 //
6 // History
7 // May 8th, 2021 : first implementation - Makoto Asai (SLAC)
8 // June 23rd, 2021 : Add eASTHepMC3Interface - Makoto Asai (SLAC)
9 // December 28th, 2021 : Add event start time - Makoto Asai (JLab)
10 //
11 // ********************************************************************
12 
13 #ifndef eASTPrimaryGeneratorAction_h
14 #define eASTPrimaryGeneratorAction_h 1
15 
16 #include "G4VUserPrimaryGeneratorAction.hh"
17 #include "globals.hh"
18 
19 class G4ParticleGun;
20 class G4GeneralParticleSource;
21 class G4Event;
22 
23 #ifdef eAST_USE_HepMC3
25 #endif // eAST_USE_HepMC3
26 
28 
29 class eASTPrimaryGeneratorAction : public G4VUserPrimaryGeneratorAction
30 {
31  public:
32  eASTPrimaryGeneratorAction(G4bool,G4bool,G4bool);
34 
35  virtual void GeneratePrimaries(G4Event*);
36 
37  private:
38  G4ParticleGun* fParticleGun = nullptr;
39  G4GeneralParticleSource* fParticleSource = nullptr;
40 #ifdef eAST_USE_HepMC3
41  eASTHepMC3Interface* fHepMC3Interface = nullptr;
42 #endif // eAST_USE_HepMC3
43 
45 
46  public:
47  // Event start time is set to (deltaT * eventID + T0)
48  void SetT(G4double dt, G4double t0)
49  {
50  deltaT = dt;
51  T0 = t0;
52  }
53  void GetT(G4double& dt, G4double& t0)
54  {
55  dt = deltaT;
56  t0 = T0;
57  }
58 
59  private:
60  G4double deltaT = 0.0;
61  G4double T0 = 0.0;
62 };
63 
64 #endif