Logo ROOT   6.16/01
Reference Guide
List of all members | Public Member Functions | Static Public Member Functions | Public Attributes | Private Types | Private Member Functions | Private Attributes | List of all members
TGDMLParse Class Reference

This class contains the implementation of the GDML parser associated to all the supported GDML elements.

User should never need to explicitly instaciate this class. It is internally used by the TGeoManager.

Each element process has a 'Binding' to ROOT. The 'binding' is specific mapping of GDML elements (materials, solids, etc) to specific objects which should be instanciated by the converted. In the present case (ROOT) the binding is implemented at the near the end of each process function. Most bindings follow similar format, dependent on what is being added to the geometry.

This file also contains the implementation of the TGDMLRefl class. This is just a small helper class used internally by the 'reflection' method (for reflected solids).

The presently supported list of TGeo classes is the following:

Materials:

Solids:

Approximated Solids:

Geometry:

When most solids or volumes are added to the geometry they

Whenever a new element is added to GDML schema, this class needs to be extended. The appropriate method (process) needs to be implemented, as well as the new element process then needs to be linked thru the function TGDMLParse

For any question or remarks concerning this code, please send an email to ben.l.nosp@m.loyd.nosp@m.@cern.nosp@m..ch

Definition at line 93 of file TGDMLParse.h.

Public Member Functions

 TGDMLParse ()
 Constructor. More...
 
virtual ~TGDMLParse ()
 
TGeoVolumeGDMLReadFile (const char *filename="test.gdml")
 Creates the new instance of the XMLEngine called 'gdml', using the filename >> then parses the file and creates the DOM tree. More...
 
- Public Member Functions inherited from TObject
 TObject ()
 TObject constructor. More...
 
 TObject (const TObject &object)
 TObject copy ctor. More...
 
virtual ~TObject ()
 TObject destructor. More...
 
void AbstractMethod (const char *method) const
 Use this method to implement an "abstract" method that you don't want to leave purely abstract. More...
 
virtual void AppendPad (Option_t *option="")
 Append graphics object to current pad. More...
 
virtual void Browse (TBrowser *b)
 Browse object. May be overridden for another default action. More...
 
ULong_t CheckedHash ()
 Check and record whether this class has a consistent Hash/RecursiveRemove setup (*) and then return the regular Hash value for this object. More...
 
virtual const char * ClassName () const
 Returns name of class to which the object belongs. More...
 
virtual void Clear (Option_t *="")
 
virtual TObjectClone (const char *newname="") const
 Make a clone of an object using the Streamer facility. More...
 
virtual Int_t Compare (const TObject *obj) const
 Compare abstract method. More...
 
virtual void Copy (TObject &object) const
 Copy this to obj. More...
 
virtual void Delete (Option_t *option="")
 Delete this object. More...
 
virtual Int_t DistancetoPrimitive (Int_t px, Int_t py)
 Computes distance from point (px,py) to the object. More...
 
virtual void Draw (Option_t *option="")
 Default Draw method for all objects. More...
 
virtual void DrawClass () const
 Draw class inheritance tree of the class to which this object belongs. More...
 
virtual TObjectDrawClone (Option_t *option="") const
 Draw a clone of this object in the current selected pad for instance with: gROOT->SetSelectedPad(gPad). More...
 
virtual void Dump () const
 Dump contents of object on stdout. More...
 
virtual void Error (const char *method, const char *msgfmt,...) const
 Issue error message. More...
 
virtual void Execute (const char *method, const char *params, Int_t *error=0)
 Execute method on this object with the given parameter string, e.g. More...
 
virtual void Execute (TMethod *method, TObjArray *params, Int_t *error=0)
 Execute method on this object with parameters stored in the TObjArray. More...
 
virtual void ExecuteEvent (Int_t event, Int_t px, Int_t py)
 Execute action corresponding to an event at (px,py). More...
 
virtual void Fatal (const char *method, const char *msgfmt,...) const
 Issue fatal error message. More...
 
virtual TObjectFindObject (const char *name) const
 Must be redefined in derived classes. More...
 
virtual TObjectFindObject (const TObject *obj) const
 Must be redefined in derived classes. More...
 
virtual Option_tGetDrawOption () const
 Get option used by the graphics system to draw this object. More...
 
virtual const char * GetIconName () const
 Returns mime type name of object. More...
 
virtual const char * GetName () const
 Returns name of object. More...
 
virtual char * GetObjectInfo (Int_t px, Int_t py) const
 Returns string containing info about the object at position (px,py). More...
 
virtual Option_tGetOption () const
 
virtual const char * GetTitle () const
 Returns title of object. More...
 
virtual UInt_t GetUniqueID () const
 Return the unique object id. More...
 
virtual Bool_t HandleTimer (TTimer *timer)
 Execute action in response of a timer timing out. More...
 
virtual ULong_t Hash () const
 Return hash value for this object. More...
 
Bool_t HasInconsistentHash () const
 Return true is the type of this object is known to have an inconsistent setup for Hash and RecursiveRemove (i.e. More...
 
virtual void Info (const char *method, const char *msgfmt,...) const
 Issue info message. More...
 
virtual Bool_t InheritsFrom (const char *classname) const
 Returns kTRUE if object inherits from class "classname". More...
 
virtual Bool_t InheritsFrom (const TClass *cl) const
 Returns kTRUE if object inherits from TClass cl. More...
 
virtual void Inspect () const
 Dump contents of this object in a graphics canvas. More...
 
void InvertBit (UInt_t f)
 
virtual Bool_t IsEqual (const TObject *obj) const
 Default equal comparison (objects are equal if they have the same address in memory). More...
 
virtual Bool_t IsFolder () const
 Returns kTRUE in case object contains browsable objects (like containers or lists of other objects). More...
 
R__ALWAYS_INLINE Bool_t IsOnHeap () const
 
virtual Bool_t IsSortable () const
 
R__ALWAYS_INLINE Bool_t IsZombie () const
 
virtual void ls (Option_t *option="") const
 The ls function lists the contents of a class on stdout. More...
 
void MayNotUse (const char *method) const
 Use this method to signal that a method (defined in a base class) may not be called in a derived class (in principle against good design since a child class should not provide less functionality than its parent, however, sometimes it is necessary). More...
 
virtual Bool_t Notify ()
 This method must be overridden to handle object notification. More...
 
void Obsolete (const char *method, const char *asOfVers, const char *removedFromVers) const
 Use this method to declare a method obsolete. More...
 
void operator delete (void *ptr)
 Operator delete. More...
 
void operator delete[] (void *ptr)
 Operator delete []. More...
 
voidoperator new (size_t sz)
 
voidoperator new (size_t sz, void *vp)
 
voidoperator new[] (size_t sz)
 
voidoperator new[] (size_t sz, void *vp)
 
TObjectoperator= (const TObject &rhs)
 TObject assignment operator. More...
 
virtual void Paint (Option_t *option="")
 This method must be overridden if a class wants to paint itself. More...
 
virtual void Pop ()
 Pop on object drawn in a pad to the top of the display list. More...
 
virtual void Print (Option_t *option="") const
 This method must be overridden when a class wants to print itself. More...
 
virtual Int_t Read (const char *name)
 Read contents of object with specified name from the current directory. More...
 
virtual void RecursiveRemove (TObject *obj)
 Recursively remove this object from a list. More...
 
void ResetBit (UInt_t f)
 
virtual void SaveAs (const char *filename="", Option_t *option="") const
 Save this object in the file specified by filename. More...
 
virtual void SavePrimitive (std::ostream &out, Option_t *option="")
 Save a primitive as a C++ statement(s) on output stream "out". More...
 
void SetBit (UInt_t f)
 
void SetBit (UInt_t f, Bool_t set)
 Set or unset the user status bits as specified in f. More...
 
virtual void SetDrawOption (Option_t *option="")
 Set drawing option for object. More...
 
virtual void SetUniqueID (UInt_t uid)
 Set the unique object id. More...
 
virtual void SysError (const char *method, const char *msgfmt,...) const
 Issue system error message. More...
 
R__ALWAYS_INLINE Bool_t TestBit (UInt_t f) const
 
Int_t TestBits (UInt_t f) const
 
virtual void UseCurrentStyle ()
 Set current style settings in this object This function is called when either TCanvas::UseCurrentStyle or TROOT::ForceStyle have been invoked. More...
 
virtual void Warning (const char *method, const char *msgfmt,...) const
 Issue warning message. More...
 
virtual Int_t Write (const char *name=0, Int_t option=0, Int_t bufsize=0)
 Write this object to the current directory. More...
 
virtual Int_t Write (const char *name=0, Int_t option=0, Int_t bufsize=0) const
 Write this object to the current directory. More...
 

Static Public Member Functions

static TGeoVolumeStartGDML (const char *filename)
 
- Static Public Member Functions inherited from TObject
static Long_t GetDtorOnly ()
 Return destructor only flag. More...
 
static Bool_t GetObjectStat ()
 Get status of object stat flag. More...
 
static void SetDtorOnly (void *obj)
 Set destructor only flag. More...
 
static void SetObjectStat (Bool_t stat)
 Turn on/off tracking of objects in the TObjectTable. More...
 

Public Attributes

const char * fCurrentFile
 
std::string fDefault_aunit = "rad"
 
std::string fDefault_lunit = "mm"
 
TXMLEnginefFileEngine [20]
 
int fFILENO
 
const char * fStartFile
 
int fVolID
 
TGeoVolumefWorld
 
TString fWorldName
 

Private Types

typedef std::map< std::string, double > ConstMap
 
typedef TGDMMapHelper< TGeoElementEleMap
 
typedef TGDMMapHelper< const char > FileMap
 
typedef std::map< std::string, double > FracMap
 
typedef TGDMMapHelper< TGeoIsotopeIsoMap
 
typedef TGDMMapHelper< TGeoMaterialMatMap
 
typedef TGDMMapHelper< TGeoMediumMedMap
 
typedef TGDMMapHelper< TGeoMixtureMixMap
 
typedef TGDMMapHelper< TGeoTranslationPosMap
 
typedef std::map< std::string, std::string > ReflectionsMap
 
typedef TGDMMapHelper< TGDMLReflReflSolidMap
 
typedef std::map< std::string, std::string > ReflVolMap
 
typedef TGDMMapHelper< TGeoRotationRotMap
 
typedef TGDMMapHelper< TGeoScaleSclMap
 
typedef TGDMMapHelper< TGeoShapeSolMap
 
typedef TGDMMapHelper< TGeoVolumeVolMap
 

Private Member Functions

XMLNodePointer_t Arb8 (TXMLEngine *gdml, XMLNodePointer_t node, XMLAttrPointer_t attr)
 In the solids section of the GDML file, an Arb8 may be declared. More...
 
XMLNodePointer_t AssProcess (TXMLEngine *gdml, XMLNodePointer_t node)
 In the structure section of the GDML file, assembly volumes can be declared. More...
 
XMLNodePointer_t BooSolid (TXMLEngine *gdml, XMLNodePointer_t node, XMLAttrPointer_t attr, int num)
 In the solid section of the GDML file, boolean solids can be declared. More...
 
XMLNodePointer_t Box (TXMLEngine *gdml, XMLNodePointer_t node, XMLAttrPointer_t attr)
 In the solids section of the GDML file, a box may be declared. More...
 
XMLNodePointer_t Cone (TXMLEngine *gdml, XMLNodePointer_t node, XMLAttrPointer_t attr)
 In the solids section of the GDML file, a cone may be declared. More...
 
XMLNodePointer_t ConProcess (TXMLEngine *gdml, XMLNodePointer_t node, XMLAttrPointer_t attr)
 In the define section of the GDML file, constants can be declared. More...
 
XMLNodePointer_t CutTube (TXMLEngine *gdml, XMLNodePointer_t node, XMLAttrPointer_t attr)
 In the solids section of the GDML file, a Cut Tube may be declared. More...
 
XMLNodePointer_t ElCone (TXMLEngine *gdml, XMLNodePointer_t node, XMLAttrPointer_t attr)
 In the solids section of the GDML file, an elliptical cone may be declared. More...
 
XMLNodePointer_t EleProcess (TXMLEngine *gdml, XMLNodePointer_t node, XMLNodePointer_t parentn, Bool_t hasIsotopes, Bool_t hasIsotopesExtended)
 When the element keyword is found, this function is called, and the name and values of the element are converted into type TGeoElement and stored in felemap map using the name as its key. More...
 
XMLNodePointer_t Ellipsoid (TXMLEngine *gdml, XMLNodePointer_t node, XMLAttrPointer_t attr)
 In the solids section of the GDML file, an ellipsoid may be declared. More...
 
XMLNodePointer_t ElTube (TXMLEngine *gdml, XMLNodePointer_t node, XMLAttrPointer_t attr)
 In the solids section of the GDML file, a ElTube may be declared. More...
 
double Evaluate (const char *evalline)
 Takes a string containing a mathematical expression and returns the value of the expression. More...
 
TString GetScale (const char *unit)
 Throughout the GDML file, a unit can de specified. More...
 
double GetScaleVal (const char *unit)
 Throughout the GDML file, a unit can de specified. More...
 
XMLNodePointer_t Hype (TXMLEngine *gdml, XMLNodePointer_t node, XMLAttrPointer_t attr)
 In the solids section of the GDML file, a Hype may be declared. More...
 
XMLNodePointer_t IsoProcess (TXMLEngine *gdml, XMLNodePointer_t node, XMLNodePointer_t parentn)
 In the material section of the GDML file, an isotope may be declared. More...
 
XMLNodePointer_t MatProcess (TXMLEngine *gdml, XMLNodePointer_t node, XMLAttrPointer_t attr, int z)
 In the materials section of the GDML file, materials can be declared. More...
 
const char * NameShort (const char *name)
 This function looks thru a string for the chars '0x' next to each other, when it finds this, it calls another function to strip the hex address. More...
 
XMLNodePointer_t Orb (TXMLEngine *gdml, XMLNodePointer_t node, XMLAttrPointer_t attr)
 In the solids section of the GDML file, an Orb may be declared. More...
 
XMLNodePointer_t Para (TXMLEngine *gdml, XMLNodePointer_t node, XMLAttrPointer_t attr)
 In the solids section of the GDML file, a Para may be declared. More...
 
XMLNodePointer_t Paraboloid (TXMLEngine *gdml, XMLNodePointer_t node, XMLAttrPointer_t attr)
 In the solids section of the GDML file, a Paraboloid may be declared. More...
 
const char * ParseGDML (TXMLEngine *gdml, XMLNodePointer_t node)
 This function recursively moves thru the DOM tree of the GDML file. More...
 
XMLNodePointer_t Polycone (TXMLEngine *gdml, XMLNodePointer_t node, XMLAttrPointer_t attr)
 In the solids section of the GDML file, a Polycone may be declared. More...
 
XMLNodePointer_t Polyhedra (TXMLEngine *gdml, XMLNodePointer_t node, XMLAttrPointer_t attr)
 In the solids section of the GDML file, a Polyhedra may be declared. More...
 
XMLNodePointer_t PosProcess (TXMLEngine *gdml, XMLNodePointer_t node, XMLAttrPointer_t attr)
 In the define section of the GDML file, positions can be declared. More...
 
XMLNodePointer_t QuantityProcess (TXMLEngine *gdml, XMLNodePointer_t node, XMLAttrPointer_t attr)
 In the define section of the GDML file, quantities can be declared. More...
 
XMLNodePointer_t Reflection (TXMLEngine *gdml, XMLNodePointer_t node, XMLAttrPointer_t attr)
 In the solids section of the GDML file, a Reflected Solid may be declared when the ReflectedSolid keyword is found, this function is called. More...
 
XMLNodePointer_t RotProcess (TXMLEngine *gdml, XMLNodePointer_t node, XMLAttrPointer_t attr)
 In the define section of the GDML file, rotations can be declared. More...
 
XMLNodePointer_t SclProcess (TXMLEngine *gdml, XMLNodePointer_t node, XMLAttrPointer_t attr)
 In the define section of the GDML file, rotations can be declared. More...
 
Int_t SetAxis (const char *axisString)
 When using the 'divide' process in the geometry this function sets the variable 'axis' depending on what is specified. More...
 
XMLNodePointer_t Sphere (TXMLEngine *gdml, XMLNodePointer_t node, XMLAttrPointer_t attr)
 In the solids section of the GDML file, a Sphere may be declared. More...
 
XMLNodePointer_t TopProcess (TXMLEngine *gdml, XMLNodePointer_t node)
 In the setup section of the GDML file, the top volume need to be declared. More...
 
XMLNodePointer_t Torus (TXMLEngine *gdml, XMLNodePointer_t node, XMLAttrPointer_t attr)
 In the solids section of the GDML file, a Torus may be declared. More...
 
XMLNodePointer_t Trap (TXMLEngine *gdml, XMLNodePointer_t node, XMLAttrPointer_t attr)
 In the solids section of the GDML file, a Trap may be declared. More...
 
XMLNodePointer_t Trd (TXMLEngine *gdml, XMLNodePointer_t node, XMLAttrPointer_t attr)
 In the solids section of the GDML file, a Trd may be declared. More...
 
XMLNodePointer_t Tube (TXMLEngine *gdml, XMLNodePointer_t node, XMLAttrPointer_t attr)
 In the solids section of the GDML file, a Tube may be declared. More...
 
XMLNodePointer_t TwistTrap (TXMLEngine *gdml, XMLNodePointer_t node, XMLAttrPointer_t attr)
 In the solids section of the GDML file, a TwistTrap may be declared. More...
 
XMLNodePointer_t UsrProcess (TXMLEngine *gdml, XMLNodePointer_t node)
 User data to be processed. More...
 
double Value (const char *svalue) const
 Convert number in string format to double value. More...
 
XMLNodePointer_t VolProcess (TXMLEngine *gdml, XMLNodePointer_t node)
 In the structure section of the GDML file, volumes can be declared. More...
 
XMLNodePointer_t Xtru (TXMLEngine *gdml, XMLNodePointer_t node, XMLAttrPointer_t attr)
 In the solids section of the GDML file, an Xtru may be declared. More...
 

Private Attributes

ConstMap fconsts
 Map containing files parsed during entire parsing, with their world volume name. More...
 
EleMap felemap
 Map containing isotope names and the TGeoIsotope for it. More...
 
FileMap ffilemap
 Map containing reflected volume names and the solid ref for it. More...
 
IsoMap fisomap
 Map containing scale names and the TGeoScale for it. More...
 
MatMap fmatmap
 Map containing element names and the TGeoElement for it. More...
 
MedMap fmedmap
 Map containing material names and the TGeoMaterial for it. More...
 
MixMap fmixmap
 Map containing medium names and the TGeoMedium for it. More...
 
PosMap fposmap
 
ReflectionsMap freflectmap
 Map containing volume names and the TGeoVolume for it. More...
 
ReflSolidMap freflsolidmap
 Map containing reflection names and the Solid name ir references to. More...
 
ReflVolMap freflvolmap
 Map containing reflection names and the TGDMLRefl for it - containing refl matrix. More...
 
RotMap frotmap
 Map containing position names and the TGeoTranslation for it. More...
 
SclMap fsclmap
 Map containing rotation names and the TGeoRotation for it. More...
 
SolMap fsolmap
 Map containing mixture names and the TGeoMixture for it. More...
 
VolMap fvolmap
 Map containing solid names and the TGeoShape for it. More...
 

Additional Inherited Members

- Public Types inherited from TObject
enum  {
  kIsOnHeap = 0x01000000 , kNotDeleted = 0x02000000 , kZombie = 0x04000000 , kInconsistent = 0x08000000 ,
  kBitMask = 0x00ffffff
}
 
enum  { kSingleKey = BIT(0) , kOverwrite = BIT(1) , kWriteDelete = BIT(2) }
 
enum  EDeprecatedStatusBits { kObjInCanvas = BIT(3) }
 
enum  EStatusBits {
  kCanDelete = BIT(0) , kMustCleanup = BIT(3) , kIsReferenced = BIT(4) , kHasUUID = BIT(5) ,
  kCannotPick = BIT(6) , kNoContextMenu = BIT(8) , kInvalidObject = BIT(13)
}
 
- Protected Member Functions inherited from TObject
virtual void DoError (int level, const char *location, const char *fmt, va_list va) const
 Interface to ErrorHandler (protected). More...
 
void MakeZombie ()
 

#include <TGDMLParse.h>

Inheritance diagram for TGDMLParse:
[legend]

Member Typedef Documentation

◆ ConstMap

typedef std::map<std::string, double> TGDMLParse::ConstMap
private

Definition at line 189 of file TGDMLParse.h.

◆ EleMap

Definition at line 176 of file TGDMLParse.h.

◆ FileMap

typedef TGDMMapHelper<const char> TGDMLParse::FileMap
private

Definition at line 185 of file TGDMLParse.h.

◆ FracMap

typedef std::map<std::string, double> TGDMLParse::FracMap
private

Definition at line 188 of file TGDMLParse.h.

◆ IsoMap

Definition at line 177 of file TGDMLParse.h.

◆ MatMap

Definition at line 178 of file TGDMLParse.h.

◆ MedMap

Definition at line 179 of file TGDMLParse.h.

◆ MixMap

Definition at line 180 of file TGDMLParse.h.

◆ PosMap

Definition at line 173 of file TGDMLParse.h.

◆ ReflectionsMap

typedef std::map<std::string, std::string> TGDMLParse::ReflectionsMap
private

Definition at line 186 of file TGDMLParse.h.

◆ ReflSolidMap

Definition at line 184 of file TGDMLParse.h.

◆ ReflVolMap

typedef std::map<std::string, std::string> TGDMLParse::ReflVolMap
private

Definition at line 187 of file TGDMLParse.h.

◆ RotMap

Definition at line 174 of file TGDMLParse.h.

◆ SclMap

Definition at line 175 of file TGDMLParse.h.

◆ SolMap

Definition at line 182 of file TGDMLParse.h.

◆ VolMap

Definition at line 183 of file TGDMLParse.h.

Constructor & Destructor Documentation

◆ TGDMLParse()

TGDMLParse::TGDMLParse ( )

Constructor.

Definition at line 122 of file TGDMLParse.cxx.

◆ ~TGDMLParse()

virtual TGDMLParse::~TGDMLParse ( )
inlinevirtual

Definition at line 107 of file TGDMLParse.h.

Member Function Documentation

◆ Arb8()

XMLNodePointer_t TGDMLParse::Arb8 ( TXMLEngine gdml,
XMLNodePointer_t  node,
XMLAttrPointer_t  attr 
)
private

In the solids section of the GDML file, an Arb8 may be declared.

when the arb8 keyword is found, this function is called, and the dimensions required are taken and stored, these are then bound and converted to type TGeoArb8 and stored in fsolmap map using the name as its key.

Definition at line 2464 of file TGDMLParse.cxx.

◆ AssProcess()

XMLNodePointer_t TGDMLParse::AssProcess ( TXMLEngine gdml,
XMLNodePointer_t  node 
)
private

In the structure section of the GDML file, assembly volumes can be declared.

when the assembly keyword is found, this function is called, and the name is converted into type TGeoVolumeAssembly and stored in fvolmap map using the name as its key. Some assembly volumes reference to other physical volumes to contain inside that assembly, declaring positions and rotations within that volume. When each 'physvol' is declared, a matrix for its rotation and translation is built and the 'physvol node' is added to the original assembly using TGeoVolume->AddNode.

Definition at line 2053 of file TGDMLParse.cxx.

◆ BooSolid()

XMLNodePointer_t TGDMLParse::BooSolid ( TXMLEngine gdml,
XMLNodePointer_t  node,
XMLAttrPointer_t  attr,
int  num 
)
private

In the solid section of the GDML file, boolean solids can be declared.

when the subtraction, intersection or union keyword is found, this function is called, and the values (rotation and translation) of the solid are converted into type TGeoCompositeShape and stored in fsolmap map using the name as its key.

  • 1 = SUBTRACTION
  • 2 = INTERSECTION
  • 3 = UNION

Definition at line 1856 of file TGDMLParse.cxx.

◆ Box()

XMLNodePointer_t TGDMLParse::Box ( TXMLEngine gdml,
XMLNodePointer_t  node,
XMLAttrPointer_t  attr 
)
private

In the solids section of the GDML file, a box may be declared.

when the box keyword is found, this function is called, and the dimensions required are taken and stored, these are then bound and converted to type TGeoBBox and stored in fsolmap map using the name as its key.

Definition at line 2190 of file TGDMLParse.cxx.

◆ Cone()

XMLNodePointer_t TGDMLParse::Cone ( TXMLEngine gdml,
XMLNodePointer_t  node,
XMLAttrPointer_t  attr 
)
private

In the solids section of the GDML file, a cone may be declared.

when the cone keyword is found, this function is called, and the dimensions required are taken and stored, these are then bound and converted to type TGeoConSeg and stored in fsolmap map using the name as its key.

Definition at line 2762 of file TGDMLParse.cxx.

◆ ConProcess()

XMLNodePointer_t TGDMLParse::ConProcess ( TXMLEngine gdml,
XMLNodePointer_t  node,
XMLAttrPointer_t  attr 
)
private

In the define section of the GDML file, constants can be declared.

when the constant keyword is found, this function is called, and the name and value of the constant is stored in the "fformvec" vector as a TFormula class, representing a constant function

Definition at line 432 of file TGDMLParse.cxx.

◆ CutTube()

XMLNodePointer_t TGDMLParse::CutTube ( TXMLEngine gdml,
XMLNodePointer_t  node,
XMLAttrPointer_t  attr 
)
private

In the solids section of the GDML file, a Cut Tube may be declared.

when the cutTube keyword is found, this function is called, and the dimensions required are taken and stored, these are then bound and converted to type TGeoCtub and stored in fsolmap map using the name as its key.

Definition at line 2660 of file TGDMLParse.cxx.

◆ ElCone()

XMLNodePointer_t TGDMLParse::ElCone ( TXMLEngine gdml,
XMLNodePointer_t  node,
XMLAttrPointer_t  attr 
)
private

In the solids section of the GDML file, an elliptical cone may be declared.

Unfortunately, the elliptical cone is not supported under ROOT so, when the elcone keyword is found, this function is called to convert it to a simple box with similar dimensions, and the dimensions required are taken and stored, these are then bound and converted to type TGeoBBox and stored in fsolmap map using the name as its key.

Definition at line 2333 of file TGDMLParse.cxx.

◆ EleProcess()

XMLNodePointer_t TGDMLParse::EleProcess ( TXMLEngine gdml,
XMLNodePointer_t  node,
XMLNodePointer_t  parentn,
Bool_t  hasIsotopes,
Bool_t  hasIsotopesExtended 
)
private

When the element keyword is found, this function is called, and the name and values of the element are converted into type TGeoElement and stored in felemap map using the name as its key.

Definition at line 888 of file TGDMLParse.cxx.

◆ Ellipsoid()

XMLNodePointer_t TGDMLParse::Ellipsoid ( TXMLEngine gdml,
XMLNodePointer_t  node,
XMLAttrPointer_t  attr 
)
private

In the solids section of the GDML file, an ellipsoid may be declared.

Unfortunately, the ellipsoid is not supported under ROOT so, when the ellipsoid keyword is found, this function is called to convert it to a simple box with similar dimensions, and the dimensions required are taken and stored, these are then bound and converted to type TGeoBBox and stored in fsolmap map using the name as its key.

Definition at line 2247 of file TGDMLParse.cxx.

◆ ElTube()

XMLNodePointer_t TGDMLParse::ElTube ( TXMLEngine gdml,
XMLNodePointer_t  node,
XMLAttrPointer_t  attr 
)
private

In the solids section of the GDML file, a ElTube may be declared.

when the eltube keyword is found, this function is called, and the dimensions required are taken and stored, these are then bound and converted to type TGeoEltu and stored in fsolmap map using the name as its key.

Definition at line 3672 of file TGDMLParse.cxx.

◆ Evaluate()

double TGDMLParse::Evaluate ( const char *  evalline)
private

Takes a string containing a mathematical expression and returns the value of the expression.

Definition at line 382 of file TGDMLParse.cxx.

◆ GDMLReadFile()

TGeoVolume * TGDMLParse::GDMLReadFile ( const char *  filename = "test.gdml")

Creates the new instance of the XMLEngine called 'gdml', using the filename >> then parses the file and creates the DOM tree.

Then passes the DOM to the next function to translate it.

Definition at line 152 of file TGDMLParse.cxx.

◆ GetScale()

TString TGDMLParse::GetScale ( const char *  unit)
private

Throughout the GDML file, a unit can de specified.

Whether it be angular or linear, values can be used as well as abbreviations such as 'mm' or 'deg'. This function is passed the specified unit and if it is found, replaces it with the appropriate value.

Definition at line 498 of file TGDMLParse.cxx.

◆ GetScaleVal()

Double_t TGDMLParse::GetScaleVal ( const char *  sunit)
private

Throughout the GDML file, a unit can de specified.

Whether it be angular or linear, values can be used as well as abbreviations such as 'mm' or 'deg'. This function is passed the specified unit and if it is found, replaces it with the appropriate value.

Definition at line 544 of file TGDMLParse.cxx.

◆ Hype()

XMLNodePointer_t TGDMLParse::Hype ( TXMLEngine gdml,
XMLNodePointer_t  node,
XMLAttrPointer_t  attr 
)
private

In the solids section of the GDML file, a Hype may be declared.

when the hype keyword is found, this function is called, and the dimensions required are taken and stored, these are then bound and converted to type TGeoHype and stored in fsolmap map using the name as its key.

Definition at line 3416 of file TGDMLParse.cxx.

◆ IsoProcess()

XMLNodePointer_t TGDMLParse::IsoProcess ( TXMLEngine gdml,
XMLNodePointer_t  node,
XMLNodePointer_t  parentn 
)
private

In the material section of the GDML file, an isotope may be declared.

when the isotope keyword is found, this function is called, and the required parameters are taken and stored, these are then bound and converted to type TGeoIsotope and stored in fisomap map using the name as its key.

Definition at line 816 of file TGDMLParse.cxx.

◆ MatProcess()

XMLNodePointer_t TGDMLParse::MatProcess ( TXMLEngine gdml,
XMLNodePointer_t  node,
XMLAttrPointer_t  attr,
int  z 
)
private

In the materials section of the GDML file, materials can be declared.

when the material keyword is found, this function is called, and the name and values of the material are converted into type TGeoMaterial and stored in fmatmap map using the name as its key. Mixtures can also be declared, and they are converted to TGeoMixture and stored in fmixmap. These mixtures and materials are then all converted into one common type - TGeoMedium. The map fmedmap is then built up of all the mixtures and materials.

Definition at line 1103 of file TGDMLParse.cxx.

◆ NameShort()

const char * TGDMLParse::NameShort ( const char *  name)
private

This function looks thru a string for the chars '0x' next to each other, when it finds this, it calls another function to strip the hex address.

It does this recursively until the end of the string is reached, returning a string without any hex addresses.

Definition at line 417 of file TGDMLParse.cxx.

◆ Orb()

XMLNodePointer_t TGDMLParse::Orb ( TXMLEngine gdml,
XMLNodePointer_t  node,
XMLAttrPointer_t  attr 
)
private

In the solids section of the GDML file, an Orb may be declared.

when the orb keyword is found, this function is called, and the dimensions required are taken and stored, these are then bound and converted to type TGeoSphere and stored in fsolmap map using the name as its key.

Definition at line 3727 of file TGDMLParse.cxx.

◆ Para()

XMLNodePointer_t TGDMLParse::Para ( TXMLEngine gdml,
XMLNodePointer_t  node,
XMLAttrPointer_t  attr 
)
private

In the solids section of the GDML file, a Para may be declared.

when the para keyword is found, this function is called, and the dimensions required are taken and stored, these are then bound and converted to type TGeoPara and stored in fsolmap map using the name as its key.

Definition at line 3487 of file TGDMLParse.cxx.

◆ Paraboloid()

XMLNodePointer_t TGDMLParse::Paraboloid ( TXMLEngine gdml,
XMLNodePointer_t  node,
XMLAttrPointer_t  attr 
)
private

In the solids section of the GDML file, a Paraboloid may be declared.

when the paraboloid keyword is found, this function is called, and the dimensions required are taken and stored, these are then bound and converted to type TGeoParaboloid and stored in fsolmap map using the name as its key.

Definition at line 2410 of file TGDMLParse.cxx.

◆ ParseGDML()

const char * TGDMLParse::ParseGDML ( TXMLEngine gdml,
XMLNodePointer_t  node 
)
private

This function recursively moves thru the DOM tree of the GDML file.

It checks for key words along the way and if a key word is found it calls the corresponding function to interpret the node.

Definition at line 189 of file TGDMLParse.cxx.

◆ Polycone()

XMLNodePointer_t TGDMLParse::Polycone ( TXMLEngine gdml,
XMLNodePointer_t  node,
XMLAttrPointer_t  attr 
)
private

In the solids section of the GDML file, a Polycone may be declared.

when the polycone keyword is found, this function is called, and the dimensions required are taken and stored, these are then bound and converted to type TGeoPCon and stored in fsolmap map using the name as its key. Polycone has Zplanes, planes along the z axis specifying the rmin, rmax dimensions at that point along z.

Definition at line 3018 of file TGDMLParse.cxx.

◆ Polyhedra()

XMLNodePointer_t TGDMLParse::Polyhedra ( TXMLEngine gdml,
XMLNodePointer_t  node,
XMLAttrPointer_t  attr 
)
private

In the solids section of the GDML file, a Polyhedra may be declared.

when the polyhedra keyword is found, this function is called, and the dimensions required are taken and stored, these are then bound and converted to type TGeoPgon and stored in fsolmap map using the name as its key. Polycone has Zplanes, planes along the z axis specifying the rmin, rmax dimensions at that point along z.

Definition at line 3141 of file TGDMLParse.cxx.

◆ PosProcess()

XMLNodePointer_t TGDMLParse::PosProcess ( TXMLEngine gdml,
XMLNodePointer_t  node,
XMLAttrPointer_t  attr 
)
private

In the define section of the GDML file, positions can be declared.

when the position keyword is found, this function is called, and the name and values of the position are converted into type TGeoPosition and stored in fposmap map using the name as its key. This function can also be called when declaring solids.

Definition at line 661 of file TGDMLParse.cxx.

◆ QuantityProcess()

XMLNodePointer_t TGDMLParse::QuantityProcess ( TXMLEngine gdml,
XMLNodePointer_t  node,
XMLAttrPointer_t  attr 
)
private

In the define section of the GDML file, quantities can be declared.

These are treated the same as constants, but the unit has to be multiplied

Definition at line 464 of file TGDMLParse.cxx.

◆ Reflection()

XMLNodePointer_t TGDMLParse::Reflection ( TXMLEngine gdml,
XMLNodePointer_t  node,
XMLAttrPointer_t  attr 
)
private

In the solids section of the GDML file, a Reflected Solid may be declared when the ReflectedSolid keyword is found, this function is called.

The rotation, position and scale for the reflection are applied to a matrix that is then stored in the class object TGDMLRefl. This is then stored in the map freflsolidmap, with the reflection name as a reference. also the name of the solid to be reflected is stored in a map called freflectmap with the reflection name as a reference.

Definition at line 3937 of file TGDMLParse.cxx.

◆ RotProcess()

XMLNodePointer_t TGDMLParse::RotProcess ( TXMLEngine gdml,
XMLNodePointer_t  node,
XMLAttrPointer_t  attr 
)
private

In the define section of the GDML file, rotations can be declared.

when the rotation keyword is found, this function is called, and the name and values of the rotation are converted into type TGeoRotation and stored in frotmap map using the name as its key. This function can also be called when declaring solids.

Definition at line 714 of file TGDMLParse.cxx.

◆ SclProcess()

XMLNodePointer_t TGDMLParse::SclProcess ( TXMLEngine gdml,
XMLNodePointer_t  node,
XMLAttrPointer_t  attr 
)
private

In the define section of the GDML file, rotations can be declared.

when the scale keyword is found, this function is called, and the name and values of the scale are converted into type TGeoScale and stored in fsclmap map using the name as its key. This function can also be called when declaring solids.

Definition at line 772 of file TGDMLParse.cxx.

◆ SetAxis()

Int_t TGDMLParse::SetAxis ( const char *  axisString)
private

When using the 'divide' process in the geometry this function sets the variable 'axis' depending on what is specified.

Definition at line 392 of file TGDMLParse.cxx.

◆ Sphere()

XMLNodePointer_t TGDMLParse::Sphere ( TXMLEngine gdml,
XMLNodePointer_t  node,
XMLAttrPointer_t  attr 
)
private

In the solids section of the GDML file, a Sphere may be declared.

when the sphere keyword is found, this function is called, and the dimensions required are taken and stored, these are then bound and converted to type TGeoSphere and stored in fsolmap map using the name as its key.

Definition at line 3270 of file TGDMLParse.cxx.

◆ StartGDML()

static TGeoVolume * TGDMLParse::StartGDML ( const char *  filename)
inlinestatic

Definition at line 109 of file TGDMLParse.h.

◆ TopProcess()

XMLNodePointer_t TGDMLParse::TopProcess ( TXMLEngine gdml,
XMLNodePointer_t  node 
)
private

In the setup section of the GDML file, the top volume need to be declared.

when the setup keyword is found, this function is called, and the top volume ref is taken and 'world' is set

Definition at line 2155 of file TGDMLParse.cxx.

◆ Torus()

XMLNodePointer_t TGDMLParse::Torus ( TXMLEngine gdml,
XMLNodePointer_t  node,
XMLAttrPointer_t  attr 
)
private

In the solids section of the GDML file, a Torus may be declared.

when the torus keyword is found, this function is called, and the dimensions required are taken and stored, these are then bound and converted to type TGeoTorus and stored in fsolmap map using the name as its key.

Definition at line 3345 of file TGDMLParse.cxx.

◆ Trap()

XMLNodePointer_t TGDMLParse::Trap ( TXMLEngine gdml,
XMLNodePointer_t  node,
XMLAttrPointer_t  attr 
)
private

In the solids section of the GDML file, a Trap may be declared.

when the trap keyword is found, this function is called, and the dimensions required are taken and stored, these are then bound and converted to type TGeoTrap and stored in fsolmap map using the name as its key.

Definition at line 2850 of file TGDMLParse.cxx.

◆ Trd()

XMLNodePointer_t TGDMLParse::Trd ( TXMLEngine gdml,
XMLNodePointer_t  node,
XMLAttrPointer_t  attr 
)
private

In the solids section of the GDML file, a Trd may be declared.

when the trd keyword is found, this function is called, and the dimensions required are taken and stored, these are then bound and converted to type TGeoTrd2 and stored in fsolmap map using the name as its key.

Definition at line 2950 of file TGDMLParse.cxx.

◆ Tube()

XMLNodePointer_t TGDMLParse::Tube ( TXMLEngine gdml,
XMLNodePointer_t  node,
XMLAttrPointer_t  attr 
)
private

In the solids section of the GDML file, a Tube may be declared.

when the tube keyword is found, this function is called, and the dimensions required are taken and stored, these are then bound and converted to type TGeoTubeSeg and stored in fsolmap map using the name as its key.

Definition at line 2584 of file TGDMLParse.cxx.

◆ TwistTrap()

XMLNodePointer_t TGDMLParse::TwistTrap ( TXMLEngine gdml,
XMLNodePointer_t  node,
XMLAttrPointer_t  attr 
)
private

In the solids section of the GDML file, a TwistTrap may be declared.

when the twistedtrap keyword is found, this function is called, and the dimensions required are taken and stored, these are then bound and converted to type TGeoGTra and stored in fsolmap map using the name as its key.

Definition at line 3564 of file TGDMLParse.cxx.

◆ UsrProcess()

XMLNodePointer_t TGDMLParse::UsrProcess ( TXMLEngine gdml,
XMLNodePointer_t  node 
)
private

User data to be processed.

Definition at line 2002 of file TGDMLParse.cxx.

◆ Value()

Double_t TGDMLParse::Value ( const char *  svalue) const
private

Convert number in string format to double value.

Definition at line 584 of file TGDMLParse.cxx.

◆ VolProcess()

XMLNodePointer_t TGDMLParse::VolProcess ( TXMLEngine gdml,
XMLNodePointer_t  node 
)
private

In the structure section of the GDML file, volumes can be declared.

when the volume keyword is found, this function is called, and the name and values of the volume are converted into type TGeoVolume and stored in fvolmap map using the name as its key. Volumes reference to a solid declared higher up in the solids section of the GDML file. Some volumes reference to other physical volumes to contain inside that volume, declaring positions and rotations within that volume. when each 'physvol' is declared, a matrix for its rotation and translation is built and the 'physvol node' is added to the original volume using TGeoVolume->AddNode. volume division is also declared within the volume node, and once the values for the division have been collected, using TGeoVolume->divide, the division can be applied.

Definition at line 1359 of file TGDMLParse.cxx.

◆ Xtru()

XMLNodePointer_t TGDMLParse::Xtru ( TXMLEngine gdml,
XMLNodePointer_t  node,
XMLAttrPointer_t  attr 
)
private

In the solids section of the GDML file, an Xtru may be declared.

when the xtru keyword is found, this function is called, and the dimensions required are taken and stored, these are then bound and converted to type TGeoXtru and stored in fsolmap map using the name as its key. The xtru has child nodes of either 'twoDimVertex'or 'section'. These two nodes define the real structure of the shape. The twoDimVertex's define the x,y sizes of a vertice. The section links the vertice to a position within the xtru.

Definition at line 3777 of file TGDMLParse.cxx.

Member Data Documentation

◆ fconsts

ConstMap TGDMLParse::fconsts
private

Map containing files parsed during entire parsing, with their world volume name.

Definition at line 205 of file TGDMLParse.h.

◆ fCurrentFile

const char* TGDMLParse::fCurrentFile

Definition at line 102 of file TGDMLParse.h.

◆ fDefault_aunit

std::string TGDMLParse::fDefault_aunit = "rad"

Definition at line 104 of file TGDMLParse.h.

◆ fDefault_lunit

std::string TGDMLParse::fDefault_lunit = "mm"

Definition at line 103 of file TGDMLParse.h.

◆ felemap

EleMap TGDMLParse::felemap
private

Map containing isotope names and the TGeoIsotope for it.

Definition at line 195 of file TGDMLParse.h.

◆ fFileEngine

TXMLEngine* TGDMLParse::fFileEngine[20]

Definition at line 100 of file TGDMLParse.h.

◆ ffilemap

FileMap TGDMLParse::ffilemap
private

Map containing reflected volume names and the solid ref for it.

Definition at line 204 of file TGDMLParse.h.

◆ fFILENO

int TGDMLParse::fFILENO

Definition at line 99 of file TGDMLParse.h.

◆ fisomap

IsoMap TGDMLParse::fisomap
private

Map containing scale names and the TGeoScale for it.

Definition at line 194 of file TGDMLParse.h.

◆ fmatmap

MatMap TGDMLParse::fmatmap
private

Map containing element names and the TGeoElement for it.

Definition at line 196 of file TGDMLParse.h.

◆ fmedmap

MedMap TGDMLParse::fmedmap
private

Map containing material names and the TGeoMaterial for it.

Definition at line 197 of file TGDMLParse.h.

◆ fmixmap

MixMap TGDMLParse::fmixmap
private

Map containing medium names and the TGeoMedium for it.

Definition at line 198 of file TGDMLParse.h.

◆ fposmap

PosMap TGDMLParse::fposmap
private

Definition at line 191 of file TGDMLParse.h.

◆ freflectmap

ReflectionsMap TGDMLParse::freflectmap
private

Map containing volume names and the TGeoVolume for it.

Definition at line 201 of file TGDMLParse.h.

◆ freflsolidmap

ReflSolidMap TGDMLParse::freflsolidmap
private

Map containing reflection names and the Solid name ir references to.

Definition at line 202 of file TGDMLParse.h.

◆ freflvolmap

ReflVolMap TGDMLParse::freflvolmap
private

Map containing reflection names and the TGDMLRefl for it - containing refl matrix.

Definition at line 203 of file TGDMLParse.h.

◆ frotmap

RotMap TGDMLParse::frotmap
private

Map containing position names and the TGeoTranslation for it.

Definition at line 192 of file TGDMLParse.h.

◆ fsclmap

SclMap TGDMLParse::fsclmap
private

Map containing rotation names and the TGeoRotation for it.

Definition at line 193 of file TGDMLParse.h.

◆ fsolmap

SolMap TGDMLParse::fsolmap
private

Map containing mixture names and the TGeoMixture for it.

Definition at line 199 of file TGDMLParse.h.

◆ fStartFile

const char* TGDMLParse::fStartFile

Definition at line 101 of file TGDMLParse.h.

◆ fVolID

int TGDMLParse::fVolID

Definition at line 98 of file TGDMLParse.h.

◆ fvolmap

VolMap TGDMLParse::fvolmap
private

Map containing solid names and the TGeoShape for it.

Definition at line 200 of file TGDMLParse.h.

◆ fWorld

TGeoVolume* TGDMLParse::fWorld

Definition at line 97 of file TGDMLParse.h.

◆ fWorldName

TString TGDMLParse::fWorldName

Definition at line 96 of file TGDMLParse.h.

Libraries for TGDMLParse:
[legend]

The documentation for this class was generated from the following files: