67{
68
69
70 G4AutoLock l(G4TypeMutex<Dicom2RunAction>());
71
72 G4cout << G4endl;
73 G4cout << "[==========================================================="
74 << " DICOM "
75 << "===========================================================]"
76 << G4endl;
77 G4cout << G4endl;
78
80
81 G4cout << G4endl;
82 G4cout << "[==========================================================="
83 << " DICOM2 "
84 << "==========================================================]"
85 << G4endl;
86 G4cout << G4endl;
87
88 G4int nofEvents = aRun->GetNumberOfEvent();
89
91
93
94 for(uintmax_t i = 0; i <
fSDName.size(); i++)
95 {
96
97
98
99
100
101
104
105 if(DoseDeposit && DoseDeposit->size() != 0 )
106 {
107 for(auto itr = DoseDeposit->begin(); itr != DoseDeposit->end(); ++itr)
108 {
109
110 if(!DoseDeposit->GetObject(itr))
111 continue;
112 local_total_dose += (*DoseDeposit->GetObject(itr));
113 }
114 }
115 }
116
117 if(IsMaster())
118 {
119 G4cout << " ###### EndOfRunAction ###### " << G4endl;
120
122
123
124 for(uintmax_t i = 0; i <
fSDName.size(); i++)
125 {
126
127
128
129
130
131
134
135 G4cout << "============================================================="
136 <<G4endl;
137 G4cout << " Number of event processed : "
138 << aRun->GetNumberOfEvent() << G4endl;
139 G4cout << "============================================================="
140 <<G4endl;
141
142 std::ofstream fileout;
143 G4String fname =
"dicom2-vector.out";
144 fileout.open(fname);
145 G4cout << " opened file " << fname << " for dose output" << G4endl;
146
147 if(DoseDeposit && DoseDeposit->size() != 0)
148 {
149 std::ostream *myout = &G4cout;
151 for(auto itr = DoseDeposit->begin(); itr != DoseDeposit->end();
152 ++itr)
153 {
154 auto _idx = DoseDeposit->GetIndex(itr);
156 if(_stat && _stat->GetHits() > 0)
157 {
159 _tmp_stat /= CLHEP::gray;
160 fileout << _idx << " " << (*_stat) << G4endl;
161 }
162 }
163 G4cout << "============================================="<<G4endl;
164 }
165 else
166 {
167 G4Exception("Dicom2RunAction", "000", JustWarning,
168 "DoseDeposit HitsMap is either a null pointer "
169 "of the HitsMap was empty");
170 }
171 fileout.close();
172 G4cout << " closed file " << fname << " for dose output" << G4endl;
173
174 }
175 }
176
177
178 if (IsMaster())
179 {
180
181 local_total_dose /= gray;
182 G4cout << "--------------------End of Global Run-----------------------"
183 << G4endl;
184 G4cout << " The run was " << nofEvents << " events " << G4endl;
185 G4cout << " TOTAL DOSE : \t" << local_total_dose << " Gy" << G4endl;
186 if(nofEvents > 0)
187 {
188 local_total_dose /= nofEvents;
189 G4cout << " TOTAL DOSE/Bq-s : \t" << local_total_dose << " Gy/Bq-s"
190 << G4endl;
191 }
192 }
193 else
194 {
195
196 local_total_dose /= gray;
197 G4cout << "--------------------End of Local Run------------------------"
198 << G4endl;
199 G4cout << " The run was " << nofEvents << " events" << G4endl;
200 G4cout << "LOCAL TOTAL DOSE : \t" << local_total_dose << " Gy" << G4endl;
201 if(nofEvents > 0)
202 {
203 local_total_dose /= nofEvents;
204 G4cout << " LOCAL DOSE/Bq-s : \t" << local_total_dose << " Gy/Bq-s"
205 << G4endl;
206 }
207 }
208
209 G4cout << G4endl;
210 G4cout << "Finished : End of Run Action " << aRun->GetRunID() << "\n" << G4endl;
211
212}
Dicom2Run::Dicom2RunVector Dicom2RunVector
Dicom2RunVector * GetHitsVector(G4int i) const
void EndOfRunAction(const G4Run *)
void PrintHeader(std::ostream *out)