53 analysis = analysis_manager;
64 {
G4cout <<
"BrachyUserScorer-defined DumpQuantityToFile() method is invoked."
70 std::transform(opt.begin(), opt.end(), opt.begin(), (
int (*)(
int))(tolower));
73 if(opt.size() == 0) opt =
"csv";
76 std::ofstream
ofile(fileName);
80 G4cerr <<
"ERROR : DumpToFile : File open error -> " << fileName <<
G4endl;
88 MeshScoreMap::const_iterator msMapItr = fSMap.find(psName);
90 if(msMapItr == fSMap.end())
92 G4cerr <<
"ERROR : DumpToFile : Unknown quantity, \""<< psName
97 std::map<G4int, G4double*> * score = msMapItr ->
second-> GetMap();
99 ofile <<
"# primitive scorer name: " << msMapItr ->
first <<
G4endl;
103 ofile << std::setprecision(16);
106 for(
int y = 0;
y < fNMeshSegments[1];
y++) {
107 for(
int z = 0;
z < fNMeshSegments[2];
z++){
108 G4int numberOfVoxel = fNMeshSegments[0];
113 G4double xx = ( - numberOfVoxel + 1+ 2*
x )* voxelWidth/2;
114 G4double yy = ( - numberOfVoxel + 1+ 2*
y )* voxelWidth/2;
115 G4double zz = ( - numberOfVoxel + 1+ 2*
z )* voxelWidth/2;
117 std::map<G4int, G4double*>::iterator
value = score -> find(idx);
119 if (value != score -> end())
122 ofile << xx <<
" " << yy <<
" " << zz <<
" "
123 <<*(value->second)/
keV << G4endl;
127 analysis -> FillNtupleWithEnergyDeposition(xx, yy, zz, *(value->second)/
keV);
131 ofile << std::setprecision(6);
const G4String & GetWorldName() const
std::map< G4String, G4THitsMap< G4double > * > MeshScoreMap
typedef int(XMLCALL *XML_NotStandaloneHandler)(void *userData)
BrachyUserScoreWriter(BrachyAnalysisManager *analysis)
void DumpQuantityToFile(const G4String &psName, const G4String &fileName, const G4String &option)
G4VScoringMesh * fScoringMesh
G4GLOB_DLL std::ostream G4cout
G4int GetIndex(G4int x, G4int y, G4int z) const
const XML_Char int const XML_Char * value
virtual ~BrachyUserScoreWriter()
G4GLOB_DLL std::ostream G4cerr