74 G4cout <<
"### Run " << aRun->GetRunID() <<
" start." << G4endl;
76 G4RunManager::GetRunManager()->SetRandomNumberStore(
true);
77 G4RunManager::GetRunManager()->SetRandomNumberStorePerEvent(
false);
78 G4RunManager::GetRunManager()->SetRandomNumberStoreDir(
79 G4String(
"dicom-run-") + std::to_string(aRun->GetRunID()));
81 G4int progress = aRun->GetNumberOfEventToBeProcessed() / 100;
82 progress = (progress < 1) ? 1 : progress;
83 G4RunManager::GetRunManager()->SetPrintProgress(progress);
89 G4int nofEvents = aRun->GetNumberOfEvent();
91 static G4double local_total_dose = 0;
92 G4double total_dose = 0;
96 for ( G4int i = 0; i < (G4int)
fSDName.size(); i++ ){
106 if( DoseDeposit && DoseDeposit->GetMap()->size() != 0 ) {
107 std::map<G4int,G4double*>::iterator itr =
108 DoseDeposit->GetMap()->begin();
109 for(; itr != DoseDeposit->GetMap()->end(); itr++) {
110 if(!IsMaster()) { local_total_dose += *(itr->second); }
111 total_dose += *(itr->second);
119 G4cout <<
"--------------------End of Global Run-----------------------"
121 G4cout <<
" The run was " << nofEvents <<
" events " << G4endl;
122 G4cout <<
"LOCAL TOTAL DOSE : \t" << local_total_dose/gray
124 G4cout <<
" TOTAL DOSE : \t" << total_dose/gray
130 G4cout <<
"--------------------End of Local Run------------------------"
132 G4cout <<
" The run was " << nofEvents << G4endl;
133 G4cout <<
"LOCAL TOTAL DOSE : \t" << local_total_dose/gray
135 G4cout <<
" TOTAL DOSE : \t" << total_dose/gray
141 G4cout <<
" ###### EndOfRunAction ###### " << G4endl;
146 for ( G4int i = 0; i < (G4int)
fSDName.size(); i++ ){
156 G4cout <<
"============================================================="
158 G4cout <<
" Number of event processed : "
159 << aRun->GetNumberOfEvent() << G4endl;
160 G4cout <<
"============================================================="
163 std::ofstream fileout;
166 G4cout <<
" opened file " << fname <<
" for dose output" << G4endl;
168 if( DoseDeposit && DoseDeposit->GetMap()->size() != 0 ) {
169 std::ostream *myout = &G4cout;
171 std::map<G4int,G4double*>::iterator itr =DoseDeposit->GetMap()->begin();
172 for(; itr != DoseDeposit->GetMap()->end(); itr++) {
173 fileout << itr->first
174 <<
" " << *(itr->second)/CLHEP::gray
181 G4cout <<
"============================================="<<G4endl;
183 G4Exception(
"DicomRunAction",
"000", JustWarning,
184 "DoseDeposit HitsMap is either a null pointer of the HitsMap was empty");
187 G4cout <<
" closed file " << fname <<
" for dose output" << G4endl;
192 G4cout <<
"Finished : End of Run Action " << aRun->GetRunID() << G4endl;