pyg4ometry.gdml.Reader

Classes

Reader

Read a GDML file.

Functions

isComment(node)

_StripPointer(name)

Module Contents

pyg4ometry.gdml.Reader.isComment(node)
class pyg4ometry.gdml.Reader.Reader(fileName, registryOn=True, skipMaterials=False, reduceNISTMaterialsToPredefined=False)

Read a GDML file.

Parameters:
  • fileName (str) – path to gdml file to load

  • registryOn (bool) – whether to build a registry

  • reduceNISTMaterialsToPredefined (bool) – change NIST-named materials to predefined ones

When loading a GDML file that was exported by Geant4, the NIST materials may be fully expanded to include their full element / isotope composition. With the reduceNISTMaterialsToPredefined flag set to True, these will be ignored and the materials that have a name that matches a NIST one will be ‘reduced’ back to a predefined material by name only.

filename
registryOn
_reduceNISTMaterialsToPredefined
_skipMaterials
_physVolumeNameCount
load()
getRegistry()
parseDefines(xmldoc)
parseVector(node, type='position', addRegistry=True)
parseMaterials(xmldoc)
_makeMaterials(materials, elements, isotopes)

Construct the isotopes, elements and materials in that order. These aren’t returned, but simply constructed in and therefore exist in the registry.

parseUserInfo(xmldoc)
_parseAuxiliary(xmlnode, register=True)
parseSolids(xmldoc)
parseBox(node)
parseTube(node)
parseCutTube(node)
parseCone(node)
parsePara(node)
parseTrd(node)
parseTrap(node)
parseSphere(node)
parseOrb(node)
parseTorus(node)
parsePolycone(node)
parseGenericPolycone(node)
parsePolyhedra(node)
parseGenericPolyhedra(node)
parseEllipticalTube(node)
parseEllipsoid(node)
parseEllipticalCone(node)
parseParaboloid(node)
parseHype(node)
parseTet(node)
parseExtrudedSolid(node)
parseTwistedBox(node)
parseTwistedTrap(node)
parseTwistedTrd(node)
parseTwistedTubs(node)
parseGenericTrap(node)
parseTessellatedSolid(node)
parseUnion(node)
parseSubtraction(node)
parseIntersection(node)
parseMultiUnion(node)
parseOpticalSurface(node)
parseScaledSolid(node)
parseSolidLoop(node)
parseStructure(xmldoc, materialSubstitutionNames=None)
extractStructureNodeData(node, materialSubstitutionNames=None)
parsePhysicalVolumeChildren(node, vol)
pyg4ometry.gdml.Reader._StripPointer(name)