Monte Carlo LYSO
Geant4 simulation for the LYSO calorimeter prototype
detector.hh
Go to the documentation of this file.
1 
5 #ifndef DETECTOR_HH
6 #define DETECTOR_HH
7 
8 #include <fstream>
9 #include <sstream>
10 
11 #include "G4VSensitiveDetector.hh"
12 #include "G4RunManager.hh"
13 #include "G4SystemOfUnits.hh"
14 #include "Randomize.hh"
15 #include "G4HCofThisEvent.hh"
16 #include "G4Step.hh"
17 #include "G4SDManager.hh"
18 #include "G4PhysicsFreeVector.hh"
19 
20 #include "globalsettings.hh"
21 #include "hit.hh"
22 
27 class MySensitiveDetector : public G4VSensitiveDetector
28 {
29 public:
36  MySensitiveDetector(G4String name, G4String hitsCollectionName);
37  ~MySensitiveDetector() override = default;
45  void Initialize(G4HCofThisEvent *hce) override;
57  G4bool ProcessHits(G4Step *aStep, G4TouchableHistory *ROhist) override;
58  // void EndOfEvent(G4HCofThisEvent*) override;
59 
60 private:
61  void RandomizeEfficiencies();
66  enum SetEfficiencies {fIsNominalEfficiency, fIsFixedEfficiency, fIsRandomEfficiency, fIsAssignedEfficiency};
67  SetEfficiencies fEfficiencySetting;
68  G4PhysicsFreeVector *fPDE;
69  G4double fFixedEfficiency;
72 };
73 
74 #endif // DETECTOR_HH
Concrete class of G4VSensitiveDetector, representing the detector (i.e. the SiPM).
Definition: detector.hh:28
G4bool ProcessHits(G4Step *aStep, G4TouchableHistory *ROhist) override
For every optical photon that hits the SD this method instantiates a MyHit object,...
Definition: detector.cc:45
~MySensitiveDetector() override=default
Destructor of the class.
G4double fBackEfficiency[GS::nOfSiPMs]
Array of PDEs for back MPPCs.
Definition: detector.hh:71
void Initialize(G4HCofThisEvent *hce) override
Associates a new MyHitsCollection with a G4HCofThisEvent object at the beginning of each event.
Definition: detector.cc:34
void GetEfficienciesFromFile()
Reads and sets the efficiencies from the file.
Definition: detector.cc:136
MySensitiveDetector(G4String name, G4String hitsCollectionName)
Constructor of the class.
Definition: detector.cc:7
SetEfficiencies fEfficiencySetting
Type of SetEfficiencies.
Definition: detector.hh:67
MyHitsCollection * fHitsCollection
Pointer to the hits collection of the event.
Definition: detector.hh:64
G4double fFrontEfficiency[GS::nOfSiPMs]
Array of PDEs for front MPPCs.
Definition: detector.hh:70
void RandomizeEfficiencies()
Fixes random efficiencies for all MPPCs.
Definition: detector.cc:105
Definition of the namespace GS.
Declaration of the class MyHit.
G4THitsCollection< MyHit > MyHitsCollection
Concrete hit collection class for MyHit.
Definition: hit.hh:54
constexpr G4int nOfSiPMs
The number of SiPMs on a detector face.