#include "TG4Globals.h"
#include <G4VProcess.hh>
+#include <g4std/strstream>
#include <math.h>
}
//_____________________________________________________________________________
-void TG4G3ControlVector::Print() const
+G4String TG4G3ControlVector::Format() const
{
-// Prints the controls.
+// Formats the output into a string.
// ---
- G4cout << " G3 control vector:" << G4endl;
+ strstream tmpStream;
+
+ tmpStream << " G3 control vector:" << G4endl;
for (G4int i=0; i<kNoG3Controls; i++)
//if (i != kDRAY) {
- G4cout << " " << fgControlNameVector[i]
- << " control value: " << fControlVector[i] << G4endl;
+ tmpStream << " " << fgControlNameVector[i]
+ << " control value: " << fControlVector[i] << G4endl;
//}
+
+ return tmpStream.str();
+}
+
+//_____________________________________________________________________________
+void TG4G3ControlVector::Print() const
+{
+// Prints the controls.
+// ---
+
+ G4cout << Format();
}
//_____________________________________________________________________________
#include <G4ParticleDefinition.hh>
#include <G4VProcess.hh>
+#include <g4std/strstream>
+
const G4double TG4G3CutVector::fgkDCUTEOff = 10. * TeV;
const G4double TG4G3CutVector::fgkDCUTMOff = 10. * TeV;
const G4double TG4G3CutVector::fgkTolerance = 1. * keV;
}
//_____________________________________________________________________________
-void TG4G3CutVector::Print() const
+G4String TG4G3CutVector::Format() const
{
-// Prints the cuts.
+// Formats the output into a string.
// ---
- G4cout << " G3 cut vector:" << G4endl;
+ strstream tmpStream;
+ tmpStream << " G3 cut vector:" << G4endl;
if (fDeltaRaysOn)
- G4cout << " Delta rays On" << G4endl;
+ tmpStream << " Delta rays On" << G4endl;
else
- G4cout << " Delta rays Off" << G4endl;
+ tmpStream << " Delta rays Off" << G4endl;
// energy cuts
for (G4int i=0; i<kTOFMAX; i++) {
- G4cout << " " << fgCutNameVector[i] << " cut value (MeV): ";
+ tmpStream << " " << fgCutNameVector[i] << " cut value (MeV): ";
if (i == kDCUTE && !fDeltaRaysOn)
- G4cout << fgkDCUTEOff/MeV << G4endl;
+ tmpStream << fgkDCUTEOff/MeV << G4endl;
else if (i == kDCUTM && !fDeltaRaysOn)
- G4cout << fgkDCUTMOff/MeV << G4endl;
+ tmpStream << fgkDCUTMOff/MeV << G4endl;
else
- G4cout << fCutVector[i]/MeV << G4endl;
+ tmpStream << fCutVector[i]/MeV << G4endl;
}
// time cut
- G4cout << " " << fgCutNameVector[kTOFMAX] << " cut value (s): "
- << fCutVector[kTOFMAX]/s << G4endl;
+ tmpStream << " " << fgCutNameVector[kTOFMAX] << " cut value (s): "
+ << fCutVector[kTOFMAX]/s << G4endl;
+
+ return tmpStream.str();
+}
+
+//_____________________________________________________________________________
+void TG4G3CutVector::Print() const
+{
+// Prints the cuts.
+// ---
+
+ G4cout << Format();
}
//_____________________________________________________________________________