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

#include <G4GDMLReadParamvol.hh>

+ Inheritance diagram for G4GDMLReadParamvol:

Public Member Functions

virtual void ParamvolRead (const xercesc::DOMElement *const, G4LogicalVolume *)
 
virtual void Paramvol_contentRead (const xercesc::DOMElement *const)
 
- Public Member Functions inherited from G4GDMLReadSetup
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

 G4GDMLReadParamvol ()
 
virtual ~G4GDMLReadParamvol ()
 
void Box_dimensionsRead (const xercesc::DOMElement *const, G4GDMLParameterisation::PARAMETER &)
 
void Trd_dimensionsRead (const xercesc::DOMElement *const, G4GDMLParameterisation::PARAMETER &)
 
void Trap_dimensionsRead (const xercesc::DOMElement *const, G4GDMLParameterisation::PARAMETER &)
 
void Tube_dimensionsRead (const xercesc::DOMElement *const, G4GDMLParameterisation::PARAMETER &)
 
void Cone_dimensionsRead (const xercesc::DOMElement *const, G4GDMLParameterisation::PARAMETER &)
 
void Sphere_dimensionsRead (const xercesc::DOMElement *const, G4GDMLParameterisation::PARAMETER &)
 
void Orb_dimensionsRead (const xercesc::DOMElement *const, G4GDMLParameterisation::PARAMETER &)
 
void Torus_dimensionsRead (const xercesc::DOMElement *const, G4GDMLParameterisation::PARAMETER &)
 
void Para_dimensionsRead (const xercesc::DOMElement *const, G4GDMLParameterisation::PARAMETER &)
 
void Hype_dimensionsRead (const xercesc::DOMElement *const, G4GDMLParameterisation::PARAMETER &)
 
void ParameterisedRead (const xercesc::DOMElement *const)
 
void ParametersRead (const xercesc::DOMElement *const)
 
- Protected Member Functions inherited from G4GDMLReadSetup
 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

G4GDMLParameterisationparameterisation
 
- Protected Attributes inherited from G4GDMLReadSetup
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 48 of file G4GDMLReadParamvol.hh.

Constructor & Destructor Documentation

◆ G4GDMLReadParamvol()

G4GDMLReadParamvol::G4GDMLReadParamvol ( )
protected

Definition at line 41 of file G4GDMLReadParamvol.cc.

43{
44}
G4GDMLParameterisation * parameterisation

◆ ~G4GDMLReadParamvol()

G4GDMLReadParamvol::~G4GDMLReadParamvol ( )
protectedvirtual

Definition at line 46 of file G4GDMLReadParamvol.cc.

47{
48}

Member Function Documentation

◆ Box_dimensionsRead()

void G4GDMLReadParamvol::Box_dimensionsRead ( const xercesc::DOMElement * const  element,
G4GDMLParameterisation::PARAMETER parameter 
)
protected

Definition at line 50 of file G4GDMLReadParamvol.cc.

53{
54 G4double lunit = 1.0;
55
56 const xercesc::DOMNamedNodeMap* const attributes = element->getAttributes();
57 XMLSize_t attributeCount = attributes->getLength();
58
59 for (XMLSize_t attribute_index=0;
60 attribute_index<attributeCount; attribute_index++)
61 {
62 xercesc::DOMNode* attribute_node = attributes->item(attribute_index);
63
64 if (attribute_node->getNodeType() != xercesc::DOMNode::ATTRIBUTE_NODE)
65 { continue; }
66
67 const xercesc::DOMAttr* const attribute
68 = dynamic_cast<xercesc::DOMAttr*>(attribute_node);
69 if (!attribute)
70 {
71 G4Exception("G4GDMLReadParamvol::Box_dimensionsRead()",
72 "InvalidRead", FatalException, "No attribute found!");
73 return;
74 }
75 const G4String attName = Transcode(attribute->getName());
76 const G4String attValue = Transcode(attribute->getValue());
77
78 if (attName=="lunit") { lunit = eval.Evaluate(attValue); } else
79 if (attName=="x") { parameter.dimension[0] = eval.Evaluate(attValue); } else
80 if (attName=="y") { parameter.dimension[1] = eval.Evaluate(attValue); } else
81 if (attName=="z") { parameter.dimension[2] = eval.Evaluate(attValue); }
82 }
83
84 parameter.dimension[0] *= 0.5*lunit;
85 parameter.dimension[1] *= 0.5*lunit;
86 parameter.dimension[2] *= 0.5*lunit;
87}
@ FatalException
double G4double
Definition: G4Types.hh:64
G4double Evaluate(const G4String &)
G4String Transcode(const XMLCh *const)
Definition: G4GDMLRead.cc:55
G4GDMLEvaluator eval
Definition: G4GDMLRead.hh:144
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)
Definition: G4Exception.cc:41

Referenced by ParametersRead().

◆ Cone_dimensionsRead()

void G4GDMLReadParamvol::Cone_dimensionsRead ( const xercesc::DOMElement * const  element,
G4GDMLParameterisation::PARAMETER parameter 
)
protected

Definition at line 254 of file G4GDMLReadParamvol.cc.

257{
258 G4double lunit = 1.0;
259 G4double aunit = 1.0;
260
261 const xercesc::DOMNamedNodeMap* const attributes = element->getAttributes();
262 XMLSize_t attributeCount = attributes->getLength();
263
264 for (XMLSize_t attribute_index=0;
265 attribute_index<attributeCount; attribute_index++)
266 {
267 xercesc::DOMNode* attribute_node = attributes->item(attribute_index);
268
269 if (attribute_node->getNodeType() != xercesc::DOMNode::ATTRIBUTE_NODE)
270 { continue; }
271
272 const xercesc::DOMAttr* const attribute
273 = dynamic_cast<xercesc::DOMAttr*>(attribute_node);
274 if (!attribute)
275 {
276 G4Exception("G4GDMLReadParamvol::Cone_dimensionsRead()",
277 "InvalidRead", FatalException, "No attribute found!");
278 return;
279 }
280 const G4String attName = Transcode(attribute->getName());
281 const G4String attValue = Transcode(attribute->getValue());
282
283 if (attName=="lunit")
284 { lunit = eval.Evaluate(attValue); } else
285 if (attName=="aunit")
286 { aunit = eval.Evaluate(attValue); } else
287 if (attName=="rmin1")
288 { parameter.dimension[0] = eval.Evaluate(attValue); } else
289 if (attName=="rmax1")
290 { parameter.dimension[1] = eval.Evaluate(attValue); } else
291 if (attName=="rmin2")
292 { parameter.dimension[2] = eval.Evaluate(attValue); } else
293 if (attName=="rmax2")
294 { parameter.dimension[3] = eval.Evaluate(attValue); } else
295 if (attName=="z")
296 { parameter.dimension[4] = eval.Evaluate(attValue); } else
297 if (attName=="startphi")
298 { parameter.dimension[5] = eval.Evaluate(attValue); } else
299 if (attName=="deltaphi")
300 { parameter.dimension[6] = eval.Evaluate(attValue); }
301 }
302
303 parameter.dimension[0] *= lunit;
304 parameter.dimension[1] *= lunit;
305 parameter.dimension[2] *= lunit;
306 parameter.dimension[3] *= lunit;
307 parameter.dimension[4] *= 0.5*lunit;
308 parameter.dimension[5] *= aunit;
309 parameter.dimension[6] *= aunit;
310}

Referenced by ParametersRead().

◆ Hype_dimensionsRead()

void G4GDMLReadParamvol::Hype_dimensionsRead ( const xercesc::DOMElement * const  element,
G4GDMLParameterisation::PARAMETER parameter 
)
protected

Definition at line 509 of file G4GDMLReadParamvol.cc.

512{
513 G4double lunit = 1.0;
514 G4double aunit = 1.0;
515
516 const xercesc::DOMNamedNodeMap* const attributes = element->getAttributes();
517 XMLSize_t attributeCount = attributes->getLength();
518
519 for (XMLSize_t attribute_index=0;
520 attribute_index<attributeCount; attribute_index++)
521 {
522 xercesc::DOMNode* attribute_node = attributes->item(attribute_index);
523
524 if (attribute_node->getNodeType() != xercesc::DOMNode::ATTRIBUTE_NODE)
525 { continue; }
526
527 const xercesc::DOMAttr* const attribute
528 = dynamic_cast<xercesc::DOMAttr*>(attribute_node);
529 if (!attribute)
530 {
531 G4Exception("G4GDMLReadParamvol::Hype_dimensionsRead()",
532 "InvalidRead", FatalException, "No attribute found!");
533 return;
534 }
535 const G4String attName = Transcode(attribute->getName());
536 const G4String attValue = Transcode(attribute->getValue());
537
538 if (attName=="lunit")
539 { lunit = eval.Evaluate(attValue); } else
540 if (attName=="aunit")
541 { aunit = eval.Evaluate(attValue); } else
542 if (attName=="rmin")
543 { parameter.dimension[0] = eval.Evaluate(attValue); } else
544 if (attName=="rmax")
545 { parameter.dimension[1] = eval.Evaluate(attValue); } else
546 if (attName=="inst")
547 { parameter.dimension[2] = eval.Evaluate(attValue); } else
548 if (attName=="outst")
549 { parameter.dimension[3] = eval.Evaluate(attValue); } else
550 if (attName=="z")
551 { parameter.dimension[4] = eval.Evaluate(attValue); }
552 }
553
554 parameter.dimension[0] = lunit;
555 parameter.dimension[1] = lunit;
556 parameter.dimension[2] = aunit;
557 parameter.dimension[3] = aunit;
558 parameter.dimension[4] = 0.5*lunit;
559}

Referenced by ParametersRead().

◆ Orb_dimensionsRead()

void G4GDMLReadParamvol::Orb_dimensionsRead ( const xercesc::DOMElement * const  element,
G4GDMLParameterisation::PARAMETER parameter 
)
protected

Definition at line 367 of file G4GDMLReadParamvol.cc.

370{
371 G4double lunit = 1.0;
372
373 const xercesc::DOMNamedNodeMap* const attributes = element->getAttributes();
374 XMLSize_t attributeCount = attributes->getLength();
375
376 for (XMLSize_t attribute_index=0;
377 attribute_index<attributeCount; attribute_index++)
378 {
379 xercesc::DOMNode* attribute_node = attributes->item(attribute_index);
380
381 if (attribute_node->getNodeType() != xercesc::DOMNode::ATTRIBUTE_NODE)
382 { continue; }
383
384 const xercesc::DOMAttr* const attribute
385 = dynamic_cast<xercesc::DOMAttr*>(attribute_node);
386 if (!attribute)
387 {
388 G4Exception("G4GDMLReadParamvol::Orb_dimensionsRead()",
389 "InvalidRead", FatalException, "No attribute found!");
390 return;
391 }
392 const G4String attName = Transcode(attribute->getName());
393 const G4String attValue = Transcode(attribute->getValue());
394
395 if (attName=="lunit") { lunit = eval.Evaluate(attValue); } else
396 if (attName=="r") { parameter.dimension[0] = eval.Evaluate(attValue); }
397 }
398
399 parameter.dimension[0] *= lunit;
400}

◆ Para_dimensionsRead()

void G4GDMLReadParamvol::Para_dimensionsRead ( const xercesc::DOMElement * const  element,
G4GDMLParameterisation::PARAMETER parameter 
)
protected

Definition at line 454 of file G4GDMLReadParamvol.cc.

457{
458 G4double lunit = 1.0;
459 G4double aunit = 1.0;
460
461 const xercesc::DOMNamedNodeMap* const attributes = element->getAttributes();
462 XMLSize_t attributeCount = attributes->getLength();
463
464 for (XMLSize_t attribute_index=0;
465 attribute_index<attributeCount; attribute_index++)
466 {
467 xercesc::DOMNode* attribute_node = attributes->item(attribute_index);
468
469 if (attribute_node->getNodeType() != xercesc::DOMNode::ATTRIBUTE_NODE)
470 { continue; }
471
472 const xercesc::DOMAttr* const attribute
473 = dynamic_cast<xercesc::DOMAttr*>(attribute_node);
474 if (!attribute)
475 {
476 G4Exception("G4GDMLReadParamvol::Para_dimensionsRead()",
477 "InvalidRead", FatalException, "No attribute found!");
478 return;
479 }
480 const G4String attName = Transcode(attribute->getName());
481 const G4String attValue = Transcode(attribute->getValue());
482
483 if (attName=="lunit")
484 { lunit = eval.Evaluate(attValue); } else
485 if (attName=="aunit")
486 { aunit = eval.Evaluate(attValue); } else
487 if (attName=="x")
488 { parameter.dimension[0] = eval.Evaluate(attValue); } else
489 if (attName=="y")
490 { parameter.dimension[1] = eval.Evaluate(attValue); } else
491 if (attName=="z")
492 { parameter.dimension[2] = eval.Evaluate(attValue); } else
493 if (attName=="alpha")
494 { parameter.dimension[3] = eval.Evaluate(attValue); } else
495 if (attName=="theta")
496 { parameter.dimension[4] = eval.Evaluate(attValue); } else
497 if (attName=="phi")
498 { parameter.dimension[5] = eval.Evaluate(attValue); }
499 }
500
501 parameter.dimension[0] = 0.5*lunit;
502 parameter.dimension[1] = 0.5*lunit;
503 parameter.dimension[2] = 0.5*lunit;
504 parameter.dimension[3] = aunit;
505 parameter.dimension[4] = aunit;
506 parameter.dimension[5] = aunit;
507}

◆ ParameterisedRead()

void G4GDMLReadParamvol::ParameterisedRead ( const xercesc::DOMElement * const  element)
protected

Definition at line 618 of file G4GDMLReadParamvol.cc.

620{
621 for (xercesc::DOMNode* iter = element->getFirstChild();
622 iter != 0; iter = iter->getNextSibling())
623 {
624 if (iter->getNodeType() != xercesc::DOMNode::ELEMENT_NODE) { continue; }
625
626 const xercesc::DOMElement* const child
627 = dynamic_cast<xercesc::DOMElement*>(iter);
628 if (!child)
629 {
630 G4Exception("G4GDMLReadParamvol::ParameterisedRead()",
631 "InvalidRead", FatalException, "No child found!");
632 return;
633 }
634 const G4String tag = Transcode(child->getTagName());
635
636 if (tag=="parameters")
637 {
638 const xercesc::DOMNamedNodeMap* const attributes
639 = element->getAttributes();
640 XMLSize_t attributeCount = attributes->getLength();
641 for (XMLSize_t attribute_index=0;
642 attribute_index<attributeCount; attribute_index++)
643 {
644 xercesc::DOMNode* attribute_node = attributes->item(attribute_index);
645
646 if (attribute_node->getNodeType() != xercesc::DOMNode::ATTRIBUTE_NODE)
647 { continue; }
648
649 const xercesc::DOMAttr* const attribute
650 = dynamic_cast<xercesc::DOMAttr*>(attribute_node);
651 if (!attribute)
652 {
653 G4Exception("G4GDMLReadParamvol::ParameterisedRead()",
654 "InvalidRead", FatalException, "No attribute found!");
655 return;
656 }
657 const G4String attName = Transcode(attribute->getName());
658 const G4String attValue = Transcode(attribute->getValue());
659
660 if (attName=="number") { eval.Evaluate(attValue); }
661 }
662 ParametersRead(child);
663 }
664 else
665 {
666 if (tag=="loop") { LoopRead(child,&G4GDMLRead::Paramvol_contentRead); }
667 }
668 }
669}
void ParametersRead(const xercesc::DOMElement *const)
virtual void Paramvol_contentRead(const xercesc::DOMElement *const)=0
void LoopRead(const xercesc::DOMElement *const, void(G4GDMLRead::*)(const xercesc::DOMElement *const))
Definition: G4GDMLRead.cc:179
Definition: xmlparse.cc:179

Referenced by Paramvol_contentRead().

◆ ParametersRead()

void G4GDMLReadParamvol::ParametersRead ( const xercesc::DOMElement * const  element)
protected

Definition at line 561 of file G4GDMLReadParamvol.cc.

562 {
563
564 G4ThreeVector rotation(0.0,0.0,0.0);
565 G4ThreeVector position(0.0,0.0,0.0);
566
568
569 for (xercesc::DOMNode* iter = element->getFirstChild();
570 iter != 0; iter = iter->getNextSibling())
571 {
572 if (iter->getNodeType() != xercesc::DOMNode::ELEMENT_NODE) { continue; }
573
574 const xercesc::DOMElement* const child
575 = dynamic_cast<xercesc::DOMElement*>(iter);
576 if (!child)
577 {
578 G4Exception("G4GDMLReadParamvol::ParametersRead()",
579 "InvalidRead", FatalException, "No child found!");
580 return;
581 }
582 const G4String tag = Transcode(child->getTagName());
583 if (tag=="rotation") { VectorRead(child,rotation); } else
584 if (tag=="position") { VectorRead(child,position); } else
585 if (tag=="positionref")
586 { position = GetPosition(GenerateName(RefRead(child))); } else
587 if (tag=="rotationref")
588 { rotation = GetRotation(GenerateName(RefRead(child))); } else
589 if (tag=="box_dimensions") { Box_dimensionsRead(child,parameter); } else
590 if (tag=="trd_dimensions") { Trd_dimensionsRead(child,parameter); } else
591 if (tag=="trap_dimensions") { Trap_dimensionsRead(child,parameter); } else
592 if (tag=="tube_dimensions") { Tube_dimensionsRead(child,parameter); } else
593 if (tag=="cone_dimensions") { Cone_dimensionsRead(child,parameter); } else
594 if (tag=="sphere_dimensions") { Cone_dimensionsRead(child,parameter); } else
595 if (tag=="orb_dimensions") { Cone_dimensionsRead(child,parameter); } else
596 if (tag=="torus_dimensions") { Cone_dimensionsRead(child,parameter); } else
597 if (tag=="para_dimensions") { Cone_dimensionsRead(child,parameter); } else
598 if (tag=="hype_dimensions") { Hype_dimensionsRead(child,parameter); }
599 else
600 {
601 G4String error_msg = "Unknown tag in parameters: " + tag;
602 G4Exception("G4GDMLReadParamvol::ParametersRead()", "ReadError",
603 FatalException, error_msg);
604 }
605 }
606
607 parameter.pRot = new G4RotationMatrix();
608
609 parameter.pRot->rotateX(rotation.x());
610 parameter.pRot->rotateY(rotation.y());
611 parameter.pRot->rotateZ(rotation.z());
612
613 parameter.position = position;
614
615 parameterisation->AddParameter(parameter);
616}
CLHEP::HepRotation G4RotationMatrix
HepRotation & rotateX(double delta)
Definition: Rotation.cc:66
HepRotation & rotateZ(double delta)
Definition: Rotation.cc:92
HepRotation & rotateY(double delta)
Definition: Rotation.cc:79
void AddParameter(const PARAMETER &)
void VectorRead(const xercesc::DOMElement *const, G4ThreeVector &)
G4ThreeVector GetPosition(const G4String &)
G4String RefRead(const xercesc::DOMElement *const)
G4ThreeVector GetRotation(const G4String &)
void Cone_dimensionsRead(const xercesc::DOMElement *const, G4GDMLParameterisation::PARAMETER &)
void Box_dimensionsRead(const xercesc::DOMElement *const, G4GDMLParameterisation::PARAMETER &)
void Hype_dimensionsRead(const xercesc::DOMElement *const, G4GDMLParameterisation::PARAMETER &)
void Trap_dimensionsRead(const xercesc::DOMElement *const, G4GDMLParameterisation::PARAMETER &)
void Trd_dimensionsRead(const xercesc::DOMElement *const, G4GDMLParameterisation::PARAMETER &)
void Tube_dimensionsRead(const xercesc::DOMElement *const, G4GDMLParameterisation::PARAMETER &)
G4String GenerateName(const G4String &name, G4bool strip=false)
Definition: G4GDMLRead.cc:68
#define position
Definition: xmlparse.cc:605

Referenced by ParameterisedRead().

◆ Paramvol_contentRead()

void G4GDMLReadParamvol::Paramvol_contentRead ( const xercesc::DOMElement * const  element)
virtual

Implements G4GDMLRead.

Definition at line 671 of file G4GDMLReadParamvol.cc.

673{
674 for (xercesc::DOMNode* iter = element->getFirstChild();
675 iter != 0; iter = iter->getNextSibling())
676 {
677 if (iter->getNodeType() != xercesc::DOMNode::ELEMENT_NODE) { continue; }
678
679 const xercesc::DOMElement* const child
680 = dynamic_cast<xercesc::DOMElement*>(iter);
681 if (!child)
682 {
683 G4Exception("G4GDMLReadParamvol::Paramvol_contentRead()", "InvalidRead",
684 FatalException, "No child found!");
685 return;
686 }
687 const G4String tag = Transcode(child->getTagName());
688 if (tag=="parameterised_position_size") { ParameterisedRead(child); }else
689 if (tag=="loop") { LoopRead(child,&G4GDMLRead::Paramvol_contentRead); }
690 }
691}
void ParameterisedRead(const xercesc::DOMElement *const)

Referenced by ParamvolRead().

◆ ParamvolRead()

void G4GDMLReadParamvol::ParamvolRead ( const xercesc::DOMElement * const  element,
G4LogicalVolume mother 
)
virtual

Definition at line 693 of file G4GDMLReadParamvol.cc.

695{
696 G4String volumeref;
697
699
700 for (xercesc::DOMNode* iter = element->getFirstChild();
701 iter != 0; iter = iter->getNextSibling())
702 {
703 if (iter->getNodeType() != xercesc::DOMNode::ELEMENT_NODE) { continue; }
704
705 const xercesc::DOMElement* const child
706 = dynamic_cast<xercesc::DOMElement*>(iter);
707 if (!child)
708 {
709 G4Exception("G4GDMLReadParamvol::ParamvolRead()", "InvalidRead",
710 FatalException, "No child found!");
711 return;
712 }
713 const G4String tag = Transcode(child->getTagName());
714
715 if (tag=="volumeref") { volumeref = RefRead(child); }
716
717 }
718
719 Paramvol_contentRead(element);
720
721 G4LogicalVolume* logvol = GetVolume(GenerateName(volumeref));
722
723 if (parameterisation->GetSize()==0)
724 {
725 G4Exception("G4GDMLReadParamvol::ParamvolRead()",
726 "ReadError", FatalException,
727 "No parameters are defined in parameterised volume!");
728 }
729 G4String pv_name = logvol->GetName() + "_param";
730 new G4PVParameterised(pv_name, logvol, mother, kUndefined,
732}
virtual void Paramvol_contentRead(const xercesc::DOMElement *const)
G4bool check
Definition: G4GDMLRead.hh:146
virtual G4LogicalVolume * GetVolume(const G4String &) const =0
G4String GetName() const
@ kUndefined
Definition: geomdefs.hh:54

Referenced by G4GDMLReadStructure::Volume_contentRead().

◆ Sphere_dimensionsRead()

void G4GDMLReadParamvol::Sphere_dimensionsRead ( const xercesc::DOMElement * const  element,
G4GDMLParameterisation::PARAMETER parameter 
)
protected

Definition at line 312 of file G4GDMLReadParamvol.cc.

315{
316 G4double lunit = 1.0;
317 G4double aunit = 1.0;
318
319 const xercesc::DOMNamedNodeMap* const attributes = element->getAttributes();
320 XMLSize_t attributeCount = attributes->getLength();
321
322 for (XMLSize_t attribute_index=0;
323 attribute_index<attributeCount; attribute_index++)
324 {
325 xercesc::DOMNode* attribute_node = attributes->item(attribute_index);
326
327 if (attribute_node->getNodeType() != xercesc::DOMNode::ATTRIBUTE_NODE)
328 { continue; }
329
330 const xercesc::DOMAttr* const attribute
331 = dynamic_cast<xercesc::DOMAttr*>(attribute_node);
332 if (!attribute)
333 {
334 G4Exception("G4GDMLReadParamvol::Sphere_dimensionsRead()",
335 "InvalidRead", FatalException, "No attribute found!");
336 return;
337 }
338 const G4String attName = Transcode(attribute->getName());
339 const G4String attValue = Transcode(attribute->getValue());
340
341 if (attName=="lunit")
342 { lunit = eval.Evaluate(attValue); } else
343 if (attName=="aunit")
344 { aunit = eval.Evaluate(attValue); } else
345 if (attName=="rmin")
346 { parameter.dimension[0] = eval.Evaluate(attValue); } else
347 if (attName=="rmax")
348 { parameter.dimension[1] = eval.Evaluate(attValue); } else
349 if (attName=="startphi")
350 { parameter.dimension[2] = eval.Evaluate(attValue); } else
351 if (attName=="deltaphi")
352 { parameter.dimension[3] = eval.Evaluate(attValue); } else
353 if (attName=="starttheta")
354 { parameter.dimension[4] = eval.Evaluate(attValue); } else
355 if (attName=="deltatheta")
356 { parameter.dimension[5] = eval.Evaluate(attValue); }
357 }
358
359 parameter.dimension[0] *= lunit;
360 parameter.dimension[1] *= lunit;
361 parameter.dimension[2] *= aunit;
362 parameter.dimension[3] *= aunit;
363 parameter.dimension[4] *= aunit;
364 parameter.dimension[5] *= aunit;
365}

◆ Torus_dimensionsRead()

void G4GDMLReadParamvol::Torus_dimensionsRead ( const xercesc::DOMElement * const  element,
G4GDMLParameterisation::PARAMETER parameter 
)
protected

Definition at line 402 of file G4GDMLReadParamvol.cc.

405{
406 G4double lunit = 1.0;
407 G4double aunit = 1.0;
408
409 const xercesc::DOMNamedNodeMap* const attributes = element->getAttributes();
410 XMLSize_t attributeCount = attributes->getLength();
411
412 for (XMLSize_t attribute_index=0;
413 attribute_index<attributeCount; attribute_index++)
414 {
415 xercesc::DOMNode* attribute_node = attributes->item(attribute_index);
416
417 if (attribute_node->getNodeType() != xercesc::DOMNode::ATTRIBUTE_NODE)
418 { continue; }
419
420 const xercesc::DOMAttr* const attribute
421 = dynamic_cast<xercesc::DOMAttr*>(attribute_node);
422 if (!attribute)
423 {
424 G4Exception("G4GDMLReadParamvol::Torus_dimensionsRead()",
425 "InvalidRead", FatalException, "No attribute found!");
426 return;
427 }
428 const G4String attName = Transcode(attribute->getName());
429 const G4String attValue = Transcode(attribute->getValue());
430
431 if (attName=="lunit")
432 { lunit = eval.Evaluate(attValue); } else
433 if (attName=="aunit")
434 { aunit = eval.Evaluate(attValue); } else
435 if (attName=="rmin")
436 { parameter.dimension[0] = eval.Evaluate(attValue); } else
437 if (attName=="rmax")
438 { parameter.dimension[1] = eval.Evaluate(attValue); } else
439 if (attName=="rtor")
440 { parameter.dimension[2] = eval.Evaluate(attValue); } else
441 if (attName=="startphi")
442 { parameter.dimension[3] = eval.Evaluate(attValue); } else
443 if (attName=="deltaphi")
444 { parameter.dimension[4] = eval.Evaluate(attValue); }
445 }
446
447 parameter.dimension[0] *= lunit;
448 parameter.dimension[1] *= lunit;
449 parameter.dimension[2] *= lunit;
450 parameter.dimension[3] *= aunit;
451 parameter.dimension[4] *= aunit;
452}

◆ Trap_dimensionsRead()

void G4GDMLReadParamvol::Trap_dimensionsRead ( const xercesc::DOMElement * const  element,
G4GDMLParameterisation::PARAMETER parameter 
)
protected

Definition at line 132 of file G4GDMLReadParamvol.cc.

135{
136 G4double lunit = 1.0;
137 G4double aunit = 1.0;
138
139 const xercesc::DOMNamedNodeMap* const attributes = element->getAttributes();
140 XMLSize_t attributeCount = attributes->getLength();
141
142 for (XMLSize_t attribute_index=0;
143 attribute_index<attributeCount; attribute_index++)
144 {
145 xercesc::DOMNode* attribute_node = attributes->item(attribute_index);
146
147 if (attribute_node->getNodeType() != xercesc::DOMNode::ATTRIBUTE_NODE)
148 { continue; }
149
150 const xercesc::DOMAttr* const attribute
151 = dynamic_cast<xercesc::DOMAttr*>(attribute_node);
152 if (!attribute)
153 {
154 G4Exception("G4GDMLReadParamvol::Trap_dimensionsRead()",
155 "InvalidRead", FatalException, "No attribute found!");
156 return;
157 }
158 const G4String attName = Transcode(attribute->getName());
159 const G4String attValue = Transcode(attribute->getValue());
160
161 if (attName=="lunit")
162 { lunit = eval.Evaluate(attValue); } else
163 if (attName=="aunit")
164 { aunit = eval.Evaluate(attValue); } else
165 if (attName=="z")
166 { parameter.dimension[0] = eval.Evaluate(attValue); } else
167 if (attName=="theta")
168 { parameter.dimension[1] = eval.Evaluate(attValue); } else
169 if (attName=="phi")
170 { parameter.dimension[2] = eval.Evaluate(attValue); } else
171 if (attName=="y1")
172 { parameter.dimension[3] = eval.Evaluate(attValue); } else
173 if (attName=="x1")
174 { parameter.dimension[4] = eval.Evaluate(attValue); } else
175 if (attName=="x2")
176 { parameter.dimension[5] = eval.Evaluate(attValue); } else
177 if (attName=="alpha1")
178 { parameter.dimension[6] = eval.Evaluate(attValue); } else
179 if (attName=="y2")
180 { parameter.dimension[7] = eval.Evaluate(attValue); } else
181 if (attName=="x3")
182 { parameter.dimension[8] = eval.Evaluate(attValue); } else
183 if (attName=="x4")
184 { parameter.dimension[9] = eval.Evaluate(attValue); } else
185 if (attName=="alpha2")
186 { parameter.dimension[10] = eval.Evaluate(attValue); }
187 }
188
189 parameter.dimension[0] *= 0.5*lunit;
190 parameter.dimension[1] *= aunit;
191 parameter.dimension[2] *= aunit;
192 parameter.dimension[3] *= 0.5*lunit;
193 parameter.dimension[4] *= 0.5*lunit;
194 parameter.dimension[5] *= 0.5*lunit;
195 parameter.dimension[6] *= aunit;
196 parameter.dimension[7] *= 0.5*lunit;
197 parameter.dimension[8] *= 0.5*lunit;
198 parameter.dimension[9] *= 0.5*lunit;
199 parameter.dimension[10] *= aunit;
200}

Referenced by ParametersRead().

◆ Trd_dimensionsRead()

void G4GDMLReadParamvol::Trd_dimensionsRead ( const xercesc::DOMElement * const  element,
G4GDMLParameterisation::PARAMETER parameter 
)
protected

Definition at line 89 of file G4GDMLReadParamvol.cc.

92{
93 G4double lunit = 1.0;
94
95 const xercesc::DOMNamedNodeMap* const attributes = element->getAttributes();
96 XMLSize_t attributeCount = attributes->getLength();
97
98 for (XMLSize_t attribute_index=0;
99 attribute_index<attributeCount; attribute_index++)
100 {
101 xercesc::DOMNode* attribute_node = attributes->item(attribute_index);
102
103 if (attribute_node->getNodeType() != xercesc::DOMNode::ATTRIBUTE_NODE)
104 { continue; }
105
106 const xercesc::DOMAttr* const attribute
107 = dynamic_cast<xercesc::DOMAttr*>(attribute_node);
108 if (!attribute)
109 {
110 G4Exception("G4GDMLReadParamvol::Trd_dimensionsRead()",
111 "InvalidRead", FatalException, "No attribute found!");
112 return;
113 }
114 const G4String attName = Transcode(attribute->getName());
115 const G4String attValue = Transcode(attribute->getValue());
116
117 if (attName=="lunit") { lunit = eval.Evaluate(attValue); } else
118 if (attName=="x1") { parameter.dimension[0]=eval.Evaluate(attValue); } else
119 if (attName=="x2") { parameter.dimension[1]=eval.Evaluate(attValue); } else
120 if (attName=="y1") { parameter.dimension[2]=eval.Evaluate(attValue); } else
121 if (attName=="y2") { parameter.dimension[3]=eval.Evaluate(attValue); } else
122 if (attName=="z") { parameter.dimension[4]=eval.Evaluate(attValue); }
123 }
124
125 parameter.dimension[0] *= 0.5*lunit;
126 parameter.dimension[1] *= 0.5*lunit;
127 parameter.dimension[2] *= 0.5*lunit;
128 parameter.dimension[3] *= 0.5*lunit;
129 parameter.dimension[4] *= 0.5*lunit;
130}

Referenced by ParametersRead().

◆ Tube_dimensionsRead()

void G4GDMLReadParamvol::Tube_dimensionsRead ( const xercesc::DOMElement * const  element,
G4GDMLParameterisation::PARAMETER parameter 
)
protected

Definition at line 202 of file G4GDMLReadParamvol.cc.

205{
206 G4double lunit = 1.0;
207 G4double aunit = 1.0;
208
209 const xercesc::DOMNamedNodeMap* const attributes = element->getAttributes();
210 XMLSize_t attributeCount = attributes->getLength();
211
212 for (XMLSize_t attribute_index=0;
213 attribute_index<attributeCount; attribute_index++)
214 {
215 xercesc::DOMNode* attribute_node = attributes->item(attribute_index);
216
217 if (attribute_node->getNodeType() != xercesc::DOMNode::ATTRIBUTE_NODE)
218 { continue; }
219
220 const xercesc::DOMAttr* const attribute
221 = dynamic_cast<xercesc::DOMAttr*>(attribute_node);
222 if (!attribute)
223 {
224 G4Exception("G4GDMLReadParamvol::Tube_dimensionsRead()",
225 "InvalidRead", FatalException, "No attribute found!");
226 return;
227 }
228 const G4String attName = Transcode(attribute->getName());
229 const G4String attValue = Transcode(attribute->getValue());
230
231 if (attName=="lunit")
232 { lunit = eval.Evaluate(attValue); } else
233 if (attName=="aunit")
234 { aunit = eval.Evaluate(attValue); } else
235 if (attName=="InR")
236 { parameter.dimension[0] = eval.Evaluate(attValue); } else
237 if (attName=="OutR")
238 { parameter.dimension[1] = eval.Evaluate(attValue); } else
239 if (attName=="hz")
240 { parameter.dimension[2] = eval.Evaluate(attValue); } else
241 if (attName=="StartPhi")
242 { parameter.dimension[3] = eval.Evaluate(attValue); } else
243 if (attName=="DeltaPhi")
244 { parameter.dimension[4] = eval.Evaluate(attValue); }
245 }
246
247 parameter.dimension[0] *= lunit;
248 parameter.dimension[1] *= lunit;
249 parameter.dimension[2] *= 0.5*lunit;
250 parameter.dimension[3] *= aunit;
251 parameter.dimension[4] *= aunit;
252}

Referenced by ParametersRead().

Member Data Documentation

◆ parameterisation

G4GDMLParameterisation* G4GDMLReadParamvol::parameterisation
protected

Definition at line 89 of file G4GDMLReadParamvol.hh.

Referenced by ParametersRead(), and ParamvolRead().


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