67 {
G4cout <<
"BrachyUserScorer-defined DumpQuantityToFile() method is invoked." 73 std::transform(opt.begin(), opt.end(), opt.begin(), (int (*)(int))(tolower));
76 if(opt.size() == 0) opt =
"csv";
79 std::ofstream
ofile(fileName);
83 G4cerr <<
"ERROR : DumpToFile : File open error -> " << fileName <<
G4endl;
91 MeshScoreMap::const_iterator msMapItr = fSMap.find(psName);
93 if(msMapItr == fSMap.end())
95 G4cerr <<
"ERROR : DumpToFile : Unknown quantity, \""<< psName
100 std::map<G4int, G4double*> * score = msMapItr ->
second-> GetMap();
102 ofile <<
"# primitive scorer name: " << msMapItr -> first <<
G4endl;
106 ofile << std::setprecision(16);
109 for(
int y = 0;
y < fNMeshSegments[1];
y++) {
110 for(
int z = 0;
z < fNMeshSegments[2];
z++){
111 G4int numberOfVoxel = fNMeshSegments[0];
116 G4double xx = ( - numberOfVoxel + 1+ 2*
x )* voxelWidth/2;
117 G4double yy = ( - numberOfVoxel + 1+ 2*
y )* voxelWidth/2;
118 G4double zz = ( - numberOfVoxel + 1+ 2*
z )* voxelWidth/2;
120 std::map<G4int, G4double*>::iterator value = score -> find(idx);
122 if (value != score -> end())
125 ofile << xx <<
" " << yy <<
" " << zz <<
" " 126 <<*(value->second)/
keV << G4endl;
131 analysis -> FillNtupleWithEnergyDeposition(xx, yy, zz, *(value->second)/
keV);
135 ofile << std::setprecision(6);
std::map< G4String, G4THitsMap< G4double > *> MeshScoreMap
static BrachyAnalysisManager * GetInstance()
void DumpQuantityToFile(const G4String &psName, const G4String &fileName, const G4String &option)
G4VScoringMesh * fScoringMesh
const G4String & GetWorldName() const
G4GLOB_DLL std::ostream G4cout
static const double second
G4int GetIndex(G4int x, G4int y, G4int z) const
virtual ~BrachyUserScoreWriter()
G4GLOB_DLL std::ostream G4cerr