-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathPrimaryGeneratorAction.hh
41 lines (31 loc) · 1.11 KB
/
PrimaryGeneratorAction.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
#ifndef PrimaryGeneratorAction_h
#define PrimaryGeneratorAction_h 1
#include "globals.hh"
#include "G4VUserPrimaryGeneratorAction.hh"
class G4ParticleGun;
class G4Event;
class DetectorConstruction;
class PrimaryGeneratorMessenger;
class G4ParticleDefinition;
class PrimaryGeneratorAction : public G4VUserPrimaryGeneratorAction
{
public:
PrimaryGeneratorAction(DetectorConstruction*);
virtual ~PrimaryGeneratorAction();
public:
virtual void GeneratePrimaries(G4Event*);
void SetRndmFlag(G4String val) { fRndmFlag = val; }
void SetXVertex(G4double x);
void SetYVertex(G4double y);
void SetZVertex(G4double z);
static G4String GetPrimaryName();
private:
G4ParticleGun* fParticleGun; //pointer a to G4 service class
DetectorConstruction* fDetector; //pointer to the geometry
PrimaryGeneratorMessenger* fGunMessenger; //messenger of this class
G4String fRndmFlag; //flag for random impact point
static G4ParticleDefinition* fgPrimaryParticle;
G4double fXVertex, fYVertex, fZVertex;
G4bool fVertexDefined;
};
#endif