Geant4 Cross Reference |
1 // 2 // ******************************************************************** 3 // * License and Disclaimer * 4 // * * 5 // * The Geant4 software is copyright of the Copyright Holders of * 6 // * the Geant4 Collaboration. It is provided under the terms and * 7 // * conditions of the Geant4 Software License, included in the file * 8 // * LICENSE and available at http://cern.ch/geant4/license . These * 9 // * include a list of copyright holders. * 10 // * * 11 // * Neither the authors of this software system, nor their employing * 12 // * institutes,nor the agencies providing financial support for this * 13 // * work make any representation or warranty, express or implied, * 14 // * regarding this software system or assume any liability for its * 15 // * use. Please see the license in the file LICENSE and URL above * 16 // * for the full disclaimer and the limitation of liability. * 17 // * * 18 // * This code implementation is the result of the scientific and * 19 // * technical work of the GEANT4 collaboration. * 20 // * By using, copying, modifying or distributing the software (or * 21 // * any work based on the software) you agree to acknowledge its * 22 // * use in resulting scientific publications, and indicate your * 23 // * acceptance of all terms of the Geant4 Software license. * 24 // ******************************************************************** 25 // 26 // 27 /// \file optical/LXe/include/LXeEventAction.hh 28 /// \brief Definition of the LXeEventAction class 29 // 30 31 #ifndef LXeEventAction_h 32 #define LXeEventAction_h 1 33 34 #include "LXeEventMessenger.hh" 35 36 #include "G4ThreeVector.hh" 37 #include "G4UserEventAction.hh" 38 #include "globals.hh" 39 40 class G4Event; 41 class LXeDetectorConstruction; 42 43 class LXeEventAction : public G4UserEventAction 44 { 45 public: 46 LXeEventAction(const LXeDetectorConstruction*); 47 ~LXeEventAction() override; 48 49 void BeginOfEventAction(const G4Event*) override; 50 void EndOfEventAction(const G4Event*) override; 51 52 void SetEventVerbose(G4int v) { fVerbose = v; } 53 54 void SetPMTThreshold(G4int t) { fPMTThreshold = t; } 55 56 void SetForceDrawPhotons(G4bool b) { fForcedrawphotons = b; } 57 void SetForceDrawNoPhotons(G4bool b) { fForcenophotons = b; } 58 59 void IncPhotonCount_Scint() { ++fPhotonCount_Scint; } 60 void IncPhotonCount_Ceren() { ++fPhotonCount_Ceren; } 61 void IncEDep(G4double dep) { fTotE += dep; } 62 void IncAbsorption() { ++fAbsorptionCount; } 63 void IncBoundaryAbsorption() { ++fBoundaryAbsorptionCount; } 64 void IncHitCount(G4int i = 1) { fHitCount += i; } 65 66 void SetEWeightPos(const G4ThreeVector& p) { fEWeightPos = p; } 67 void SetReconPos(const G4ThreeVector& p) { fReconPos = p; } 68 void SetConvPos(const G4ThreeVector& p) 69 { 70 fConvPos = p; 71 fConvPosSet = true; 72 } 73 void SetPosMax(const G4ThreeVector& p, G4double edep) 74 { 75 fPosMax = p; 76 fEdepMax = edep; 77 } 78 79 G4int GetPhotonCount_Scint() const { return fPhotonCount_Scint; } 80 G4int GetPhotonCount_Ceren() const { return fPhotonCount_Ceren; } 81 G4int GetHitCount() const { return fHitCount; } 82 G4double GetEDep() const { return fTotE; } 83 G4int GetAbsorptionCount() const { return fAbsorptionCount; } 84 G4int GetBoundaryAbsorptionCount() const { return fBoundaryAbsorptionCount; } 85 86 G4ThreeVector GetEWeightPos() { return fEWeightPos; } 87 G4ThreeVector GetReconPos() { return fReconPos; } 88 G4ThreeVector GetConvPos() { return fConvPos; } 89 G4ThreeVector GetPosMax() { return fPosMax; } 90 G4double GetEDepMax() { return fEdepMax; } 91 G4double IsConvPosSet() { return fConvPosSet; } 92 93 // Gets the total photon count produced 94 G4int GetPhotonCount() { return fPhotonCount_Scint + fPhotonCount_Ceren; } 95 96 void IncPMTSAboveThreshold() { ++fPMTsAboveThreshold; } 97 G4int GetPMTSAboveThreshold() { return fPMTsAboveThreshold; } 98 99 private: 100 LXeEventMessenger* fEventMessenger = nullptr; 101 const LXeDetectorConstruction* fDetector = nullptr; 102 103 G4int fScintCollID = -1; 104 G4int fPMTCollID = -1; 105 106 G4int fVerbose = 0; 107 108 G4int fPMTThreshold = 1; 109 110 G4bool fForcedrawphotons = false; 111 G4bool fForcenophotons = false; 112 113 G4int fHitCount = 0; 114 G4int fPhotonCount_Scint = 0; 115 G4int fPhotonCount_Ceren = 0; 116 G4int fAbsorptionCount = 0; 117 G4int fBoundaryAbsorptionCount = 0; 118 119 G4double fTotE = 0.; 120 121 // These only have meaning if totE > 0 122 // If totE = 0 then these won't be set by EndOfEventAction 123 G4ThreeVector fEWeightPos; 124 G4ThreeVector fReconPos; // Also relies on hitCount>0 125 G4ThreeVector fConvPos; // true (initial) converstion position 126 G4bool fConvPosSet = false; 127 G4ThreeVector fPosMax; 128 G4double fEdepMax = 0.; 129 130 G4int fPMTsAboveThreshold = 0; 131 }; 132 133 #endif 134