File indexing completed on 2025-01-31 09:22:41
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
0032
0033
0034
0035
0036
0037
0038
0039
0040
0041
0042 #ifndef DMXEventAction_h
0043 #define DMXEventAction_h 1
0044
0045 #include "G4UserEventAction.hh"
0046 #include "globals.hh"
0047 #include "G4ios.hh"
0048
0049 #include "DMXScintHit.hh"
0050 #include "DMXPmtHit.hh"
0051
0052 class DMXRunAction;
0053 class DMXPrimaryGeneratorAction;
0054 class DMXEventActionMessenger;
0055 class DMXAnalysisManager;
0056
0057
0058 class DMXEventAction : public G4UserEventAction {
0059
0060 public:
0061 DMXEventAction();
0062 virtual ~DMXEventAction();
0063 virtual void BeginOfEventAction(const G4Event*);
0064 virtual void EndOfEventAction(const G4Event*);
0065
0066 private:
0067 void writeScintHitsToFile();
0068 void writePmtHitsToFile(const DMXPmtHitsCollection*);
0069 void drawTracks(const G4Event*);
0070
0071 public:
0072 void SetDrawTrksFlag (G4String val) {drawTrksFlag = val;};
0073 G4String GetDrawTrksFlag() const {return drawTrksFlag;};
0074
0075 void SetDrawColsFlag (G4String val) {drawColsFlag = val;};
0076 G4String GetDrawColsFlag() const {return drawColsFlag;};
0077
0078 void SetDrawHitsFlag (G4int val) {drawHitsFlag = val;};
0079 void SetSavePmtFlag (G4int val) {savePmtFlag = val;};
0080 void SetSaveHitsFlag (G4int val) {saveHitsFlag = val;};
0081 void SetPrintModulo (G4int val) {printModulo = val;};
0082
0083 private:
0084 G4int event_id;
0085
0086 const long* seeds;
0087 G4double energy_pri;
0088
0089
0090 G4int scintillatorCollID;
0091 G4int pmtCollID;
0092 G4int S_hits;
0093 G4int P_hits;
0094
0095
0096 G4double aveTimePmtHits;
0097 G4double totEnergy;
0098 G4double totEnergyGammas;
0099 G4double totEnergyNeutrons;
0100 G4double hitEnergy;
0101 G4double firstLXeHitTime;
0102 G4double firstParticleE;
0103 G4double particleEnergy;
0104 G4String particleName;
0105 G4String firstParticleName;
0106
0107 G4bool gamma_ev;
0108 G4bool neutron_ev;
0109 G4bool positron_ev;
0110 G4bool electron_ev;
0111 G4bool proton_ev;
0112 G4bool other_ev;
0113 G4bool start_gamma;
0114 G4bool start_neutron;
0115
0116
0117 G4String drawTrksFlag;
0118 G4String drawColsFlag;
0119 G4int drawHitsFlag;
0120 G4int savePmtFlag;
0121 G4int saveHitsFlag;
0122 G4int printModulo;
0123 DMXEventActionMessenger* eventMessenger;
0124
0125 const DMXRunAction* runAct;
0126 const DMXPrimaryGeneratorAction* genAction;
0127 std::ofstream *hitsfile;
0128 std::ofstream *pmtfile;
0129 };
0130
0131 #endif
0132