Geant4 9.6.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 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 OverlapCheck (G4bool)
 

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 OrbRead (const xercesc::DOMElement *const)
 
void ParaRead (const xercesc::DOMElement *const)
 
void ParaboloidRead (const xercesc::DOMElement *const)
 
void PolyconeRead (const xercesc::DOMElement *const)
 
void PolyhedraRead (const xercesc::DOMElement *const)
 
G4QuadrangularFacetQuadrangularRead (const xercesc::DOMElement *const)
 
void ReflectedSolidRead (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)
 
void OpticalSurfaceRead (const xercesc::DOMElement *const)
 
- 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 StripName (G4String &) const
 
void GeneratePhysvolName (const G4String &, G4VPhysicalVolume *)
 
void LoopRead (const xercesc::DOMElement *const, void(G4GDMLRead::*)(const xercesc::DOMElement *const))
 

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
 
G4bool check
 

Detailed Description

Definition at line 49 of file G4GDMLReadSetup.hh.

Constructor & Destructor Documentation

◆ G4GDMLReadSetup()

G4GDMLReadSetup::G4GDMLReadSetup ( )
protected

Definition at line 36 of file G4GDMLReadSetup.cc.

37{
38}

◆ ~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 44 of file G4GDMLReadSetup.cc.

45{
46 if (setupMap.size() == 1) // If there is only one setup defined,
47 { // no matter how it is named
48 return setupMap.begin()->second;
49 }
50
51 if (setupMap.find(ref) == setupMap.end())
52 {
53 G4String error_msg = "Referenced setup '" + ref + "' was not found!";
54 G4Exception("G4GDMLReadSetup::getSetup()", "ReadError",
55 FatalException, error_msg);
56 }
57
58 return setupMap[ref];
59}
@ FatalException
std::map< G4String, G4String > setupMap
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)
Definition: G4Exception.cc:41

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

◆ SetupRead()

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

Implements G4GDMLRead.

Definition at line 61 of file G4GDMLReadSetup.cc.

62{
63 G4cout << "G4GDML: Reading setup..." << G4endl;
64
65 G4String name;
66
67 const xercesc::DOMNamedNodeMap* const attributes = element->getAttributes();
68 XMLSize_t attributeCount = attributes->getLength();
69
70 for (XMLSize_t attribute_index=0;
71 attribute_index<attributeCount; attribute_index++)
72 {
73 xercesc::DOMNode* attribute_node = attributes->item(attribute_index);
74
75 if (attribute_node->getNodeType() != xercesc::DOMNode::ATTRIBUTE_NODE)
76 { continue; }
77
78 const xercesc::DOMAttr* const attribute
79 = dynamic_cast<xercesc::DOMAttr*>(attribute_node);
80 if (!attribute)
81 {
82 G4Exception("G4GDMLReadSetup::SetupRead()",
83 "InvalidRead", FatalException, "No attribute found!");
84 return;
85 }
86 const G4String attName = Transcode(attribute->getName());
87 const G4String attValue = Transcode(attribute->getValue());
88
89 if (attName=="name") { name = attValue; }
90 }
91
92 for (xercesc::DOMNode* iter = element->getFirstChild();
93 iter != 0; iter = iter->getNextSibling())
94 {
95 if (iter->getNodeType() != xercesc::DOMNode::ELEMENT_NODE) { continue; }
96
97 const xercesc::DOMElement* const child
98 = dynamic_cast<xercesc::DOMElement*>(iter);
99 if (!child)
100 {
101 G4Exception("G4GDMLReadSetup::SetupRead()",
102 "InvalidRead", FatalException, "No child found!");
103 return;
104 }
105 const G4String tag = Transcode(child->getTagName());
106
107 if (tag == "world") { setupMap[name] = GenerateName(RefRead(child)); }
108 }
109}
#define G4endl
Definition: G4ios.hh:52
G4DLLIMPORT std::ostream G4cout
G4String RefRead(const xercesc::DOMElement *const)
G4String GenerateName(const G4String &name, G4bool strip=false)
Definition: G4GDMLRead.cc:68
G4String Transcode(const XMLCh *const)
Definition: G4GDMLRead.cc:55
Definition: xmlparse.cc:179

Member Data Documentation

◆ setupMap

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

Definition at line 64 of file G4GDMLReadSetup.hh.

Referenced by GetSetup(), and SetupRead().


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