]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - Flugg/WrapUtils.cxx
Adding TPHIC
[u/mrichter/AliRoot.git] / Flugg / WrapUtils.cxx
index a00f99e84ed83cfd3f6c69b915992f6f0b67d76c..9a0291e70b8559d46930ae9e79ce082dfe7dd5ba 100644 (file)
@@ -1,8 +1,5 @@
 #include "WrapUtils.hh"
-
 #include "FGeometryInit.hh"
-#include <iostream.h>
-#include <iomanip.h>
 
 ////////////////////////////////////////////////////////////////////////
 // StepAndLocation
@@ -172,95 +169,29 @@ bool EqualHistories(const G4NavigationHistory* ptrFirstHist,
 ////////////////////////////////////////////////////////////////////////
 // PrintHeader
 ////////////////////////////////////////////////////////////////////////
-ostream& PrintHeader(ostream& os, const char* title) {
+G4std::ostream& PrintHeader(G4std::ostream& os, const char* title) {
   os << "*\n" << "*\n" << "*\n";
   os << "*********************  " << title << " *********************\n"
      << "*\n";
   os << "*...+....1....+....2....+....3....+....4....+....5....+....6....+....7..."
-     << endl;
-  os << "*" << endl;
-
-  return os;
-}
-
-////////////////////////////////////////////////////////////////////////
-// PrintMaterial
-////////////////////////////////////////////////////////////////////////
-ostream& PrintMaterial(ostream& os, const char* title,
-                      G4double Z, G4double A,
-                      G4double density,
-                      G4double index,
-                      G4double N,
-                      const char* name) {
-
-  os << setw10 << title;
-
-  os.setf(0,G4std::ios::floatfield);
-  if (Z < 0)
-    os << setw10 << " ";
-  else
-    os << setw10 
-       << setfixed
-       << G4std::setprecision(1) 
-       << Z;
-  
-  if (A < 0)
-    os << setw10 << " ";
-  else
-    os << setw10 << G4std::setprecision(3)
-       << A;
-
-  os.setf(0,G4std::ios::floatfield);
-  os << setw10 
-     << setscientific
-     << G4std::setprecision(3) 
-     << density;
-
-  os.setf(0,G4std::ios::floatfield);
-  os << setw10 
-     << setfixed
-     << G4std::setprecision(1) 
-     << index;
-
-  os << setw10 << " ";
-
-  if (N < 0)
-    os << setw10 << " ";
-  else
-    os << setw10 << N;
-
-  os << name << endl;
+     << G4endl;
+  os << "*" << G4endl;
 
   return os;
 }
 
-
 ////////////////////////////////////////////////////////////////////////
-// PrintCompund
+// ToFlukaString converts an string to something usefull in FLUKA:
+// * Capital letters
+// * Only 8 letters
+// * Replace ' ' by '_'
 ////////////////////////////////////////////////////////////////////////
-ostream& PrintCompound(ostream& os, const char* title,
-                      G4int count,
-                      const char* name,
-                      G4double fraction,
-                      G4double index) {
-
-  
-  if(count==3) {
-    os << name << endl;
-    os << setw10 << "COMPOUND  ";
+G4String ToFlukaString(G4String str) {
+  str = str.substr(0,8);
+  str.toUpper();
+  for (unsigned int i = 0; i < str.length(); i++) {
+    if (str.at(i) == ' ')
+      str.replace(i,1,"_",1);
   }
-  
-  os.setf(0,G4std::ios::floatfield);
-  os << setw10
-     << setscientific
-     << G4std::setprecision(2)
-     << fraction;
-  os.setf(0,G4std::ios::floatfield);
-  os << setw10
-     << setfixed
-     << G4std::setprecision(1)
-     << index;
-
-  return os;
+  return str;
 }
-