/
eASTPrimaryGeneratorAction.hh
64 lines (52 loc) · 1.55 KB
/
eASTPrimaryGeneratorAction.hh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
// ********************************************************************
//
// eASTPrimaryGeneratorAction.hh
// Header file of primary generator action class
//
// History
// May 8th, 2021 : first implementation - Makoto Asai (SLAC)
// June 23rd, 2021 : Add eASTHepMC3Interface - Makoto Asai (SLAC)
// December 28th, 2021 : Add event start time - Makoto Asai (JLab)
//
// ********************************************************************
#ifndef eASTPrimaryGeneratorAction_h
#define eASTPrimaryGeneratorAction_h 1
#include "G4VUserPrimaryGeneratorAction.hh"
#include "globals.hh"
class G4ParticleGun;
class G4GeneralParticleSource;
class G4Event;
#ifdef eAST_USE_HepMC3
class eASTHepMC3Interface;
#endif // eAST_USE_HepMC3
class eASTPrimGenActionMessenger;
class eASTPrimaryGeneratorAction : public G4VUserPrimaryGeneratorAction
{
public:
eASTPrimaryGeneratorAction(G4bool,G4bool,G4bool);
virtual ~eASTPrimaryGeneratorAction();
virtual void GeneratePrimaries(G4Event*);
private:
G4ParticleGun* fParticleGun = nullptr;
G4GeneralParticleSource* fParticleSource = nullptr;
#ifdef eAST_USE_HepMC3
eASTHepMC3Interface* fHepMC3Interface = nullptr;
#endif // eAST_USE_HepMC3
eASTPrimGenActionMessenger* messenger = nullptr;
public:
// Event start time is set to (deltaT * eventID + T0)
void SetT(G4double dt, G4double t0)
{
deltaT = dt;
T0 = t0;
}
void GetT(G4double& dt, G4double& t0)
{
dt = deltaT;
t0 = T0;
}
private:
G4double deltaT = 0.0;
G4double T0 = 0.0;
};
#endif