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

#include <G4GDMLWriteParamvol.hh>

+ Inheritance diagram for G4GDMLWriteParamvol:

Public Member Functions

virtual void ParamvolWrite (xercesc::DOMElement *, const G4VPhysicalVolume *const)
 
virtual void ParamvolAlgorithmWrite (xercesc::DOMElement *paramvolElement, const G4VPhysicalVolume *const paramvol)
 
- Public Member Functions inherited from G4GDMLWriteSetup
virtual void SetupWrite (xercesc::DOMElement *, const G4LogicalVolume *const)
 
- Public Member Functions inherited from G4GDMLWriteSolids
virtual void AddSolid (const G4VSolid *const)
 
virtual void SolidsWrite (xercesc::DOMElement *)
 
- Public Member Functions inherited from G4GDMLWriteMaterials
void AddIsotope (const G4Isotope *const)
 
void AddElement (const G4Element *const)
 
void AddMaterial (const G4Material *const)
 
virtual void MaterialsWrite (xercesc::DOMElement *)
 
- Public Member Functions inherited from G4GDMLWriteDefine
G4ThreeVector GetAngles (const G4RotationMatrix &)
 
void ScaleWrite (xercesc::DOMElement *element, const G4String &name, const G4ThreeVector &scl)
 
void RotationWrite (xercesc::DOMElement *element, const G4String &name, const G4ThreeVector &rot)
 
void PositionWrite (xercesc::DOMElement *element, const G4String &name, const G4ThreeVector &pos)
 
void FirstrotationWrite (xercesc::DOMElement *element, const G4String &name, const G4ThreeVector &rot)
 
void FirstpositionWrite (xercesc::DOMElement *element, const G4String &name, const G4ThreeVector &pos)
 
void AddPosition (const G4String &name, const G4ThreeVector &pos)
 
virtual void DefineWrite (xercesc::DOMElement *)
 
- Public Member Functions inherited from G4GDMLWrite
G4Transform3D Write (const G4String &filename, const G4LogicalVolume *const topLog, const G4String &schemaPath, const G4int depth, G4bool storeReferences=true)
 
void AddModule (const G4VPhysicalVolume *const topVol)
 
void AddModule (const G4int depth)
 
void AddAuxiliary (G4GDMLAuxStructType myaux)
 
void SetOutputFileOverwrite (G4bool flag)
 
virtual void DefineWrite (xercesc::DOMElement *)=0
 
virtual void MaterialsWrite (xercesc::DOMElement *)=0
 
virtual void SolidsWrite (xercesc::DOMElement *)=0
 
virtual void StructureWrite (xercesc::DOMElement *)=0
 
virtual G4Transform3D TraverseVolumeTree (const G4LogicalVolume *const, const G4int)=0
 
virtual void SurfacesWrite ()=0
 
virtual void SetupWrite (xercesc::DOMElement *, const G4LogicalVolume *const)=0
 
virtual void ExtensionWrite (xercesc::DOMElement *)
 
virtual void UserinfoWrite (xercesc::DOMElement *)
 
virtual void AddExtension (xercesc::DOMElement *, const G4LogicalVolume *const)
 
G4String GenerateName (const G4String &, const void *const)
 

Protected Member Functions

 G4GDMLWriteParamvol ()
 
virtual ~G4GDMLWriteParamvol ()
 
void Box_dimensionsWrite (xercesc::DOMElement *, const G4Box *const)
 
void Trd_dimensionsWrite (xercesc::DOMElement *, const G4Trd *const)
 
void Trap_dimensionsWrite (xercesc::DOMElement *, const G4Trap *const)
 
void Tube_dimensionsWrite (xercesc::DOMElement *, const G4Tubs *const)
 
void Cone_dimensionsWrite (xercesc::DOMElement *, const G4Cons *const)
 
void Sphere_dimensionsWrite (xercesc::DOMElement *, const G4Sphere *const)
 
void Orb_dimensionsWrite (xercesc::DOMElement *, const G4Orb *const)
 
void Torus_dimensionsWrite (xercesc::DOMElement *, const G4Torus *const)
 
void Ellipsoid_dimensionsWrite (xercesc::DOMElement *, const G4Ellipsoid *const)
 
void Para_dimensionsWrite (xercesc::DOMElement *, const G4Para *const)
 
void Hype_dimensionsWrite (xercesc::DOMElement *, const G4Hype *const)
 
void Polycone_dimensionsWrite (xercesc::DOMElement *, const G4Polycone *const)
 
void Polyhedra_dimensionsWrite (xercesc::DOMElement *, const G4Polyhedra *const)
 
void ParametersWrite (xercesc::DOMElement *, const G4VPhysicalVolume *const, const G4int &)
 
- Protected Member Functions inherited from G4GDMLWriteSetup
 G4GDMLWriteSetup ()
 
virtual ~G4GDMLWriteSetup ()
 
- Protected Member Functions inherited from G4GDMLWriteSolids
 G4GDMLWriteSolids ()
 
virtual ~G4GDMLWriteSolids ()
 
void MultiUnionWrite (xercesc::DOMElement *solElement, const G4MultiUnion *const)
 
void BooleanWrite (xercesc::DOMElement *, const G4BooleanSolid *const)
 
void ScaledWrite (xercesc::DOMElement *, const G4ScaledSolid *const)
 
void BoxWrite (xercesc::DOMElement *, const G4Box *const)
 
void ConeWrite (xercesc::DOMElement *, const G4Cons *const)
 
void ElconeWrite (xercesc::DOMElement *, const G4EllipticalCone *const)
 
void EllipsoidWrite (xercesc::DOMElement *, const G4Ellipsoid *const)
 
void EltubeWrite (xercesc::DOMElement *, const G4EllipticalTube *const)
 
void XtruWrite (xercesc::DOMElement *, const G4ExtrudedSolid *const)
 
void HypeWrite (xercesc::DOMElement *, const G4Hype *const)
 
void OrbWrite (xercesc::DOMElement *, const G4Orb *const)
 
void ParaWrite (xercesc::DOMElement *, const G4Para *const)
 
void ParaboloidWrite (xercesc::DOMElement *, const G4Paraboloid *const)
 
void PolyconeWrite (xercesc::DOMElement *, const G4Polycone *const)
 
void GenericPolyconeWrite (xercesc::DOMElement *, const G4GenericPolycone *const)
 
void PolyhedraWrite (xercesc::DOMElement *, const G4Polyhedra *const)
 
void SphereWrite (xercesc::DOMElement *, const G4Sphere *const)
 
void TessellatedWrite (xercesc::DOMElement *, const G4TessellatedSolid *const)
 
void TetWrite (xercesc::DOMElement *, const G4Tet *const)
 
void TorusWrite (xercesc::DOMElement *, const G4Torus *const)
 
void GenTrapWrite (xercesc::DOMElement *, const G4GenericTrap *const)
 
void TrapWrite (xercesc::DOMElement *, const G4Trap *const)
 
void TrdWrite (xercesc::DOMElement *, const G4Trd *const)
 
void TubeWrite (xercesc::DOMElement *, const G4Tubs *const)
 
void CutTubeWrite (xercesc::DOMElement *, const G4CutTubs *const)
 
void TwistedboxWrite (xercesc::DOMElement *, const G4TwistedBox *const)
 
void TwistedtrapWrite (xercesc::DOMElement *, const G4TwistedTrap *const)
 
void TwistedtrdWrite (xercesc::DOMElement *, const G4TwistedTrd *const)
 
void TwistedtubsWrite (xercesc::DOMElement *, const G4TwistedTubs *const)
 
void ZplaneWrite (xercesc::DOMElement *, const G4double &, const G4double &, const G4double &)
 
void RZPointWrite (xercesc::DOMElement *, const G4double &, const G4double &)
 
void OpticalSurfaceWrite (xercesc::DOMElement *, const G4OpticalSurface *const)
 
void PropertyWrite (xercesc::DOMElement *, const G4OpticalSurface *const)
 
- Protected Member Functions inherited from G4GDMLWriteMaterials
 G4GDMLWriteMaterials ()
 
virtual ~G4GDMLWriteMaterials ()
 
void AtomWrite (xercesc::DOMElement *, const G4double &)
 
void DWrite (xercesc::DOMElement *, const G4double &)
 
void PWrite (xercesc::DOMElement *, const G4double &)
 
void TWrite (xercesc::DOMElement *, const G4double &)
 
void MEEWrite (xercesc::DOMElement *, const G4double &)
 
void IsotopeWrite (const G4Isotope *const)
 
void ElementWrite (const G4Element *const)
 
void MaterialWrite (const G4Material *const)
 
void PropertyWrite (xercesc::DOMElement *, const G4Material *const)
 
void PropertyVectorWrite (const G4String &, const G4PhysicsFreeVector *const)
 
void PropertyConstWrite (const G4String &, const G4double, const G4MaterialPropertiesTable *)
 
- Protected Member Functions inherited from G4GDMLWriteDefine
 G4GDMLWriteDefine ()
 
virtual ~G4GDMLWriteDefine ()
 
void Scale_vectorWrite (xercesc::DOMElement *, const G4String &, const G4String &, const G4ThreeVector &)
 
void Rotation_vectorWrite (xercesc::DOMElement *, const G4String &, const G4String &, const G4ThreeVector &)
 
void Position_vectorWrite (xercesc::DOMElement *, const G4String &, const G4String &, const G4ThreeVector &)
 
- Protected Member Functions inherited from G4GDMLWrite
 G4GDMLWrite ()
 
virtual ~G4GDMLWrite ()
 
VolumeMapType & VolumeMap ()
 
xercesc::DOMAttr * NewAttribute (const G4String &, const G4String &)
 
xercesc::DOMAttr * NewAttribute (const G4String &, const G4double &)
 
xercesc::DOMElement * NewElement (const G4String &)
 
G4String Modularize (const G4VPhysicalVolume *const topvol, const G4int depth)
 
void AddAuxInfo (G4GDMLAuxListType *auxInfoList, xercesc::DOMElement *element)
 
G4bool FileExists (const G4String &) const
 
PhysVolumeMapType & PvolumeMap ()
 
DepthMapType & DepthMap ()
 

Additional Inherited Members

- Static Public Member Functions inherited from G4GDMLWrite
static void SetAddPointerToName (G4bool)
 
- Protected Attributes inherited from G4GDMLWriteSolids
std::vector< const G4VSolid * > solidList
 
xercesc::DOMElement * solidsElement = nullptr
 
- Protected Attributes inherited from G4GDMLWriteMaterials
std::vector< const G4Isotope * > isotopeList
 
std::vector< const G4Element * > elementList
 
std::vector< const G4Material * > materialList
 
std::vector< const G4PhysicsFreeVector * > propertyList
 
xercesc::DOMElement * materialsElement = nullptr
 
- Protected Attributes inherited from G4GDMLWriteDefine
xercesc::DOMElement * defineElement = nullptr
 
- Protected Attributes inherited from G4GDMLWrite
G4String SchemaLocation
 
xercesc::DOMDocument * doc = nullptr
 
xercesc::DOMElement * extElement = nullptr
 
xercesc::DOMElement * userinfoElement = nullptr
 
G4GDMLAuxListType auxList
 
G4bool overwriteOutputFile = false
 
- Static Protected Attributes inherited from G4GDMLWriteSolids
static const G4int maxTransforms = 8
 
- Static Protected Attributes inherited from G4GDMLWriteDefine
static const G4double kRelativePrecision = DBL_EPSILON
 
static const G4double kAngularPrecision = DBL_EPSILON
 
static const G4double kLinearPrecision = DBL_EPSILON
 
- Static Protected Attributes inherited from G4GDMLWrite
static G4bool addPointerToName = true
 

Detailed Description

Definition at line 54 of file G4GDMLWriteParamvol.hh.

Constructor & Destructor Documentation

◆ G4GDMLWriteParamvol()

G4GDMLWriteParamvol::G4GDMLWriteParamvol ( )
protected

Definition at line 54 of file G4GDMLWriteParamvol.cc.

56{
57}

◆ ~G4GDMLWriteParamvol()

G4GDMLWriteParamvol::~G4GDMLWriteParamvol ( )
protectedvirtual

Definition at line 60 of file G4GDMLWriteParamvol.cc.

61{
62}

Member Function Documentation

◆ Box_dimensionsWrite()

void G4GDMLWriteParamvol::Box_dimensionsWrite ( xercesc::DOMElement *  parametersElement,
const G4Box * const  box 
)
protected

Definition at line 65 of file G4GDMLWriteParamvol.cc.

67{
68 xercesc::DOMElement* box_dimensionsElement = NewElement("box_dimensions");
69 box_dimensionsElement->setAttributeNode(
70 NewAttribute("x", 2.0 * box->GetXHalfLength() / mm));
71 box_dimensionsElement->setAttributeNode(
72 NewAttribute("y", 2.0 * box->GetYHalfLength() / mm));
73 box_dimensionsElement->setAttributeNode(
74 NewAttribute("z", 2.0 * box->GetZHalfLength() / mm));
75 box_dimensionsElement->setAttributeNode(NewAttribute("lunit", "mm"));
76 parametersElement->appendChild(box_dimensionsElement);
77}
G4double GetYHalfLength() const
G4double GetZHalfLength() const
G4double GetXHalfLength() const
xercesc::DOMElement * NewElement(const G4String &)
Definition: G4GDMLWrite.cc:192
xercesc::DOMAttr * NewAttribute(const G4String &, const G4String &)
Definition: G4GDMLWrite.cc:155

Referenced by ParametersWrite().

◆ Cone_dimensionsWrite()

void G4GDMLWriteParamvol::Cone_dimensionsWrite ( xercesc::DOMElement *  parametersElement,
const G4Cons * const  cone 
)
protected

Definition at line 157 of file G4GDMLWriteParamvol.cc.

159{
160 xercesc::DOMElement* cone_dimensionsElement = NewElement("cone_dimensions");
161 cone_dimensionsElement->setAttributeNode(
162 NewAttribute("rmin1", cone->GetInnerRadiusMinusZ() / mm));
163 cone_dimensionsElement->setAttributeNode(
164 NewAttribute("rmax1", cone->GetOuterRadiusMinusZ() / mm));
165 cone_dimensionsElement->setAttributeNode(
166 NewAttribute("rmin2", cone->GetInnerRadiusPlusZ() / mm));
167 cone_dimensionsElement->setAttributeNode(
168 NewAttribute("rmax2", cone->GetOuterRadiusPlusZ() / mm));
169 cone_dimensionsElement->setAttributeNode(
170 NewAttribute("z", 2.0 * cone->GetZHalfLength() / mm));
171 cone_dimensionsElement->setAttributeNode(
172 NewAttribute("startphi", cone->GetStartPhiAngle() / degree));
173 cone_dimensionsElement->setAttributeNode(
174 NewAttribute("deltaphi", cone->GetDeltaPhiAngle() / degree));
175 cone_dimensionsElement->setAttributeNode(NewAttribute("aunit", "deg"));
176 cone_dimensionsElement->setAttributeNode(NewAttribute("lunit", "mm"));
177 parametersElement->appendChild(cone_dimensionsElement);
178}
G4double GetOuterRadiusPlusZ() const
G4double GetStartPhiAngle() const
G4double GetDeltaPhiAngle() const
G4double GetInnerRadiusMinusZ() const
G4double GetInnerRadiusPlusZ() const
G4double GetOuterRadiusMinusZ() const
G4double GetZHalfLength() const

Referenced by ParametersWrite().

◆ Ellipsoid_dimensionsWrite()

void G4GDMLWriteParamvol::Ellipsoid_dimensionsWrite ( xercesc::DOMElement *  parametersElement,
const G4Ellipsoid * const  ellipsoid 
)
protected

Definition at line 235 of file G4GDMLWriteParamvol.cc.

237{
238 xercesc::DOMElement* ellipsoid_dimensionsElement =
239 NewElement("ellipsoid_dimensions");
240 ellipsoid_dimensionsElement->setAttributeNode(
241 NewAttribute("ax", ellipsoid->GetSemiAxisMax(0) / mm));
242 ellipsoid_dimensionsElement->setAttributeNode(
243 NewAttribute("by", ellipsoid->GetSemiAxisMax(1) / mm));
244 ellipsoid_dimensionsElement->setAttributeNode(
245 NewAttribute("cz", ellipsoid->GetSemiAxisMax(2) / mm));
246 ellipsoid_dimensionsElement->setAttributeNode(
247 NewAttribute("zcut1", ellipsoid->GetZBottomCut() / mm));
248 ellipsoid_dimensionsElement->setAttributeNode(
249 NewAttribute("zcut2", ellipsoid->GetZTopCut() / mm));
250 ellipsoid_dimensionsElement->setAttributeNode(NewAttribute("lunit", "mm"));
251 parametersElement->appendChild(ellipsoid_dimensionsElement);
252}
G4double GetSemiAxisMax(G4int i) const
G4double GetZTopCut() const
G4double GetZBottomCut() const

Referenced by ParametersWrite().

◆ Hype_dimensionsWrite()

void G4GDMLWriteParamvol::Hype_dimensionsWrite ( xercesc::DOMElement *  parametersElement,
const G4Hype * const  hype 
)
protected

Definition at line 283 of file G4GDMLWriteParamvol.cc.

285{
286 xercesc::DOMElement* hype_dimensionsElement = NewElement("hype_dimensions");
287 hype_dimensionsElement->setAttributeNode(
288 NewAttribute("rmin", hype->GetInnerRadius() / mm));
289 hype_dimensionsElement->setAttributeNode(
290 NewAttribute("rmax", hype->GetOuterRadius() / mm));
291 hype_dimensionsElement->setAttributeNode(
292 NewAttribute("inst", hype->GetInnerStereo() / degree));
293 hype_dimensionsElement->setAttributeNode(
294 NewAttribute("outst", hype->GetOuterStereo() / degree));
295 hype_dimensionsElement->setAttributeNode(
296 NewAttribute("z", 2.0 * hype->GetZHalfLength() / mm));
297 hype_dimensionsElement->setAttributeNode(NewAttribute("aunit", "deg"));
298 hype_dimensionsElement->setAttributeNode(NewAttribute("lunit", "mm"));
299 parametersElement->appendChild(hype_dimensionsElement);
300}
G4double GetInnerStereo() const
G4double GetZHalfLength() const
G4double GetOuterStereo() const
G4double GetOuterRadius() const
G4double GetInnerRadius() const

Referenced by ParametersWrite().

◆ Orb_dimensionsWrite()

void G4GDMLWriteParamvol::Orb_dimensionsWrite ( xercesc::DOMElement *  parametersElement,
const G4Orb * const  orb 
)
protected

Definition at line 204 of file G4GDMLWriteParamvol.cc.

206{
207 xercesc::DOMElement* orb_dimensionsElement = NewElement("orb_dimensions");
208 orb_dimensionsElement->setAttributeNode(
209 NewAttribute("r", orb->GetRadius() / mm));
210 orb_dimensionsElement->setAttributeNode(NewAttribute("lunit", "mm"));
211 parametersElement->appendChild(orb_dimensionsElement);
212}
G4double GetRadius() const

Referenced by ParametersWrite().

◆ Para_dimensionsWrite()

void G4GDMLWriteParamvol::Para_dimensionsWrite ( xercesc::DOMElement *  parametersElement,
const G4Para * const  para 
)
protected

Definition at line 255 of file G4GDMLWriteParamvol.cc.

257{
258 const G4ThreeVector simaxis = para->GetSymAxis();
259
260 const G4double alpha = std::atan(para->GetTanAlpha());
261 const G4double theta = std::acos(simaxis.z());
262 const G4double phi =
263 (simaxis.z() != 1.0) ? (std::atan(simaxis.y() / simaxis.x())) : (0.0);
264
265 xercesc::DOMElement* para_dimensionsElement = NewElement("para_dimensions");
266 para_dimensionsElement->setAttributeNode(
267 NewAttribute("x", 2.0 * para->GetXHalfLength() / mm));
268 para_dimensionsElement->setAttributeNode(
269 NewAttribute("y", 2.0 * para->GetYHalfLength() / mm));
270 para_dimensionsElement->setAttributeNode(
271 NewAttribute("z", 2.0 * para->GetZHalfLength() / mm));
272 para_dimensionsElement->setAttributeNode(
273 NewAttribute("alpha", alpha / degree));
274 para_dimensionsElement->setAttributeNode(
275 NewAttribute("theta", theta / degree));
276 para_dimensionsElement->setAttributeNode(NewAttribute("phi", phi / degree));
277 para_dimensionsElement->setAttributeNode(NewAttribute("aunit", "deg"));
278 para_dimensionsElement->setAttributeNode(NewAttribute("lunit", "mm"));
279 parametersElement->appendChild(para_dimensionsElement);
280}
double G4double
Definition: G4Types.hh:83
double z() const
double x() const
double y() const
G4double GetTanAlpha() const
G4ThreeVector GetSymAxis() const
G4double GetYHalfLength() const
G4double GetZHalfLength() const
G4double GetXHalfLength() const

Referenced by ParametersWrite().

◆ ParametersWrite()

void G4GDMLWriteParamvol::ParametersWrite ( xercesc::DOMElement *  paramvolElement,
const G4VPhysicalVolume * const  paramvol,
const G4int index 
)
protected

Definition at line 363 of file G4GDMLWriteParamvol.cc.

365{
367 index, const_cast<G4VPhysicalVolume*>(paramvol));
368 G4ThreeVector Angles;
369 G4String name = GenerateName(paramvol->GetName(), paramvol);
370 std::stringstream os;
371 os.precision(15);
372 os << index;
373 G4String sncopie = os.str();
374
375 xercesc::DOMElement* parametersElement = NewElement("parameters");
376 parametersElement->setAttributeNode(NewAttribute("number", index + 1));
377
378 PositionWrite(parametersElement, name + sncopie + "_pos",
379 paramvol->GetObjectTranslation());
380 Angles = GetAngles(paramvol->GetObjectRotationValue());
381 if(Angles.mag2() > DBL_EPSILON)
382 {
383 RotationWrite(parametersElement, name + sncopie + "_rot",
384 GetAngles(paramvol->GetObjectRotationValue()));
385 }
386 paramvolElement->appendChild(parametersElement);
387
388 G4VSolid* solid = paramvol->GetLogicalVolume()->GetSolid();
389
390 if(G4Box* box = dynamic_cast<G4Box*>(solid))
391 {
393 *box, index, const_cast<G4VPhysicalVolume*>(paramvol));
394 Box_dimensionsWrite(parametersElement, box);
395 }
396 else if(G4Trd* trd = dynamic_cast<G4Trd*>(solid))
397 {
399 *trd, index, const_cast<G4VPhysicalVolume*>(paramvol));
400 Trd_dimensionsWrite(parametersElement, trd);
401 }
402 else if(G4Trap* trap = dynamic_cast<G4Trap*>(solid))
403 {
405 *trap, index, const_cast<G4VPhysicalVolume*>(paramvol));
406 Trap_dimensionsWrite(parametersElement, trap);
407 }
408 else if(G4Tubs* tube = dynamic_cast<G4Tubs*>(solid))
409 {
411 *tube, index, const_cast<G4VPhysicalVolume*>(paramvol));
412 Tube_dimensionsWrite(parametersElement, tube);
413 }
414 else if(G4Cons* cone = dynamic_cast<G4Cons*>(solid))
415 {
417 *cone, index, const_cast<G4VPhysicalVolume*>(paramvol));
418 Cone_dimensionsWrite(parametersElement, cone);
419 }
420 else if(G4Sphere* sphere = dynamic_cast<G4Sphere*>(solid))
421 {
423 *sphere, index, const_cast<G4VPhysicalVolume*>(paramvol));
424 Sphere_dimensionsWrite(parametersElement, sphere);
425 }
426 else if(G4Orb* orb = dynamic_cast<G4Orb*>(solid))
427 {
429 *orb, index, const_cast<G4VPhysicalVolume*>(paramvol));
430 Orb_dimensionsWrite(parametersElement, orb);
431 }
432 else if(G4Torus* torus = dynamic_cast<G4Torus*>(solid))
433 {
435 *torus, index, const_cast<G4VPhysicalVolume*>(paramvol));
436 Torus_dimensionsWrite(parametersElement, torus);
437 }
438 else if(G4Ellipsoid* ellipsoid = dynamic_cast<G4Ellipsoid*>(solid))
439 {
441 *ellipsoid, index, const_cast<G4VPhysicalVolume*>(paramvol));
442 Ellipsoid_dimensionsWrite(parametersElement, ellipsoid);
443 }
444 else if(G4Para* para = dynamic_cast<G4Para*>(solid))
445 {
447 *para, index, const_cast<G4VPhysicalVolume*>(paramvol));
448 Para_dimensionsWrite(parametersElement, para);
449 }
450 else if(G4Hype* hype = dynamic_cast<G4Hype*>(solid))
451 {
453 *hype, index, const_cast<G4VPhysicalVolume*>(paramvol));
454 Hype_dimensionsWrite(parametersElement, hype);
455 }
456 else if(G4Polycone* pcone = dynamic_cast<G4Polycone*>(solid))
457 {
459 *pcone, index, const_cast<G4VPhysicalVolume*>(paramvol));
460 Polycone_dimensionsWrite(parametersElement, pcone);
461 }
462 else if(G4Polyhedra* polyhedra = dynamic_cast<G4Polyhedra*>(solid))
463 {
465 *polyhedra, index, const_cast<G4VPhysicalVolume*>(paramvol));
466 Polyhedra_dimensionsWrite(parametersElement, polyhedra);
467 }
468 else
469 {
470 G4String error_msg = "Solid '" + solid->GetName() +
471 "' cannot be used in parameterised volume!";
472 G4Exception("G4GDMLWriteParamvol::ParametersWrite()", "InvalidSetup",
473 FatalException, error_msg);
474 }
475}
@ FatalException
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)
Definition: G4Exception.cc:59
double mag2() const
Definition: G4Box.hh:56
Definition: G4Cons.hh:78
void RotationWrite(xercesc::DOMElement *element, const G4String &name, const G4ThreeVector &rot)
void PositionWrite(xercesc::DOMElement *element, const G4String &name, const G4ThreeVector &pos)
G4ThreeVector GetAngles(const G4RotationMatrix &)
void Tube_dimensionsWrite(xercesc::DOMElement *, const G4Tubs *const)
void Orb_dimensionsWrite(xercesc::DOMElement *, const G4Orb *const)
void Trap_dimensionsWrite(xercesc::DOMElement *, const G4Trap *const)
void Polycone_dimensionsWrite(xercesc::DOMElement *, const G4Polycone *const)
void Hype_dimensionsWrite(xercesc::DOMElement *, const G4Hype *const)
void Ellipsoid_dimensionsWrite(xercesc::DOMElement *, const G4Ellipsoid *const)
void Polyhedra_dimensionsWrite(xercesc::DOMElement *, const G4Polyhedra *const)
void Trd_dimensionsWrite(xercesc::DOMElement *, const G4Trd *const)
void Box_dimensionsWrite(xercesc::DOMElement *, const G4Box *const)
void Cone_dimensionsWrite(xercesc::DOMElement *, const G4Cons *const)
void Sphere_dimensionsWrite(xercesc::DOMElement *, const G4Sphere *const)
void Para_dimensionsWrite(xercesc::DOMElement *, const G4Para *const)
void Torus_dimensionsWrite(xercesc::DOMElement *, const G4Torus *const)
G4String GenerateName(const G4String &, const void *const)
Definition: G4GDMLWrite.cc:132
Definition: G4Hype.hh:69
G4VSolid * GetSolid() const
Definition: G4Orb.hh:56
Definition: G4Para.hh:79
Definition: G4Trd.hh:63
Definition: G4Tubs.hh:75
virtual void ComputeTransformation(const G4int, G4VPhysicalVolume *) const =0
virtual void ComputeDimensions(G4Box &, const G4int, const G4VPhysicalVolume *) const
G4LogicalVolume * GetLogicalVolume() const
G4RotationMatrix GetObjectRotationValue() const
const G4String & GetName() const
virtual G4VPVParameterisation * GetParameterisation() const =0
G4ThreeVector GetObjectTranslation() const
G4String GetName() const
const char * name(G4int ptype)
#define DBL_EPSILON
Definition: templates.hh:66

Referenced by ParamvolAlgorithmWrite().

◆ ParamvolAlgorithmWrite()

void G4GDMLWriteParamvol::ParamvolAlgorithmWrite ( xercesc::DOMElement *  paramvolElement,
const G4VPhysicalVolume *const  paramvol 
)
virtual

Definition at line 498 of file G4GDMLWriteParamvol.cc.

500{
501 const G4String volumeref = GenerateName(
502 paramvol->GetLogicalVolume()->GetName(), paramvol->GetLogicalVolume());
503
504 const G4int parameterCount = paramvol->GetMultiplicity();
505
506 for(G4int i = 0; i < parameterCount; ++i)
507 {
508 ParametersWrite(paramvolElement, paramvol, i);
509 }
510}
int G4int
Definition: G4Types.hh:85
void ParametersWrite(xercesc::DOMElement *, const G4VPhysicalVolume *const, const G4int &)
const G4String & GetName() const
virtual G4int GetMultiplicity() const

Referenced by ParamvolWrite().

◆ ParamvolWrite()

void G4GDMLWriteParamvol::ParamvolWrite ( xercesc::DOMElement *  volumeElement,
const G4VPhysicalVolume * const  paramvol 
)
virtual

Definition at line 478 of file G4GDMLWriteParamvol.cc.

480{
481 const G4String volumeref = GenerateName(
482 paramvol->GetLogicalVolume()->GetName(), paramvol->GetLogicalVolume());
483 xercesc::DOMElement* paramvolElement = NewElement("paramvol");
484 paramvolElement->setAttributeNode(
485 NewAttribute("ncopies", paramvol->GetMultiplicity()));
486 xercesc::DOMElement* volumerefElement = NewElement("volumeref");
487 volumerefElement->setAttributeNode(NewAttribute("ref", volumeref));
488
489 xercesc::DOMElement* algorithmElement =
490 NewElement("parameterised_position_size");
491 paramvolElement->appendChild(volumerefElement);
492 paramvolElement->appendChild(algorithmElement);
493 ParamvolAlgorithmWrite(algorithmElement, paramvol);
494 volumeElement->appendChild(paramvolElement);
495}
virtual void ParamvolAlgorithmWrite(xercesc::DOMElement *paramvolElement, const G4VPhysicalVolume *const paramvol)

Referenced by G4GDMLWriteStructure::TraverseVolumeTree().

◆ Polycone_dimensionsWrite()

void G4GDMLWriteParamvol::Polycone_dimensionsWrite ( xercesc::DOMElement *  parametersElement,
const G4Polycone * const  pcone 
)
protected

Definition at line 303 of file G4GDMLWriteParamvol.cc.

305{
306 xercesc::DOMElement* pcone_dimensionsElement =
307 NewElement("polycone_dimensions");
308
309 pcone_dimensionsElement->setAttributeNode(
311 pcone_dimensionsElement->setAttributeNode(NewAttribute(
312 "startPhi", pcone->GetOriginalParameters()->Start_angle / degree));
313 pcone_dimensionsElement->setAttributeNode(NewAttribute(
314 "openPhi", pcone->GetOriginalParameters()->Opening_angle / degree));
315 pcone_dimensionsElement->setAttributeNode(NewAttribute("aunit", "deg"));
316 pcone_dimensionsElement->setAttributeNode(NewAttribute("lunit", "mm"));
317
318 parametersElement->appendChild(pcone_dimensionsElement);
319 const size_t num_zplanes = pcone->GetOriginalParameters()->Num_z_planes;
320 const G4double* z_array = pcone->GetOriginalParameters()->Z_values;
321 const G4double* rmin_array = pcone->GetOriginalParameters()->Rmin;
322 const G4double* rmax_array = pcone->GetOriginalParameters()->Rmax;
323
324 for(std::size_t i = 0; i < num_zplanes; ++i)
325 {
326 ZplaneWrite(pcone_dimensionsElement, z_array[i], rmin_array[i],
327 rmax_array[i]);
328 }
329}
void ZplaneWrite(xercesc::DOMElement *, const G4double &, const G4double &, const G4double &)
G4PolyconeHistorical * GetOriginalParameters() const

Referenced by ParametersWrite().

◆ Polyhedra_dimensionsWrite()

void G4GDMLWriteParamvol::Polyhedra_dimensionsWrite ( xercesc::DOMElement *  parametersElement,
const G4Polyhedra * const  polyhedra 
)
protected

Definition at line 332 of file G4GDMLWriteParamvol.cc.

334{
335 xercesc::DOMElement* polyhedra_dimensionsElement =
336 NewElement("polyhedra_dimensions");
337
338 polyhedra_dimensionsElement->setAttributeNode(
339 NewAttribute("numRZ", polyhedra->GetOriginalParameters()->Num_z_planes));
340 polyhedra_dimensionsElement->setAttributeNode(
341 NewAttribute("numSide", polyhedra->GetOriginalParameters()->numSide));
342 polyhedra_dimensionsElement->setAttributeNode(NewAttribute(
343 "startPhi", polyhedra->GetOriginalParameters()->Start_angle / degree));
344 polyhedra_dimensionsElement->setAttributeNode(NewAttribute(
345 "openPhi", polyhedra->GetOriginalParameters()->Opening_angle / degree));
346 polyhedra_dimensionsElement->setAttributeNode(NewAttribute("aunit", "deg"));
347 polyhedra_dimensionsElement->setAttributeNode(NewAttribute("lunit", "mm"));
348
349 parametersElement->appendChild(polyhedra_dimensionsElement);
350 const size_t num_zplanes = polyhedra->GetOriginalParameters()->Num_z_planes;
351 const G4double* z_array = polyhedra->GetOriginalParameters()->Z_values;
352 const G4double* rmin_array = polyhedra->GetOriginalParameters()->Rmin;
353 const G4double* rmax_array = polyhedra->GetOriginalParameters()->Rmax;
354
355 for(std::size_t i = 0; i < num_zplanes; ++i)
356 {
357 ZplaneWrite(polyhedra_dimensionsElement, z_array[i], rmin_array[i],
358 rmax_array[i]);
359 }
360}
G4PolyhedraHistorical * GetOriginalParameters() const

Referenced by ParametersWrite().

◆ Sphere_dimensionsWrite()

void G4GDMLWriteParamvol::Sphere_dimensionsWrite ( xercesc::DOMElement *  parametersElement,
const G4Sphere * const  sphere 
)
protected

Definition at line 181 of file G4GDMLWriteParamvol.cc.

183{
184 xercesc::DOMElement* sphere_dimensionsElement =
185 NewElement("sphere_dimensions");
186 sphere_dimensionsElement->setAttributeNode(
187 NewAttribute("rmin", sphere->GetInnerRadius() / mm));
188 sphere_dimensionsElement->setAttributeNode(
189 NewAttribute("rmax", sphere->GetOuterRadius() / mm));
190 sphere_dimensionsElement->setAttributeNode(
191 NewAttribute("startphi", sphere->GetStartPhiAngle() / degree));
192 sphere_dimensionsElement->setAttributeNode(
193 NewAttribute("deltaphi", sphere->GetDeltaPhiAngle() / degree));
194 sphere_dimensionsElement->setAttributeNode(
195 NewAttribute("starttheta", sphere->GetStartThetaAngle() / degree));
196 sphere_dimensionsElement->setAttributeNode(
197 NewAttribute("deltatheta", sphere->GetDeltaThetaAngle() / degree));
198 sphere_dimensionsElement->setAttributeNode(NewAttribute("aunit", "deg"));
199 sphere_dimensionsElement->setAttributeNode(NewAttribute("lunit", "mm"));
200 parametersElement->appendChild(sphere_dimensionsElement);
201}
G4double GetStartPhiAngle() const
G4double GetDeltaPhiAngle() const
G4double GetInnerRadius() const
G4double GetOuterRadius() const
G4double GetDeltaThetaAngle() const
G4double GetStartThetaAngle() const

Referenced by ParametersWrite().

◆ Torus_dimensionsWrite()

void G4GDMLWriteParamvol::Torus_dimensionsWrite ( xercesc::DOMElement *  parametersElement,
const G4Torus * const  torus 
)
protected

Definition at line 215 of file G4GDMLWriteParamvol.cc.

217{
218 xercesc::DOMElement* torus_dimensionsElement = NewElement("torus_dimensions");
219 torus_dimensionsElement->setAttributeNode(
220 NewAttribute("rmin", torus->GetRmin() / mm));
221 torus_dimensionsElement->setAttributeNode(
222 NewAttribute("rmax", torus->GetRmax() / mm));
223 torus_dimensionsElement->setAttributeNode(
224 NewAttribute("rtor", torus->GetRtor() / mm));
225 torus_dimensionsElement->setAttributeNode(
226 NewAttribute("startphi", torus->GetSPhi() / degree));
227 torus_dimensionsElement->setAttributeNode(
228 NewAttribute("deltaphi", torus->GetDPhi() / degree));
229 torus_dimensionsElement->setAttributeNode(NewAttribute("aunit", "deg"));
230 torus_dimensionsElement->setAttributeNode(NewAttribute("lunit", "mm"));
231 parametersElement->appendChild(torus_dimensionsElement);
232}
G4double GetDPhi() const
G4double GetRmin() const
G4double GetRtor() const
G4double GetRmax() const
G4double GetSPhi() const

Referenced by ParametersWrite().

◆ Trap_dimensionsWrite()

void G4GDMLWriteParamvol::Trap_dimensionsWrite ( xercesc::DOMElement *  parametersElement,
const G4Trap * const  trap 
)
protected

Definition at line 99 of file G4GDMLWriteParamvol.cc.

101{
102 const G4ThreeVector simaxis = trap->GetSymAxis();
103 const G4double phi =
104 (simaxis.z() != 1.0) ? (std::atan(simaxis.y() / simaxis.x())) : (0.0);
105 const G4double theta = std::acos(simaxis.z());
106 const G4double alpha1 = std::atan(trap->GetTanAlpha1());
107 const G4double alpha2 = std::atan(trap->GetTanAlpha2());
108
109 xercesc::DOMElement* trap_dimensionsElement = NewElement("trap");
110 trap_dimensionsElement->setAttributeNode(
111 NewAttribute("z", 2.0 * trap->GetZHalfLength() / mm));
112 trap_dimensionsElement->setAttributeNode(
113 NewAttribute("theta", theta / degree));
114 trap_dimensionsElement->setAttributeNode(NewAttribute("phi", phi / degree));
115 trap_dimensionsElement->setAttributeNode(
116 NewAttribute("y1", 2.0 * trap->GetYHalfLength1() / mm));
117 trap_dimensionsElement->setAttributeNode(
118 NewAttribute("x1", 2.0 * trap->GetXHalfLength1() / mm));
119 trap_dimensionsElement->setAttributeNode(
120 NewAttribute("x2", 2.0 * trap->GetXHalfLength2() / mm));
121 trap_dimensionsElement->setAttributeNode(
122 NewAttribute("alpha1", alpha1 / degree));
123 trap_dimensionsElement->setAttributeNode(
124 NewAttribute("y2", 2.0 * trap->GetYHalfLength2() / mm));
125 trap_dimensionsElement->setAttributeNode(
126 NewAttribute("x3", 2.0 * trap->GetXHalfLength3() / mm));
127 trap_dimensionsElement->setAttributeNode(
128 NewAttribute("x4", 2.0 * trap->GetXHalfLength4() / mm));
129 trap_dimensionsElement->setAttributeNode(
130 NewAttribute("alpha2", alpha2 / degree));
131 trap_dimensionsElement->setAttributeNode(NewAttribute("aunit", "deg"));
132 trap_dimensionsElement->setAttributeNode(NewAttribute("lunit", "mm"));
133 parametersElement->appendChild(trap_dimensionsElement);
134}
const G4double alpha2
G4double GetYHalfLength1() const
G4double GetTanAlpha2() const
G4double GetXHalfLength2() const
G4ThreeVector GetSymAxis() const
G4double GetXHalfLength4() const
G4double GetZHalfLength() const
G4double GetYHalfLength2() const
G4double GetTanAlpha1() const
G4double GetXHalfLength3() const
G4double GetXHalfLength1() const

Referenced by ParametersWrite().

◆ Trd_dimensionsWrite()

void G4GDMLWriteParamvol::Trd_dimensionsWrite ( xercesc::DOMElement *  parametersElement,
const G4Trd * const  trd 
)
protected

Definition at line 80 of file G4GDMLWriteParamvol.cc.

82{
83 xercesc::DOMElement* trd_dimensionsElement = NewElement("trd_dimensions");
84 trd_dimensionsElement->setAttributeNode(
85 NewAttribute("x1", 2.0 * trd->GetXHalfLength1() / mm));
86 trd_dimensionsElement->setAttributeNode(
87 NewAttribute("x2", 2.0 * trd->GetXHalfLength2() / mm));
88 trd_dimensionsElement->setAttributeNode(
89 NewAttribute("y1", 2.0 * trd->GetYHalfLength1() / mm));
90 trd_dimensionsElement->setAttributeNode(
91 NewAttribute("y2", 2.0 * trd->GetYHalfLength2() / mm));
92 trd_dimensionsElement->setAttributeNode(
93 NewAttribute("z", 2.0 * trd->GetZHalfLength() / mm));
94 trd_dimensionsElement->setAttributeNode(NewAttribute("lunit", "mm"));
95 parametersElement->appendChild(trd_dimensionsElement);
96}
G4double GetXHalfLength2() const
G4double GetYHalfLength2() const
G4double GetXHalfLength1() const
G4double GetYHalfLength1() const
G4double GetZHalfLength() const

Referenced by ParametersWrite().

◆ Tube_dimensionsWrite()

void G4GDMLWriteParamvol::Tube_dimensionsWrite ( xercesc::DOMElement *  parametersElement,
const G4Tubs * const  tube 
)
protected

Definition at line 137 of file G4GDMLWriteParamvol.cc.

139{
140 xercesc::DOMElement* tube_dimensionsElement = NewElement("tube_dimensions");
141 tube_dimensionsElement->setAttributeNode(
142 NewAttribute("InR", tube->GetInnerRadius() / mm));
143 tube_dimensionsElement->setAttributeNode(
144 NewAttribute("OutR", tube->GetOuterRadius() / mm));
145 tube_dimensionsElement->setAttributeNode(
146 NewAttribute("hz", 2.0 * tube->GetZHalfLength() / mm));
147 tube_dimensionsElement->setAttributeNode(
148 NewAttribute("StartPhi", tube->GetStartPhiAngle() / degree));
149 tube_dimensionsElement->setAttributeNode(
150 NewAttribute("DeltaPhi", tube->GetDeltaPhiAngle() / degree));
151 tube_dimensionsElement->setAttributeNode(NewAttribute("aunit", "deg"));
152 tube_dimensionsElement->setAttributeNode(NewAttribute("lunit", "mm"));
153 parametersElement->appendChild(tube_dimensionsElement);
154}
G4double GetZHalfLength() const
G4double GetInnerRadius() const
G4double GetOuterRadius() const
G4double GetStartPhiAngle() const
G4double GetDeltaPhiAngle() const

Referenced by ParametersWrite().


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