00001 // 00002 // $Id: RunAction.hh 166 2008-09-16 10:39:56Z maire $ 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 namespace AIDA { 00018 class IAnalysisFactory; 00019 class ITree; 00020 class IHistogram1D; 00021 } 00022 00023 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 00024 00025 class RunAction : public G4UserRunAction 00026 { 00027 public: 00028 RunAction(DetectorConstruction*); 00029 ~RunAction(); 00030 00031 public: 00032 void BeginOfRunAction(const G4Run*); 00033 void EndOfRunAction(const G4Run*); 00034 00035 void SumEvents(G4double e) { m_sumEdep += e; m_sumEdep2 += e*e; m_nbEntry++; }; 00036 void SumDepthDose(G4double,G4double); 00037 00038 void WriteDepthDose(G4String); 00039 00040 void BookHistoFile (G4String, G4String); 00041 void SaveHistoFile (); 00042 AIDA::IHistogram1D* GetHisto(G4int id) {return m_histo[id];} 00043 00044 private: 00045 DetectorConstruction* m_detector; 00046 00047 G4double m_sumEdep, m_sumEdep2; 00048 G4int m_nbEntry; 00049 00050 std::vector<G4double> m_depthDose; 00051 G4double m_astronautHeight; 00052 G4double m_sliceWidth; 00053 G4int m_nbSlices; 00054 00055 G4String histoFile; 00056 AIDA::IAnalysisFactory* m_af; 00057 AIDA::ITree* m_tree; 00058 AIDA::IHistogram1D* m_histo[2]; 00059 }; 00060 00061 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 00062 00063 #endif 00064