34 #include "Analysis.hh"
88 G4cout <<
"=====================================================" <<
G4endl;
89 G4cout <<
"Start EndOfRunAction for master thread in rank: " << rank<<
G4endl;
90 G4cout <<
"=====================================================" <<
G4endl;
94 RunMerger rm(static_cast<const Run*>(arun));
96 if ( rank == 0 && ver == 0) ver = 1;
99 G4cout<<
"Before merge the Run object has test counter value: "
100 <<
static_cast<const Run*
>(arun)->GetCounter()<<
G4endl;
105 G4cout<<
"After merge the Run object has test counter value: "
106 <<
static_cast<const Run*
>(arun)->GetCounter()
107 <<
" (with 1 thread== number of ranks)"<<
G4endl;
117 auto debugme = [&scor](){
118 for (
size_t idx = 0 ; idx < scor->GetNumberOfMesh() ; ++idx) {
119 const auto m = scor->GetMesh(idx);
121 std::for_each(map.begin(),map.end(),
122 [](
const MeshScoreMap::value_type& e) {
124 const auto data = e.second->GetMap();
125 for(
auto it = data->begin() ; it != data->end() ; ++it ) {
126 G4cout<<it->first<<
" => G4StatDouble(n,sum_w,sum_w2,sum_wx,sum_wx2): "
127 <<it->second->n()<<
" "<<it->second->sum_w()<<
" "
128 <<it->second->sum_w2()<<
" "<<it->second->sum_wx()<<
" "
129 <<it->second->sum_wx2()<<
G4endl;
143 for (
size_t idx = 0 ; idx < scor->GetNumberOfMesh() ; ++idx) {
144 const auto m = scor->GetMesh(idx);
145 const auto& mn =
m->GetWorldName();
146 std::ostringstream fname;
147 fname<<
"scorer-"<<mn<<
"-rank"<<rank<<
".csv";
148 scor->DumpAllQuantitiesToFile(mn,fname.str());
162 for (
size_t idx = 0 ; idx < scor->GetNumberOfMesh() ; ++idx) {
163 const auto m = scor->GetMesh(idx);
164 const auto& mn =
m->GetWorldName();
165 std::ostringstream fname;
166 fname<<
"scorer-"<<mn<<
"-merged.csv";
167 scor->DumpAllQuantitiesToFile(mn,fname.str());
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;
virtual void EndOfRunAction(const G4Run *arun)
void SetVerbosity(G4int ver)
G4GLOB_DLL std::ostream G4cout
static G4ScoringManager * GetScoringManagerIfExist()
static constexpr double m
static Analysis * GetAnalysis()
static G4MPImanager * GetManager()
virtual G4Run * GenerateRun()
void SetVerbosity(G4int ver)
virtual void BeginOfRunAction(const G4Run *arun)
static G4ScoringManager * GetScoringManager()
void SetVerbosity(G4int ver)
std::map< G4String, RunScore * > MeshScoreMap