42 namespace G4PhysChemIO{
44 FormattedText::FormattedText(){
47 fFileInitialized =
false;
52 FormattedText::~FormattedText(){
58 void FormattedText::InitializeFile()
60 if(fFileInitialized)
return;
62 fOfstream << std::setprecision(6) << std::scientific;
63 fOfstream << setw(11) <<
left <<
"#Parent ID" << setw(10) <<
"Molecule"
64 << setw(14) <<
"Elec Modif" << setw(13) <<
"Energy (eV)"
65 << setw(22) <<
"X pos of parent [nm]" << setw(22)
66 <<
"Y pos of parent [nm]" << setw(22) <<
"Z pos of parent [nm]"
67 << setw(14) <<
"X pos [nm]" << setw(14) <<
"Y pos [nm]"
68 << setw(14) <<
"Z pos [nm]" <<
G4endl<< setw(21) <<
"#"
69 << setw(13) <<
"1)io/ex=0/1"
72 << setw(13) <<
"2)level=0...5"
75 fFileInitialized =
true;
80 void FormattedText::WriteInto(
const G4String& output,
81 ios_base::openmode mode)
83 fOfstream.open(output.
data(), mode);
84 fFileInitialized =
false;
89 void FormattedText::AddEmptyLineInOutputFile()
91 if(fFileInitialized) fOfstream <<
G4endl;
96 void FormattedText::CloseFile()
98 if (fFileInitialized ==
false)
return;
100 if (fOfstream.is_open())
108 void FormattedText::CreateWaterMolecule(
G4int modification,
109 G4int electronicLevel,
111 const G4Track* theIncomingTrack)
113 if(!fFileInitialized) InitializeFile();
116 << setw(10) <<
"H2O" <<
left << modification <<
internal
117 <<
":" <<
right << electronicLevel <<
left << setw(11) <<
""
118 << std::setprecision(2) << std::fixed << setw(13)
119 << energy /
eV << std::setprecision(6) << std::scientific
131 void FormattedText::CreateSolvatedElectron(
const G4Track* theIncomingTrack,
134 if(!fFileInitialized) InitializeFile();
136 fOfstream << setw(11) << theIncomingTrack->
GetTrackID() << setw(10)
137 <<
"e_aq" << setw(14) << -1 << std::setprecision(2)
138 << std::fixed << setw(13)
140 << std::setprecision(6) << std::scientific << setw(22)
147 if (finalPosition != 0)
149 fOfstream << setw(14) << (finalPosition->
x()) /
nanometer << setw(14)
150 << (finalPosition->
y()) /
nanometer << setw(14)
163 fpAnalysisManager(analysisManager)
227 G4int electronicLevel,
229 const G4Track* theIncomingTrack)
293 if (finalPosition != 0)