TGDMLWrite Class This class contains implementation of converting ROOT's gGeoManager geometry to GDML file. gGeoManager is the instance of TGeoManager class containing tree of geometries creating resulting geometry. GDML is xml based format of file mirroring the tree of geometries according to GDML schema rules. For more information about GDML see http://gdml.web.cern.ch. Each object in ROOT is represented by xml tag (=xml node/element) in GDML. This class is not needed to be instanciated. It should always be called by gGeoManager->Export("xyz.gdml") method. Export is driven by extenstion that is why ".gdml" is important in resulting name. Whenever a new ROOT geometry object is implemented or there is a change in GDML schema this class is needed to be updated to ensure proper mapping between ROOT objects and GDML elements. Current status of mapping ROOT -> GDML is implemented in method called TGDMLWrite::ChooseObject and it contains following "map": Solids: TGeoBBox -> <box ... > TGeoParaboloid -> <paraboloid ...> TGeoSphere -> <sphere ...> TGeoArb8 -> <arb8 ...> TGeoConeSeg -> <cone ...> TGeoCone -> <cone ...> TGeoPara -> <para ...> TGeoTrap -> <trap ...> or - -> <arb8 ...> TGeoGtra -> <twistedtrap ...> or - -> <trap ...> or - -> <arb8 ...> TGeoTrd1 -> <trd ...> TGeoTrd2 -> <trd ...> TGeoTubeSeg -> <tube ...> TGeoCtub -> <cutTube ...> TGeoTube -> <tube ...> TGeoPcon -> <polycone ...> TGeoTorus -> <torus ...> TGeoPgon -> <polyhedra ...> TGeoEltu -> <eltube ...> TGeoHype -> <hype ...> TGeoXtru -> <xtru ...> TGeoCompositeShape -> <union ...> or - -> <subtraction ...> or - -> <intersection ...> Special cases of solids: TGeoScaledShape -> <elcone ...> if scaled TGeoCone or - -> element without scale TGeoCompositeShape -> <ellipsoid ...> - intersection of: - scaled TGeoSphere and TGeoBBox Materials: TGeoIsotope -> <isotope ...> TGeoElement -> <element ...> TGeoMaterial -> <material ...> TGeoMixture -> <material ...> Structure TGeoVolume -> <volume ...> or - -> <assembly ...> TGeoNode -> <physvol ...> TGeoPatternFinder -> <divisionvol ...> There are options that can be set to change resulting document Options: g - is set by default in gGeoManager, this option ensures compatibility - with Geant4. It means: - -> atomic number of material will be changed if <1 to 1 - -> if polycone is set badly it will try to export it correctly - -> if widht * ndiv + offset is more then width of object being divided - (in divisions) then it will be rounded so it will not exceed or - if kPhi divsion then it will keep range of offset in -360 -> 0 f - if this option is set then names of volumes and solids will have - pointer as a suffix to ensure uniqness of names n - if this option is set then names will not have suffix, but uniqness is - of names is not secured - - if none of this two options (f,n) is set then default behaviour is so - that incremental suffix is added to the names. - (eg. TGeoBBox_0x1, TGeoBBox_0x2 ...) USAGE: gGeoManager->Export("output.gdml"); gGeoManager->Export("output.gdml","","vg"); //the same as previous just options are set explicitly gGeoManager->Export("output.gdml","","vgf"); gGeoManager->Export("output.gdml","","gn"); gGeoManager->Export("output.gdml","","f"); NB: Options discussed above are used only for TGDMLWrite class. There are other options in the TGeoManager::Export(...) method that can be used. See that function for details.
TGDMLWrite() | |
TGDMLWrite(const TGDMLWrite&) | |
virtual | ~TGDMLWrite() |
void | TObject::AbstractMethod(const char* method) const |
virtual void | TObject::AppendPad(Option_t* option = "") |
virtual void | TObject::Browse(TBrowser* b) |
static TClass* | Class() |
virtual const char* | TObject::ClassName() const |
virtual void | TObject::Clear(Option_t* = "") |
virtual TObject* | TObject::Clone(const char* newname = "") const |
virtual Int_t | TObject::Compare(const TObject* obj) const |
virtual void | TObject::Copy(TObject& object) const |
virtual void | TObject::Delete(Option_t* option = "")MENU |
virtual Int_t | TObject::DistancetoPrimitive(Int_t px, Int_t py) |
virtual void | TObject::Draw(Option_t* option = "") |
virtual void | TObject::DrawClass() constMENU |
virtual TObject* | TObject::DrawClone(Option_t* option = "") constMENU |
virtual void | TObject::Dump() constMENU |
virtual void | TObject::Error(const char* method, const char* msgfmt) const |
virtual void | TObject::Execute(const char* method, const char* params, Int_t* error = 0) |
virtual void | TObject::Execute(TMethod* method, TObjArray* params, Int_t* error = 0) |
virtual void | TObject::ExecuteEvent(Int_t event, Int_t px, Int_t py) |
virtual void | TObject::Fatal(const char* method, const char* msgfmt) const |
virtual TObject* | TObject::FindObject(const char* name) const |
virtual TObject* | TObject::FindObject(const TObject* obj) const |
virtual Option_t* | TObject::GetDrawOption() const |
static Long_t | TObject::GetDtorOnly() |
virtual const char* | TObject::GetIconName() const |
virtual const char* | TObject::GetName() const |
virtual char* | TObject::GetObjectInfo(Int_t px, Int_t py) const |
static Bool_t | TObject::GetObjectStat() |
virtual Option_t* | TObject::GetOption() const |
virtual const char* | TObject::GetTitle() const |
virtual UInt_t | TObject::GetUniqueID() const |
virtual Bool_t | TObject::HandleTimer(TTimer* timer) |
virtual ULong_t | TObject::Hash() const |
virtual void | TObject::Info(const char* method, const char* msgfmt) const |
virtual Bool_t | TObject::InheritsFrom(const char* classname) const |
virtual Bool_t | TObject::InheritsFrom(const TClass* cl) const |
virtual void | TObject::Inspect() constMENU |
void | TObject::InvertBit(UInt_t f) |
virtual TClass* | IsA() const |
virtual Bool_t | TObject::IsEqual(const TObject* obj) const |
virtual Bool_t | TObject::IsFolder() const |
Bool_t | TObject::IsOnHeap() const |
virtual Bool_t | TObject::IsSortable() const |
Bool_t | TObject::IsZombie() const |
virtual void | TObject::ls(Option_t* option = "") const |
void | TObject::MayNotUse(const char* method) const |
virtual Bool_t | TObject::Notify() |
void | TObject::Obsolete(const char* method, const char* asOfVers, const char* removedFromVers) const |
static void | TObject::operator delete(void* ptr) |
static void | TObject::operator delete(void* ptr, void* vp) |
static void | TObject::operator delete[](void* ptr) |
static void | TObject::operator delete[](void* ptr, void* vp) |
void* | TObject::operator new(size_t sz) |
void* | TObject::operator new(size_t sz, void* vp) |
void* | TObject::operator new[](size_t sz) |
void* | TObject::operator new[](size_t sz, void* vp) |
TGDMLWrite& | operator=(const TGDMLWrite&) |
virtual void | TObject::Paint(Option_t* option = "") |
virtual void | TObject::Pop() |
virtual void | TObject::Print(Option_t* option = "") const |
virtual Int_t | TObject::Read(const char* name) |
virtual void | TObject::RecursiveRemove(TObject* obj) |
void | TObject::ResetBit(UInt_t f) |
virtual void | TObject::SaveAs(const char* filename = "", Option_t* option = "") constMENU |
virtual void | TObject::SavePrimitive(ostream& out, Option_t* option = "") |
void | TObject::SetBit(UInt_t f) |
void | TObject::SetBit(UInt_t f, Bool_t set) |
virtual void | TObject::SetDrawOption(Option_t* option = "")MENU |
static void | TObject::SetDtorOnly(void* obj) |
void | SetG4Compatibility(Bool_t G4Compatible) |
void | SetNamingSpeed(TGDMLWrite::ENamingType naming) |
static void | TObject::SetObjectStat(Bool_t stat) |
virtual void | TObject::SetUniqueID(UInt_t uid) |
virtual void | ShowMembers(TMemberInspector&) |
static void | StartGDMLWriting(TGeoManager* geomanager, const char* filename, TString option) |
virtual void | Streamer(TBuffer&) |
void | StreamerNVirtual(TBuffer& ClassDef_StreamerNVirtual_b) |
virtual void | TObject::SysError(const char* method, const char* msgfmt) const |
Bool_t | TObject::TestBit(UInt_t f) const |
Int_t | TObject::TestBits(UInt_t f) const |
virtual void | TObject::UseCurrentStyle() |
virtual void | TObject::Warning(const char* method, const char* msgfmt) const |
virtual Int_t | TObject::Write(const char* name = 0, Int_t option = 0, Int_t bufsize = 0) |
virtual Int_t | TObject::Write(const char* name = 0, Int_t option = 0, Int_t bufsize = 0) const |
void | WriteGDMLfile(TGeoManager* geomanager, const char* filename = "test.gdml", TString option = "") |
virtual void | TObject::DoError(int level, const char* location, const char* fmt, va_list va) const |
void | TObject::MakeZombie() |
enum ENamingType { | kelegantButSlow | |
kwithoutSufixNotUniq | ||
kfastButUglySufix | ||
}; | ||
enum TObject::EStatusBits { | kCanDelete | |
kMustCleanup | ||
kObjInCanvas | ||
kIsReferenced | ||
kHasUUID | ||
kCannotPick | ||
kNoContextMenu | ||
kInvalidObject | ||
}; | ||
enum TObject::[unnamed] { | kIsOnHeap | |
kNotDeleted | ||
kZombie | ||
kBitMask | ||
kSingleKey | ||
kOverwrite | ||
kWriteDelete | ||
}; |
TGDMLWrite::StructLst* | fAccPatt | list of accepted patterns for division |
UInt_t | fActNameErr | count of name errors |
XMLNodePointer_t | fDefineNode | main <define> node... |
TGDMLWrite::StructLst* | fElementList | list of elements |
TXMLEngine* | fGdmlE | xml engine pointer |
XMLDocPointer_t | fGdmlFile | pointer storing xml file |
TGDMLWrite::StructLst* | fIsotopeList | list of isotopes |
XMLNodePointer_t | fMaterialsNode | main <materials> node... |
TGDMLWrite::NameLst* | fNameList | list of names (pointer mapped) |
Int_t | fPhysVolCnt | count of physical volumes |
TGDMLWrite::StructLst* | fRejShape | list of rejected shapes |
UInt_t | fSolCnt | count of name solids |
XMLNodePointer_t | fSolidsNode | main <solids> node... |
XMLNodePointer_t | fStructureNode | main <structure> node... |
TString | fTopVolumeName | name of top volume |
Int_t | fVolCnt | count of volumes |
Bool_t | fgG4Compatibility | input option for Geant4 compatibility |
static TGDMLWrite* | fgGDMLWrite | pointer to gdml writer |
Int_t | fgNamingSpeed | input option for volume and solid naming |
static const UInt_t | fgkMaxNameErr | maximum number of errors for naming |
static const UInt_t | fgkProcBit | 14th bit is set when solid is processed |
static const UInt_t | fgkProcBitVol | 19th bit is set when volume is processed |
Wrapper of all exporting methods Creates blank GDML file and fills it with gGeoManager structure converted to GDML structure of xml nodes
Creates "atom" node for GDML
Creates "D" density node for GDML
Creates "fraction" node for GDML
Creates "isotope" node for GDML
Creates "element" node for GDML
element node and attribute
Creates "material" node for GDML with references to other sub elements
Creates "material" node for GDML
Creates "cone" node for GDML from TGeoConeSeg object
Creates "tube" node for GDML from object TGeoTubeSeg
Creates "zplane" node for GDML
Creates "elcone" (elliptical cone) node for GDML this is a special case, because elliptical cone is not defined in ROOT so when scaled cone is found, it is considered as a elliptical cone
Creates common part of union intersection and subtraction nodes
Creates "position" kind of node for GDML
Creates "rotation" kind of node for GDML
Creates "setup" node for GDML
Creates "volume" node for GDML
Creates "physvol" node for GDML
Creates "divisionvol" node for GDML
Chooses the object and method that should be used for processing object
Method creating cutTube as an intersection of tube and two boxes - not used anymore because cutube is supported in Geant4 9.5
Checks whether name2check is in (NameList) list
NCNAME basic restrictions
Replace "$" character with empty character etc.
Important function which is responsible for naming volumes, solids and materials
Method that retrieves axis and unit along which object is divided
Check for null parameter to skip the NULL objects
Unsetting bits that were changed in gGeoManager during export so that export can be run more times with the same instance of gGeoManager.
static function - options: g - set by default - geant4 compatibility f,n - if none of this two is set then naming convention is with incremental suffix, if "f" then suffix is pointer if "n" then there is no suffix, but uniqness of names is not secured.