File indexing completed on 2025-12-17 09:28:31
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 #ifndef LXeEventAction_h
0032 #define LXeEventAction_h 1
0033
0034 #include "LXeEventMessenger.hh"
0035
0036 #include "G4ThreeVector.hh"
0037 #include "G4UserEventAction.hh"
0038 #include "globals.hh"
0039
0040 class G4Event;
0041 class LXeDetectorConstruction;
0042
0043 class LXeEventAction : public G4UserEventAction
0044 {
0045 public:
0046 LXeEventAction(const LXeDetectorConstruction*);
0047 ~LXeEventAction() override;
0048
0049 void BeginOfEventAction(const G4Event*) override;
0050 void EndOfEventAction(const G4Event*) override;
0051
0052 void SetEventVerbose(G4int v) { fVerbose = v; }
0053
0054 void SetPMTThreshold(G4int t) { fPMTThreshold = t; }
0055
0056 void SetForceDrawPhotons(G4bool b) { fForcedrawphotons = b; }
0057 void SetForceDrawNoPhotons(G4bool b) { fForcenophotons = b; }
0058
0059 void IncPhotonCount_Scint() { ++fPhotonCount_Scint; }
0060 void IncPhotonCount_Ceren() { ++fPhotonCount_Ceren; }
0061 void IncEDep(G4double dep) { fTotE += dep; }
0062 void IncAbsorption() { ++fAbsorptionCount; }
0063 void IncBoundaryAbsorption() { ++fBoundaryAbsorptionCount; }
0064 void IncHitCount(G4int i = 1) { fHitCount += i; }
0065
0066 void SetEWeightPos(const G4ThreeVector& p) { fEWeightPos = p; }
0067 void SetReconPos(const G4ThreeVector& p) { fReconPos = p; }
0068 void SetConvPos(const G4ThreeVector& p)
0069 {
0070 fConvPos = p;
0071 fConvPosSet = true;
0072 }
0073 void SetPosMax(const G4ThreeVector& p, G4double edep)
0074 {
0075 fPosMax = p;
0076 fEdepMax = edep;
0077 }
0078
0079 G4int GetPhotonCount_Scint() const { return fPhotonCount_Scint; }
0080 G4int GetPhotonCount_Ceren() const { return fPhotonCount_Ceren; }
0081 G4int GetHitCount() const { return fHitCount; }
0082 G4double GetEDep() const { return fTotE; }
0083 G4int GetAbsorptionCount() const { return fAbsorptionCount; }
0084 G4int GetBoundaryAbsorptionCount() const { return fBoundaryAbsorptionCount; }
0085
0086 G4ThreeVector GetEWeightPos() { return fEWeightPos; }
0087 G4ThreeVector GetReconPos() { return fReconPos; }
0088 G4ThreeVector GetConvPos() { return fConvPos; }
0089 G4ThreeVector GetPosMax() { return fPosMax; }
0090 G4double GetEDepMax() { return fEdepMax; }
0091 G4double IsConvPosSet() { return fConvPosSet; }
0092
0093
0094 G4int GetPhotonCount() { return fPhotonCount_Scint + fPhotonCount_Ceren; }
0095
0096 void IncPMTSAboveThreshold() { ++fPMTsAboveThreshold; }
0097 G4int GetPMTSAboveThreshold() { return fPMTsAboveThreshold; }
0098
0099 private:
0100 LXeEventMessenger* fEventMessenger = nullptr;
0101 const LXeDetectorConstruction* fDetector = nullptr;
0102
0103 G4int fScintCollID = -1;
0104 G4int fPMTCollID = -1;
0105
0106 G4int fVerbose = 0;
0107
0108 G4int fPMTThreshold = 1;
0109
0110 G4bool fForcedrawphotons = false;
0111 G4bool fForcenophotons = false;
0112
0113 G4int fHitCount = 0;
0114 G4int fPhotonCount_Scint = 0;
0115 G4int fPhotonCount_Ceren = 0;
0116 G4int fAbsorptionCount = 0;
0117 G4int fBoundaryAbsorptionCount = 0;
0118
0119 G4double fTotE = 0.;
0120
0121
0122
0123 G4ThreeVector fEWeightPos;
0124 G4ThreeVector fReconPos;
0125 G4ThreeVector fConvPos;
0126 G4bool fConvPosSet = false;
0127 G4ThreeVector fPosMax;
0128 G4double fEdepMax = 0.;
0129
0130 G4int fPMTsAboveThreshold = 0;
0131 };
0132
0133 #endif