155 std::transform(opt.begin(), opt.end(), opt.begin(), (int (*)(int))(tolower));
158 if(opt.size() == 0) opt =
"csv";
159 if(opt.find(
"csv") == std::string::npos &&
160 opt.find(
"sequence") == std::string::npos) {
161 G4cerr <<
"ERROR : DumpToFile : Unknown option -> " 167 std::ofstream
ofile(fileName);
169 G4cerr <<
"ERROR : DumpToFile : File open error -> " 177 MeshScoreMap::const_iterator msMapItr = fSMap.begin();
178 std::map<G4int, G4double*> * score;
179 for(; msMapItr != fSMap.end(); msMapItr++) {
183 score = msMapItr->second->GetMap();
184 ofile <<
"# primitive scorer name: " << msMapItr->first << std::endl;
191 ofile <<
"# i" << divisionAxisNames[0]
192 <<
", i" << divisionAxisNames[1]
193 <<
", i" << divisionAxisNames[2];
196 if(unit.size() > 0)
ofile <<
"[" << unit <<
"]";
201 if(opt.find(
"sequence") != std::string::npos) {
208 ofile << std::setprecision(16);
210 for(
int y = 0;
y < fNMeshSegments[1];
y++) {
211 for(
int z = 0;
z < fNMeshSegments[2];
z++) {
214 if(opt.find(
"csv") != std::string::npos)
215 ofile <<
x <<
"," <<
y <<
"," <<
z <<
",";
217 std::map<G4int, G4double*>::iterator value = score->find(idx);
218 if(value == score->end()) {
221 ofile << *(value->second)/unitValue;
224 if(opt.find(
"csv") != std::string::npos) {
226 }
else if(opt.find(
"sequence") != std::string::npos) {
234 ofile << std::setprecision(6);
std::map< G4String, G4THitsMap< G4double > *> MeshScoreMap
MeshScoreMap GetScoreMap() const
G4double GetPSUnitValue(const G4String &psname)
G4String GetPSUnit(const G4String &psname)
G4VScoringMesh * fScoringMesh
const G4String & GetWorldName() const
void GetDivisionAxisNames(G4String divisionAxisNames[3])
G4int GetIndex(G4int x, G4int y, G4int z) const
G4GLOB_DLL std::ostream G4cerr