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, G4StatDouble*> * 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_x = fNMeshSegments[0];
112 G4int numberOfVoxel_y = fNMeshSegments[1];
113 G4int numberOfVoxel_z =fNMeshSegments[2];
118 G4double xx = ( - numberOfVoxel_x + 1+ 2*
x )* voxelWidth/2;
119 G4double yy = ( - numberOfVoxel_y + 1+ 2*y )* voxelWidth/2;
120 G4double zz = ( - numberOfVoxel_z + 1+ 2*
z )* voxelWidth/2;
122 std::map<G4int, G4StatDouble*>::iterator
value = score -> find(idx);
124 if (value != score -> end())
128 ofile << xx <<
" " << yy <<
" " << zz <<
" "
129 <<(value->second->sum_wx())/
keV << G4endl;
135 if(zz> -0.125 *
mm && zz < 0.125*
mm) analysis -> FillH2WithEnergyDeposition(xx,yy, (value->second->sum_wx())/
keV);
139 ofile << std::setprecision(6);
const G4String & GetWorldName() const
static constexpr double mm
static BrachyAnalysisManager * GetInstance()
static constexpr double second
void DumpQuantityToFile(const G4String &psName, const G4String &fileName, const G4String &option)
G4VScoringMesh * fScoringMesh
G4GLOB_DLL std::ostream G4cout
const XML_Char int const XML_Char * value
typedef int(XMLCALL *XML_NotStandaloneHandler)(void *userData)
G4int GetIndex(G4int x, G4int y, G4int z) const
virtual ~BrachyUserScoreWriter()
static constexpr double keV
std::map< G4String, RunScore * > MeshScoreMap
G4GLOB_DLL std::ostream G4cerr