ROOT logo
// @(#)root/gdml:$Id: TGDMLWrite.cxx 42053 2011-11-16 12:35:25Z rdm $
// Author: Anton Pytel 15/9/2011

/*************************************************************************
 * Copyright (C) 1995-2011, Rene Brun and Fons Rademakers.               *
 * All rights reserved.                                                  *
 *                                                                       *
 * For the licensing terms see $ROOTSYS/LICENSE.                         *
 * For the list of contributors see $ROOTSYS/README/CREDITS.             *
 *************************************************************************/

#include "TGeoManager.h"
#include "TGeoMaterial.h"
#include "TGeoMatrix.h"
#include "TXMLEngine.h"
#include "TGeoVolume.h"
#include "TGeoBBox.h"
#include "TGeoParaboloid.h"
#include "TGeoArb8.h"
#include "TGeoTube.h"
#include "TGeoCone.h"
#include "TGeoTrd1.h"
#include "TGeoTrd2.h"
#include "TGeoPcon.h"
#include "TGeoPgon.h"
#include "TGeoSphere.h"
#include "TGeoTorus.h"
#include "TGeoPara.h"
#include "TGeoHype.h"
#include "TGeoEltu.h"
#include "TGeoXtru.h"
#include "TGeoScaledShape.h"
#include "TGeoVolume.h"
#include "TROOT.h"
#include "TMath.h"
#include "TGeoMaterial.h"
#include "TGeoBoolNode.h"
#include "TGeoMedium.h"
#include "TGeoElement.h"
#include "TGeoShape.h"
#include "TGeoCompositeShape.h"
#include "TGDMLWrite.h"
#include <stdlib.h>
#include <string>
#include <map>
#include <ctime>

ClassImp(TGDMLWrite)

TGDMLWrite *TGDMLWrite::fgGDMLWrite = 0;

//______________________________________________________________________________
TGDMLWrite::TGDMLWrite()
   : TObject(),
     fIsotopeList(0),
     fElementList(0),
     fMaterialList(0),
     fShapeList(0),
     fVolumeList(0),
     fAccPatt(0),
     fRejShape(0),
     fNameList(0),
     fgNamingSpeed(0),
     fgG4Compatibility(0),
     fGdmlFile(0),
     fTopVolumeName(0),
     fGdmlE(0),
     fDefineNode(0),
     fMaterialsNode(0),
     fSolidsNode(0),
     fStructureNode(0),
     fVolCnt(0),
     fPhysVolCnt(0),
     fActNameErr(0),
     fSolCnt(0)
{
// Default constructor.
   if (fgGDMLWrite) delete fgGDMLWrite;
   fgGDMLWrite = this;
}

//______________________________________________________________________________
TGDMLWrite::~TGDMLWrite()
{
// Destructor.
   delete fIsotopeList;
   delete fElementList;
   delete fMaterialList;
   delete fShapeList;
   delete fVolumeList;
   delete fAccPatt;
   delete fRejShape;
   delete fNameList;
   fgGDMLWrite = 0;
}

//______________________________________________________________________________
void TGDMLWrite::SetNamingSpeed(ENamingType naming)
{
   fgNamingSpeed = naming;
}

//______________________________________________________________________________
void TGDMLWrite::WriteGDMLfile(TGeoManager * geomanager, const char* filename, TString option)
{
// Wrapper of all exporting methods
// Creates blank GDML file and fills it with gGeoManager structure converted
// to GDML structure xml nodes

   //option process
   option.ToLower();
   if (option.Contains("g")) {
      SetG4Compatibility(kTRUE);
      Info("WriteGDMLfile", "Geant4 compatibility mode set");
   } else {
      SetG4Compatibility(kFALSE);
   }
   if (option.Contains("f")) {
      SetNamingSpeed(kfastButUglySufix);
      Info("WriteGDMLfile", "Fast naming convetion with pointer suffix set");
   } else if (option.Contains("n")) {
      SetNamingSpeed(kwithoutSufixNotUniq);
      Info("WriteGDMLfile", "Naming without prefix set - be careful uniqness of name is not ensured");
   } else {
      SetNamingSpeed(kelegantButSlow);
      Info("WriteGDMLfile", "Potentially slow with incremental suffix naming convention set");
   }

   //local variables
   Int_t outputLayout = 1;
   const char * krootNodeName = "gdml";
   const char * knsRefGeneral = "http://www.w3.org/2001/XMLSchema-instance";
   const char * knsNameGeneral = "xsi";
   const char * knsRefGdml = "http://service-spi.web.cern.ch/service-spi/app/releases/GDML/schema/gdml.xsd";
   const char * knsNameGdml = "xsi:noNamespaceSchemaLocation";

   // First create engine
   fGdmlE = new TXMLEngine;
   fGdmlE->SetSkipComments(kTRUE);

   //create blank GDML file
   fGdmlFile = fGdmlE->NewDoc();

   //create root node and add it to blank GDML file
   XMLNodePointer_t rootNode = fGdmlE->NewChild(0, 0, krootNodeName, 0);
   fGdmlE->DocSetRootElement(fGdmlFile, rootNode);

   //add namespaces to root node
   fGdmlE->NewNS(rootNode, knsRefGeneral, knsNameGeneral);
   fGdmlE->NewAttr(rootNode, 0, knsNameGdml, knsRefGdml);

   //initialize general lists and <define>, <structure> nodes
   fIsotopeList  = new StructLst;
   fElementList  = new StructLst;
   fMaterialList = new StructLst;
   fShapeList    = new StructLst;
   fVolumeList   = new StructLst;

   fNameList     = new NameLst;

   fDefineNode = fGdmlE->NewChild(0, 0, "define", 0);
   fStructureNode = fGdmlE->NewChild(0, 0, "structure", 0);
   //========================

   //initialize list of accepted patterns for divisions (in ExtractVolumes)
   fAccPatt   = new StructLst;
   fAccPatt->fLst["TGeoPatternX"] = kTRUE;
   fAccPatt->fLst["TGeoPatternY"] = kTRUE;
   fAccPatt->fLst["TGeoPatternZ"] = kTRUE;
   fAccPatt->fLst["TGeoPatternCylR"] = kTRUE;
   fAccPatt->fLst["TGeoPatternCylPhi"] = kTRUE;
   //========================

   //initialize list of rejected shapes for divisions (in ExtractVolumes)
   fRejShape     = new StructLst;
   //this shapes are rejected because, it is not possible to divide trd2
   //in Y axis and while only trd2 object is imported from GDML
   //it causes a problem when TGeoTrd1 is divided in Y axis
   fRejShape->fLst["TGeoTrd1"] = kTRUE;
   fRejShape->fLst["TGeoTrd2"] = kTRUE;
   //=========================

   //Initialize global counters
   fActNameErr = 0;
   fVolCnt = 0;
   fPhysVolCnt = 0;
   fSolCnt = 0;
   fTopVolumeName = "";

   //calling main extraction functions (with measuring time)
   time_t startT, endT;
   startT = time(NULL);
   fMaterialsNode = ExtractMaterials(geomanager->GetListOfMaterials());
   ExtractSolids(geomanager->GetListOfShapes());
   Info("WriteGDMLfile", "Extracting volumes");
   if (geomanager->GetTopVolume()) {
      ExtractVolumes(geomanager->GetTopVolume());
   } else {
      Info("WriteGDMLfile", "Top volume does not exist!");
      return;
   }
   Info("WriteGDMLfile", "%i volumes added", fVolCnt);
   Info("WriteGDMLfile", "%i physvolumes added", fPhysVolCnt);
   endT = time(NULL);
   //<gdml>
   fGdmlE->AddChild(rootNode, fDefineNode);                 //  <define>...</define>
   fGdmlE->AddChild(rootNode, fMaterialsNode);              //  <materials>...</materials>
   fGdmlE->AddChild(rootNode, fSolidsNode);                 //  <solids>...</solids>
   fGdmlE->AddChild(rootNode, fStructureNode);              //  <structure>...</structure>
   fGdmlE->AddChild(rootNode, CreateSetupN(fTopVolumeName.Data())); //  <setup>...</setup>
   //</gdml>
   Double_t tdiffI = difftime(endT, startT);
   TString tdiffS = (tdiffI == 0 ? TString("< 1 s") : TString::Format("%.0lf s", tdiffI));
   Info("WriteGDMLfile", "Exporting time: %s", tdiffS.Data());
   //=========================

   //Saving document
   fGdmlE->SaveDoc(fGdmlFile, filename, outputLayout);
   Info("WriteGDMLfile", "File %s saved", filename);
}


//______________________________________________________________________________
XMLNodePointer_t TGDMLWrite::ExtractMaterials(TList* materialsLst)
{
   Info("ExtractMaterials", "Extracting materials");
   //crate main <materials> node
   XMLNodePointer_t materialsN = fGdmlE->NewChild(0, 0, "materials", 0);
   Int_t matcnt = 0;

   //go through materials  - iterator and object declaration
   TIter next(materialsLst);
   TGeoMaterial *lmaterial;

   while ((lmaterial = (TGeoMaterial *)next())) {
      //generate uniq name
      TString lname = GenName(lmaterial->GetName(), TString::Format("%p", lmaterial));

      if (lmaterial->IsMixture()) {
         TGeoMixture  *lmixture = (TGeoMixture *)lmaterial;
         XMLNodePointer_t mixtureN = CreateMixtureN(lmixture, materialsN, lname);
         fGdmlE->AddChild(materialsN, mixtureN);
      } else {
         XMLNodePointer_t materialN = CreateMaterialN(lmaterial, lname);
         fGdmlE->AddChild(materialsN, materialN);
      }
      matcnt++;
   }
   Info("ExtractMaterials", "%i materials added", matcnt);
   return materialsN;
}

//______________________________________________________________________________
void TGDMLWrite::ExtractSolids(TObjArray* shapesLst)
{
   Info("ExtractSolids", "Extracting solids (%i found).", shapesLst->GetEntries());

   //crate main <solids> node and define node for each solid
   fSolidsNode = fGdmlE->NewChild(0, 0, "solids", 0);
   XMLNodePointer_t solidN;

   //go through shapes - iterator and object declaration
   TIter next(shapesLst);
   TGeoShape *geoshp;

   while ((geoshp = (TGeoShape *)next())) {

      solidN = ChooseObject(geoshp);

      //add solid to solids node
      fGdmlE->AddChild(fSolidsNode, solidN);
      if (solidN != NULL) fSolCnt++;
   }
   Info("ExtractSolids", "%i solids added.", fSolCnt);

}

//______________________________________________________________________________
void TGDMLWrite::ExtractVolumes(TGeoVolume* volume)
{
   XMLNodePointer_t volumeN, childN;
   TString volname, matname, solname, pattClsName, nodeVolNameBak;
   TGeoPatternFinder *pattFinder = 0;
   Bool_t isPattern = kFALSE;

   //create the name for volume/assebmly
   if (volume->IsTopVolume()) {
      //not needed a special function for generating name
      volname = volume->GetName();
      fTopVolumeName = volname;
      //register name to the pointer
      fNameList->fLst[TString::Format("%p", volume)] = volname;
   } else {
      volname = GenName(volume->GetName(), TString::Format("%p", volume));
   }

   //start to create main volume/assembly node
   if (volume->IsAssembly()) {
      volumeN = StartAssemblyN(volname);
   } else {
      //get reference material and solid name
      matname = fNameList->fLst[TString::Format("%p", volume->GetMaterial())];
      solname = fNameList->fLst[TString::Format("%p", volume->GetShape())];
      volumeN = StartVolumeN(volname, solname, matname);


      //divisionvol can't be in assembly
      pattFinder = volume->GetFinder();
      //if found pattern
      if (pattFinder) {
         pattClsName = TString::Format("%s", pattFinder->ClassName());
         TString shapeCls = TString::Format("%s", volume->GetShape()->ClassName());
         //if pattern in accepted pattern list and not in shape rejected list
         if ((fAccPatt->fLst[pattClsName] == kTRUE) &&
             (fRejShape->fLst[shapeCls] != kTRUE)) {
            isPattern = kTRUE;
         }
      }
   }
   //get all nodes in volume
   TObjArray *nodeLst = volume->GetNodes();
   TIter next(nodeLst);
   TGeoNode *geoNode;
   Int_t nCnt = 0;
   //loop through all nodes
   while ((geoNode = (TGeoNode *) next())) {
      //get volume of current node and if not processed then process it
      TGeoVolume * subvol = geoNode->GetVolume();
      if (subvol->TestAttBit(fgkProcBitVol) == kFALSE) {
         subvol->SetAttBit(fgkProcBitVol);
         ExtractVolumes(subvol);
      }

      //volume of this node has to exist because it was processed recursively
      TString nodevolname = fNameList->fLst[TString::Format("%p", geoNode->GetVolume())];
      if (nCnt == 0) { //save name of the first node for divisionvol
         nodeVolNameBak = nodevolname;
      }

      if (isPattern == kFALSE) {
         //create name for node
         TString nodename, posname, rotname;
         nodename = GenName(geoNode->GetName(), TString::Format("%p", geoNode));
         nodename = nodename + "in" + volname;

         //create name for position and clear rotation
         posname = nodename + "pos";
         rotname = "";

         //position
         const Double_t * pos = geoNode->GetMatrix()->GetTranslation();
         childN = CreatePositionN(posname.Data(), pos);
         fGdmlE->AddChild(fDefineNode, childN); //adding node to <define> node

         //Deal with reflection
         XMLNodePointer_t scaleN = NULL;
         Double_t lx, ly, lz;
         Double_t xangle = 0;
         Double_t zangle = 0;
         lx = geoNode->GetMatrix()->GetRotationMatrix()[0];
         ly = geoNode->GetMatrix()->GetRotationMatrix()[4];
         lz = geoNode->GetMatrix()->GetRotationMatrix()[8];
         if (geoNode->GetMatrix()->IsReflection()
             && TMath::Abs(lx) == 1 &&  TMath::Abs(ly) == 1 && TMath::Abs(lz) == 1) {
            scaleN = fGdmlE->NewChild(0, 0, "scale", 0);
            fGdmlE->NewAttr(scaleN, 0, "name", (nodename+"scl").Data());
            fGdmlE->NewAttr(scaleN, 0, "x", TString::Format("%f", lx));
            fGdmlE->NewAttr(scaleN, 0, "y", TString::Format("%f", ly));
            fGdmlE->NewAttr(scaleN, 0, "z", TString::Format("%f", lz));
            //experimentally found out, that rotation should be ta
            if (lx == -1) {
               zangle = 180;
            }
            if (lz == -1) {
               xangle = 180;
            }
         }

         //rotation
         //geoNode->
         TGDMLWrite::Xyz lxyz = GetXYZangles(geoNode->GetMatrix()->GetRotationMatrix());
         lxyz.x -= xangle;
         lxyz.z -= zangle;
         if ((lxyz.x != 0.0) || (lxyz.y != 0.0) || (lxyz.z != 0.0)) {
            rotname = nodename + "rot";
            childN = CreateRotationN(rotname.Data(), lxyz);
            fGdmlE->AddChild(fDefineNode, childN); //adding node to <define> node
         }

         //create physvol for main volume/assembly node
         childN = CreatePhysVolN(nodevolname.Data(), posname.Data(), rotname.Data(), scaleN);
         fGdmlE->AddChild(volumeN, childN);
      }
      nCnt++;
   }
   //create only one divisionvol node
   if (isPattern && pattFinder) {
      //retrieve attributes of division
      Int_t ndiv, divaxis;
      Double_t offset, width, xlo, xhi;
      TString axis, unit;

      ndiv = pattFinder->GetNdiv();
      width = pattFinder->GetStep();

      divaxis = pattFinder->GetDivAxis();
      volume->GetShape()->GetAxisRange(divaxis, xlo, xhi);

      //compute relative start (not positional)
      offset = pattFinder->GetStart() - xlo;
      axis = GetPattAxis(divaxis, pattClsName, unit);

      //create division node
      childN = CreateDivisionN(offset, width, ndiv, axis.Data(), unit.Data(), nodeVolNameBak.Data());
      fGdmlE->AddChild(volumeN, childN);
   }

   fVolCnt++;
   //add volume/assembly node into the <structure> node
   fGdmlE->AddChild(fStructureNode, volumeN);

}

//______________________________________________________________________________
XMLNodePointer_t TGDMLWrite::CreateAtomN(Double_t atom, const char * unit)
{
// Creates "atom" node for GDML

   XMLNodePointer_t atomN = fGdmlE->NewChild(0, 0, "atom", 0);
   fGdmlE->NewAttr(atomN, 0, "unit", unit);
   fGdmlE->NewAttr(atomN, 0, "value", TString::Format("%f", atom));
   return atomN;
}

//______________________________________________________________________________
XMLNodePointer_t TGDMLWrite::CreateDN(Double_t density, const char * unit)
{
// Creates "D" density node for GDML

   XMLNodePointer_t densN = fGdmlE->NewChild(0, 0, "D", 0);
   fGdmlE->NewAttr(densN, 0, "unit", unit);
   fGdmlE->NewAttr(densN, 0, "value", TString::Format("%f", density));
   return densN;
}

//______________________________________________________________________________
XMLNodePointer_t TGDMLWrite::CreateFractionN(Double_t percentage, const char * refName)
{
// Creates "fraction" node for GDML

   XMLNodePointer_t fractN = fGdmlE->NewChild(0, 0, "fraction", 0);
   fGdmlE->NewAttr(fractN, 0, "n", TString::Format("%f", percentage));
   fGdmlE->NewAttr(fractN, 0, "ref", refName);
   return fractN;
}

//______________________________________________________________________________
XMLNodePointer_t TGDMLWrite::CreateIsotopN(TGeoIsotope * isotope, const char * name)
{
// Creates "isotope" node for GDML

   XMLNodePointer_t mainN = fGdmlE->NewChild(0, 0, "isotope", 0);
   fGdmlE->NewAttr(mainN, 0, "name", name);
   fGdmlE->NewAttr(mainN, 0, "N", TString::Format("%i", isotope->GetN()));
   fGdmlE->NewAttr(mainN, 0, "Z", TString::Format("%i", isotope->GetZ()));
   fGdmlE->AddChild(mainN, CreateAtomN(isotope->GetA()));
   return mainN;
}

//______________________________________________________________________________
XMLNodePointer_t TGDMLWrite::CreateElementN(TGeoElement * element, XMLNodePointer_t materials, const char * name)
{
// Creates "element" node for GDML
   //element node and attribute
   XMLNodePointer_t mainN = fGdmlE->NewChild(0, 0, "element", 0);
   fGdmlE->NewAttr(mainN, 0, "name", name);
   //local associative arrays for saving isotopes and their weight
   //inside element
   NameListF wPercentage;
   NameListI wCounter;

   if (element->HasIsotopes()) {
      Int_t nOfIso = element->GetNisotopes();
      //go through isotopes
      for (Int_t idx = 0; idx < nOfIso; idx++) {
         TGeoIsotope *myIsotope = element->GetIsotope(idx);

         //Get name of the Isotope (
         TString lname = myIsotope->GetName();
         //_iso suffix is added to to avoid problems with same names
         //for material, element and isotopes
         lname = TString::Format("%s_iso", lname.Data());

         //cumulates abudance, in case 2 isotopes with same names
         //within one element
         wPercentage[lname] += element->GetRelativeAbundance(idx);
         wCounter[lname]++;

         //check whether isotope name is not in list of isotopes
         if (IsInList(fIsotopeList->fLst, lname)) {
            continue;
         }
         //add isotope to list of isotopes and to main <materials> node
         fIsotopeList->fLst[lname] = kTRUE;
         XMLNodePointer_t isoNode = CreateIsotopN(myIsotope, lname);
         fGdmlE->AddChild(materials, isoNode);
      }
      //loop through asoc array of isotopes
      for (NameListI::iterator itr = wCounter.begin(); itr != wCounter.end(); itr++) {
         if (itr->second > 1) {
            Info("CreateMixtureN", "Warning: 2 equal isotopes in one element. Check: %s isotope of %s element",
                 itr->first.Data(), name);
         }
         //add fraction child to element with reference to isotope
         fGdmlE->AddChild(mainN, CreateFractionN(wPercentage[itr->first], itr->first.Data()));
      }
   } else {
      fGdmlE->NewAttr(mainN, 0, "formula", element->GetName());
      Int_t valZ = element->Z();
      // Z can't be <1 in Geant4 and Z is optional parameter
      if (valZ >= 1) {
         fGdmlE->NewAttr(mainN, 0, "Z", TString::Format("%i", valZ));
      }
      fGdmlE->AddChild(mainN, CreateAtomN(element->A()));
   }
   return mainN;
}

//______________________________________________________________________________
XMLNodePointer_t TGDMLWrite::CreateMixtureN(TGeoMixture * mixture, XMLNodePointer_t materials, TString mname)
{
// Creates "material" node for GDML with references to other sub elements

   XMLNodePointer_t mainN = fGdmlE->NewChild(0, 0, "material", 0);
   fGdmlE->NewAttr(mainN, 0, "name", mname);
   fGdmlE->AddChild(mainN, CreateDN(mixture->GetDensity()));
   //local associative arrays for saving elements and ther weight
   //inside mixture
   NameListF wPercentage;
   NameListI wCounter;

   Int_t nOfElm = mixture->GetNelements();
   //go through elements
   for (Int_t idx = 0; idx < nOfElm; idx++) {
      TGeoElement *myElement = mixture->GetElement(idx);

      //Get name of the element
      //NOTE: that for element - GetTitle() returns the "name" tag
      //and GetName() returns "formula" tag (see createElementN)
      TString lname = myElement->GetTitle();
      //_elm suffix is added to to avoid problems with same names
      //for material and element
      lname = TString::Format("%s_elm", lname.Data());

      //cumulates percentage, in case 2 elements with same names within one mixture
      wPercentage[lname] += mixture->GetWmixt()[idx];
      wCounter[lname]++;

      //check whether element name is not in list of elements already created
      if (IsInList(fElementList->fLst, lname)) {
         continue;
      }

      //add element to list of elements and to main <materials> node
      fElementList->fLst[lname] = kTRUE;
      XMLNodePointer_t elmNode = CreateElementN(myElement, materials, lname);
      fGdmlE->AddChild(materials, elmNode);
   }
   //loop through asoc array
   for (NameListI::iterator itr = wCounter.begin(); itr != wCounter.end(); itr++) {
      if (itr->second > 1) {
         Info("CreateMixtureN", "WARNING! 2 equal elements in one material. Check: %s element of %s material",
              itr->first.Data(), mname.Data());
      }
      //add fraction child to material with reference to element
      fGdmlE->AddChild(mainN, CreateFractionN(wPercentage[itr->first], itr->first.Data()));
   }

   return mainN;
}

//______________________________________________________________________________
XMLNodePointer_t TGDMLWrite::CreateMaterialN(TGeoMaterial * material, TString mname)
{
// Creates "material" node for GDML

   XMLNodePointer_t mainN = fGdmlE->NewChild(0, 0, "material", 0);
   fGdmlE->NewAttr(mainN, 0, "name", mname);
   Double_t valZ = material->GetZ();
   //Z can't be zero in Geant4 so this is workaround for vacuum
   TString tmpname = mname;
   tmpname.ToLower();
   if (valZ < 1) {
      if (tmpname == "vacuum") {
         valZ = 1;
      } else {
         Info("CreateMaterialN", "WARNING! value of Z can't be < 1 in %s material ", mname.Data());
      }
   }
   fGdmlE->NewAttr(mainN, 0, "Z", TString::Format("%f", valZ)); //material->GetZ()));
   fGdmlE->AddChild(mainN, CreateDN(material->GetDensity()));
   fGdmlE->AddChild(mainN, CreateAtomN(material->GetA()));
   return mainN;
}

//______________________________________________________________________________
XMLNodePointer_t TGDMLWrite::CreateBoxN(TGeoBBox * geoShape)
{
// Creates "box" node for GDML

   XMLNodePointer_t mainN = fGdmlE->NewChild(0, 0, "box", 0);
   fGdmlE->NewAttr(mainN, 0, "name", GenName(geoShape->GetName(), TString::Format("%p", geoShape)));
   fGdmlE->NewAttr(mainN, 0, "x", TString::Format("%f", 2 * geoShape->GetDX()));
   fGdmlE->NewAttr(mainN, 0, "y", TString::Format("%f", 2 * geoShape->GetDY()));
   fGdmlE->NewAttr(mainN, 0, "z", TString::Format("%f", 2 * geoShape->GetDZ()));

   fGdmlE->NewAttr(mainN, 0, "lunit", "cm");
   return mainN;
}

//______________________________________________________________________________
XMLNodePointer_t TGDMLWrite::CreateParaboloidN(TGeoParaboloid * geoShape)
{
// Creates "paraboloid" node for GDML

   XMLNodePointer_t mainN = fGdmlE->NewChild(0, 0, "paraboloid", 0);
   fGdmlE->NewAttr(mainN, 0, "name", GenName(geoShape->GetName(), TString::Format("%p", geoShape)));
   fGdmlE->NewAttr(mainN, 0, "rlo", TString::Format("%f", geoShape->GetRlo()));
   fGdmlE->NewAttr(mainN, 0, "rhi", TString::Format("%f", geoShape->GetRhi()));
   fGdmlE->NewAttr(mainN, 0, "dz", TString::Format("%f", geoShape->GetDz()));

   fGdmlE->NewAttr(mainN, 0, "lunit", "cm");
   return mainN;
}

//______________________________________________________________________________
XMLNodePointer_t TGDMLWrite::CreateSphereN(TGeoSphere * geoShape)
{
// Creates "sphere" node for GDML

   XMLNodePointer_t mainN = fGdmlE->NewChild(0, 0, "sphere", 0);
   fGdmlE->NewAttr(mainN, 0, "name", GenName(geoShape->GetName(), TString::Format("%p", geoShape)));

   fGdmlE->NewAttr(mainN, 0, "rmin", TString::Format("%f", geoShape->GetRmin()));
   fGdmlE->NewAttr(mainN, 0, "rmax", TString::Format("%f", geoShape->GetRmax()));
   fGdmlE->NewAttr(mainN, 0, "startphi", TString::Format("%f", geoShape->GetPhi1()));
   fGdmlE->NewAttr(mainN, 0, "deltaphi", TString::Format("%f", geoShape->GetPhi2() - geoShape->GetPhi1()));
   fGdmlE->NewAttr(mainN, 0, "starttheta", TString::Format("%f", geoShape->GetTheta1()));
   fGdmlE->NewAttr(mainN, 0, "deltatheta", TString::Format("%f", geoShape->GetTheta2() - geoShape->GetTheta1()));

   fGdmlE->NewAttr(mainN, 0, "aunit", "deg");
   fGdmlE->NewAttr(mainN, 0, "lunit", "cm");
   return mainN;
}

//______________________________________________________________________________
XMLNodePointer_t TGDMLWrite::CreateArb8N(TGeoArb8 * geoShape)
{
// Creates "arb8" node for GDML

   XMLNodePointer_t mainN = fGdmlE->NewChild(0, 0, "arb8", 0);
   fGdmlE->NewAttr(mainN, 0, "name", GenName(geoShape->GetName(), TString::Format("%p", geoShape)));

   fGdmlE->NewAttr(mainN, 0, "v1x", TString::Format("%f", geoShape->GetVertices()[0]));
   fGdmlE->NewAttr(mainN, 0, "v1y", TString::Format("%f", geoShape->GetVertices()[1]));
   fGdmlE->NewAttr(mainN, 0, "v2x", TString::Format("%f", geoShape->GetVertices()[2]));
   fGdmlE->NewAttr(mainN, 0, "v2y", TString::Format("%f", geoShape->GetVertices()[3]));
   fGdmlE->NewAttr(mainN, 0, "v3x", TString::Format("%f", geoShape->GetVertices()[4]));
   fGdmlE->NewAttr(mainN, 0, "v3y", TString::Format("%f", geoShape->GetVertices()[5]));
   fGdmlE->NewAttr(mainN, 0, "v4x", TString::Format("%f", geoShape->GetVertices()[6]));
   fGdmlE->NewAttr(mainN, 0, "v4y", TString::Format("%f", geoShape->GetVertices()[7]));
   fGdmlE->NewAttr(mainN, 0, "v5x", TString::Format("%f", geoShape->GetVertices()[8]));
   fGdmlE->NewAttr(mainN, 0, "v5y", TString::Format("%f", geoShape->GetVertices()[9]));
   fGdmlE->NewAttr(mainN, 0, "v6x", TString::Format("%f", geoShape->GetVertices()[10]));
   fGdmlE->NewAttr(mainN, 0, "v6y", TString::Format("%f", geoShape->GetVertices()[11]));
   fGdmlE->NewAttr(mainN, 0, "v7x", TString::Format("%f", geoShape->GetVertices()[12]));
   fGdmlE->NewAttr(mainN, 0, "v7y", TString::Format("%f", geoShape->GetVertices()[13]));
   fGdmlE->NewAttr(mainN, 0, "v8x", TString::Format("%f", geoShape->GetVertices()[14]));
   fGdmlE->NewAttr(mainN, 0, "v8y", TString::Format("%f", geoShape->GetVertices()[15]));
   fGdmlE->NewAttr(mainN, 0, "dz", TString::Format("%f", geoShape->GetDz()));

   fGdmlE->NewAttr(mainN, 0, "lunit", "cm");
   return mainN;
}

//______________________________________________________________________________
XMLNodePointer_t TGDMLWrite::CreateConeN(TGeoConeSeg * geoShape)
{
// Creates "cone" node for GDML from TGeoConeSeg object

   XMLNodePointer_t mainN = fGdmlE->NewChild(0, 0, "cone", 0);
   fGdmlE->NewAttr(mainN, 0, "name", GenName(geoShape->GetName(), TString::Format("%p", geoShape)));

   fGdmlE->NewAttr(mainN, 0, "z", TString::Format("%f", 2 * geoShape->GetDz()));
   fGdmlE->NewAttr(mainN, 0, "rmin1", TString::Format("%f", geoShape->GetRmin1()));
   fGdmlE->NewAttr(mainN, 0, "rmin2", TString::Format("%f", geoShape->GetRmin2()));
   fGdmlE->NewAttr(mainN, 0, "rmax1", TString::Format("%f", geoShape->GetRmax1()));
   fGdmlE->NewAttr(mainN, 0, "rmax2", TString::Format("%f", geoShape->GetRmax2()));
   fGdmlE->NewAttr(mainN, 0, "startphi", TString::Format("%f", geoShape->GetPhi1()));
   fGdmlE->NewAttr(mainN, 0, "deltaphi", TString::Format("%f", geoShape->GetPhi2() - geoShape->GetPhi1()));

   fGdmlE->NewAttr(mainN, 0, "aunit", "deg");
   fGdmlE->NewAttr(mainN, 0, "lunit", "cm");
   return mainN;
}

//______________________________________________________________________________
XMLNodePointer_t TGDMLWrite::CreateConeN(TGeoCone * geoShape)
{
// Creates "cone" node for GDML from TGeoCone object

   XMLNodePointer_t mainN = fGdmlE->NewChild(0, 0, "cone", 0);
   fGdmlE->NewAttr(mainN, 0, "name", GenName(geoShape->GetName(), TString::Format("%p", geoShape)));

   fGdmlE->NewAttr(mainN, 0, "z", TString::Format("%f", 2 * geoShape->GetDz()));
   fGdmlE->NewAttr(mainN, 0, "rmin1", TString::Format("%f", geoShape->GetRmin1()));
   fGdmlE->NewAttr(mainN, 0, "rmin2", TString::Format("%f", geoShape->GetRmin2()));
   fGdmlE->NewAttr(mainN, 0, "rmax1", TString::Format("%f", geoShape->GetRmax1()));
   fGdmlE->NewAttr(mainN, 0, "rmax2", TString::Format("%f", geoShape->GetRmax2()));
   fGdmlE->NewAttr(mainN, 0, "startphi", TString::Format("%i", 0));
   fGdmlE->NewAttr(mainN, 0, "deltaphi", TString::Format("%i", 360));

   fGdmlE->NewAttr(mainN, 0, "aunit", "deg");
   fGdmlE->NewAttr(mainN, 0, "lunit", "cm");
   return mainN;
}

//______________________________________________________________________________
XMLNodePointer_t TGDMLWrite::CreateParaN(TGeoPara * geoShape)
{
// Creates "para" node for GDML

   XMLNodePointer_t mainN = fGdmlE->NewChild(0, 0, "para", 0);
   fGdmlE->NewAttr(mainN, 0, "name", GenName(geoShape->GetName(), TString::Format("%p", geoShape)));

   fGdmlE->NewAttr(mainN, 0, "x", TString::Format("%f", geoShape->GetX()));
   fGdmlE->NewAttr(mainN, 0, "y", TString::Format("%f", geoShape->GetY()));
   fGdmlE->NewAttr(mainN, 0, "z", TString::Format("%f", geoShape->GetZ()));
   fGdmlE->NewAttr(mainN, 0, "alpha", TString::Format("%f", geoShape->GetAlpha()));
   fGdmlE->NewAttr(mainN, 0, "theta", TString::Format("%f", geoShape->GetTheta()));
   fGdmlE->NewAttr(mainN, 0, "phi", TString::Format("%f", geoShape->GetPhi()));

   fGdmlE->NewAttr(mainN, 0, "aunit", "deg");
   fGdmlE->NewAttr(mainN, 0, "lunit", "cm");
   return mainN;
}

//______________________________________________________________________________
XMLNodePointer_t TGDMLWrite::CreateTrapN(TGeoTrap * geoShape)
{
// Creates "trap" node for GDML

   XMLNodePointer_t mainN;

   //if one base equals 0 create Arb8 instead of trap
   if ((geoShape->GetBl1() == 0 || geoShape->GetTl1() == 0 || geoShape->GetH1() == 0) ||
       (geoShape->GetBl2() == 0 || geoShape->GetTl2() == 0 || geoShape->GetH2() == 0)) {
      mainN = CreateArb8N(geoShape);
      return mainN;
   }

   mainN = fGdmlE->NewChild(0, 0, "trap", 0);
   fGdmlE->NewAttr(mainN, 0, "name", GenName(geoShape->GetName(), TString::Format("%p", geoShape)));

   fGdmlE->NewAttr(mainN, 0, "z", TString::Format("%f", 2 * geoShape->GetDz()));
   fGdmlE->NewAttr(mainN, 0, "theta", TString::Format("%f", geoShape->GetTheta()));
   fGdmlE->NewAttr(mainN, 0, "phi", TString::Format("%f", geoShape->GetPhi()));
   fGdmlE->NewAttr(mainN, 0, "x1", TString::Format("%f", 2 * geoShape->GetBl1()));
   fGdmlE->NewAttr(mainN, 0, "x2", TString::Format("%f", 2 * geoShape->GetTl1()));
   fGdmlE->NewAttr(mainN, 0, "x3", TString::Format("%f", 2 * geoShape->GetBl2()));
   fGdmlE->NewAttr(mainN, 0, "x4", TString::Format("%f", 2 * geoShape->GetTl2()));
   fGdmlE->NewAttr(mainN, 0, "y1", TString::Format("%f", 2 * geoShape->GetH1()));
   fGdmlE->NewAttr(mainN, 0, "y2", TString::Format("%f", 2 * geoShape->GetH2()));

   fGdmlE->NewAttr(mainN, 0, "alpha1", TString::Format("%f", geoShape->GetAlpha1()));
   fGdmlE->NewAttr(mainN, 0, "alpha2", TString::Format("%f", geoShape->GetAlpha2()));

   fGdmlE->NewAttr(mainN, 0, "aunit", "deg");
   fGdmlE->NewAttr(mainN, 0, "lunit", "cm");
   return mainN;
}

//______________________________________________________________________________
XMLNodePointer_t TGDMLWrite::CreateTwistedTrapN(TGeoGtra * geoShape)
{
// Creates "twistedtrap" node for GDML

   XMLNodePointer_t mainN;
   TString lname;

   //if one base equals 0 create Arb8 instead of twisted trap
   if ((geoShape->GetBl1() == 0 && geoShape->GetTl1() == 0 && geoShape->GetH1() == 0) ||
       (geoShape->GetBl2() == 0 && geoShape->GetTl2() == 0 && geoShape->GetH2() == 0)) {
      mainN = CreateArb8N((TGeoArb8 *) geoShape);
      return mainN;
   }

   //if parameter twistAngle (PhiTwist) equals zero create trap node
   if (geoShape->GetTwistAngle() == 0) {
      mainN = CreateTrapN((TGeoTrap *) geoShape);
      return mainN;
   }

   lname = GenName(geoShape->GetName(), TString::Format("%p", geoShape));
   mainN = fGdmlE->NewChild(0, 0, "twistedtrap", 0);
   fGdmlE->NewAttr(mainN, 0, "name", lname);


   fGdmlE->NewAttr(mainN, 0, "z", TString::Format("%f", 2 * geoShape->GetDz()));
   fGdmlE->NewAttr(mainN, 0, "Theta", TString::Format("%f", geoShape->GetTheta()));
   fGdmlE->NewAttr(mainN, 0, "Phi", TString::Format("%f", geoShape->GetPhi()));
   fGdmlE->NewAttr(mainN, 0, "x1", TString::Format("%f", 2 * geoShape->GetBl1()));
   fGdmlE->NewAttr(mainN, 0, "x2", TString::Format("%f", 2 * geoShape->GetTl1()));
   fGdmlE->NewAttr(mainN, 0, "x3", TString::Format("%f", 2 * geoShape->GetBl2()));
   fGdmlE->NewAttr(mainN, 0, "x4", TString::Format("%f", 2 * geoShape->GetTl2()));
   fGdmlE->NewAttr(mainN, 0, "y1", TString::Format("%f", 2 * geoShape->GetH1()));
   fGdmlE->NewAttr(mainN, 0, "y2", TString::Format("%f", 2 * geoShape->GetH2()));

   fGdmlE->NewAttr(mainN, 0, "Alph", TString::Format("%f", geoShape->GetAlpha1()));

   //check if alpha1 equals to alpha2 (converting to string - to avoid problems with floats)
   if (TString::Format("%f", geoShape->GetAlpha1()) != TString::Format("%f", geoShape->GetAlpha2())) {
      Info("CreateTwistedTrapN",
           "ERROR! Object %s is not exported correctly because parameter Alpha2 is not declared in GDML schema",
           lname.Data());
   }
   //fGdmlE->NewAttr(mainN,0, "alpha2", TString::Format("%f", geoShape->GetAlpha2()));
   fGdmlE->NewAttr(mainN, 0, "PhiTwist", TString::Format("%f", geoShape->GetTwistAngle()));

   fGdmlE->NewAttr(mainN, 0, "aunit", "deg");
   fGdmlE->NewAttr(mainN, 0, "lunit", "cm");
   return mainN;
}

//______________________________________________________________________________
XMLNodePointer_t TGDMLWrite::CreateTrdN(TGeoTrd1 * geoShape)
{
// Creates "trd" node for GDML from object TGeoTrd1

   XMLNodePointer_t mainN = fGdmlE->NewChild(0, 0, "trd", 0);
   fGdmlE->NewAttr(mainN, 0, "name", GenName(geoShape->GetName(), TString::Format("%p", geoShape)));

   fGdmlE->NewAttr(mainN, 0, "x1", TString::Format("%f", 2 * geoShape->GetDx1()));
   fGdmlE->NewAttr(mainN, 0, "x2", TString::Format("%f", 2 * geoShape->GetDx2()));
   fGdmlE->NewAttr(mainN, 0, "y1", TString::Format("%f", 2 * geoShape->GetDy()));
   fGdmlE->NewAttr(mainN, 0, "y2", TString::Format("%f", 2 * geoShape->GetDy()));
   fGdmlE->NewAttr(mainN, 0, "z", TString::Format("%f", 2 * geoShape->GetDz()));

   fGdmlE->NewAttr(mainN, 0, "lunit", "cm");
   return mainN;
}

//______________________________________________________________________________
XMLNodePointer_t TGDMLWrite::CreateTrdN(TGeoTrd2 * geoShape)
{
// Creates "trd" node for GDML from object TGeoTrd2

   XMLNodePointer_t mainN = fGdmlE->NewChild(0, 0, "trd", 0);
   fGdmlE->NewAttr(mainN, 0, "name", GenName(geoShape->GetName(), TString::Format("%p", geoShape)));

   fGdmlE->NewAttr(mainN, 0, "x1", TString::Format("%f", 2 * geoShape->GetDx1()));
   fGdmlE->NewAttr(mainN, 0, "x2", TString::Format("%f", 2 * geoShape->GetDx2()));
   fGdmlE->NewAttr(mainN, 0, "y1", TString::Format("%f", 2 * geoShape->GetDy1()));
   fGdmlE->NewAttr(mainN, 0, "y2", TString::Format("%f", 2 * geoShape->GetDy2()));
   fGdmlE->NewAttr(mainN, 0, "z", TString::Format("%f", 2 * geoShape->GetDz()));

   fGdmlE->NewAttr(mainN, 0, "lunit", "cm");
   return mainN;
}

//______________________________________________________________________________
XMLNodePointer_t TGDMLWrite::CreateTubeN(TGeoTubeSeg * geoShape)
{
// Creates "tube" node for GDML  from  object TGeoTubeSeg

   XMLNodePointer_t mainN = fGdmlE->NewChild(0, 0, "tube", 0);
   fGdmlE->NewAttr(mainN, 0, "name", GenName(geoShape->GetName(), TString::Format("%p", geoShape)));

   fGdmlE->NewAttr(mainN, 0, "rmin", TString::Format("%f", geoShape->GetRmin()));
   fGdmlE->NewAttr(mainN, 0, "rmax", TString::Format("%f", geoShape->GetRmax()));
   fGdmlE->NewAttr(mainN, 0, "z", TString::Format("%f", 2 * geoShape->GetDz()));
   fGdmlE->NewAttr(mainN, 0, "startphi", TString::Format("%f", geoShape->GetPhi1()));
   fGdmlE->NewAttr(mainN, 0, "deltaphi", TString::Format("%f", geoShape->GetPhi2() - geoShape->GetPhi1()));

   fGdmlE->NewAttr(mainN, 0, "aunit", "deg");
   fGdmlE->NewAttr(mainN, 0, "lunit", "cm");
   return mainN;
}

//______________________________________________________________________________
XMLNodePointer_t TGDMLWrite::CreateCutTubeN(TGeoCtub * geoShape)
{
// Creates "cutTube" node for GDML

   XMLNodePointer_t mainN;

   if (fgG4Compatibility == kTRUE) {
      TGeoShape * fakeCtub = CreateFakeCtub(geoShape);
      mainN = ChooseObject(fakeCtub);

      //register name for cuttube shape (so it will be found during volume export)
      TString lname = fNameList->fLst[TString::Format("%p", fakeCtub)];
      fNameList->fLst[TString::Format("%p", geoShape)] = lname;
      Info("CreateCutTubeN", "WARNING! %s - CutTube was replaced by intersection of TGeoTubSeg and two TGeoBBoxes",
           lname.Data());
   } else {
      Info("CreateCutTubeN", "WARNING! CutTube is not recognized by Geant4");
      mainN = fGdmlE->NewChild(0, 0, "cutTube", 0);
      fGdmlE->NewAttr(mainN, 0, "name", GenName(geoShape->GetName(), TString::Format("%p", geoShape)));

      fGdmlE->NewAttr(mainN, 0, "rmin", TString::Format("%f", geoShape->GetRmin()));
      fGdmlE->NewAttr(mainN, 0, "rmax", TString::Format("%f", geoShape->GetRmax()));
      fGdmlE->NewAttr(mainN, 0, "z", TString::Format("%f", 2 * geoShape->GetDz()));
      fGdmlE->NewAttr(mainN, 0, "startphi", TString::Format("%f", geoShape->GetPhi1()));
      fGdmlE->NewAttr(mainN, 0, "deltaphi", TString::Format("%f", geoShape->GetPhi2() - geoShape->GetPhi1()));
      fGdmlE->NewAttr(mainN, 0, "lowX", TString::Format("%f", geoShape->GetNlow()[0]));
      fGdmlE->NewAttr(mainN, 0, "lowY", TString::Format("%f", geoShape->GetNlow()[1]));
      fGdmlE->NewAttr(mainN, 0, "lowZ", TString::Format("%f", geoShape->GetNlow()[2]));
      fGdmlE->NewAttr(mainN, 0, "highX", TString::Format("%f", geoShape->GetNhigh()[0]));
      fGdmlE->NewAttr(mainN, 0, "highY", TString::Format("%f", geoShape->GetNhigh()[1]));
      fGdmlE->NewAttr(mainN, 0, "highZ", TString::Format("%f", geoShape->GetNhigh()[2]));

      fGdmlE->NewAttr(mainN, 0, "aunit", "deg");
      fGdmlE->NewAttr(mainN, 0, "lunit", "cm");
   }
   return mainN;
}

//______________________________________________________________________________
XMLNodePointer_t TGDMLWrite::CreateTubeN(TGeoTube * geoShape)
{
// Creates "tube" node for GDML from  object TGeoTube

   XMLNodePointer_t mainN = fGdmlE->NewChild(0, 0, "tube", 0);
   fGdmlE->NewAttr(mainN, 0, "name", GenName(geoShape->GetName(), TString::Format("%p", geoShape)));

   fGdmlE->NewAttr(mainN, 0, "rmin", TString::Format("%f", geoShape->GetRmin()));
   fGdmlE->NewAttr(mainN, 0, "rmax", TString::Format("%f", geoShape->GetRmax()));
   fGdmlE->NewAttr(mainN, 0, "z", TString::Format("%f", 2 * geoShape->GetDz()));
   fGdmlE->NewAttr(mainN, 0, "startphi", TString::Format("%i", 0));
   fGdmlE->NewAttr(mainN, 0, "deltaphi", TString::Format("%i", 360));

   fGdmlE->NewAttr(mainN, 0, "aunit", "deg");
   fGdmlE->NewAttr(mainN, 0, "lunit", "cm");
   return mainN;
}

//______________________________________________________________________________
XMLNodePointer_t TGDMLWrite::CreateZplaneN(Double_t z, Double_t rmin, Double_t rmax)
{
// Creates "zplane" node for GDML

   XMLNodePointer_t mainN = fGdmlE->NewChild(0, 0, "zplane", 0);

   fGdmlE->NewAttr(mainN, 0, "z", TString::Format("%f", z));
   fGdmlE->NewAttr(mainN, 0, "rmin", TString::Format("%f", rmin));
   fGdmlE->NewAttr(mainN, 0, "rmax", TString::Format("%f", rmax));

   return mainN;
}

//______________________________________________________________________________
XMLNodePointer_t TGDMLWrite::CreatePolyconeN(TGeoPcon * geoShape)
{
// Creates "polycone" node for GDML

   XMLNodePointer_t mainN = fGdmlE->NewChild(0, 0, "polycone", 0);
   fGdmlE->NewAttr(mainN, 0, "name", GenName(geoShape->GetName(), TString::Format("%p", geoShape)));

   fGdmlE->NewAttr(mainN, 0, "startphi", TString::Format("%f", geoShape->GetPhi1()));
   fGdmlE->NewAttr(mainN, 0, "deltaphi", TString::Format("%f", geoShape->GetDphi()));

   fGdmlE->NewAttr(mainN, 0, "aunit", "deg");
   fGdmlE->NewAttr(mainN, 0, "lunit", "cm");
   for (Int_t it = 0; it < geoShape->GetNz(); it++) {
      //add zplane child node
      fGdmlE->AddChild(mainN, CreateZplaneN(geoShape->GetZ(it), geoShape->GetRmin(it), geoShape->GetRmax(it)));
   }
   return mainN;
}

//______________________________________________________________________________
XMLNodePointer_t TGDMLWrite::CreateTorusN(TGeoTorus * geoShape)
{
// Creates "torus" node for GDML

   XMLNodePointer_t mainN = fGdmlE->NewChild(0, 0, "torus", 0);
   fGdmlE->NewAttr(mainN, 0, "name", GenName(geoShape->GetName(), TString::Format("%p", geoShape)));

   fGdmlE->NewAttr(mainN, 0, "rtor", TString::Format("%f", geoShape->GetR()));
   fGdmlE->NewAttr(mainN, 0, "rmin", TString::Format("%f", geoShape->GetRmin()));
   fGdmlE->NewAttr(mainN, 0, "rmax", TString::Format("%f", geoShape->GetRmax()));
   fGdmlE->NewAttr(mainN, 0, "startphi", TString::Format("%f", geoShape->GetPhi1()));
   fGdmlE->NewAttr(mainN, 0, "deltaphi", TString::Format("%f", geoShape->GetDphi()));

   fGdmlE->NewAttr(mainN, 0, "aunit", "deg");
   fGdmlE->NewAttr(mainN, 0, "lunit", "cm");

   return mainN;
}

//______________________________________________________________________________
XMLNodePointer_t TGDMLWrite::CreatePolyhedraN(TGeoPgon * geoShape)
{
// Creates "polyhedra" node for GDML

   XMLNodePointer_t mainN = fGdmlE->NewChild(0, 0, "polyhedra", 0);
   fGdmlE->NewAttr(mainN, 0, "name", GenName(geoShape->GetName(), TString::Format("%p", geoShape)));

   fGdmlE->NewAttr(mainN, 0, "startphi", TString::Format("%f", geoShape->GetPhi1()));
   fGdmlE->NewAttr(mainN, 0, "deltaphi", TString::Format("%f", geoShape->GetDphi()));
   fGdmlE->NewAttr(mainN, 0, "numsides", TString::Format("%i", geoShape->GetNedges()));

   fGdmlE->NewAttr(mainN, 0, "aunit", "deg");
   fGdmlE->NewAttr(mainN, 0, "lunit", "cm");
   for (Int_t it = 0; it < geoShape->GetNz(); it++) {
      //add zplane child node
      fGdmlE->AddChild(mainN, CreateZplaneN(geoShape->GetZ(it), geoShape->GetRmin(it), geoShape->GetRmax(it)));
   }
   return mainN;
}

//______________________________________________________________________________
XMLNodePointer_t TGDMLWrite::CreateEltubeN(TGeoEltu * geoShape)
{
// Creates "eltube" node for GDML

   XMLNodePointer_t mainN = fGdmlE->NewChild(0, 0, "eltube", 0);
   fGdmlE->NewAttr(mainN, 0, "name", GenName(geoShape->GetName(), TString::Format("%p", geoShape)));

   fGdmlE->NewAttr(mainN, 0, "dx", TString::Format("%f", geoShape->GetA()));
   fGdmlE->NewAttr(mainN, 0, "dy", TString::Format("%f", geoShape->GetB()));
   fGdmlE->NewAttr(mainN, 0, "dz", TString::Format("%f", geoShape->GetDz()));

   fGdmlE->NewAttr(mainN, 0, "lunit", "cm");

   return mainN;
}

//______________________________________________________________________________
XMLNodePointer_t TGDMLWrite::CreateHypeN(TGeoHype * geoShape)
{
// Creates "hype" node for GDML

   XMLNodePointer_t mainN = fGdmlE->NewChild(0, 0, "hype", 0);
   fGdmlE->NewAttr(mainN, 0, "name", GenName(geoShape->GetName(), TString::Format("%p", geoShape)));

   fGdmlE->NewAttr(mainN, 0, "rmin", TString::Format("%f", geoShape->GetRmin()));
   fGdmlE->NewAttr(mainN, 0, "rmax", TString::Format("%f", geoShape->GetRmax()));
   fGdmlE->NewAttr(mainN, 0, "inst", TString::Format("%f", geoShape->GetStIn()));
   fGdmlE->NewAttr(mainN, 0, "outst", TString::Format("%f", geoShape->GetStOut()));
   fGdmlE->NewAttr(mainN, 0, "z", TString::Format("%f", 2 * geoShape->GetDz()));

   fGdmlE->NewAttr(mainN, 0, "aunit", "deg");
   fGdmlE->NewAttr(mainN, 0, "lunit", "cm");

   return mainN;
}

//______________________________________________________________________________
XMLNodePointer_t TGDMLWrite::CreateXtrusionN(TGeoXtru * geoShape)
{
// Creates "xtru" node for GDML

   XMLNodePointer_t mainN = fGdmlE->NewChild(0, 0, "xtru", 0);
   fGdmlE->NewAttr(mainN, 0, "name", GenName(geoShape->GetName(), TString::Format("%p", geoShape)));

   fGdmlE->NewAttr(mainN, 0, "lunit", "cm");
   XMLNodePointer_t childN;
   for (Int_t it = 0; it < geoShape->GetNvert(); it++) {
      //add twoDimVertex child node
      childN = fGdmlE->NewChild(0, 0, "twoDimVertex", 0);
      fGdmlE->NewAttr(childN, 0, "x", TString::Format("%f", geoShape->GetX(it)));
      fGdmlE->NewAttr(childN, 0, "y", TString::Format("%f", geoShape->GetY(it)));
      fGdmlE->AddChild(mainN, childN);
   }
   for (Int_t it = 0; it < geoShape->GetNz(); it++) {
      //add section child node
      childN = fGdmlE->NewChild(0, 0, "section", 0);
      fGdmlE->NewAttr(childN, 0, "zOrder", TString::Format("%i", it));
      fGdmlE->NewAttr(childN, 0, "zPosition", TString::Format("%f", geoShape->GetZ(it)));
      fGdmlE->NewAttr(childN, 0, "xOffset", TString::Format("%f", geoShape->GetXOffset(it)));
      fGdmlE->NewAttr(childN, 0, "yOffset", TString::Format("%f", geoShape->GetYOffset(it)));
      fGdmlE->NewAttr(childN, 0, "scalingFactor", TString::Format("%f", geoShape->GetScale(it)));
      fGdmlE->AddChild(mainN, childN);
   }
   return mainN;
}

//______________________________________________________________________________
XMLNodePointer_t TGDMLWrite::CreateCommonBoolN(TGeoCompositeShape *geoShape)
{
// Creates common part of union intersection and subtraction nodes
   XMLNodePointer_t mainN, ndR, ndL, childN;
   TString nodeName = GenName(geoShape->GetName(), TString::Format("%p", geoShape));
   TString lboolType;
   TGeoBoolNode::EGeoBoolType boolType = geoShape->GetBoolNode()->GetBooleanOperator();
   switch (boolType) {
      case TGeoBoolNode::kGeoUnion:
         lboolType = "union";
         break;
      case TGeoBoolNode::kGeoSubtraction:
         lboolType = "subtraction";
         break;
      case TGeoBoolNode::kGeoIntersection:
         lboolType = "intersection";
         break;
   }

   TGDMLWrite::Xyz lrot = GetXYZangles(geoShape->GetBoolNode()->GetLeftMatrix()->Inverse().GetRotationMatrix());
   const Double_t  *ltr = geoShape->GetBoolNode()->GetLeftMatrix()->GetTranslation();
   TGDMLWrite::Xyz rrot = GetXYZangles(geoShape->GetBoolNode()->GetRightMatrix()->Inverse().GetRotationMatrix());
   const Double_t  *rtr = geoShape->GetBoolNode()->GetRightMatrix()->GetTranslation();

   //left and right nodes are created here also their names are created
   ndL = ChooseObject(geoShape->GetBoolNode()->GetLeftShape());
   ndR = ChooseObject(geoShape->GetBoolNode()->GetRightShape());

   //left and right nodes appended to main structure of nodes (if they are not already there)
   if (ndL != NULL) {
      fGdmlE->AddChild(fSolidsNode, ndL);
      fSolCnt++;
   }
   if (ndR != NULL) {
      fGdmlE->AddChild(fSolidsNode, ndR);
      fSolCnt++;
   }

   //retrieve left and right node names by their pointer to make reference
   TString lname = fNameList->fLst[TString::Format("%p", geoShape->GetBoolNode()->GetLeftShape())];
   TString rname = fNameList->fLst[TString::Format("%p", geoShape->GetBoolNode()->GetRightShape())];

   //create union node and its child nodes (or intersection or subtraction)
   /* <union name="...">
    *   <first ref="left name" />
    *   <second ref="right name" />
    *   <firstposition .../>
    *   <firstrotation .../>
    *   <position .../>
    *   <rotation .../>
    * </union>
   */
   mainN = fGdmlE->NewChild(0, 0, lboolType.Data(), 0);
   fGdmlE->NewAttr(mainN, 0, "name", nodeName);

   //<first> (left)
   childN = fGdmlE->NewChild(0, 0, "first", 0);
   fGdmlE->NewAttr(childN, 0, "ref", lname);
   fGdmlE->AddChild(mainN, childN);

   //<second> (right)
   childN = fGdmlE->NewChild(0, 0, "second", 0);
   fGdmlE->NewAttr(childN, 0, "ref", rname);
   fGdmlE->AddChild(mainN, childN);

   //<firstposition> (left)
   if ((ltr[0] != 0.0) || (ltr[1] != 0.0) || (ltr[2] != 0.0)) {
      childN = CreatePositionN((nodeName + lname + "pos").Data(), ltr, "firstposition");
      fGdmlE->AddChild(mainN, childN);
   }
   //<firstrotation> (left)
   if ((lrot.x != 0.0) || (lrot.y != 0.0) || (lrot.z != 0.0)) {
      childN = CreateRotationN((nodeName + lname + "rot").Data(), lrot, "firstrotation");
      fGdmlE->AddChild(mainN, childN);
   }
   //<position> (right)
   if ((rtr[0] != 0.0) || (rtr[1] != 0.0) || (rtr[2] != 0.0)) {
      childN = CreatePositionN((nodeName + rname + "pos").Data(), rtr, "position");
      fGdmlE->AddChild(mainN, childN);
   }
   //<rotation> (right)
   if ((rrot.x != 0.0) || (rrot.y != 0.0) || (rrot.z != 0.0)) {
      childN = CreateRotationN((nodeName + rname + "rot").Data(), rrot, "rotation");
      fGdmlE->AddChild(mainN, childN);
   }

   return mainN;
}


//______________________________________________________________________________
XMLNodePointer_t TGDMLWrite::CreatePositionN(const char * name, const Double_t *position, const char * type, const char * unit)
{
// Creates "position" kind of node for GDML

   XMLNodePointer_t mainN = fGdmlE->NewChild(0, 0, type, 0);
   fGdmlE->NewAttr(mainN, 0, "name", name);
   fGdmlE->NewAttr(mainN, 0, "x", TString::Format("%f", position[0]));
   fGdmlE->NewAttr(mainN, 0, "y", TString::Format("%f", position[1]));
   fGdmlE->NewAttr(mainN, 0, "z", TString::Format("%f", position[2]));
   fGdmlE->NewAttr(mainN, 0, "unit", unit);
   return mainN;
}

//______________________________________________________________________________
XMLNodePointer_t TGDMLWrite::CreateRotationN(const char * name, Xyz rotation, const char * type, const char * unit)
{
// Creates "rotation" kind of node for GDML

   XMLNodePointer_t mainN = fGdmlE->NewChild(0, 0, type, 0);
   fGdmlE->NewAttr(mainN, 0, "name", name);
   fGdmlE->NewAttr(mainN, 0, "x", TString::Format("%f", rotation.x));
   fGdmlE->NewAttr(mainN, 0, "y", TString::Format("%f", rotation.y));
   fGdmlE->NewAttr(mainN, 0, "z", TString::Format("%f", rotation.z));
   fGdmlE->NewAttr(mainN, 0, "unit", unit);
   return mainN;
}

//______________________________________________________________________________
XMLNodePointer_t TGDMLWrite::CreateSetupN(const char * topVolName, const char * name, const char * version)
{
// Creates "setup" node for GDML

   XMLNodePointer_t setupN = fGdmlE->NewChild(0, 0, "setup", 0);
   fGdmlE->NewAttr(setupN, 0, "name", name);
   fGdmlE->NewAttr(setupN, 0, "version", version);
   XMLNodePointer_t fworldN = fGdmlE->NewChild(setupN, 0, "world", 0);
   fGdmlE->NewAttr(fworldN, 0, "ref", topVolName);
   return setupN;
}

//______________________________________________________________________________
XMLNodePointer_t TGDMLWrite::StartVolumeN(const char * name, const char * solid, const char * material)
{
// Creates "volume" node for GDML

   XMLNodePointer_t childN;
   XMLNodePointer_t mainN = fGdmlE->NewChild(0, 0, "volume", 0);
   fGdmlE->NewAttr(mainN, 0, "name", name);

   childN = fGdmlE->NewChild(0, 0, "materialref", 0);
   fGdmlE->NewAttr(childN, 0, "ref", material);
   fGdmlE->AddChild(mainN, childN);

   childN = fGdmlE->NewChild(0, 0, "solidref", 0);
   fGdmlE->NewAttr(childN, 0, "ref", solid);
   fGdmlE->AddChild(mainN, childN);

   return mainN;
}

//______________________________________________________________________________
XMLNodePointer_t TGDMLWrite::StartAssemblyN(const char * name)
{
// Creates "assembly" node for GDML

   XMLNodePointer_t mainN = fGdmlE->NewChild(0, 0, "assembly", 0);
   fGdmlE->NewAttr(mainN, 0, "name", name);

   return mainN;
}

//______________________________________________________________________________
XMLNodePointer_t TGDMLWrite::CreatePhysVolN(const char * volref, const char * posref, const char * rotref, XMLNodePointer_t scaleN)
{
// Creates "physvol" node for GDML
   fPhysVolCnt++;
   XMLNodePointer_t childN;
   XMLNodePointer_t mainN = fGdmlE->NewChild(0, 0, "physvol", 0);

   childN = fGdmlE->NewChild(0, 0, "volumeref", 0);
   fGdmlE->NewAttr(childN, 0, "ref", volref);
   fGdmlE->AddChild(mainN, childN);

   childN = fGdmlE->NewChild(0, 0, "positionref", 0);
   fGdmlE->NewAttr(childN, 0, "ref", posref);
   fGdmlE->AddChild(mainN, childN);

   //if is not empty string add this node
   if (strcmp(rotref, "") != 0) {
      childN = fGdmlE->NewChild(0, 0, "rotationref", 0);
      fGdmlE->NewAttr(childN, 0, "ref", rotref);
      fGdmlE->AddChild(mainN, childN);
   }
   if (scaleN != NULL) {
      fGdmlE->AddChild(mainN, scaleN);
   }

   return mainN;
}

//______________________________________________________________________________
XMLNodePointer_t TGDMLWrite::CreateDivisionN(Double_t offset, Double_t width, Int_t number, const char * axis, const char * unit, const char * volref)
{
// Creates "divisionvol" node for GDML

   XMLNodePointer_t childN;
   XMLNodePointer_t mainN = fGdmlE->NewChild(0, 0, "divisionvol", 0);
   fGdmlE->NewAttr(mainN, 0, "axis", axis);
   fGdmlE->NewAttr(mainN, 0, "number", TString::Format("%i", number));
   fGdmlE->NewAttr(mainN, 0, "width", TString::Format("%f", width));
   fGdmlE->NewAttr(mainN, 0, "offset", TString::Format("%f", offset));
   fGdmlE->NewAttr(mainN, 0, "unit", unit);

   childN = fGdmlE->NewChild(0, 0, "volumeref", 0);
   fGdmlE->NewAttr(childN, 0, "ref", volref);
   fGdmlE->AddChild(mainN, childN);


   return mainN;
}

//______________________________________________________________________________
XMLNodePointer_t TGDMLWrite::ChooseObject(TGeoShape *geoShape)
{
// Chooses the object and method that should be used for processing
   const char * clsname = geoShape->ClassName();
   XMLNodePointer_t solidN;

   if (CanProcess((TObject *)geoShape) == kFALSE)
      return NULL;


   //process different shapes
   if (strcmp(clsname, "TGeoBBox") == 0) {
      solidN = CreateBoxN((TGeoBBox*) geoShape);
   } else if (strcmp(clsname, "TGeoParaboloid") == 0) {
      solidN = CreateParaboloidN((TGeoParaboloid*) geoShape);
   } else if (strcmp(clsname, "TGeoSphere") == 0) {
      solidN = CreateSphereN((TGeoSphere*) geoShape);
   } else if (strcmp(clsname, "TGeoArb8") == 0) {
      solidN = CreateArb8N((TGeoArb8*) geoShape);
   } else if (strcmp(clsname, "TGeoConeSeg") == 0) {
      solidN = CreateConeN((TGeoConeSeg*) geoShape);
   } else if (strcmp(clsname, "TGeoCone") == 0) {
      solidN = CreateConeN((TGeoCone*) geoShape);
   } else if (strcmp(clsname, "TGeoPara") == 0) {
      solidN = CreateParaN((TGeoPara*) geoShape);
   } else if (strcmp(clsname, "TGeoTrap") == 0) {
      solidN = CreateTrapN((TGeoTrap*) geoShape);
   } else if (strcmp(clsname, "TGeoGtra") == 0) {
      solidN = CreateTwistedTrapN((TGeoGtra*) geoShape);
   } else if (strcmp(clsname, "TGeoTrd1") == 0) {
      solidN = CreateTrdN((TGeoTrd1*) geoShape);
   } else if (strcmp(clsname, "TGeoTrd2") == 0) {
      solidN = CreateTrdN((TGeoTrd2*) geoShape);
   } else if (strcmp(clsname, "TGeoTubeSeg") == 0) {
      solidN = CreateTubeN((TGeoTubeSeg*) geoShape);
   } else if (strcmp(clsname, "TGeoCtub") == 0) {
      solidN = CreateCutTubeN((TGeoCtub*) geoShape);
   } else if (strcmp(clsname, "TGeoTube") == 0) {
      solidN = CreateTubeN((TGeoTube*) geoShape);
   } else if (strcmp(clsname, "TGeoPcon") == 0) {
      solidN = CreatePolyconeN((TGeoPcon*) geoShape);
   } else if (strcmp(clsname, "TGeoTorus") == 0) {
      solidN = CreateTorusN((TGeoTorus*) geoShape);
   } else if (strcmp(clsname, "TGeoPgon") == 0) {
      solidN = CreatePolyhedraN((TGeoPgon*) geoShape);
   } else if (strcmp(clsname, "TGeoEltu") == 0) {
      solidN = CreateEltubeN((TGeoEltu*) geoShape);
   } else if (strcmp(clsname, "TGeoHype") == 0) {
      solidN = CreateHypeN((TGeoHype*) geoShape);
   } else if (strcmp(clsname, "TGeoXtru") == 0) {
      solidN = CreateXtrusionN((TGeoXtru*) geoShape);
   } else if (strcmp(clsname, "TGeoScaledShape") == 0) {
      TGeoScaledShape * geoscale = (TGeoScaledShape *) geoShape;
      Info("ChooseObject",
           "ERROR! TGeoScaledShape object is not possible to process correctly. %s object is processed without scale",
           geoscale->GetShape()->ClassName());
      solidN = ChooseObject(geoscale->GetShape());
      //Name has to be propagated to geoscale level pointer
      fNameList->fLst[TString::Format("%p", geoscale)] =
         fNameList->fLst[TString::Format("%p", geoscale->GetShape())];
   } else if (strcmp(clsname, "TGeoCompositeShape") == 0) {
      solidN = CreateCommonBoolN((TGeoCompositeShape*) geoShape);
   } else if (strcmp(clsname, "TGeoUnion") == 0) {
      solidN = CreateCommonBoolN((TGeoCompositeShape*) geoShape);
   } else if (strcmp(clsname, "TGeoIntersection") == 0) {
      solidN = CreateCommonBoolN((TGeoCompositeShape*) geoShape);
   } else if (strcmp(clsname, "TGeoSubtraction") == 0) {
      solidN = CreateCommonBoolN((TGeoCompositeShape*) geoShape);
   } else {
      Info("ChooseObject", "WARNING! %s shape is not in the list to process", clsname);
      solidN = NULL;
   }
   return solidN;
}

//______________________________________________________________________________
TGDMLWrite::Xyz TGDMLWrite::GetXYZangles(const Double_t * rotationMatrix)
{
   TGDMLWrite::Xyz lxyz;
   Double_t a, b, c;
   Double_t rad = 180.0 / TMath::ACos(-1.0);
   const Double_t *r = rotationMatrix;
   Double_t cosb = sqrt(r[0] * r[0] + r[1] * r[1]);
   if (cosb > 0.00001) {
      a = atan2(r[5], r[8]) * rad;
      b = atan2(-r[2], cosb) * rad;
      c = atan2(r[1], r[0]) * rad;
   } else {
      a = atan2(-r[7], r[4]) * rad;
      b = atan2(-r[2], cosb) * rad;
      c = 0;
   }
   lxyz.x = a;
   lxyz.y = b;
   lxyz.z = c;
   return lxyz;
}

//______________________________________________________________________________
TGeoCompositeShape* TGDMLWrite::CreateFakeCtub(TGeoCtub* geoShape)
{

   Double_t rmin = geoShape->GetRmin();
   Double_t rmax = geoShape->GetRmax();
   Double_t z = geoShape->GetDz();
   Double_t startphi = geoShape->GetPhi1();
   Double_t deltaphi = geoShape->GetPhi2();
   Double_t x1 = geoShape->GetNlow()[0];
   Double_t y1 = geoShape->GetNlow()[1];
   Double_t z1 = geoShape->GetNlow()[2];
   Double_t x2 = geoShape->GetNhigh()[0];
   Double_t y2 = geoShape->GetNhigh()[1];
   Double_t z2 = geoShape->GetNhigh()[2];
   TString xname = geoShape->GetName();


   Double_t h0 = 2.*((TGeoBBox*)geoShape)->GetDZ();
   Double_t h1 = 2 * z;
   Double_t h2 = 2 * z;
   Double_t boxdx = 1E8 * (2 * rmax) + (2 * z);

   TGeoTubeSeg *T = new TGeoTubeSeg((xname + "T").Data(), rmin, rmax, h0, startphi, deltaphi);
   TGeoBBox *B1 = new TGeoBBox((xname + "B1").Data(), boxdx, boxdx, h1);
   TGeoBBox *B2 = new TGeoBBox((xname + "B2").Data(), boxdx, boxdx, h2);


   //first box position parameters
   Double_t phi1 = 360 - TMath::ATan2(x1, y1) * TMath::RadToDeg();
   Double_t theta1 = 360 - TMath::ATan2(sqrt(x1 * x1 + y1 * y1), z1) * TMath::RadToDeg();

   Double_t phi11 = TMath::ATan2(y1, x1) * TMath::RadToDeg() ;
   Double_t theta11 = TMath::ATan2(z1, sqrt(x1 * x1 + y1 * y1)) * TMath::RadToDeg() ;

   Double_t xpos1 = h1 * TMath::Cos((theta11) * TMath::DegToRad()) * TMath::Cos((phi11) * TMath::DegToRad()) * (-1);
   Double_t ypos1 = h1 * TMath::Cos((theta11) * TMath::DegToRad()) * TMath::Sin((phi11) * TMath::DegToRad()) * (-1);
   Double_t zpos1 = h1 * TMath::Sin((theta11) * TMath::DegToRad()) * (-1);

   //second box position parameters
   Double_t phi2 = 360 - TMath::ATan2(x2, y2) * TMath::RadToDeg();
   Double_t theta2 = 360 - TMath::ATan2(sqrt(x2 * x2 + y2 * y2), z2) * TMath::RadToDeg();

   Double_t phi21 = TMath::ATan2(y2, x2) * TMath::RadToDeg() ;
   Double_t theta21 = TMath::ATan2(z2, sqrt(x2 * x2 + y2 * y2)) * TMath::RadToDeg() ;

   Double_t xpos2 = h2 * TMath::Cos((theta21) * TMath::DegToRad()) * TMath::Cos((phi21) * TMath::DegToRad()) * (-1);
   Double_t ypos2 = h2 * TMath::Cos((theta21) * TMath::DegToRad()) * TMath::Sin((phi21) * TMath::DegToRad()) * (-1);
   Double_t zpos2 = h2 * TMath::Sin((theta21) * TMath::DegToRad()) * (-1);


   //positioning
   TGeoTranslation *t0 = new TGeoTranslation(0, 0, 0);
   TGeoTranslation *t1 = new TGeoTranslation(0 + xpos1, 0 + ypos1, 0 + (zpos1 - z));
   TGeoTranslation *t2 = new TGeoTranslation(0 + xpos2, 0 + ypos2, 0 + (zpos2 + z));
   TGeoRotation *r0 = new TGeoRotation((xname + "r0").Data());
   TGeoRotation *r1 = new TGeoRotation((xname + "r1").Data());
   TGeoRotation *r2 = new TGeoRotation((xname + "r2").Data());

   r1->SetAngles(phi1, theta1, 0);
   r2->SetAngles(phi2, theta2, 0);

   TGeoMatrix* m0 = new TGeoCombiTrans(*t0, *r0);
   TGeoMatrix* m1 = new TGeoCombiTrans(*t1, *r1);
   TGeoMatrix* m2 = new TGeoCombiTrans(*t2, *r2);

   TGeoCompositeShape *CS1 = new TGeoCompositeShape((xname + "CS1").Data(), new TGeoIntersection(T, B1, m0, m1));
   TGeoCompositeShape *cs = new TGeoCompositeShape((xname + "CS").Data(), new TGeoIntersection(CS1, B2, m0, m2));
   return cs;
}

//______________________________________________________________________________
Bool_t TGDMLWrite::IsInList(NameList list, TString name2check)
{
// Checks whether name2check is in (NameList) list

   Bool_t isIN = list[name2check];
   return isIN;
}

//______________________________________________________________________________
TString TGDMLWrite::GenName(TString oldname)
{
//NCNAME basic restrictions
//Replace "$" character with empty character

   TString newname = oldname.ReplaceAll("$", "");
   newname = newname.ReplaceAll(" ", "_");
   // :, @, $, %, &, /, +, ,, ;, whitespace characters or different parenthesis
   newname = newname.ReplaceAll(":", "");
   newname = newname.ReplaceAll("@", "");
   newname = newname.ReplaceAll("%", "");
   newname = newname.ReplaceAll("&", "");
   newname = newname.ReplaceAll("/", "");
   newname = newname.ReplaceAll("+", "");
   newname = newname.ReplaceAll(";", "");
   newname = newname.ReplaceAll("{", "");
   newname = newname.ReplaceAll("}", "");
   newname = newname.ReplaceAll("(", "");
   newname = newname.ReplaceAll(")", "");
   newname = newname.ReplaceAll("[", "");
   newname = newname.ReplaceAll("]", "");
   return newname;
}

//______________________________________________________________________________
TString TGDMLWrite::GenName(TString oldname, TString objPointer)
{
   TString newname = GenName(oldname);
   if (newname != oldname) {
      if (fgkMaxNameErr > fActNameErr) {
         Info("GenName",
              "WARNING! Name of the object was changed because it failed to comply with NCNAME xml datatype restrictions.");
      } else if ((fgkMaxNameErr == fActNameErr)) {
         Info("GenName",
              "WARNING! Probably more names are going to be changed to comply with NCNAME xml datatype restriction, but it will not be displayed on the screen.");
      }
      fActNameErr++;
   }
   TString nameIter;
   Int_t iter = 0;
   switch (fgNamingSpeed) {
      case kfastButUglySufix:
         newname = newname + "0x" + objPointer;
         break;
      case kelegantButSlow:
         //0 means not in the list
         iter = fNameList->fLstIter[newname];
         if (iter == 0) {
            nameIter = "";
         } else {
            nameIter = TString::Format("0x%i", iter);
         }
         fNameList->fLstIter[newname]++;
         newname = newname + nameIter;
         break;
      case kwithoutSufixNotUniq:
         //no change
         newname = newname;
         break;
   }
   //store the name (mapped to pointer)
   fNameList->fLst[objPointer] = newname;
   return newname;
}


//______________________________________________________________________________
Bool_t TGDMLWrite::CanProcess(TObject *pointer)
{
   Bool_t isProcessed = kFALSE;
   isProcessed = pointer->TestBit(fgkProcBit);
   pointer->SetBit(fgkProcBit, kTRUE);
   return !(isProcessed);
}

//______________________________________________________________________________
TString TGDMLWrite::GetPattAxis(Int_t divAxis, const char * pattName, TString& unit)
{
   TString resaxis;
   unit = "cm";
   switch (divAxis) {
      case 1:
         if (strcmp(pattName, "TGeoPatternX") == 0) {
            return "kXAxis";
         } else if (strcmp(pattName, "TGeoPatternCylR") == 0) {
            return "kRho";
         }
         break;
      case 2:
         if (strcmp(pattName, "TGeoPatternY") == 0) {
            return "kYAxis";
         } else if (strcmp(pattName, "TGeoPatternCylPhi") == 0) {
            unit = "deg";
            return "kPhi";
         }
         break;
      case 3:
         if (strcmp(pattName, "TGeoPatternZ") == 0) {
            return "kZAxis";
         }
         break;
      default:
         return "kUndefined";
         break;
   }
   return "kUndefined";
}

 TGDMLWrite.cxx:1
 TGDMLWrite.cxx:2
 TGDMLWrite.cxx:3
 TGDMLWrite.cxx:4
 TGDMLWrite.cxx:5
 TGDMLWrite.cxx:6
 TGDMLWrite.cxx:7
 TGDMLWrite.cxx:8
 TGDMLWrite.cxx:9
 TGDMLWrite.cxx:10
 TGDMLWrite.cxx:11
 TGDMLWrite.cxx:12
 TGDMLWrite.cxx:13
 TGDMLWrite.cxx:14
 TGDMLWrite.cxx:15
 TGDMLWrite.cxx:16
 TGDMLWrite.cxx:17
 TGDMLWrite.cxx:18
 TGDMLWrite.cxx:19
 TGDMLWrite.cxx:20
 TGDMLWrite.cxx:21
 TGDMLWrite.cxx:22
 TGDMLWrite.cxx:23
 TGDMLWrite.cxx:24
 TGDMLWrite.cxx:25
 TGDMLWrite.cxx:26
 TGDMLWrite.cxx:27
 TGDMLWrite.cxx:28
 TGDMLWrite.cxx:29
 TGDMLWrite.cxx:30
 TGDMLWrite.cxx:31
 TGDMLWrite.cxx:32
 TGDMLWrite.cxx:33
 TGDMLWrite.cxx:34
 TGDMLWrite.cxx:35
 TGDMLWrite.cxx:36
 TGDMLWrite.cxx:37
 TGDMLWrite.cxx:38
 TGDMLWrite.cxx:39
 TGDMLWrite.cxx:40
 TGDMLWrite.cxx:41
 TGDMLWrite.cxx:42
 TGDMLWrite.cxx:43
 TGDMLWrite.cxx:44
 TGDMLWrite.cxx:45
 TGDMLWrite.cxx:46
 TGDMLWrite.cxx:47
 TGDMLWrite.cxx:48
 TGDMLWrite.cxx:49
 TGDMLWrite.cxx:50
 TGDMLWrite.cxx:51
 TGDMLWrite.cxx:52
 TGDMLWrite.cxx:53
 TGDMLWrite.cxx:54
 TGDMLWrite.cxx:55
 TGDMLWrite.cxx:56
 TGDMLWrite.cxx:57
 TGDMLWrite.cxx:58
 TGDMLWrite.cxx:59
 TGDMLWrite.cxx:60
 TGDMLWrite.cxx:61
 TGDMLWrite.cxx:62
 TGDMLWrite.cxx:63
 TGDMLWrite.cxx:64
 TGDMLWrite.cxx:65
 TGDMLWrite.cxx:66
 TGDMLWrite.cxx:67
 TGDMLWrite.cxx:68
 TGDMLWrite.cxx:69
 TGDMLWrite.cxx:70
 TGDMLWrite.cxx:71
 TGDMLWrite.cxx:72
 TGDMLWrite.cxx:73
 TGDMLWrite.cxx:74
 TGDMLWrite.cxx:75
 TGDMLWrite.cxx:76
 TGDMLWrite.cxx:77
 TGDMLWrite.cxx:78
 TGDMLWrite.cxx:79
 TGDMLWrite.cxx:80
 TGDMLWrite.cxx:81
 TGDMLWrite.cxx:82
 TGDMLWrite.cxx:83
 TGDMLWrite.cxx:84
 TGDMLWrite.cxx:85
 TGDMLWrite.cxx:86
 TGDMLWrite.cxx:87
 TGDMLWrite.cxx:88
 TGDMLWrite.cxx:89
 TGDMLWrite.cxx:90
 TGDMLWrite.cxx:91
 TGDMLWrite.cxx:92
 TGDMLWrite.cxx:93
 TGDMLWrite.cxx:94
 TGDMLWrite.cxx:95
 TGDMLWrite.cxx:96
 TGDMLWrite.cxx:97
 TGDMLWrite.cxx:98
 TGDMLWrite.cxx:99
 TGDMLWrite.cxx:100
 TGDMLWrite.cxx:101
 TGDMLWrite.cxx:102
 TGDMLWrite.cxx:103
 TGDMLWrite.cxx:104
 TGDMLWrite.cxx:105
 TGDMLWrite.cxx:106
 TGDMLWrite.cxx:107
 TGDMLWrite.cxx:108
 TGDMLWrite.cxx:109
 TGDMLWrite.cxx:110
 TGDMLWrite.cxx:111
 TGDMLWrite.cxx:112
 TGDMLWrite.cxx:113
 TGDMLWrite.cxx:114
 TGDMLWrite.cxx:115
 TGDMLWrite.cxx:116
 TGDMLWrite.cxx:117
 TGDMLWrite.cxx:118
 TGDMLWrite.cxx:119
 TGDMLWrite.cxx:120
 TGDMLWrite.cxx:121
 TGDMLWrite.cxx:122
 TGDMLWrite.cxx:123
 TGDMLWrite.cxx:124
 TGDMLWrite.cxx:125
 TGDMLWrite.cxx:126
 TGDMLWrite.cxx:127
 TGDMLWrite.cxx:128
 TGDMLWrite.cxx:129
 TGDMLWrite.cxx:130
 TGDMLWrite.cxx:131
 TGDMLWrite.cxx:132
 TGDMLWrite.cxx:133
 TGDMLWrite.cxx:134
 TGDMLWrite.cxx:135
 TGDMLWrite.cxx:136
 TGDMLWrite.cxx:137
 TGDMLWrite.cxx:138
 TGDMLWrite.cxx:139
 TGDMLWrite.cxx:140
 TGDMLWrite.cxx:141
 TGDMLWrite.cxx:142
 TGDMLWrite.cxx:143
 TGDMLWrite.cxx:144
 TGDMLWrite.cxx:145
 TGDMLWrite.cxx:146
 TGDMLWrite.cxx:147
 TGDMLWrite.cxx:148
 TGDMLWrite.cxx:149
 TGDMLWrite.cxx:150
 TGDMLWrite.cxx:151
 TGDMLWrite.cxx:152
 TGDMLWrite.cxx:153
 TGDMLWrite.cxx:154
 TGDMLWrite.cxx:155
 TGDMLWrite.cxx:156
 TGDMLWrite.cxx:157
 TGDMLWrite.cxx:158
 TGDMLWrite.cxx:159
 TGDMLWrite.cxx:160
 TGDMLWrite.cxx:161
 TGDMLWrite.cxx:162
 TGDMLWrite.cxx:163
 TGDMLWrite.cxx:164
 TGDMLWrite.cxx:165
 TGDMLWrite.cxx:166
 TGDMLWrite.cxx:167
 TGDMLWrite.cxx:168
 TGDMLWrite.cxx:169
 TGDMLWrite.cxx:170
 TGDMLWrite.cxx:171
 TGDMLWrite.cxx:172
 TGDMLWrite.cxx:173
 TGDMLWrite.cxx:174
 TGDMLWrite.cxx:175
 TGDMLWrite.cxx:176
 TGDMLWrite.cxx:177
 TGDMLWrite.cxx:178
 TGDMLWrite.cxx:179
 TGDMLWrite.cxx:180
 TGDMLWrite.cxx:181
 TGDMLWrite.cxx:182
 TGDMLWrite.cxx:183
 TGDMLWrite.cxx:184
 TGDMLWrite.cxx:185
 TGDMLWrite.cxx:186
 TGDMLWrite.cxx:187
 TGDMLWrite.cxx:188
 TGDMLWrite.cxx:189
 TGDMLWrite.cxx:190
 TGDMLWrite.cxx:191
 TGDMLWrite.cxx:192
 TGDMLWrite.cxx:193
 TGDMLWrite.cxx:194
 TGDMLWrite.cxx:195
 TGDMLWrite.cxx:196
 TGDMLWrite.cxx:197
 TGDMLWrite.cxx:198
 TGDMLWrite.cxx:199
 TGDMLWrite.cxx:200
 TGDMLWrite.cxx:201
 TGDMLWrite.cxx:202
 TGDMLWrite.cxx:203
 TGDMLWrite.cxx:204
 TGDMLWrite.cxx:205
 TGDMLWrite.cxx:206
 TGDMLWrite.cxx:207
 TGDMLWrite.cxx:208
 TGDMLWrite.cxx:209
 TGDMLWrite.cxx:210
 TGDMLWrite.cxx:211
 TGDMLWrite.cxx:212
 TGDMLWrite.cxx:213
 TGDMLWrite.cxx:214
 TGDMLWrite.cxx:215
 TGDMLWrite.cxx:216
 TGDMLWrite.cxx:217
 TGDMLWrite.cxx:218
 TGDMLWrite.cxx:219
 TGDMLWrite.cxx:220
 TGDMLWrite.cxx:221
 TGDMLWrite.cxx:222
 TGDMLWrite.cxx:223
 TGDMLWrite.cxx:224
 TGDMLWrite.cxx:225
 TGDMLWrite.cxx:226
 TGDMLWrite.cxx:227
 TGDMLWrite.cxx:228
 TGDMLWrite.cxx:229
 TGDMLWrite.cxx:230
 TGDMLWrite.cxx:231
 TGDMLWrite.cxx:232
 TGDMLWrite.cxx:233
 TGDMLWrite.cxx:234
 TGDMLWrite.cxx:235
 TGDMLWrite.cxx:236
 TGDMLWrite.cxx:237
 TGDMLWrite.cxx:238
 TGDMLWrite.cxx:239
 TGDMLWrite.cxx:240
 TGDMLWrite.cxx:241
 TGDMLWrite.cxx:242
 TGDMLWrite.cxx:243
 TGDMLWrite.cxx:244
 TGDMLWrite.cxx:245
 TGDMLWrite.cxx:246
 TGDMLWrite.cxx:247
 TGDMLWrite.cxx:248
 TGDMLWrite.cxx:249
 TGDMLWrite.cxx:250
 TGDMLWrite.cxx:251
 TGDMLWrite.cxx:252
 TGDMLWrite.cxx:253
 TGDMLWrite.cxx:254
 TGDMLWrite.cxx:255
 TGDMLWrite.cxx:256
 TGDMLWrite.cxx:257
 TGDMLWrite.cxx:258
 TGDMLWrite.cxx:259
 TGDMLWrite.cxx:260
 TGDMLWrite.cxx:261
 TGDMLWrite.cxx:262
 TGDMLWrite.cxx:263
 TGDMLWrite.cxx:264
 TGDMLWrite.cxx:265
 TGDMLWrite.cxx:266
 TGDMLWrite.cxx:267
 TGDMLWrite.cxx:268
 TGDMLWrite.cxx:269
 TGDMLWrite.cxx:270
 TGDMLWrite.cxx:271
 TGDMLWrite.cxx:272
 TGDMLWrite.cxx:273
 TGDMLWrite.cxx:274
 TGDMLWrite.cxx:275
 TGDMLWrite.cxx:276
 TGDMLWrite.cxx:277
 TGDMLWrite.cxx:278
 TGDMLWrite.cxx:279
 TGDMLWrite.cxx:280
 TGDMLWrite.cxx:281
 TGDMLWrite.cxx:282
 TGDMLWrite.cxx:283
 TGDMLWrite.cxx:284
 TGDMLWrite.cxx:285
 TGDMLWrite.cxx:286
 TGDMLWrite.cxx:287
 TGDMLWrite.cxx:288
 TGDMLWrite.cxx:289
 TGDMLWrite.cxx:290
 TGDMLWrite.cxx:291
 TGDMLWrite.cxx:292
 TGDMLWrite.cxx:293
 TGDMLWrite.cxx:294
 TGDMLWrite.cxx:295
 TGDMLWrite.cxx:296
 TGDMLWrite.cxx:297
 TGDMLWrite.cxx:298
 TGDMLWrite.cxx:299
 TGDMLWrite.cxx:300
 TGDMLWrite.cxx:301
 TGDMLWrite.cxx:302
 TGDMLWrite.cxx:303
 TGDMLWrite.cxx:304
 TGDMLWrite.cxx:305
 TGDMLWrite.cxx:306
 TGDMLWrite.cxx:307
 TGDMLWrite.cxx:308
 TGDMLWrite.cxx:309
 TGDMLWrite.cxx:310
 TGDMLWrite.cxx:311
 TGDMLWrite.cxx:312
 TGDMLWrite.cxx:313
 TGDMLWrite.cxx:314
 TGDMLWrite.cxx:315
 TGDMLWrite.cxx:316
 TGDMLWrite.cxx:317
 TGDMLWrite.cxx:318
 TGDMLWrite.cxx:319
 TGDMLWrite.cxx:320
 TGDMLWrite.cxx:321
 TGDMLWrite.cxx:322
 TGDMLWrite.cxx:323
 TGDMLWrite.cxx:324
 TGDMLWrite.cxx:325
 TGDMLWrite.cxx:326
 TGDMLWrite.cxx:327
 TGDMLWrite.cxx:328
 TGDMLWrite.cxx:329
 TGDMLWrite.cxx:330
 TGDMLWrite.cxx:331
 TGDMLWrite.cxx:332
 TGDMLWrite.cxx:333
 TGDMLWrite.cxx:334
 TGDMLWrite.cxx:335
 TGDMLWrite.cxx:336
 TGDMLWrite.cxx:337
 TGDMLWrite.cxx:338
 TGDMLWrite.cxx:339
 TGDMLWrite.cxx:340
 TGDMLWrite.cxx:341
 TGDMLWrite.cxx:342
 TGDMLWrite.cxx:343
 TGDMLWrite.cxx:344
 TGDMLWrite.cxx:345
 TGDMLWrite.cxx:346
 TGDMLWrite.cxx:347
 TGDMLWrite.cxx:348
 TGDMLWrite.cxx:349
 TGDMLWrite.cxx:350
 TGDMLWrite.cxx:351
 TGDMLWrite.cxx:352
 TGDMLWrite.cxx:353
 TGDMLWrite.cxx:354
 TGDMLWrite.cxx:355
 TGDMLWrite.cxx:356
 TGDMLWrite.cxx:357
 TGDMLWrite.cxx:358
 TGDMLWrite.cxx:359
 TGDMLWrite.cxx:360
 TGDMLWrite.cxx:361
 TGDMLWrite.cxx:362
 TGDMLWrite.cxx:363
 TGDMLWrite.cxx:364
 TGDMLWrite.cxx:365
 TGDMLWrite.cxx:366
 TGDMLWrite.cxx:367
 TGDMLWrite.cxx:368
 TGDMLWrite.cxx:369
 TGDMLWrite.cxx:370
 TGDMLWrite.cxx:371
 TGDMLWrite.cxx:372
 TGDMLWrite.cxx:373
 TGDMLWrite.cxx:374
 TGDMLWrite.cxx:375
 TGDMLWrite.cxx:376
 TGDMLWrite.cxx:377
 TGDMLWrite.cxx:378
 TGDMLWrite.cxx:379
 TGDMLWrite.cxx:380
 TGDMLWrite.cxx:381
 TGDMLWrite.cxx:382
 TGDMLWrite.cxx:383
 TGDMLWrite.cxx:384
 TGDMLWrite.cxx:385
 TGDMLWrite.cxx:386
 TGDMLWrite.cxx:387
 TGDMLWrite.cxx:388
 TGDMLWrite.cxx:389
 TGDMLWrite.cxx:390
 TGDMLWrite.cxx:391
 TGDMLWrite.cxx:392
 TGDMLWrite.cxx:393
 TGDMLWrite.cxx:394
 TGDMLWrite.cxx:395
 TGDMLWrite.cxx:396
 TGDMLWrite.cxx:397
 TGDMLWrite.cxx:398
 TGDMLWrite.cxx:399
 TGDMLWrite.cxx:400
 TGDMLWrite.cxx:401
 TGDMLWrite.cxx:402
 TGDMLWrite.cxx:403
 TGDMLWrite.cxx:404
 TGDMLWrite.cxx:405
 TGDMLWrite.cxx:406
 TGDMLWrite.cxx:407
 TGDMLWrite.cxx:408
 TGDMLWrite.cxx:409
 TGDMLWrite.cxx:410
 TGDMLWrite.cxx:411
 TGDMLWrite.cxx:412
 TGDMLWrite.cxx:413
 TGDMLWrite.cxx:414
 TGDMLWrite.cxx:415
 TGDMLWrite.cxx:416
 TGDMLWrite.cxx:417
 TGDMLWrite.cxx:418
 TGDMLWrite.cxx:419
 TGDMLWrite.cxx:420
 TGDMLWrite.cxx:421
 TGDMLWrite.cxx:422
 TGDMLWrite.cxx:423
 TGDMLWrite.cxx:424
 TGDMLWrite.cxx:425
 TGDMLWrite.cxx:426
 TGDMLWrite.cxx:427
 TGDMLWrite.cxx:428
 TGDMLWrite.cxx:429
 TGDMLWrite.cxx:430
 TGDMLWrite.cxx:431
 TGDMLWrite.cxx:432
 TGDMLWrite.cxx:433
 TGDMLWrite.cxx:434
 TGDMLWrite.cxx:435
 TGDMLWrite.cxx:436
 TGDMLWrite.cxx:437
 TGDMLWrite.cxx:438
 TGDMLWrite.cxx:439
 TGDMLWrite.cxx:440
 TGDMLWrite.cxx:441
 TGDMLWrite.cxx:442
 TGDMLWrite.cxx:443
 TGDMLWrite.cxx:444
 TGDMLWrite.cxx:445
 TGDMLWrite.cxx:446
 TGDMLWrite.cxx:447
 TGDMLWrite.cxx:448
 TGDMLWrite.cxx:449
 TGDMLWrite.cxx:450
 TGDMLWrite.cxx:451
 TGDMLWrite.cxx:452
 TGDMLWrite.cxx:453
 TGDMLWrite.cxx:454
 TGDMLWrite.cxx:455
 TGDMLWrite.cxx:456
 TGDMLWrite.cxx:457
 TGDMLWrite.cxx:458
 TGDMLWrite.cxx:459
 TGDMLWrite.cxx:460
 TGDMLWrite.cxx:461
 TGDMLWrite.cxx:462
 TGDMLWrite.cxx:463
 TGDMLWrite.cxx:464
 TGDMLWrite.cxx:465
 TGDMLWrite.cxx:466
 TGDMLWrite.cxx:467
 TGDMLWrite.cxx:468
 TGDMLWrite.cxx:469
 TGDMLWrite.cxx:470
 TGDMLWrite.cxx:471
 TGDMLWrite.cxx:472
 TGDMLWrite.cxx:473
 TGDMLWrite.cxx:474
 TGDMLWrite.cxx:475
 TGDMLWrite.cxx:476
 TGDMLWrite.cxx:477
 TGDMLWrite.cxx:478
 TGDMLWrite.cxx:479
 TGDMLWrite.cxx:480
 TGDMLWrite.cxx:481
 TGDMLWrite.cxx:482
 TGDMLWrite.cxx:483
 TGDMLWrite.cxx:484
 TGDMLWrite.cxx:485
 TGDMLWrite.cxx:486
 TGDMLWrite.cxx:487
 TGDMLWrite.cxx:488
 TGDMLWrite.cxx:489
 TGDMLWrite.cxx:490
 TGDMLWrite.cxx:491
 TGDMLWrite.cxx:492
 TGDMLWrite.cxx:493
 TGDMLWrite.cxx:494
 TGDMLWrite.cxx:495
 TGDMLWrite.cxx:496
 TGDMLWrite.cxx:497
 TGDMLWrite.cxx:498
 TGDMLWrite.cxx:499
 TGDMLWrite.cxx:500
 TGDMLWrite.cxx:501
 TGDMLWrite.cxx:502
 TGDMLWrite.cxx:503
 TGDMLWrite.cxx:504
 TGDMLWrite.cxx:505
 TGDMLWrite.cxx:506
 TGDMLWrite.cxx:507
 TGDMLWrite.cxx:508
 TGDMLWrite.cxx:509
 TGDMLWrite.cxx:510
 TGDMLWrite.cxx:511
 TGDMLWrite.cxx:512
 TGDMLWrite.cxx:513
 TGDMLWrite.cxx:514
 TGDMLWrite.cxx:515
 TGDMLWrite.cxx:516
 TGDMLWrite.cxx:517
 TGDMLWrite.cxx:518
 TGDMLWrite.cxx:519
 TGDMLWrite.cxx:520
 TGDMLWrite.cxx:521
 TGDMLWrite.cxx:522
 TGDMLWrite.cxx:523
 TGDMLWrite.cxx:524
 TGDMLWrite.cxx:525
 TGDMLWrite.cxx:526
 TGDMLWrite.cxx:527
 TGDMLWrite.cxx:528
 TGDMLWrite.cxx:529
 TGDMLWrite.cxx:530
 TGDMLWrite.cxx:531
 TGDMLWrite.cxx:532
 TGDMLWrite.cxx:533
 TGDMLWrite.cxx:534
 TGDMLWrite.cxx:535
 TGDMLWrite.cxx:536
 TGDMLWrite.cxx:537
 TGDMLWrite.cxx:538
 TGDMLWrite.cxx:539
 TGDMLWrite.cxx:540
 TGDMLWrite.cxx:541
 TGDMLWrite.cxx:542
 TGDMLWrite.cxx:543
 TGDMLWrite.cxx:544
 TGDMLWrite.cxx:545
 TGDMLWrite.cxx:546
 TGDMLWrite.cxx:547
 TGDMLWrite.cxx:548
 TGDMLWrite.cxx:549
 TGDMLWrite.cxx:550
 TGDMLWrite.cxx:551
 TGDMLWrite.cxx:552
 TGDMLWrite.cxx:553
 TGDMLWrite.cxx:554
 TGDMLWrite.cxx:555
 TGDMLWrite.cxx:556
 TGDMLWrite.cxx:557
 TGDMLWrite.cxx:558
 TGDMLWrite.cxx:559
 TGDMLWrite.cxx:560
 TGDMLWrite.cxx:561
 TGDMLWrite.cxx:562
 TGDMLWrite.cxx:563
 TGDMLWrite.cxx:564
 TGDMLWrite.cxx:565
 TGDMLWrite.cxx:566
 TGDMLWrite.cxx:567
 TGDMLWrite.cxx:568
 TGDMLWrite.cxx:569
 TGDMLWrite.cxx:570
 TGDMLWrite.cxx:571
 TGDMLWrite.cxx:572
 TGDMLWrite.cxx:573
 TGDMLWrite.cxx:574
 TGDMLWrite.cxx:575
 TGDMLWrite.cxx:576
 TGDMLWrite.cxx:577
 TGDMLWrite.cxx:578
 TGDMLWrite.cxx:579
 TGDMLWrite.cxx:580
 TGDMLWrite.cxx:581
 TGDMLWrite.cxx:582
 TGDMLWrite.cxx:583
 TGDMLWrite.cxx:584
 TGDMLWrite.cxx:585
 TGDMLWrite.cxx:586
 TGDMLWrite.cxx:587
 TGDMLWrite.cxx:588
 TGDMLWrite.cxx:589
 TGDMLWrite.cxx:590
 TGDMLWrite.cxx:591
 TGDMLWrite.cxx:592
 TGDMLWrite.cxx:593
 TGDMLWrite.cxx:594
 TGDMLWrite.cxx:595
 TGDMLWrite.cxx:596
 TGDMLWrite.cxx:597
 TGDMLWrite.cxx:598
 TGDMLWrite.cxx:599
 TGDMLWrite.cxx:600
 TGDMLWrite.cxx:601
 TGDMLWrite.cxx:602
 TGDMLWrite.cxx:603
 TGDMLWrite.cxx:604
 TGDMLWrite.cxx:605
 TGDMLWrite.cxx:606
 TGDMLWrite.cxx:607
 TGDMLWrite.cxx:608
 TGDMLWrite.cxx:609
 TGDMLWrite.cxx:610
 TGDMLWrite.cxx:611
 TGDMLWrite.cxx:612
 TGDMLWrite.cxx:613
 TGDMLWrite.cxx:614
 TGDMLWrite.cxx:615
 TGDMLWrite.cxx:616
 TGDMLWrite.cxx:617
 TGDMLWrite.cxx:618
 TGDMLWrite.cxx:619
 TGDMLWrite.cxx:620
 TGDMLWrite.cxx:621
 TGDMLWrite.cxx:622
 TGDMLWrite.cxx:623
 TGDMLWrite.cxx:624
 TGDMLWrite.cxx:625
 TGDMLWrite.cxx:626
 TGDMLWrite.cxx:627
 TGDMLWrite.cxx:628
 TGDMLWrite.cxx:629
 TGDMLWrite.cxx:630
 TGDMLWrite.cxx:631
 TGDMLWrite.cxx:632
 TGDMLWrite.cxx:633
 TGDMLWrite.cxx:634
 TGDMLWrite.cxx:635
 TGDMLWrite.cxx:636
 TGDMLWrite.cxx:637
 TGDMLWrite.cxx:638
 TGDMLWrite.cxx:639
 TGDMLWrite.cxx:640
 TGDMLWrite.cxx:641
 TGDMLWrite.cxx:642
 TGDMLWrite.cxx:643
 TGDMLWrite.cxx:644
 TGDMLWrite.cxx:645
 TGDMLWrite.cxx:646
 TGDMLWrite.cxx:647
 TGDMLWrite.cxx:648
 TGDMLWrite.cxx:649
 TGDMLWrite.cxx:650
 TGDMLWrite.cxx:651
 TGDMLWrite.cxx:652
 TGDMLWrite.cxx:653
 TGDMLWrite.cxx:654
 TGDMLWrite.cxx:655
 TGDMLWrite.cxx:656
 TGDMLWrite.cxx:657
 TGDMLWrite.cxx:658
 TGDMLWrite.cxx:659
 TGDMLWrite.cxx:660
 TGDMLWrite.cxx:661
 TGDMLWrite.cxx:662
 TGDMLWrite.cxx:663
 TGDMLWrite.cxx:664
 TGDMLWrite.cxx:665
 TGDMLWrite.cxx:666
 TGDMLWrite.cxx:667
 TGDMLWrite.cxx:668
 TGDMLWrite.cxx:669
 TGDMLWrite.cxx:670
 TGDMLWrite.cxx:671
 TGDMLWrite.cxx:672
 TGDMLWrite.cxx:673
 TGDMLWrite.cxx:674
 TGDMLWrite.cxx:675
 TGDMLWrite.cxx:676
 TGDMLWrite.cxx:677
 TGDMLWrite.cxx:678
 TGDMLWrite.cxx:679
 TGDMLWrite.cxx:680
 TGDMLWrite.cxx:681
 TGDMLWrite.cxx:682
 TGDMLWrite.cxx:683
 TGDMLWrite.cxx:684
 TGDMLWrite.cxx:685
 TGDMLWrite.cxx:686
 TGDMLWrite.cxx:687
 TGDMLWrite.cxx:688
 TGDMLWrite.cxx:689
 TGDMLWrite.cxx:690
 TGDMLWrite.cxx:691
 TGDMLWrite.cxx:692
 TGDMLWrite.cxx:693
 TGDMLWrite.cxx:694
 TGDMLWrite.cxx:695
 TGDMLWrite.cxx:696
 TGDMLWrite.cxx:697
 TGDMLWrite.cxx:698
 TGDMLWrite.cxx:699
 TGDMLWrite.cxx:700
 TGDMLWrite.cxx:701
 TGDMLWrite.cxx:702
 TGDMLWrite.cxx:703
 TGDMLWrite.cxx:704
 TGDMLWrite.cxx:705
 TGDMLWrite.cxx:706
 TGDMLWrite.cxx:707
 TGDMLWrite.cxx:708
 TGDMLWrite.cxx:709
 TGDMLWrite.cxx:710
 TGDMLWrite.cxx:711
 TGDMLWrite.cxx:712
 TGDMLWrite.cxx:713
 TGDMLWrite.cxx:714
 TGDMLWrite.cxx:715
 TGDMLWrite.cxx:716
 TGDMLWrite.cxx:717
 TGDMLWrite.cxx:718
 TGDMLWrite.cxx:719
 TGDMLWrite.cxx:720
 TGDMLWrite.cxx:721
 TGDMLWrite.cxx:722
 TGDMLWrite.cxx:723
 TGDMLWrite.cxx:724
 TGDMLWrite.cxx:725
 TGDMLWrite.cxx:726
 TGDMLWrite.cxx:727
 TGDMLWrite.cxx:728
 TGDMLWrite.cxx:729
 TGDMLWrite.cxx:730
 TGDMLWrite.cxx:731
 TGDMLWrite.cxx:732
 TGDMLWrite.cxx:733
 TGDMLWrite.cxx:734
 TGDMLWrite.cxx:735
 TGDMLWrite.cxx:736
 TGDMLWrite.cxx:737
 TGDMLWrite.cxx:738
 TGDMLWrite.cxx:739
 TGDMLWrite.cxx:740
 TGDMLWrite.cxx:741
 TGDMLWrite.cxx:742
 TGDMLWrite.cxx:743
 TGDMLWrite.cxx:744
 TGDMLWrite.cxx:745
 TGDMLWrite.cxx:746
 TGDMLWrite.cxx:747
 TGDMLWrite.cxx:748
 TGDMLWrite.cxx:749
 TGDMLWrite.cxx:750
 TGDMLWrite.cxx:751
 TGDMLWrite.cxx:752
 TGDMLWrite.cxx:753
 TGDMLWrite.cxx:754
 TGDMLWrite.cxx:755
 TGDMLWrite.cxx:756
 TGDMLWrite.cxx:757
 TGDMLWrite.cxx:758
 TGDMLWrite.cxx:759
 TGDMLWrite.cxx:760
 TGDMLWrite.cxx:761
 TGDMLWrite.cxx:762
 TGDMLWrite.cxx:763
 TGDMLWrite.cxx:764
 TGDMLWrite.cxx:765
 TGDMLWrite.cxx:766
 TGDMLWrite.cxx:767
 TGDMLWrite.cxx:768
 TGDMLWrite.cxx:769
 TGDMLWrite.cxx:770
 TGDMLWrite.cxx:771
 TGDMLWrite.cxx:772
 TGDMLWrite.cxx:773
 TGDMLWrite.cxx:774
 TGDMLWrite.cxx:775
 TGDMLWrite.cxx:776
 TGDMLWrite.cxx:777
 TGDMLWrite.cxx:778
 TGDMLWrite.cxx:779
 TGDMLWrite.cxx:780
 TGDMLWrite.cxx:781
 TGDMLWrite.cxx:782
 TGDMLWrite.cxx:783
 TGDMLWrite.cxx:784
 TGDMLWrite.cxx:785
 TGDMLWrite.cxx:786
 TGDMLWrite.cxx:787
 TGDMLWrite.cxx:788
 TGDMLWrite.cxx:789
 TGDMLWrite.cxx:790
 TGDMLWrite.cxx:791
 TGDMLWrite.cxx:792
 TGDMLWrite.cxx:793
 TGDMLWrite.cxx:794
 TGDMLWrite.cxx:795
 TGDMLWrite.cxx:796
 TGDMLWrite.cxx:797
 TGDMLWrite.cxx:798
 TGDMLWrite.cxx:799
 TGDMLWrite.cxx:800
 TGDMLWrite.cxx:801
 TGDMLWrite.cxx:802
 TGDMLWrite.cxx:803
 TGDMLWrite.cxx:804
 TGDMLWrite.cxx:805
 TGDMLWrite.cxx:806
 TGDMLWrite.cxx:807
 TGDMLWrite.cxx:808
 TGDMLWrite.cxx:809
 TGDMLWrite.cxx:810
 TGDMLWrite.cxx:811
 TGDMLWrite.cxx:812
 TGDMLWrite.cxx:813
 TGDMLWrite.cxx:814
 TGDMLWrite.cxx:815
 TGDMLWrite.cxx:816
 TGDMLWrite.cxx:817
 TGDMLWrite.cxx:818
 TGDMLWrite.cxx:819
 TGDMLWrite.cxx:820
 TGDMLWrite.cxx:821
 TGDMLWrite.cxx:822
 TGDMLWrite.cxx:823
 TGDMLWrite.cxx:824
 TGDMLWrite.cxx:825
 TGDMLWrite.cxx:826
 TGDMLWrite.cxx:827
 TGDMLWrite.cxx:828
 TGDMLWrite.cxx:829
 TGDMLWrite.cxx:830
 TGDMLWrite.cxx:831
 TGDMLWrite.cxx:832
 TGDMLWrite.cxx:833
 TGDMLWrite.cxx:834
 TGDMLWrite.cxx:835
 TGDMLWrite.cxx:836
 TGDMLWrite.cxx:837
 TGDMLWrite.cxx:838
 TGDMLWrite.cxx:839
 TGDMLWrite.cxx:840
 TGDMLWrite.cxx:841
 TGDMLWrite.cxx:842
 TGDMLWrite.cxx:843
 TGDMLWrite.cxx:844
 TGDMLWrite.cxx:845
 TGDMLWrite.cxx:846
 TGDMLWrite.cxx:847
 TGDMLWrite.cxx:848
 TGDMLWrite.cxx:849
 TGDMLWrite.cxx:850
 TGDMLWrite.cxx:851
 TGDMLWrite.cxx:852
 TGDMLWrite.cxx:853
 TGDMLWrite.cxx:854
 TGDMLWrite.cxx:855
 TGDMLWrite.cxx:856
 TGDMLWrite.cxx:857
 TGDMLWrite.cxx:858
 TGDMLWrite.cxx:859
 TGDMLWrite.cxx:860
 TGDMLWrite.cxx:861
 TGDMLWrite.cxx:862
 TGDMLWrite.cxx:863
 TGDMLWrite.cxx:864
 TGDMLWrite.cxx:865
 TGDMLWrite.cxx:866
 TGDMLWrite.cxx:867
 TGDMLWrite.cxx:868
 TGDMLWrite.cxx:869
 TGDMLWrite.cxx:870
 TGDMLWrite.cxx:871
 TGDMLWrite.cxx:872
 TGDMLWrite.cxx:873
 TGDMLWrite.cxx:874
 TGDMLWrite.cxx:875
 TGDMLWrite.cxx:876
 TGDMLWrite.cxx:877
 TGDMLWrite.cxx:878
 TGDMLWrite.cxx:879
 TGDMLWrite.cxx:880
 TGDMLWrite.cxx:881
 TGDMLWrite.cxx:882
 TGDMLWrite.cxx:883
 TGDMLWrite.cxx:884
 TGDMLWrite.cxx:885
 TGDMLWrite.cxx:886
 TGDMLWrite.cxx:887
 TGDMLWrite.cxx:888
 TGDMLWrite.cxx:889
 TGDMLWrite.cxx:890
 TGDMLWrite.cxx:891
 TGDMLWrite.cxx:892
 TGDMLWrite.cxx:893
 TGDMLWrite.cxx:894
 TGDMLWrite.cxx:895
 TGDMLWrite.cxx:896
 TGDMLWrite.cxx:897
 TGDMLWrite.cxx:898
 TGDMLWrite.cxx:899
 TGDMLWrite.cxx:900
 TGDMLWrite.cxx:901
 TGDMLWrite.cxx:902
 TGDMLWrite.cxx:903
 TGDMLWrite.cxx:904
 TGDMLWrite.cxx:905
 TGDMLWrite.cxx:906
 TGDMLWrite.cxx:907
 TGDMLWrite.cxx:908
 TGDMLWrite.cxx:909
 TGDMLWrite.cxx:910
 TGDMLWrite.cxx:911
 TGDMLWrite.cxx:912
 TGDMLWrite.cxx:913
 TGDMLWrite.cxx:914
 TGDMLWrite.cxx:915
 TGDMLWrite.cxx:916
 TGDMLWrite.cxx:917
 TGDMLWrite.cxx:918
 TGDMLWrite.cxx:919
 TGDMLWrite.cxx:920
 TGDMLWrite.cxx:921
 TGDMLWrite.cxx:922
 TGDMLWrite.cxx:923
 TGDMLWrite.cxx:924
 TGDMLWrite.cxx:925
 TGDMLWrite.cxx:926
 TGDMLWrite.cxx:927
 TGDMLWrite.cxx:928
 TGDMLWrite.cxx:929
 TGDMLWrite.cxx:930
 TGDMLWrite.cxx:931
 TGDMLWrite.cxx:932
 TGDMLWrite.cxx:933
 TGDMLWrite.cxx:934
 TGDMLWrite.cxx:935
 TGDMLWrite.cxx:936
 TGDMLWrite.cxx:937
 TGDMLWrite.cxx:938
 TGDMLWrite.cxx:939
 TGDMLWrite.cxx:940
 TGDMLWrite.cxx:941
 TGDMLWrite.cxx:942
 TGDMLWrite.cxx:943
 TGDMLWrite.cxx:944
 TGDMLWrite.cxx:945
 TGDMLWrite.cxx:946
 TGDMLWrite.cxx:947
 TGDMLWrite.cxx:948
 TGDMLWrite.cxx:949
 TGDMLWrite.cxx:950
 TGDMLWrite.cxx:951
 TGDMLWrite.cxx:952
 TGDMLWrite.cxx:953
 TGDMLWrite.cxx:954
 TGDMLWrite.cxx:955
 TGDMLWrite.cxx:956
 TGDMLWrite.cxx:957
 TGDMLWrite.cxx:958
 TGDMLWrite.cxx:959
 TGDMLWrite.cxx:960
 TGDMLWrite.cxx:961
 TGDMLWrite.cxx:962
 TGDMLWrite.cxx:963
 TGDMLWrite.cxx:964
 TGDMLWrite.cxx:965
 TGDMLWrite.cxx:966
 TGDMLWrite.cxx:967
 TGDMLWrite.cxx:968
 TGDMLWrite.cxx:969
 TGDMLWrite.cxx:970
 TGDMLWrite.cxx:971
 TGDMLWrite.cxx:972
 TGDMLWrite.cxx:973
 TGDMLWrite.cxx:974
 TGDMLWrite.cxx:975
 TGDMLWrite.cxx:976
 TGDMLWrite.cxx:977
 TGDMLWrite.cxx:978
 TGDMLWrite.cxx:979
 TGDMLWrite.cxx:980
 TGDMLWrite.cxx:981
 TGDMLWrite.cxx:982
 TGDMLWrite.cxx:983
 TGDMLWrite.cxx:984
 TGDMLWrite.cxx:985
 TGDMLWrite.cxx:986
 TGDMLWrite.cxx:987
 TGDMLWrite.cxx:988
 TGDMLWrite.cxx:989
 TGDMLWrite.cxx:990
 TGDMLWrite.cxx:991
 TGDMLWrite.cxx:992
 TGDMLWrite.cxx:993
 TGDMLWrite.cxx:994
 TGDMLWrite.cxx:995
 TGDMLWrite.cxx:996
 TGDMLWrite.cxx:997
 TGDMLWrite.cxx:998
 TGDMLWrite.cxx:999
 TGDMLWrite.cxx:1000
 TGDMLWrite.cxx:1001
 TGDMLWrite.cxx:1002
 TGDMLWrite.cxx:1003
 TGDMLWrite.cxx:1004
 TGDMLWrite.cxx:1005
 TGDMLWrite.cxx:1006
 TGDMLWrite.cxx:1007
 TGDMLWrite.cxx:1008
 TGDMLWrite.cxx:1009
 TGDMLWrite.cxx:1010
 TGDMLWrite.cxx:1011
 TGDMLWrite.cxx:1012
 TGDMLWrite.cxx:1013
 TGDMLWrite.cxx:1014
 TGDMLWrite.cxx:1015
 TGDMLWrite.cxx:1016
 TGDMLWrite.cxx:1017
 TGDMLWrite.cxx:1018
 TGDMLWrite.cxx:1019
 TGDMLWrite.cxx:1020
 TGDMLWrite.cxx:1021
 TGDMLWrite.cxx:1022
 TGDMLWrite.cxx:1023
 TGDMLWrite.cxx:1024
 TGDMLWrite.cxx:1025
 TGDMLWrite.cxx:1026
 TGDMLWrite.cxx:1027
 TGDMLWrite.cxx:1028
 TGDMLWrite.cxx:1029
 TGDMLWrite.cxx:1030
 TGDMLWrite.cxx:1031
 TGDMLWrite.cxx:1032
 TGDMLWrite.cxx:1033
 TGDMLWrite.cxx:1034
 TGDMLWrite.cxx:1035
 TGDMLWrite.cxx:1036
 TGDMLWrite.cxx:1037
 TGDMLWrite.cxx:1038
 TGDMLWrite.cxx:1039
 TGDMLWrite.cxx:1040
 TGDMLWrite.cxx:1041
 TGDMLWrite.cxx:1042
 TGDMLWrite.cxx:1043
 TGDMLWrite.cxx:1044
 TGDMLWrite.cxx:1045
 TGDMLWrite.cxx:1046
 TGDMLWrite.cxx:1047
 TGDMLWrite.cxx:1048
 TGDMLWrite.cxx:1049
 TGDMLWrite.cxx:1050
 TGDMLWrite.cxx:1051
 TGDMLWrite.cxx:1052
 TGDMLWrite.cxx:1053
 TGDMLWrite.cxx:1054
 TGDMLWrite.cxx:1055
 TGDMLWrite.cxx:1056
 TGDMLWrite.cxx:1057
 TGDMLWrite.cxx:1058
 TGDMLWrite.cxx:1059
 TGDMLWrite.cxx:1060
 TGDMLWrite.cxx:1061
 TGDMLWrite.cxx:1062
 TGDMLWrite.cxx:1063
 TGDMLWrite.cxx:1064
 TGDMLWrite.cxx:1065
 TGDMLWrite.cxx:1066
 TGDMLWrite.cxx:1067
 TGDMLWrite.cxx:1068
 TGDMLWrite.cxx:1069
 TGDMLWrite.cxx:1070
 TGDMLWrite.cxx:1071
 TGDMLWrite.cxx:1072
 TGDMLWrite.cxx:1073
 TGDMLWrite.cxx:1074
 TGDMLWrite.cxx:1075
 TGDMLWrite.cxx:1076
 TGDMLWrite.cxx:1077
 TGDMLWrite.cxx:1078
 TGDMLWrite.cxx:1079
 TGDMLWrite.cxx:1080
 TGDMLWrite.cxx:1081
 TGDMLWrite.cxx:1082
 TGDMLWrite.cxx:1083
 TGDMLWrite.cxx:1084
 TGDMLWrite.cxx:1085
 TGDMLWrite.cxx:1086
 TGDMLWrite.cxx:1087
 TGDMLWrite.cxx:1088
 TGDMLWrite.cxx:1089
 TGDMLWrite.cxx:1090
 TGDMLWrite.cxx:1091
 TGDMLWrite.cxx:1092
 TGDMLWrite.cxx:1093
 TGDMLWrite.cxx:1094
 TGDMLWrite.cxx:1095
 TGDMLWrite.cxx:1096
 TGDMLWrite.cxx:1097
 TGDMLWrite.cxx:1098
 TGDMLWrite.cxx:1099
 TGDMLWrite.cxx:1100
 TGDMLWrite.cxx:1101
 TGDMLWrite.cxx:1102
 TGDMLWrite.cxx:1103
 TGDMLWrite.cxx:1104
 TGDMLWrite.cxx:1105
 TGDMLWrite.cxx:1106
 TGDMLWrite.cxx:1107
 TGDMLWrite.cxx:1108
 TGDMLWrite.cxx:1109
 TGDMLWrite.cxx:1110
 TGDMLWrite.cxx:1111
 TGDMLWrite.cxx:1112
 TGDMLWrite.cxx:1113
 TGDMLWrite.cxx:1114
 TGDMLWrite.cxx:1115
 TGDMLWrite.cxx:1116
 TGDMLWrite.cxx:1117
 TGDMLWrite.cxx:1118
 TGDMLWrite.cxx:1119
 TGDMLWrite.cxx:1120
 TGDMLWrite.cxx:1121
 TGDMLWrite.cxx:1122
 TGDMLWrite.cxx:1123
 TGDMLWrite.cxx:1124
 TGDMLWrite.cxx:1125
 TGDMLWrite.cxx:1126
 TGDMLWrite.cxx:1127
 TGDMLWrite.cxx:1128
 TGDMLWrite.cxx:1129
 TGDMLWrite.cxx:1130
 TGDMLWrite.cxx:1131
 TGDMLWrite.cxx:1132
 TGDMLWrite.cxx:1133
 TGDMLWrite.cxx:1134
 TGDMLWrite.cxx:1135
 TGDMLWrite.cxx:1136
 TGDMLWrite.cxx:1137
 TGDMLWrite.cxx:1138
 TGDMLWrite.cxx:1139
 TGDMLWrite.cxx:1140
 TGDMLWrite.cxx:1141
 TGDMLWrite.cxx:1142
 TGDMLWrite.cxx:1143
 TGDMLWrite.cxx:1144
 TGDMLWrite.cxx:1145
 TGDMLWrite.cxx:1146
 TGDMLWrite.cxx:1147
 TGDMLWrite.cxx:1148
 TGDMLWrite.cxx:1149
 TGDMLWrite.cxx:1150
 TGDMLWrite.cxx:1151
 TGDMLWrite.cxx:1152
 TGDMLWrite.cxx:1153
 TGDMLWrite.cxx:1154
 TGDMLWrite.cxx:1155
 TGDMLWrite.cxx:1156
 TGDMLWrite.cxx:1157
 TGDMLWrite.cxx:1158
 TGDMLWrite.cxx:1159
 TGDMLWrite.cxx:1160
 TGDMLWrite.cxx:1161
 TGDMLWrite.cxx:1162
 TGDMLWrite.cxx:1163
 TGDMLWrite.cxx:1164
 TGDMLWrite.cxx:1165
 TGDMLWrite.cxx:1166
 TGDMLWrite.cxx:1167
 TGDMLWrite.cxx:1168
 TGDMLWrite.cxx:1169
 TGDMLWrite.cxx:1170
 TGDMLWrite.cxx:1171
 TGDMLWrite.cxx:1172
 TGDMLWrite.cxx:1173
 TGDMLWrite.cxx:1174
 TGDMLWrite.cxx:1175
 TGDMLWrite.cxx:1176
 TGDMLWrite.cxx:1177
 TGDMLWrite.cxx:1178
 TGDMLWrite.cxx:1179
 TGDMLWrite.cxx:1180
 TGDMLWrite.cxx:1181
 TGDMLWrite.cxx:1182
 TGDMLWrite.cxx:1183
 TGDMLWrite.cxx:1184
 TGDMLWrite.cxx:1185
 TGDMLWrite.cxx:1186
 TGDMLWrite.cxx:1187
 TGDMLWrite.cxx:1188
 TGDMLWrite.cxx:1189
 TGDMLWrite.cxx:1190
 TGDMLWrite.cxx:1191
 TGDMLWrite.cxx:1192
 TGDMLWrite.cxx:1193
 TGDMLWrite.cxx:1194
 TGDMLWrite.cxx:1195
 TGDMLWrite.cxx:1196
 TGDMLWrite.cxx:1197
 TGDMLWrite.cxx:1198
 TGDMLWrite.cxx:1199
 TGDMLWrite.cxx:1200
 TGDMLWrite.cxx:1201
 TGDMLWrite.cxx:1202
 TGDMLWrite.cxx:1203
 TGDMLWrite.cxx:1204
 TGDMLWrite.cxx:1205
 TGDMLWrite.cxx:1206
 TGDMLWrite.cxx:1207
 TGDMLWrite.cxx:1208
 TGDMLWrite.cxx:1209
 TGDMLWrite.cxx:1210
 TGDMLWrite.cxx:1211
 TGDMLWrite.cxx:1212
 TGDMLWrite.cxx:1213
 TGDMLWrite.cxx:1214
 TGDMLWrite.cxx:1215
 TGDMLWrite.cxx:1216
 TGDMLWrite.cxx:1217
 TGDMLWrite.cxx:1218
 TGDMLWrite.cxx:1219
 TGDMLWrite.cxx:1220
 TGDMLWrite.cxx:1221
 TGDMLWrite.cxx:1222
 TGDMLWrite.cxx:1223
 TGDMLWrite.cxx:1224
 TGDMLWrite.cxx:1225
 TGDMLWrite.cxx:1226
 TGDMLWrite.cxx:1227
 TGDMLWrite.cxx:1228
 TGDMLWrite.cxx:1229
 TGDMLWrite.cxx:1230
 TGDMLWrite.cxx:1231
 TGDMLWrite.cxx:1232
 TGDMLWrite.cxx:1233
 TGDMLWrite.cxx:1234
 TGDMLWrite.cxx:1235
 TGDMLWrite.cxx:1236
 TGDMLWrite.cxx:1237
 TGDMLWrite.cxx:1238
 TGDMLWrite.cxx:1239
 TGDMLWrite.cxx:1240
 TGDMLWrite.cxx:1241
 TGDMLWrite.cxx:1242
 TGDMLWrite.cxx:1243
 TGDMLWrite.cxx:1244
 TGDMLWrite.cxx:1245
 TGDMLWrite.cxx:1246
 TGDMLWrite.cxx:1247
 TGDMLWrite.cxx:1248
 TGDMLWrite.cxx:1249
 TGDMLWrite.cxx:1250
 TGDMLWrite.cxx:1251
 TGDMLWrite.cxx:1252
 TGDMLWrite.cxx:1253
 TGDMLWrite.cxx:1254
 TGDMLWrite.cxx:1255
 TGDMLWrite.cxx:1256
 TGDMLWrite.cxx:1257
 TGDMLWrite.cxx:1258
 TGDMLWrite.cxx:1259
 TGDMLWrite.cxx:1260
 TGDMLWrite.cxx:1261
 TGDMLWrite.cxx:1262
 TGDMLWrite.cxx:1263
 TGDMLWrite.cxx:1264
 TGDMLWrite.cxx:1265
 TGDMLWrite.cxx:1266
 TGDMLWrite.cxx:1267
 TGDMLWrite.cxx:1268
 TGDMLWrite.cxx:1269
 TGDMLWrite.cxx:1270
 TGDMLWrite.cxx:1271
 TGDMLWrite.cxx:1272
 TGDMLWrite.cxx:1273
 TGDMLWrite.cxx:1274
 TGDMLWrite.cxx:1275
 TGDMLWrite.cxx:1276
 TGDMLWrite.cxx:1277
 TGDMLWrite.cxx:1278
 TGDMLWrite.cxx:1279
 TGDMLWrite.cxx:1280
 TGDMLWrite.cxx:1281
 TGDMLWrite.cxx:1282
 TGDMLWrite.cxx:1283
 TGDMLWrite.cxx:1284
 TGDMLWrite.cxx:1285
 TGDMLWrite.cxx:1286
 TGDMLWrite.cxx:1287
 TGDMLWrite.cxx:1288
 TGDMLWrite.cxx:1289
 TGDMLWrite.cxx:1290
 TGDMLWrite.cxx:1291
 TGDMLWrite.cxx:1292
 TGDMLWrite.cxx:1293
 TGDMLWrite.cxx:1294
 TGDMLWrite.cxx:1295
 TGDMLWrite.cxx:1296
 TGDMLWrite.cxx:1297
 TGDMLWrite.cxx:1298
 TGDMLWrite.cxx:1299
 TGDMLWrite.cxx:1300
 TGDMLWrite.cxx:1301
 TGDMLWrite.cxx:1302
 TGDMLWrite.cxx:1303
 TGDMLWrite.cxx:1304
 TGDMLWrite.cxx:1305
 TGDMLWrite.cxx:1306
 TGDMLWrite.cxx:1307
 TGDMLWrite.cxx:1308
 TGDMLWrite.cxx:1309
 TGDMLWrite.cxx:1310
 TGDMLWrite.cxx:1311
 TGDMLWrite.cxx:1312
 TGDMLWrite.cxx:1313
 TGDMLWrite.cxx:1314
 TGDMLWrite.cxx:1315
 TGDMLWrite.cxx:1316
 TGDMLWrite.cxx:1317
 TGDMLWrite.cxx:1318
 TGDMLWrite.cxx:1319
 TGDMLWrite.cxx:1320
 TGDMLWrite.cxx:1321
 TGDMLWrite.cxx:1322
 TGDMLWrite.cxx:1323
 TGDMLWrite.cxx:1324
 TGDMLWrite.cxx:1325
 TGDMLWrite.cxx:1326
 TGDMLWrite.cxx:1327
 TGDMLWrite.cxx:1328
 TGDMLWrite.cxx:1329
 TGDMLWrite.cxx:1330
 TGDMLWrite.cxx:1331
 TGDMLWrite.cxx:1332
 TGDMLWrite.cxx:1333
 TGDMLWrite.cxx:1334
 TGDMLWrite.cxx:1335
 TGDMLWrite.cxx:1336
 TGDMLWrite.cxx:1337
 TGDMLWrite.cxx:1338
 TGDMLWrite.cxx:1339
 TGDMLWrite.cxx:1340
 TGDMLWrite.cxx:1341
 TGDMLWrite.cxx:1342
 TGDMLWrite.cxx:1343
 TGDMLWrite.cxx:1344
 TGDMLWrite.cxx:1345
 TGDMLWrite.cxx:1346
 TGDMLWrite.cxx:1347
 TGDMLWrite.cxx:1348
 TGDMLWrite.cxx:1349
 TGDMLWrite.cxx:1350
 TGDMLWrite.cxx:1351
 TGDMLWrite.cxx:1352
 TGDMLWrite.cxx:1353
 TGDMLWrite.cxx:1354
 TGDMLWrite.cxx:1355
 TGDMLWrite.cxx:1356
 TGDMLWrite.cxx:1357
 TGDMLWrite.cxx:1358
 TGDMLWrite.cxx:1359
 TGDMLWrite.cxx:1360
 TGDMLWrite.cxx:1361
 TGDMLWrite.cxx:1362
 TGDMLWrite.cxx:1363
 TGDMLWrite.cxx:1364
 TGDMLWrite.cxx:1365
 TGDMLWrite.cxx:1366
 TGDMLWrite.cxx:1367
 TGDMLWrite.cxx:1368
 TGDMLWrite.cxx:1369
 TGDMLWrite.cxx:1370
 TGDMLWrite.cxx:1371
 TGDMLWrite.cxx:1372
 TGDMLWrite.cxx:1373
 TGDMLWrite.cxx:1374
 TGDMLWrite.cxx:1375
 TGDMLWrite.cxx:1376
 TGDMLWrite.cxx:1377
 TGDMLWrite.cxx:1378
 TGDMLWrite.cxx:1379
 TGDMLWrite.cxx:1380
 TGDMLWrite.cxx:1381
 TGDMLWrite.cxx:1382
 TGDMLWrite.cxx:1383
 TGDMLWrite.cxx:1384
 TGDMLWrite.cxx:1385
 TGDMLWrite.cxx:1386
 TGDMLWrite.cxx:1387
 TGDMLWrite.cxx:1388
 TGDMLWrite.cxx:1389
 TGDMLWrite.cxx:1390
 TGDMLWrite.cxx:1391
 TGDMLWrite.cxx:1392
 TGDMLWrite.cxx:1393
 TGDMLWrite.cxx:1394
 TGDMLWrite.cxx:1395
 TGDMLWrite.cxx:1396
 TGDMLWrite.cxx:1397
 TGDMLWrite.cxx:1398
 TGDMLWrite.cxx:1399
 TGDMLWrite.cxx:1400
 TGDMLWrite.cxx:1401
 TGDMLWrite.cxx:1402
 TGDMLWrite.cxx:1403
 TGDMLWrite.cxx:1404
 TGDMLWrite.cxx:1405
 TGDMLWrite.cxx:1406
 TGDMLWrite.cxx:1407
 TGDMLWrite.cxx:1408
 TGDMLWrite.cxx:1409
 TGDMLWrite.cxx:1410
 TGDMLWrite.cxx:1411
 TGDMLWrite.cxx:1412
 TGDMLWrite.cxx:1413
 TGDMLWrite.cxx:1414
 TGDMLWrite.cxx:1415
 TGDMLWrite.cxx:1416
 TGDMLWrite.cxx:1417
 TGDMLWrite.cxx:1418
 TGDMLWrite.cxx:1419
 TGDMLWrite.cxx:1420
 TGDMLWrite.cxx:1421
 TGDMLWrite.cxx:1422
 TGDMLWrite.cxx:1423
 TGDMLWrite.cxx:1424
 TGDMLWrite.cxx:1425
 TGDMLWrite.cxx:1426
 TGDMLWrite.cxx:1427
 TGDMLWrite.cxx:1428
 TGDMLWrite.cxx:1429
 TGDMLWrite.cxx:1430
 TGDMLWrite.cxx:1431
 TGDMLWrite.cxx:1432
 TGDMLWrite.cxx:1433
 TGDMLWrite.cxx:1434
 TGDMLWrite.cxx:1435
 TGDMLWrite.cxx:1436
 TGDMLWrite.cxx:1437
 TGDMLWrite.cxx:1438
 TGDMLWrite.cxx:1439
 TGDMLWrite.cxx:1440
 TGDMLWrite.cxx:1441
 TGDMLWrite.cxx:1442
 TGDMLWrite.cxx:1443
 TGDMLWrite.cxx:1444
 TGDMLWrite.cxx:1445
 TGDMLWrite.cxx:1446
 TGDMLWrite.cxx:1447
 TGDMLWrite.cxx:1448
 TGDMLWrite.cxx:1449
 TGDMLWrite.cxx:1450
 TGDMLWrite.cxx:1451
 TGDMLWrite.cxx:1452
 TGDMLWrite.cxx:1453
 TGDMLWrite.cxx:1454
 TGDMLWrite.cxx:1455
 TGDMLWrite.cxx:1456
 TGDMLWrite.cxx:1457
 TGDMLWrite.cxx:1458
 TGDMLWrite.cxx:1459
 TGDMLWrite.cxx:1460
 TGDMLWrite.cxx:1461
 TGDMLWrite.cxx:1462
 TGDMLWrite.cxx:1463
 TGDMLWrite.cxx:1464
 TGDMLWrite.cxx:1465
 TGDMLWrite.cxx:1466
 TGDMLWrite.cxx:1467
 TGDMLWrite.cxx:1468
 TGDMLWrite.cxx:1469
 TGDMLWrite.cxx:1470
 TGDMLWrite.cxx:1471
 TGDMLWrite.cxx:1472
 TGDMLWrite.cxx:1473
 TGDMLWrite.cxx:1474
 TGDMLWrite.cxx:1475
 TGDMLWrite.cxx:1476
 TGDMLWrite.cxx:1477
 TGDMLWrite.cxx:1478
 TGDMLWrite.cxx:1479
 TGDMLWrite.cxx:1480
 TGDMLWrite.cxx:1481
 TGDMLWrite.cxx:1482
 TGDMLWrite.cxx:1483
 TGDMLWrite.cxx:1484
 TGDMLWrite.cxx:1485
 TGDMLWrite.cxx:1486
 TGDMLWrite.cxx:1487
 TGDMLWrite.cxx:1488
 TGDMLWrite.cxx:1489
 TGDMLWrite.cxx:1490
 TGDMLWrite.cxx:1491
 TGDMLWrite.cxx:1492
 TGDMLWrite.cxx:1493
 TGDMLWrite.cxx:1494
 TGDMLWrite.cxx:1495
 TGDMLWrite.cxx:1496
 TGDMLWrite.cxx:1497
 TGDMLWrite.cxx:1498
 TGDMLWrite.cxx:1499
 TGDMLWrite.cxx:1500
 TGDMLWrite.cxx:1501
 TGDMLWrite.cxx:1502
 TGDMLWrite.cxx:1503
 TGDMLWrite.cxx:1504
 TGDMLWrite.cxx:1505
 TGDMLWrite.cxx:1506
 TGDMLWrite.cxx:1507
 TGDMLWrite.cxx:1508
 TGDMLWrite.cxx:1509
 TGDMLWrite.cxx:1510
 TGDMLWrite.cxx:1511
 TGDMLWrite.cxx:1512
 TGDMLWrite.cxx:1513
 TGDMLWrite.cxx:1514
 TGDMLWrite.cxx:1515
 TGDMLWrite.cxx:1516
 TGDMLWrite.cxx:1517
 TGDMLWrite.cxx:1518
 TGDMLWrite.cxx:1519
 TGDMLWrite.cxx:1520
 TGDMLWrite.cxx:1521
 TGDMLWrite.cxx:1522
 TGDMLWrite.cxx:1523
 TGDMLWrite.cxx:1524
 TGDMLWrite.cxx:1525
 TGDMLWrite.cxx:1526
 TGDMLWrite.cxx:1527
 TGDMLWrite.cxx:1528
 TGDMLWrite.cxx:1529
 TGDMLWrite.cxx:1530
 TGDMLWrite.cxx:1531
 TGDMLWrite.cxx:1532
 TGDMLWrite.cxx:1533
 TGDMLWrite.cxx:1534
 TGDMLWrite.cxx:1535
 TGDMLWrite.cxx:1536
 TGDMLWrite.cxx:1537
 TGDMLWrite.cxx:1538
 TGDMLWrite.cxx:1539
 TGDMLWrite.cxx:1540
 TGDMLWrite.cxx:1541
 TGDMLWrite.cxx:1542
 TGDMLWrite.cxx:1543
 TGDMLWrite.cxx:1544
 TGDMLWrite.cxx:1545
 TGDMLWrite.cxx:1546
 TGDMLWrite.cxx:1547
 TGDMLWrite.cxx:1548
 TGDMLWrite.cxx:1549
 TGDMLWrite.cxx:1550
 TGDMLWrite.cxx:1551
 TGDMLWrite.cxx:1552
 TGDMLWrite.cxx:1553
 TGDMLWrite.cxx:1554
 TGDMLWrite.cxx:1555
 TGDMLWrite.cxx:1556
 TGDMLWrite.cxx:1557
 TGDMLWrite.cxx:1558
 TGDMLWrite.cxx:1559
 TGDMLWrite.cxx:1560
 TGDMLWrite.cxx:1561
 TGDMLWrite.cxx:1562
 TGDMLWrite.cxx:1563
 TGDMLWrite.cxx:1564
 TGDMLWrite.cxx:1565
 TGDMLWrite.cxx:1566
 TGDMLWrite.cxx:1567
 TGDMLWrite.cxx:1568
 TGDMLWrite.cxx:1569
 TGDMLWrite.cxx:1570
 TGDMLWrite.cxx:1571
 TGDMLWrite.cxx:1572
 TGDMLWrite.cxx:1573
 TGDMLWrite.cxx:1574
 TGDMLWrite.cxx:1575
 TGDMLWrite.cxx:1576
 TGDMLWrite.cxx:1577
 TGDMLWrite.cxx:1578
 TGDMLWrite.cxx:1579
 TGDMLWrite.cxx:1580
 TGDMLWrite.cxx:1581
 TGDMLWrite.cxx:1582
 TGDMLWrite.cxx:1583
 TGDMLWrite.cxx:1584
 TGDMLWrite.cxx:1585
 TGDMLWrite.cxx:1586
 TGDMLWrite.cxx:1587
 TGDMLWrite.cxx:1588
 TGDMLWrite.cxx:1589
 TGDMLWrite.cxx:1590