Monte Carlo LYSO
Geant4 simulation for the LYSO calorimeter prototype
generator.hh
Go to the documentation of this file.
1 
5 #ifndef GENERATOR_HH
6 #define GENERATOR_HH
7 
8 #include "G4VUserPrimaryGeneratorAction.hh"
9 #include "G4ParticleGun.hh"
10 #include "G4SystemOfUnits.hh"
11 #include "G4ParticleTable.hh"
12 #include "G4IonTable.hh"
13 #include "G4ParticleDefinition.hh"
14 #include "Randomize.hh"
15 #include "G4GenericMessenger.hh"
16 
17 #include "globalsettings.hh"
18 
24 class MyPrimaryGenerator : public G4VUserPrimaryGeneratorAction
25 {
26 public:
35  ~MyPrimaryGenerator() override;
53  void GeneratePrimaries(G4Event *anEvent) override;
54 
55  inline G4int GetModeType() const { return fModeType; };
56 
57 private:
59  void PrimariesForSpreadBeam();
60  void PrimariesForCircleBeam();
63  void PrimariesForLEDMode();
65  G4double PDF_E_CosmicRay(G4double energy);
66  G4ThreeVector ProjectOnBottomDetector(G4ThreeVector pos0, G4ThreeVector mom0);
67 
68  void DefineCommands();
70  G4ParticleGun *fParticleGun;
72  // Generic Messengers
73  G4GenericMessenger *fMessenger_Mode;
74  G4GenericMessenger *fMessenger_Gun;
75  G4GenericMessenger *fMessenger_Calib;
77  // Define variables that want to set as UI
78  G4int fModeType,
80  G4double fMeanEnergy,
84  G4ThreeVector fPosFixedDecay;
85  G4String fChooseFrontorBack,
87 };
88 
89 #endif // GENERATOR_HH
Mandatory user action concrete class of G4VUserPrimaryGeneratorAction. It defines the settings for th...
Definition: generator.hh:25
G4double fRadiusSpread
Radius of the area on the front face of the crystal that could be hit by primary gamma when spread is...
Definition: generator.hh:82
G4int fBeamType
Flag indicating the beam type.
Definition: generator.hh:79
void PrimariesForSpreadBeam()
Generate primaries auxiliary function for spread beam.
Definition: generator.cc:88
void PrimariesForCosmicRaysMode()
Generate primaries auxiliary function for Cosmic rays mode.
Definition: generator.cc:245
G4double fSigmaEnergy
Sigma of the gaussian distribution of the energy of the primary particle.
Definition: generator.hh:81
void PrimariesForLuDecayMode()
Generate primaries auxiliary function for Lu decay mode.
Definition: generator.cc:197
G4GenericMessenger * fMessenger_Calib
Generic messenger for the calibration mode.
Definition: generator.hh:75
G4GenericMessenger * fMessenger_Mode
Generic messenger for mode selection.
Definition: generator.hh:73
void PrimariesForStandardMode()
Generate primaries auxiliary function for Standard mode.
Definition: generator.cc:127
G4double fRadiusCircle
Radius of the beam profile in circle type.
Definition: generator.hh:83
G4double fMeanEnergy
Mean of the gaussian distribution of the energy of the primary particle.
Definition: generator.hh:80
MyPrimaryGenerator()
Constructor of the class.
Definition: generator.cc:7
G4String fChooseFrontorBack
Flag indicating on which face of the crystal a LED has to be switched ON.
Definition: generator.hh:85
G4int fModeType
Flag indicating the mode type.
Definition: generator.hh:78
void PrimariesForCircleBeam()
Generate primaries auxiliary function for circle beam.
Definition: generator.cc:114
void GeneratePrimaries(G4Event *anEvent) override
It generates the primary vertex of the event.
Definition: generator.cc:48
G4ParticleGun * fParticleGun
Pointer to the G4ParticleGun object.
Definition: generator.hh:70
G4GenericMessenger * fMessenger_Gun
Generic messenger for the standard gamma mode.
Definition: generator.hh:74
~MyPrimaryGenerator() override
Destructor of the class.
Definition: generator.cc:38
G4String fSwitchOnLED
Flag indicating which LED has to be switched ON.
Definition: generator.hh:86
G4ThreeVector fPosFixedDecay
Position of 176Lu isotope for fixed-position mode.
Definition: generator.hh:84
void DefineCommands()
Defines new user commands for primary particle generation.
Definition: generator.cc:349
void PrimariesForLEDMode()
Generate primaries auxiliary function for LED mode.
Definition: generator.cc:152
Definition of the namespace GS.