33 #include "Analysis.hh"
34 #include "RunActionMaster.hh"
36 #include "RunMerger.hh"
87 G4cout <<
"=====================================================" <<
G4endl;
88 G4cout <<
"Start EndOfRunAction for master thread in rank: " << rank<<
G4endl;
89 G4cout <<
"=====================================================" <<
G4endl;
93 RunMerger rm(static_cast<const Run*>(arun));
95 if ( rank == 0 && ver == 0) ver = 1;
98 G4cout<<
"Before merge the Run object has test counter value: "
99 <<
static_cast<const Run*
>(arun)->GetCounter()<<
G4endl;
104 G4cout<<
"After merge the Run object has test counter value: "
105 <<
static_cast<const Run*
>(arun)->GetCounter()
106 <<
" (with 1 thread== number of ranks)"<<
G4endl;
116 auto debugme = [&scor](){
117 for (
size_t idx = 0 ;
idx < scor->GetNumberOfMesh() ; ++
idx) {
118 const auto m = scor->GetMesh(
idx);
119 const auto map =
m->GetScoreMap();
120 std::for_each(map.begin(),map.end(),
121 [](
const G4VScoringMesh::MeshScoreMap::value_type&
e) {
123 const auto data =
e.second->GetMap();
125 G4cout<<
it->first<<
" => G4StatDouble(n,sum_w,sum_w2,sum_wx,sum_wx2): "
126 <<
it->second->n()<<
" "<<
it->second->sum_w()<<
" "
127 <<
it->second->sum_w2()<<
" "<<
it->second->sum_wx()<<
" "
142 for (
size_t idx = 0 ;
idx < scor->GetNumberOfMesh() ; ++
idx) {
143 const auto m = scor->GetMesh(
idx);
144 const auto& mn =
m->GetWorldName();
145 std::ostringstream
fname;
146 fname<<
"scorer-"<<mn<<
"-rank"<<rank<<
".csv";
147 scor->DumpAllQuantitiesToFile(mn,fname.str());
161 for (
size_t idx = 0 ;
idx < scor->GetNumberOfMesh() ; ++
idx) {
162 const auto m = scor->GetMesh(
idx);
163 const auto& mn =
m->GetWorldName();
164 std::ostringstream
fname;
165 fname<<
"scorer-"<<mn<<
"-merged.csv";
166 scor->DumpAllQuantitiesToFile(mn,fname.str());
177 myana->
Close(
false);
191 std::ostringstream
fname;
192 fname<<
"dose-rank"<<rank;
194 fname.str(
"dose-merged");
197 myana-> Save(fname.str());
202 G4cout <<
"===================================================" <<
G4endl;
203 G4cout <<
"End EndOfRunAction for master thread in rank: " << rank <<
G4endl;
204 G4cout <<
"===================================================" <<
G4endl;