- Timestamp:
- Jun 14, 2010, 3:54:58 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/examples/advanced/hadrontherapy/src/HadrontherapyRunAction.cc
r1230 r1313 27 27 // See more at: http://g4advancedexamples.lngs.infn.it/Examples/hadrontherapy 28 28 29 29 30 #include "HadrontherapyRunAction.hh" 30 31 #include "HadrontherapyEventAction.hh" … … 38 39 #include "HadrontherapyRunAction.hh" 39 40 41 42 #include "HadrontherapyAnalysisManager.hh" 43 #include "HadrontherapyMatrix.hh" 44 40 45 HadrontherapyRunAction::HadrontherapyRunAction() 41 46 { … … 48 53 void HadrontherapyRunAction::BeginOfRunAction(const G4Run* aRun) 49 54 { 50 G4RunManager::GetRunManager()->SetRandomNumberStore(true);51 G4cout << "Run " << aRun -> GetRunID() << " starts ..." << G4endl;55 G4RunManager::GetRunManager()-> SetRandomNumberStore(true); 56 G4cout << "Run " << aRun -> GetRunID() << " starts ..." << G4endl; 52 57 53 electromagnetic = 0; 54 hadronic = 0; 58 // Warning! any beamOn will reset all data (dose, fluence, histograms, etc)! 59 // 60 61 // Initialize matrix with energy of primaries clearing data inside 62 if (HadrontherapyMatrix::GetInstance()) 63 { 64 HadrontherapyMatrix::GetInstance() -> Initialize(); 65 } 66 67 #ifdef G4ANALYSIS_USE_ROOT 68 HadrontherapyAnalysisManager::GetInstance() -> flush(); // Finalize the root file 69 // Initialize root analysis ----> book 70 HadrontherapyAnalysisManager::GetInstance() -> book(); 71 #endif 72 electromagnetic = 0; 73 hadronic = 0; 55 74 } 56 75 57 76 void HadrontherapyRunAction::EndOfRunAction(const G4Run*) 58 77 { 59 // G4cout << " Summary of Run " << aRun -> GetRunID() <<" :"<< G4endl; 60 //G4cout << "Number of electromagnetic processes of primary particles in the phantom:" 61 // << electromagnetic << G4endl; 62 //G4cout << "Number of hadronic processes of primary particles in the phantom:" 63 // << hadronic << G4endl; 78 // Store dose & fluence data to ASCII & ROOT files 79 if ( HadrontherapyMatrix::GetInstance() ) 80 { 81 HadrontherapyMatrix::GetInstance() -> TotalEnergyDeposit(); 82 HadrontherapyMatrix::GetInstance() -> StoreDoseFluenceAscii(); 83 84 #ifdef G4ANALYSIS_USE_ROOT 85 if (HadrontherapyAnalysisManager::GetInstance()) 86 { 87 HadrontherapyMatrix::GetInstance() -> StoreDoseFluenceRoot(); 88 } 89 #endif 90 } 91 92 //G4cout << " Summary of Run " << aRun -> GetRunID() <<" :"<< G4endl; 93 //G4cout << "Number of electromagnetic processes of primary particles in the phantom:" 94 // << electromagnetic << G4endl; 95 //G4cout << "Number of hadronic processes of primary particles in the phantom:" 96 // << hadronic << G4endl; 64 97 } 65 98 void HadrontherapyRunAction::AddEMProcess() … … 72 105 } 73 106 74 75
Note: See TracChangeset
for help on using the changeset viewer.