]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - TGeant4/TG4G3ControlVector.cxx
Minor corrections (Sun)
[u/mrichter/AliRoot.git] / TGeant4 / TG4G3ControlVector.cxx
index 19f0131f20c9861d86db7185edffdbba6cb5f8fe..483f5f2e506b0a2e3a7cfd1070377f573c150c34 100644 (file)
@@ -14,6 +14,7 @@
 #include "TG4Globals.h"
 
 #include <G4VProcess.hh>
+#include <g4std/strstream>
 
 #include <math.h>
 
@@ -251,17 +252,30 @@ G4bool TG4G3ControlVector::Update(const TG4G3ControlVector& vector)
 }
 
 //_____________________________________________________________________________
-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();       
 }         
 
 //_____________________________________________________________________________