]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - TGeant4/TG4XMLConvertor.cxx
Updated SDigitizer
[u/mrichter/AliRoot.git] / TGeant4 / TG4XMLConvertor.cxx
index a1ba687e355e1c4473e4a7d5800b4ab9b5c00c78..b6a943e0402d6ae1398a2b0b81dc089d5c70c6da 100644 (file)
@@ -1,6 +1,10 @@
 // $Id$
 // Category: geometry
 //
+// Author: I. Hrivnacova, 27.07.2000 
+//
+// Class TG4XMLConvertor 
+// ---------------------
 // See the class description in the header file.
 
 #include "TG4XMLConvertor.h"
 #include <G4PVReplica.hh>
 #include <G4Material.hh>
 #include <G4VSolid.hh>
+#include <G4ReflectedSolid.hh>
 #include <G4Box.hh>
 #include <G4Tubs.hh>
 #include <G4Cons.hh>
 #include <G4Trd.hh>
 #include <G4Trap.hh>
+#include <G4Para.hh>
 #include <G4Polycone.hh>
 #include <G4Polyhedra.hh>
 
 
 const G4int TG4XMLConvertor::fgkMaxVolumeNameLength   = 10;
 const G4int TG4XMLConvertor::fgkMaxMaterialNameLength = 20;
+const G4int TG4XMLConvertor::fgkDefaultNumWidth = 7;
+const G4int TG4XMLConvertor::fgkDefaultNumPrecision = 4;
 
+//_____________________________________________________________________________
 TG4XMLConvertor::TG4XMLConvertor(G4std::ofstream& outFile) 
   : fOutFile(outFile),
     fkBasicIndention("   "),
+    fNW(fgkDefaultNumWidth),
+    fNP(fgkDefaultNumPrecision),
     fIndention(fkBasicIndention),
     fRotationCounter(0)
 {
-//
+  fOutFile.width(fgkDefaultNumWidth);
+  fOutFile.precision(fgkDefaultNumPrecision);
 }
 
+//_____________________________________________________________________________
 TG4XMLConvertor::~TG4XMLConvertor() {
 //
 }
 
 // private methods
 
+//_____________________________________________________________________________
 void TG4XMLConvertor::CutName(G4String& name) const
 {
 // Removes spaces after the name if present.
@@ -49,6 +63,7 @@ void TG4XMLConvertor::CutName(G4String& name) const
   while (name(--i) == ' ') name = name(0,i);
 }  
 
+//_____________________________________________________________________________
 void TG4XMLConvertor::CutName(G4String& name, G4int size) const
 {
 // Cuts name to given size.
@@ -57,6 +72,7 @@ void TG4XMLConvertor::CutName(G4String& name, G4int size) const
   if (name.length() > size) name = name(0, size);
 }  
 
+//_____________________________________________________________________________
 void TG4XMLConvertor::PutName(G4String& element, G4String name, 
                               G4String templ) const
 {
@@ -75,6 +91,7 @@ void TG4XMLConvertor::PutName(G4String& element, G4String name,
   while (element.contains(templ)) element.replace(element.find(templ), 1 , " ");
 }    
   
+//_____________________________________________________________________________
 void TG4XMLConvertor::WriteBox(G4String lvName, const G4Box* box, 
                                G4String materialName)
 {
@@ -98,12 +115,13 @@ void TG4XMLConvertor::WriteBox(G4String lvName, const G4Box* box,
   fOutFile << fkBasicIndention << element1 << G4endl  
            << indention        << element2 << G4endl
           << indention        << element3
-           << G4std::setw(7) << G4std::setprecision(2) << x << "  "
-           << G4std::setw(7) << G4std::setprecision(2) << y << "  "
-           << G4std::setw(7) << G4std::setprecision(2) << z 
+           << G4std::setw(fNW) << G4std::setprecision(fNP) << x << "  "
+           << G4std::setw(fNW) << G4std::setprecision(fNP) << y << "  "
+           << G4std::setw(fNW) << G4std::setprecision(fNP) << z 
           << element4 << G4endl << G4endl;
 }
  
+//_____________________________________________________________________________
 void TG4XMLConvertor::WriteTubs(G4String lvName, const G4Tubs* tubs, 
                                 G4String materialName)
 {
@@ -130,17 +148,17 @@ void TG4XMLConvertor::WriteTubs(G4String lvName, const G4Tubs* tubs,
   fOutFile << fkBasicIndention << element1 << G4endl
           << indention        << element2 << G4endl
           << indention        << element3
-           << G4std::setw(7)   << G4std::setprecision(2) << sphi << "  "
-           << G4std::setw(7)   << G4std::setprecision(2) << sphi+dphi
+           << G4std::setw(fNW)   << G4std::setprecision(fNP) << sphi << "  "
+           << G4std::setw(fNW)   << G4std::setprecision(fNP) << sphi+dphi
           << quota << G4endl              
           << indention        << element4
-           << G4std::setw(7) << G4std::setprecision(2) << rmin << "  "
-           << G4std::setw(7) << G4std::setprecision(2) << rmax << "  "
-           << G4std::setw(7) << G4std::setprecision(2) << hz 
+           << G4std::setw(fNW) << G4std::setprecision(fNP) << rmin << "  "
+           << G4std::setw(fNW) << G4std::setprecision(fNP) << rmax << "  "
+           << G4std::setw(fNW) << G4std::setprecision(fNP) << hz 
           << element5 << G4endl << G4endl;
 }  
 
-
+//_____________________________________________________________________________
 void TG4XMLConvertor::WriteCons(G4String lvName, const G4Cons* cons, 
                                 G4String materialName)
 {
@@ -169,19 +187,19 @@ void TG4XMLConvertor::WriteCons(G4String lvName, const G4Cons* cons,
   fOutFile << fkBasicIndention << element1 << G4endl
           << indention        << element2 << G4endl
           << indention        << element3
-           << G4std::setw(7)   << G4std::setprecision(2) << sphi << "  "
-           << G4std::setw(7)   << G4std::setprecision(2) << sphi+dphi
+           << G4std::setw(fNW)   << G4std::setprecision(fNP) << sphi << "  "
+           << G4std::setw(fNW)   << G4std::setprecision(fNP) << sphi+dphi
           << quota << G4endl              
           << indention        << element4
-           << G4std::setw(7) << G4std::setprecision(2) << rmin1 << "  "
-           << G4std::setw(7) << G4std::setprecision(2) << rmax1 << "  "
-           << G4std::setw(7) << G4std::setprecision(2) << rmin2 << "  "
-           << G4std::setw(7) << G4std::setprecision(2) << rmax2 << "  "
-           << G4std::setw(7) << G4std::setprecision(2) << hz 
+           << G4std::setw(fNW) << G4std::setprecision(fNP) << rmin1 << "  "
+           << G4std::setw(fNW) << G4std::setprecision(fNP) << rmin2 << "  "
+           << G4std::setw(fNW) << G4std::setprecision(fNP) << rmax1 << "  "
+           << G4std::setw(fNW) << G4std::setprecision(fNP) << rmax2 << "  "
+           << G4std::setw(fNW) << G4std::setprecision(fNP) << hz 
           << element5 << G4endl << G4endl;
 }  
 
-
+//_____________________________________________________________________________
 void TG4XMLConvertor::WriteTrd(G4String lvName, const G4Trd* trd, 
                                G4String materialName)
 {
@@ -207,15 +225,15 @@ void TG4XMLConvertor::WriteTrd(G4String lvName, const G4Trd* trd,
   fOutFile << fkBasicIndention << element1 << G4endl
           << indention        << element2 << G4endl
           << indention        << element3
-           << G4std::setw(7) << G4std::setprecision(2) << x1 << "  "
-           << G4std::setw(7) << G4std::setprecision(2) << x2 << "  "
-           << G4std::setw(7) << G4std::setprecision(2) << y1 << "  "
-           << G4std::setw(7) << G4std::setprecision(2) << y2 << "  "
-           << G4std::setw(7) << G4std::setprecision(2) << hz
+           << G4std::setw(fNW) << G4std::setprecision(fNP) << x1 << "  "
+           << G4std::setw(fNW) << G4std::setprecision(fNP) << x2 << "  "
+           << G4std::setw(fNW) << G4std::setprecision(fNP) << y1 << "  "
+           << G4std::setw(fNW) << G4std::setprecision(fNP) << y2 << "  "
+           << G4std::setw(fNW) << G4std::setprecision(fNP) << hz
           << element4 << G4endl << G4endl;
 }  
 
-
+//_____________________________________________________________________________
 void TG4XMLConvertor::WriteTrap(G4String lvName, const G4Trap* trap, 
                                 G4String materialName)
 {
@@ -259,24 +277,77 @@ void TG4XMLConvertor::WriteTrap(G4String lvName, const G4Trap* trap,
   fOutFile << fkBasicIndention << element1 << G4endl
           << indention        << element2 << G4endl
           << indention        << element3
-           << G4std::setw(7) << G4std::setprecision(2) << x2 << "  "
-           << G4std::setw(7) << G4std::setprecision(2) << x1 << "  "
-           << G4std::setw(7) << G4std::setprecision(2) << x4 << "  "
-           << G4std::setw(7) << G4std::setprecision(2) << x3 << "  "
-           << G4std::setw(7) << G4std::setprecision(2) << y2 << "  "
-           << G4std::setw(7) << G4std::setprecision(2) << y1 << "  "
-           << G4std::setw(7) << G4std::setprecision(2) << dz 
+           << G4std::setw(fNW) << G4std::setprecision(fNP) << x2 << "  "
+           << G4std::setw(fNW) << G4std::setprecision(fNP) << x1 << "  "
+           << G4std::setw(fNW) << G4std::setprecision(fNP) << x4 << "  "
+           << G4std::setw(fNW) << G4std::setprecision(fNP) << x3 << "  "
+           << G4std::setw(fNW) << G4std::setprecision(fNP) << y2 << "  "
+           << G4std::setw(fNW) << G4std::setprecision(fNP) << y1 << "  "
+           << G4std::setw(fNW) << G4std::setprecision(fNP) << dz 
           << quota << G4endl
            << indention       << element4
-           << G4std::setw(7) << G4std::setprecision(2) << inc1 << "  "
-           << G4std::setw(7) << G4std::setprecision(2) << inc2 
+           << G4std::setw(fNW) << G4std::setprecision(fNP) << inc1 << "  "
+           << G4std::setw(fNW) << G4std::setprecision(fNP) << inc2 
           << quota << G4endl
           << indention       << element5
-           << G4std::setw(7) << G4std::setprecision(2) << alpha1 << "  "
-           << G4std::setw(7) << G4std::setprecision(2) << alpha2 
+           << G4std::setw(fNW) << G4std::setprecision(fNP) << alpha1 << "  "
+           << G4std::setw(fNW) << G4std::setprecision(fNP) << alpha2 
           << element6 << G4endl << G4endl;
 }  
 
+//_____________________________________________________________________________
+void TG4XMLConvertor::WritePara(G4String lvName, const G4Para* para, 
+                                G4String materialName)
+{
+// Writes G4Para solid.
+// ---
+
+  // get parameters
+  G4double dx = para->GetXHalfLength()/TG4G3Units::Length()*2.;
+  G4double dy = para->GetYHalfLength()/TG4G3Units::Length()*2.;
+  G4double dz = para->GetZHalfLength()/TG4G3Units::Length()*2.;
+  G4double tanAlpha     = para->GetTanAlpha();
+  G4ThreeVector symAxis = para->GetSymAxis();
+  
+  G4double alpha = atan(tanAlpha) / deg;
+  G4double theta = acos(symAxis.z()) / deg;
+  G4double phi;
+  if (theta == 0.)
+    phi = 0;
+  else        
+    phi = atan(symAxis.y()/symAxis.x()) / deg;
+
+  // compose element string template
+  G4String quota = "\"";
+  G4String element1 = "<para   name=\"" + lvName + quota;
+  G4String element2 = "material=\"" + materialName + quota;
+  G4String element3 = "X_Y_Z=\"";
+  G4String element4 = "alpha=\"";
+  G4String element5 = "theta=\"";
+  G4String element6 = "phi=  \"";
+  G4String element7 = "\" />";
+  G4String indention = fkBasicIndention + fkBasicIndention;
+  
+  // write element
+  fOutFile << fkBasicIndention << element1 << G4endl  
+           << indention        << element2 << G4endl
+          << indention        << element3
+           << G4std::setw(fNW) << G4std::setprecision(fNP) << dx << "  "
+           << G4std::setw(fNW) << G4std::setprecision(fNP) << dy << "  "
+           << G4std::setw(fNW) << G4std::setprecision(fNP) << dz 
+          << quota << G4endl
+          << indention        << element4
+           << G4std::setw(fNW) << G4std::setprecision(fNP) << alpha 
+          << quota << G4endl
+          << indention        << element5
+           << G4std::setw(fNW) << G4std::setprecision(fNP) << theta
+          << quota << G4endl
+          << indention        << element6
+           << G4std::setw(fNW) << G4std::setprecision(fNP) << phi         
+          << element7 << G4endl << G4endl;
+}
+//_____________________________________________________________________________
 void TG4XMLConvertor::WritePolycone(G4String lvName, const G4Polycone* polycone, 
                                     G4String materialName)
 {
@@ -310,8 +381,8 @@ void TG4XMLConvertor::WritePolycone(G4String lvName, const G4Polycone* polycone,
   fOutFile << fkBasicIndention << element1 << G4endl
           << indention        << element2 << G4endl
           << indention        << element3
-           << G4std::setw(7) << G4std::setprecision(2) << sphi << "  "
-           << G4std::setw(7) << G4std::setprecision(2) << ephi
+           << G4std::setw(fNW) << G4std::setprecision(fNP) << sphi << "  "
+           << G4std::setw(fNW) << G4std::setprecision(fNP) << ephi
           << element4 << G4endl;
 
   // write polyplane elements
@@ -323,9 +394,9 @@ void TG4XMLConvertor::WritePolycone(G4String lvName, const G4Polycone* polycone,
     G4double z    = zArray[i]/TG4G3Units::Length();
 
     fOutFile << indention << element5
-             << G4std::setw(7) << G4std::setprecision(2) << rmin << "  "
-             << G4std::setw(7) << G4std::setprecision(2) << rmax << "  " 
-             << G4std::setw(7) << G4std::setprecision(2) << z 
+             << G4std::setw(fNW) << G4std::setprecision(fNP) << rmin << "  "
+             << G4std::setw(fNW) << G4std::setprecision(fNP) << rmax << "  " 
+             << G4std::setw(fNW) << G4std::setprecision(fNP) << z 
             << element6
             << G4endl;
   }
@@ -335,7 +406,7 @@ void TG4XMLConvertor::WritePolycone(G4String lvName, const G4Polycone* polycone,
            << element7 << G4endl << G4endl;         
 }  
 
-
+//_____________________________________________________________________________
 void TG4XMLConvertor::WritePolyhedra(G4String lvName, const G4Polyhedra* polyhedra, 
                                     G4String materialName)
 {
@@ -371,8 +442,8 @@ void TG4XMLConvertor::WritePolyhedra(G4String lvName, const G4Polyhedra* polyhed
   fOutFile << fkBasicIndention << element1 << G4endl
           << indention        << element2 << G4endl
           << indention        << element3
-           << G4std::setw(7) << G4std::setprecision(2) << sphi << "  "
-           << G4std::setw(7) << G4std::setprecision(2) << ephi
+           << G4std::setw(fNW) << G4std::setprecision(fNP) << sphi << "  "
+           << G4std::setw(fNW) << G4std::setprecision(fNP) << ephi
           << quota << G4endl
           << indention       << element4 
           << nofSides
@@ -384,7 +455,7 @@ void TG4XMLConvertor::WritePolyhedra(G4String lvName, const G4Polyhedra* polyhed
     // set units    
     G4double rmin = rminArray[i]/TG4G3Units::Length();
     if (i>0) fOutFile << "  ";
-    fOutFile << G4std::setw(7) << G4std::setprecision(2) << rmin;
+    fOutFile << G4std::setw(fNW) << G4std::setprecision(fNP) << rmin;
   };
   fOutFile << quota << G4endl;
 
@@ -393,7 +464,7 @@ void TG4XMLConvertor::WritePolyhedra(G4String lvName, const G4Polyhedra* polyhed
     // set units
     G4double rmax = rmaxArray[i]/TG4G3Units::Length();
     if (i>0) fOutFile << "  ";
-    fOutFile << G4std::setw(7) << G4std::setprecision(2) << rmax;
+    fOutFile << G4std::setw(fNW) << G4std::setprecision(fNP) << rmax;
   };
   fOutFile << quota << G4endl;
 
@@ -402,7 +473,7 @@ void TG4XMLConvertor::WritePolyhedra(G4String lvName, const G4Polyhedra* polyhed
     // set units
     G4double z = zArray[i]/TG4G3Units::Length();
     if (i>0) fOutFile << "  ";
-    fOutFile << G4std::setw(7) << G4std::setprecision(2) << z;
+    fOutFile << G4std::setw(fNW) << G4std::setprecision(fNP) << z;
   };
   fOutFile << element8 << G4endl << G4endl;
 }  
@@ -410,6 +481,7 @@ void TG4XMLConvertor::WritePolyhedra(G4String lvName, const G4Polyhedra* polyhed
 
 // public methods
 
+//_____________________________________________________________________________
 void TG4XMLConvertor::OpenMaterials(const G4String& version, 
                         const G4String& date, const G4String& author,
                          const G4String dtdVersion)
@@ -432,6 +504,7 @@ void TG4XMLConvertor::OpenMaterials(const G4String& version,
            << element5 << G4endl;
 }  
 
+//_____________________________________________________________________________
 void TG4XMLConvertor::OpenSection(const G4String& name, const G4String& version,
                         const G4String& date, const G4String& author,
                          const G4String& topVolume)
@@ -474,6 +547,7 @@ void TG4XMLConvertor::OpenComposition(const G4String& name)
   IncreaseIndention();    
 }  
 
+//_____________________________________________________________________________
 void TG4XMLConvertor::CloseMaterials()
 {
 // Writes materials closing.
@@ -487,6 +561,7 @@ void TG4XMLConvertor::CloseMaterials()
           << G4endl;
 }  
 
+//_____________________________________________________________________________
 void TG4XMLConvertor::CloseSection()
 {
 // Writes section closing.
@@ -500,6 +575,7 @@ void TG4XMLConvertor::CloseSection()
           << G4endl;
 }  
 
+//_____________________________________________________________________________
 void TG4XMLConvertor::CloseComposition()
 {
 // Writes composition closing.
@@ -517,6 +593,7 @@ void TG4XMLConvertor::CloseComposition()
           << G4endl;
 }  
 
+//_____________________________________________________________________________
 void TG4XMLConvertor::WriteMaterial(const G4Material* material) 
 {
 // Writes G4Material. 
@@ -537,6 +614,7 @@ void TG4XMLConvertor::WriteMaterial(const G4Material* material)
            << G4endl;
 }  
 
+//_____________________________________________________________________________
 void TG4XMLConvertor::WriteSolid(G4String lvName, const G4VSolid* solid, 
                                  G4String materialName) 
 {
@@ -547,43 +625,58 @@ void TG4XMLConvertor::WriteSolid(G4String lvName, const G4VSolid* solid,
   // to be removed when materials are supported
   materialName = "Hydrogen";
   
-  const G4Box* box = dynamic_cast<const G4Box*>(solid);
+  const G4ReflectedSolid* reflSolid
+    = dynamic_cast<const G4ReflectedSolid*>(solid);
+
+  const G4VSolid* consSolid;
+  if (reflSolid) 
+    consSolid = reflSolid->GetConstituentMovedSolid();
+  else  
+    consSolid = solid;  
+  
+  const G4Box* box = dynamic_cast<const G4Box*>(consSolid);
   if (box) { 
     WriteBox(lvName, box, materialName); 
     return;
   }
   
-  const G4Tubs* tubs = dynamic_cast<const G4Tubs*>(solid);
+  const G4Tubs* tubs = dynamic_cast<const G4Tubs*>(consSolid);
   if (tubs) { 
     WriteTubs(lvName, tubs, materialName); 
     return;
   }
   
-  const G4Cons* cons = dynamic_cast<const G4Cons*>(solid);
+  const G4Cons* cons = dynamic_cast<const G4Cons*>(consSolid);
   if (cons) { 
     WriteCons(lvName, cons, materialName); 
     return;
   }
   
-  const G4Trd* trd = dynamic_cast<const G4Trd*>(solid);
+  const G4Trd* trd = dynamic_cast<const G4Trd*>(consSolid);
   if (trd) { 
     WriteTrd(lvName, trd, materialName); 
     return;
   }
   
-  const G4Trap* trap = dynamic_cast<const G4Trap*>(solid);
+  const G4Trap* trap = dynamic_cast<const G4Trap*>(consSolid);
   if (trap) { 
     WriteTrap(lvName, trap, materialName); 
     return;
   }
   
-  const G4Polycone* polycone = dynamic_cast<const G4Polycone*>(solid);
+  const G4Para* para = dynamic_cast<const G4Para*>(consSolid);
+  if (para) { 
+    WritePara(lvName, para, materialName); 
+    return;
+  }
+  
+  const G4Polycone* polycone = dynamic_cast<const G4Polycone*>(consSolid);
   if (polycone) { 
     WritePolycone(lvName, polycone, materialName); 
     return;
   }
   
-  const G4Polyhedra* polyhedra = dynamic_cast<const G4Polyhedra*>(solid);
+  const G4Polyhedra* polyhedra = dynamic_cast<const G4Polyhedra*>(consSolid);
   if (polyhedra) { 
     WritePolyhedra(lvName, polyhedra, materialName); 
     return;
@@ -603,6 +696,7 @@ void TG4XMLConvertor::WriteSolid(G4String lvName, const G4VSolid* solid,
            << G4endl;
 }  
 
+//_____________________________________________________________________________
 void TG4XMLConvertor::WriteRotation(const G4RotationMatrix* rotation)
 {
 // Writes G4RotationMatrix. 
@@ -661,6 +755,7 @@ void TG4XMLConvertor::WriteRotation(const G4RotationMatrix* rotation)
            << G4endl;
 }  
 
+//_____________________________________________________________________________
 void TG4XMLConvertor::WritePosition(G4String lvName, G4ThreeVector position) 
 {
 // Writes position without rotation with a given solid name. 
@@ -681,13 +776,14 @@ void TG4XMLConvertor::WritePosition(G4String lvName, G4ThreeVector position)
   // write element
   fOutFile << fIndention
            << element1
-           << G4std::setw(8) << G4std::setprecision(2) << x << "  "
-           << G4std::setw(8) << G4std::setprecision(2) << y << "  "
-           << G4std::setw(8) << G4std::setprecision(2) << z
+           << G4std::setw(fNW+1) << G4std::setprecision(fNP) << x << "  "
+           << G4std::setw(fNW+1) << G4std::setprecision(fNP) << y << "  "
+           << G4std::setw(fNW+1) << G4std::setprecision(fNP) << z
           << element2
           << G4endl;
 }  
 
+//_____________________________________________________________________________
 void TG4XMLConvertor::WritePositionWithRotation(
                            G4String lvName, G4ThreeVector position, 
                           const G4RotationMatrix* rotation)
@@ -736,9 +832,9 @@ void TG4XMLConvertor::WritePositionWithRotation(
   // write element
   fOutFile << fIndention
            << element1
-           << G4std::setw(8) << G4std::setprecision(2) << x << "  "
-           << G4std::setw(8) << G4std::setprecision(2) << y << "  "
-           << G4std::setw(8) << G4std::setprecision(2) << z << quota
+           << G4std::setw(fNW+1) << G4std::setprecision(fNP) << x << "  "
+           << G4std::setw(fNW+1) << G4std::setprecision(fNP) << y << "  "
+           << G4std::setw(fNW+1) << G4std::setprecision(fNP) << z << quota
           << fIndention
           << element2 
           << G4std::setw(8) << G4std::setprecision(5) << xx << "  "  
@@ -758,6 +854,7 @@ void TG4XMLConvertor::WritePositionWithRotation(
           << G4endl;
 }  
 
+//_____________________________________________________________________________
 void TG4XMLConvertor::WriteReplica(G4String lvName, G4PVReplica* pvr) 
 {
 // Writes position without rotation with a given solid name. 
@@ -809,15 +906,16 @@ void TG4XMLConvertor::WriteReplica(G4String lvName, G4PVReplica* pvr)
   // write element
   fOutFile << fIndention
            << element1
-           << G4std::setw(8) << G4std::setprecision(2) << nReplicas
+           << G4std::setw(fNW+1) << G4std::setprecision(fNP) << nReplicas
           << element2
-           << G4std::setw(8) << G4std::setprecision(2) << value0
+           << G4std::setw(fNW+1) << G4std::setprecision(fNP) << value0
           << element3     
-           << G4std::setw(8) << G4std::setprecision(2) << dValue
+           << G4std::setw(fNW+1) << G4std::setprecision(fNP) << dValue
           << element4
           << G4endl;
 }  
 
+//_____________________________________________________________________________
 void TG4XMLConvertor::WriteEmptyLine()
 {
 // Writes empty line.
@@ -826,12 +924,14 @@ void TG4XMLConvertor::WriteEmptyLine()
   fOutFile << G4endl;
 }  
 
+//_____________________________________________________________________________
 void TG4XMLConvertor::IncreaseIndention()
 {
   // increase indention
   fIndention.append(fkBasicIndention);    
 }
 
+//_____________________________________________________________________________
 void TG4XMLConvertor::DecreaseIndention()
 {
   // decrease indention