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 PrimariesForCountingCosmicRaysMode();
64  void PrimariesForLEDMode();
66  G4double PDF_E_CosmicRay(G4double energy);
67  G4ThreeVector ProjectOnBottomDetector(G4ThreeVector pos0, G4ThreeVector mom0);
68 
69  void DefineCommands();
71  G4ParticleGun *fParticleGun;
73  // Generic Messengers
74  G4GenericMessenger *fMessenger_Mode;
75  G4GenericMessenger *fMessenger_Gun;
76  G4GenericMessenger *fMessenger_Calib;
78  // Define variables that want to set as UI
79  G4int fModeType,
81  G4double fMeanEnergy,
85  G4ThreeVector fPosFixedDecay;
86  G4String fChooseFrontorBack,
88 };
89 
90 #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:83
G4int fBeamType
Flag indicating the beam type.
Definition: generator.hh:80
void PrimariesForSpreadBeam()
Generate primaries auxiliary function for spread beam.
Definition: generator.cc:90
void PrimariesForCosmicRaysMode()
Generate primaries auxiliary function for Cosmic rays mode.
Definition: generator.cc:247
G4double fSigmaEnergy
Sigma of the gaussian distribution of the energy of the primary particle.
Definition: generator.hh:82
void PrimariesForLuDecayMode()
Generate primaries auxiliary function for Lu decay mode.
Definition: generator.cc:199
G4GenericMessenger * fMessenger_Calib
Generic messenger for the calibration mode.
Definition: generator.hh:76
G4GenericMessenger * fMessenger_Mode
Generic messenger for mode selection.
Definition: generator.hh:74
void PrimariesForStandardMode()
Generate primaries auxiliary function for Standard mode.
Definition: generator.cc:129
G4double fRadiusCircle
Radius of the beam profile in circle type.
Definition: generator.hh:84
G4double fMeanEnergy
Mean of the gaussian distribution of the energy of the primary particle.
Definition: generator.hh:81
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:86
G4int fModeType
Flag indicating the mode type.
Definition: generator.hh:79
void PrimariesForCircleBeam()
Generate primaries auxiliary function for circle beam.
Definition: generator.cc:116
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:71
G4GenericMessenger * fMessenger_Gun
Generic messenger for the standard gamma mode.
Definition: generator.hh:75
~MyPrimaryGenerator() override
Destructor of the class.
Definition: generator.cc:38
G4String fSwitchOnLED
Flag indicating which LED has to be switched ON.
Definition: generator.hh:87
G4ThreeVector fPosFixedDecay
Position of 176Lu isotope for fixed-position mode.
Definition: generator.hh:85
void DefineCommands()
Defines new user commands for primary particle generation.
Definition: generator.cc:407
void PrimariesForLEDMode()
Generate primaries auxiliary function for LED mode.
Definition: generator.cc:154
Definition of the namespace GS.