File indexing completed on 2026-04-17 07:52:13
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022
0023
0024
0025
0026
0027
0028
0029
0030
0031
0032
0033 #ifndef PrimaryGeneratorAction_h
0034 #define PrimaryGeneratorAction_h 1
0035
0036 #include "PrimaryGeneratorActionMessenger.hh"
0037
0038 #include "G4VUserPrimaryGeneratorAction.hh"
0039 #include "globals.hh"
0040 #include "G4SystemOfUnits.hh"
0041
0042 class G4GeneralParticleSource;
0043 class G4ParticleGun;
0044 class G4Event;
0045
0046
0047
0048
0049
0050
0051
0052 class PrimaryGeneratorAction : public G4VUserPrimaryGeneratorAction
0053 {
0054 public:
0055 PrimaryGeneratorAction();
0056 ~PrimaryGeneratorAction() override;
0057
0058 void GeneratePrimaries(G4Event*) override;
0059
0060 void SetUseGPS(G4bool vBool) {fUseGPS = vBool;};
0061
0062 void SetType(G4String val) {fType = val;}
0063 void SetEnergy(G4double val) {fEnergy = val;}
0064 void SetRelSigmaEnergy(G4double val) {fRelSigmaEnergy = val;}
0065 void SetX(G4double val) {fX = val;}
0066 void SetY(G4double val) {fY = val;}
0067 void SetZ(G4double val) {fZ = val;}
0068 void SetT(G4double val) {fT = val;}
0069 void SetXp(G4double val) {fXp = val;}
0070 void SetYp(G4double val) {fYp = val;}
0071 void SetSigmaX(G4double val) {fSigmaX = val;}
0072 void SetSigmaY(G4double val) {fSigmaY = val;}
0073 void SetSigmaZ(G4double val) {fSigmaZ = val;}
0074 void SetSigmaT(G4double val) {fSigmaT = val;}
0075 void SetSigmaXp(G4double val) {fSigmaXp = val;}
0076 void SetSigmaYp(G4double val) {fSigmaYp = val;}
0077
0078 private:
0079 PrimaryGeneratorActionMessenger* fMessenger{nullptr};
0080
0081 G4GeneralParticleSource* fGPS{nullptr};
0082 G4ParticleGun* fGun{nullptr};
0083
0084 G4bool fUseGPS = false;
0085
0086 G4String fType = "e-";
0087 G4double fEnergy = 2.86*GeV;
0088 G4double fRelSigmaEnergy = 1.e-3;
0089 G4double fX = 0*mm;
0090 G4double fY = 0*mm;
0091 G4double fZ = -30*mm;
0092 G4double fT = 0*ns;
0093 G4double fXp = 0;
0094 G4double fYp = 0;
0095 G4double fSigmaX = 1.*mm;
0096 G4double fSigmaY = 1.*mm;
0097 G4double fSigmaZ = 1.*mm;
0098 G4double fSigmaT = 0.*ns;
0099 G4double fSigmaXp = 1.e-5;
0100 G4double fSigmaYp = 1.e-5;
0101 };
0102
0103
0104
0105 #endif
0106