#include <RE03UserScoreWriter.hh>
Definition at line 43 of file RE03UserScoreWriter.hh.
◆ RE03UserScoreWriter()
RE03UserScoreWriter::RE03UserScoreWriter |
( |
| ) |
|
◆ ~RE03UserScoreWriter()
RE03UserScoreWriter::~RE03UserScoreWriter |
( |
| ) |
|
|
virtual |
◆ DumpQuantityToFile()
void RE03UserScoreWriter::DumpQuantityToFile |
( |
const G4String & |
psName, |
|
|
const G4String & |
fileName, |
|
|
const G4String & |
option |
|
) |
| |
|
virtual |
Reimplemented from G4VScoreWriter.
Definition at line 52 of file RE03UserScoreWriter.cc.
58 G4cout <<
"User-defined DumpQuantityToFile() method is invoked." 60 G4cout <<
" -- to obtain a projection of the quantity <" 62 <<
"> onto the x-y plane --" <<
G4endl;
67 std::transform(opt.begin(), opt.end(), opt.begin(), (int (*)(int))(tolower));
70 if(opt.size() == 0) opt =
"csv";
73 std::ofstream
ofile(fileName);
75 G4cerr <<
"ERROR : DumpToFile : File open error -> " 85 MeshScoreMap::const_iterator msMapItr = scMap.find(psName);
86 if(msMapItr == scMap.end()) {
87 G4cerr <<
"ERROR : DumpToFile : Unknown quantity, \"" 88 << psName <<
"\"." <<
G4endl;
91 std::map<G4int, G4double*> * score = msMapItr->second->GetMap();
92 ofile <<
"# primitive scorer name: " << msMapItr->first <<
G4endl;
99 std::vector<double> projy;
101 std::vector<std::vector<double> > projxy;
102 for(
int x = 0;
x < fNMeshSegments[0];
x++) projxy.push_back(projy);
104 ofile << std::setprecision(16);
105 for(
int x = 0;
x < fNMeshSegments[0];
x++) {
106 for(
int y = 0;
y < fNMeshSegments[1];
y++) {
107 for(
int z = 0;
z < fNMeshSegments[2];
z++) {
111 std::map<G4int, G4double*>::iterator value = score->find(idx);
112 if(value != score->end()) projxy[
x][
y] += *(value->second);
119 ofile << std::setprecision(16);
120 for(
int x = 0;
x < fNMeshSegments[0];
x++) {
121 for(
int y = 0;
y < fNMeshSegments[1];
y++) {
128 ofile << std::setprecision(6);
std::map< G4String, G4THitsMap< G4double > *> MeshScoreMap
MeshScoreMap GetScoreMap() const
G4VScoringMesh * fScoringMesh
const G4String & GetWorldName() const
G4GLOB_DLL std::ostream G4cout
G4int GetIndex(G4int x, G4int y, G4int z) const
G4GLOB_DLL std::ostream G4cerr
The documentation for this class was generated from the following files: