Geant4 10.7.0
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
G4GDMLReadSetup Class Reference

#include <G4GDMLReadSetup.hh>

+ Inheritance diagram for G4GDMLReadSetup:

Public Member Functions

G4String GetSetup (const G4String &)
 
virtual void SetupRead (const xercesc::DOMElement *const element)
 
- Public Member Functions inherited from G4GDMLReadSolids
G4VSolidGetSolid (const G4String &) const
 
G4SurfacePropertyGetSurfaceProperty (const G4String &) const
 
virtual void SolidsRead (const xercesc::DOMElement *const)
 
- Public Member Functions inherited from G4GDMLReadMaterials
G4ElementGetElement (const G4String &, G4bool verbose=true) const
 
G4IsotopeGetIsotope (const G4String &, G4bool verbose=true) const
 
G4MaterialGetMaterial (const G4String &, G4bool verbose=true) const
 
virtual void MaterialsRead (const xercesc::DOMElement *const)
 
- Public Member Functions inherited from G4GDMLReadDefine
G4bool IsValidID (const G4String &) const
 
G4double GetConstant (const G4String &)
 
G4double GetVariable (const G4String &)
 
G4double GetQuantity (const G4String &)
 
G4ThreeVector GetPosition (const G4String &)
 
G4ThreeVector GetRotation (const G4String &)
 
G4ThreeVector GetScale (const G4String &)
 
G4GDMLMatrix GetMatrix (const G4String &)
 
virtual void DefineRead (const xercesc::DOMElement *const)
 
- Public Member Functions inherited from G4GDMLRead
virtual void DefineRead (const xercesc::DOMElement *const)=0
 
virtual void MaterialsRead (const xercesc::DOMElement *const)=0
 
virtual void SetupRead (const xercesc::DOMElement *const)=0
 
virtual void SolidsRead (const xercesc::DOMElement *const)=0
 
virtual void Paramvol_contentRead (const xercesc::DOMElement *const)=0
 
virtual void Volume_contentRead (const xercesc::DOMElement *const)=0
 
virtual void StructureRead (const xercesc::DOMElement *const)=0
 
virtual void ExtensionRead (const xercesc::DOMElement *const)
 
virtual void UserinfoRead (const xercesc::DOMElement *const)
 
virtual G4LogicalVolumeGetVolume (const G4String &) const =0
 
virtual G4String GetSetup (const G4String &)=0
 
void Read (const G4String &, G4bool validation, G4bool isModule, G4bool strip=true)
 
void StripNames () const
 
void StripName (G4String &) const
 
void OverlapCheck (G4bool)
 
const G4GDMLAuxListTypeGetAuxList () const
 

Protected Member Functions

 G4GDMLReadSetup ()
 
virtual ~G4GDMLReadSetup ()
 
- Protected Member Functions inherited from G4GDMLReadSolids
 G4GDMLReadSolids ()
 
virtual ~G4GDMLReadSolids ()
 
void BooleanRead (const xercesc::DOMElement *const, const BooleanOp)
 
void BoxRead (const xercesc::DOMElement *const)
 
void ConeRead (const xercesc::DOMElement *const)
 
void ElconeRead (const xercesc::DOMElement *const)
 
void EllipsoidRead (const xercesc::DOMElement *const)
 
void EltubeRead (const xercesc::DOMElement *const)
 
void XtruRead (const xercesc::DOMElement *const)
 
void HypeRead (const xercesc::DOMElement *const)
 
void MultiUnionNodeRead (const xercesc::DOMElement *const, G4MultiUnion *const)
 
void MultiUnionRead (const xercesc::DOMElement *const)
 
void OrbRead (const xercesc::DOMElement *const)
 
void ParaRead (const xercesc::DOMElement *const)
 
void ParaboloidRead (const xercesc::DOMElement *const)
 
void PolyconeRead (const xercesc::DOMElement *const)
 
void GenericPolyconeRead (const xercesc::DOMElement *const)
 
void PolyhedraRead (const xercesc::DOMElement *const)
 
void GenericPolyhedraRead (const xercesc::DOMElement *const)
 
G4QuadrangularFacetQuadrangularRead (const xercesc::DOMElement *const)
 
void ReflectedSolidRead (const xercesc::DOMElement *const)
 
void ScaledSolidRead (const xercesc::DOMElement *const)
 
G4ExtrudedSolid::ZSection SectionRead (const xercesc::DOMElement *const, G4double)
 
void SphereRead (const xercesc::DOMElement *const)
 
void TessellatedRead (const xercesc::DOMElement *const)
 
void TetRead (const xercesc::DOMElement *const)
 
void TorusRead (const xercesc::DOMElement *const)
 
void GenTrapRead (const xercesc::DOMElement *const)
 
void TrapRead (const xercesc::DOMElement *const)
 
void TrdRead (const xercesc::DOMElement *const)
 
void TubeRead (const xercesc::DOMElement *const)
 
void CutTubeRead (const xercesc::DOMElement *const)
 
void TwistedboxRead (const xercesc::DOMElement *const)
 
void TwistedtrapRead (const xercesc::DOMElement *const)
 
void TwistedtrdRead (const xercesc::DOMElement *const)
 
void TwistedtubsRead (const xercesc::DOMElement *const)
 
G4TriangularFacetTriangularRead (const xercesc::DOMElement *const)
 
G4TwoVector TwoDimVertexRead (const xercesc::DOMElement *const, G4double)
 
zplaneType ZplaneRead (const xercesc::DOMElement *const)
 
rzPointType RZPointRead (const xercesc::DOMElement *const)
 
void OpticalSurfaceRead (const xercesc::DOMElement *const)
 
void PropertyRead (const xercesc::DOMElement *const, G4OpticalSurface *)
 
- Protected Member Functions inherited from G4GDMLReadMaterials
 G4GDMLReadMaterials ()
 
virtual ~G4GDMLReadMaterials ()
 
G4double AtomRead (const xercesc::DOMElement *const)
 
G4int CompositeRead (const xercesc::DOMElement *const, G4String &)
 
G4double DRead (const xercesc::DOMElement *const)
 
G4double PRead (const xercesc::DOMElement *const)
 
G4double TRead (const xercesc::DOMElement *const)
 
G4double MEERead (const xercesc::DOMElement *const)
 
void ElementRead (const xercesc::DOMElement *const)
 
G4double FractionRead (const xercesc::DOMElement *const, G4String &)
 
void IsotopeRead (const xercesc::DOMElement *const)
 
void MaterialRead (const xercesc::DOMElement *const)
 
void MixtureRead (const xercesc::DOMElement *const, G4Element *)
 
void MixtureRead (const xercesc::DOMElement *const, G4Material *)
 
void PropertyRead (const xercesc::DOMElement *const, G4Material *)
 
- Protected Member Functions inherited from G4GDMLReadDefine
 G4GDMLReadDefine ()
 
virtual ~G4GDMLReadDefine ()
 
G4RotationMatrix GetRotationMatrix (const G4ThreeVector &)
 
void VectorRead (const xercesc::DOMElement *const, G4ThreeVector &)
 
G4String RefRead (const xercesc::DOMElement *const)
 
void ConstantRead (const xercesc::DOMElement *const)
 
void MatrixRead (const xercesc::DOMElement *const)
 
void PositionRead (const xercesc::DOMElement *const)
 
void RotationRead (const xercesc::DOMElement *const)
 
void ScaleRead (const xercesc::DOMElement *const)
 
void VariableRead (const xercesc::DOMElement *const)
 
void QuantityRead (const xercesc::DOMElement *const)
 
void ExpressionRead (const xercesc::DOMElement *const)
 
- Protected Member Functions inherited from G4GDMLRead
 G4GDMLRead ()
 
virtual ~G4GDMLRead ()
 
G4String Transcode (const XMLCh *const)
 
G4String GenerateName (const G4String &name, G4bool strip=false)
 
G4String Strip (const G4String &) const
 
void GeneratePhysvolName (const G4String &, G4VPhysicalVolume *)
 
void LoopRead (const xercesc::DOMElement *const, void(G4GDMLRead::*)(const xercesc::DOMElement *const))
 
G4GDMLAuxStructType AuxiliaryRead (const xercesc::DOMElement *const auxElem)
 

Protected Attributes

std::map< G4String, G4StringsetupMap
 
- Protected Attributes inherited from G4GDMLReadDefine
std::map< G4String, G4doublequantityMap
 
std::map< G4String, G4ThreeVectorpositionMap
 
std::map< G4String, G4ThreeVectorrotationMap
 
std::map< G4String, G4ThreeVectorscaleMap
 
std::map< G4String, G4GDMLMatrixmatrixMap
 
- Protected Attributes inherited from G4GDMLRead
G4GDMLEvaluator eval
 
G4bool validate = true
 
G4bool check = false
 
G4bool dostrip = true
 

Detailed Description

Definition at line 43 of file G4GDMLReadSetup.hh.

Constructor & Destructor Documentation

◆ G4GDMLReadSetup()

G4GDMLReadSetup::G4GDMLReadSetup ( )
protected

Definition at line 34 of file G4GDMLReadSetup.cc.

36{
37}

◆ ~G4GDMLReadSetup()

G4GDMLReadSetup::~G4GDMLReadSetup ( )
protectedvirtual

Definition at line 40 of file G4GDMLReadSetup.cc.

41{
42}

Member Function Documentation

◆ GetSetup()

G4String G4GDMLReadSetup::GetSetup ( const G4String ref)
virtual

Implements G4GDMLRead.

Definition at line 45 of file G4GDMLReadSetup.cc.

46{
47 if(setupMap.size() == 1) // If there is only one setup defined,
48 { // no matter how it is named
49 return setupMap.cbegin()->second;
50 }
51
52 if(setupMap.find(ref) == setupMap.cend())
53 {
54#ifdef G4VERBOSE
55 std::ostringstream message;
56 message << "Referenced setup '" << ref << "' was not found!";
57 G4Exception("G4GDMLReadSetup::getSetup()", "NullSetup", JustWarning,
58 message, "Returning NULL pointer!");
59#endif
60 return "";
61 }
62
63 return setupMap[ref];
64}
@ JustWarning
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)
Definition: G4Exception.cc:35
std::map< G4String, G4String > setupMap

Referenced by G4GDMLReadStructure::FileRead(), and G4GDMLReadStructure::GetWorldVolume().

◆ SetupRead()

void G4GDMLReadSetup::SetupRead ( const xercesc::DOMElement *const  element)
virtual

Implements G4GDMLRead.

Definition at line 67 of file G4GDMLReadSetup.cc.

68{
69#ifdef G4VERBOSE
70 G4cout << "G4GDML: Reading setup..." << G4endl;
71#endif
73
74 const xercesc::DOMNamedNodeMap* const attributes = element->getAttributes();
75 XMLSize_t attributeCount = attributes->getLength();
76
77 for(XMLSize_t attribute_index = 0; attribute_index < attributeCount;
78 ++attribute_index)
79 {
80 xercesc::DOMNode* attribute_node = attributes->item(attribute_index);
81
82 if(attribute_node->getNodeType() != xercesc::DOMNode::ATTRIBUTE_NODE)
83 {
84 continue;
85 }
86
87 const xercesc::DOMAttr* const attribute =
88 dynamic_cast<xercesc::DOMAttr*>(attribute_node);
89 if(attribute == nullptr)
90 {
91 G4Exception("G4GDMLReadSetup::SetupRead()", "InvalidRead", FatalException,
92 "No attribute found!");
93 return;
94 }
95 const G4String attName = Transcode(attribute->getName());
96 const G4String attValue = Transcode(attribute->getValue());
97
98 if(attName == "name")
99 {
100 name = attValue;
101 }
102 }
103
104 for(xercesc::DOMNode* iter = element->getFirstChild(); iter != nullptr;
105 iter = iter->getNextSibling())
106 {
107 if(iter->getNodeType() != xercesc::DOMNode::ELEMENT_NODE)
108 {
109 continue;
110 }
111
112 const xercesc::DOMElement* const child =
113 dynamic_cast<xercesc::DOMElement*>(iter);
114 if(child == nullptr)
115 {
116 G4Exception("G4GDMLReadSetup::SetupRead()", "InvalidRead", FatalException,
117 "No child found!");
118 return;
119 }
120 const G4String tag = Transcode(child->getTagName());
121
122 if(tag == "world")
123 {
125 }
126 }
127}
@ FatalException
#define G4endl
Definition: G4ios.hh:57
G4GLOB_DLL std::ostream G4cout
G4String RefRead(const xercesc::DOMElement *const)
G4String GenerateName(const G4String &name, G4bool strip=false)
Definition: G4GDMLRead.cc:70
G4String Transcode(const XMLCh *const)
Definition: G4GDMLRead.cc:55
const char * name(G4int ptype)
Definition: xmlparse.cc:187

Member Data Documentation

◆ setupMap

std::map<G4String, G4String> G4GDMLReadSetup::setupMap
protected

Definition at line 58 of file G4GDMLReadSetup.hh.

Referenced by GetSetup(), and SetupRead().


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