70 G4AutoLock l(G4TypeMutex<Dicom2RunAction>());
73 G4cout <<
"[==========================================================="
75 <<
"===========================================================]"
82 G4cout <<
"[==========================================================="
84 <<
"==========================================================]"
88 G4int nofEvents = aRun->GetNumberOfEvent();
94 for(uintmax_t i = 0; i <
fSDName.size(); i++)
105 if(DoseDeposit && DoseDeposit->size() != 0 )
107 for(
auto itr = DoseDeposit->begin(); itr != DoseDeposit->end(); ++itr)
110 if(!DoseDeposit->GetObject(itr))
112 local_total_dose += (*DoseDeposit->GetObject(itr));
119 G4cout <<
" ###### EndOfRunAction ###### " << G4endl;
124 for(uintmax_t i = 0; i <
fSDName.size(); i++)
135 G4cout <<
"============================================================="
137 G4cout <<
" Number of event processed : "
138 << aRun->GetNumberOfEvent() << G4endl;
139 G4cout <<
"============================================================="
142 std::ofstream fileout;
143 G4String fname =
"dicom2-vector.out";
145 G4cout <<
" opened file " << fname <<
" for dose output" << G4endl;
147 if(DoseDeposit && DoseDeposit->size() != 0)
149 std::ostream *myout = &G4cout;
151 for(
auto itr = DoseDeposit->begin(); itr != DoseDeposit->end();
154 auto _idx = DoseDeposit->GetIndex(itr);
156 if(_stat && _stat->GetHits() > 0)
159 _tmp_stat /= CLHEP::gray;
160 fileout << _idx <<
" " << (*_stat) << G4endl;
163 G4cout <<
"============================================="<<G4endl;
167 G4Exception(
"Dicom2RunAction",
"000", JustWarning,
168 "DoseDeposit HitsMap is either a null pointer "
169 "of the HitsMap was empty");
172 G4cout <<
" closed file " << fname <<
" for dose output" << G4endl;
181 local_total_dose /= gray;
182 G4cout <<
"--------------------End of Global Run-----------------------"
184 G4cout <<
" The run was " << nofEvents <<
" events " << G4endl;
185 G4cout <<
" TOTAL DOSE : \t" << local_total_dose <<
" Gy" << G4endl;
188 local_total_dose /= nofEvents;
189 G4cout <<
" TOTAL DOSE/Bq-s : \t" << local_total_dose <<
" Gy/Bq-s"
196 local_total_dose /= gray;
197 G4cout <<
"--------------------End of Local Run------------------------"
199 G4cout <<
" The run was " << nofEvents <<
" events" << G4endl;
200 G4cout <<
"LOCAL TOTAL DOSE : \t" << local_total_dose <<
" Gy" << G4endl;
203 local_total_dose /= nofEvents;
204 G4cout <<
" LOCAL DOSE/Bq-s : \t" << local_total_dose <<
" Gy/Bq-s"
210 G4cout <<
"Finished : End of Run Action " << aRun->GetRunID() <<
"\n" << G4endl;