00001 // 00002 // $Id: RunAction.hh 222 2008-11-21 08:12:11Z jacquem $ 00003 // 00004 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 00005 00006 #ifndef RunAction_h 00007 #define RunAction_h 1 00008 00009 #include "G4UserRunAction.hh" 00010 #include "globals.hh" 00011 00012 #include <vector> 00013 00014 class G4Run; 00015 class DetectorConstruction; 00016 00017 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 00018 00019 class RunAction : public G4UserRunAction 00020 { 00021 public: 00022 RunAction(DetectorConstruction*); 00023 ~RunAction(); 00024 00025 public: 00026 void BeginOfRunAction(const G4Run*); 00027 void EndOfRunAction(const G4Run*); 00028 00029 void SumEvents(G4double e) { m_sumEdep += e; m_sumEdep2 += e*e; m_nbEntry++; }; 00030 void SumDepthDose(G4double,G4double); 00031 00032 // -- jour4a : duplication of SumDepthDose code for depthDoseSD vector: 00033 void SumDepthDoseSD(G4double,G4double); 00034 // -- jour4b2 : additionnal method to fill passing directly a given bin: 00035 void SumDepthDoseSD(G4int, G4double, G4int, G4double); 00036 // -- utility method to get the slice number, from the z coordinate: 00037 G4int GetSliceNumber(G4double z) const; 00038 // -- number of slices defined: 00039 G4int GetNumberOfSlices() const {return m_nbSlices;} 00040 00041 void WriteDepthDose(G4String); 00042 00043 private: 00044 DetectorConstruction* m_detector; 00045 00046 G4double m_sumEdep, m_sumEdep2; 00047 G4int m_nbEntry; 00048 00049 std::vector<G4double> m_depthDose; 00050 std::vector<G4double> m_depthDoseSD, m_depthTotalEkin; 00051 std::vector<G4int> m_depthNbProton; 00052 G4double m_astronautHeight; 00053 G4double m_sliceWidth; 00054 G4int m_nbSlices; 00055 }; 00056 00057 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 00058 00059 #endif 00060