Geant4 9.6.0
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)
 
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 AddExtension (xercesc::DOMElement *, const G4LogicalVolume *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 Para_dimensionsWrite (xercesc::DOMElement *, const G4Para *const)
 
void Hype_dimensionsWrite (xercesc::DOMElement *, const G4Hype *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 BooleanWrite (xercesc::DOMElement *, const G4BooleanSolid *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 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 OpticalSurfaceWrite (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 G4PhysicsOrderedFreeVector *const)
 
- 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 ()
 
G4String GenerateName (const G4String &, const void *const)
 
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)
 
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
 
- Protected Attributes inherited from G4GDMLWriteMaterials
std::vector< const G4Isotope * > isotopeList
 
std::vector< const G4Element * > elementList
 
std::vector< const G4Material * > materialList
 
xercesc::DOMElement * materialsElement
 
- Protected Attributes inherited from G4GDMLWriteDefine
xercesc::DOMElement * defineElement
 
- Protected Attributes inherited from G4GDMLWrite
G4String SchemaLocation
 
xercesc::DOMDocument * doc
 
xercesc::DOMElement * extElement
 
XMLCh tempStr [10000]
 
- 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 57 of file G4GDMLWriteParamvol.hh.

Constructor & Destructor Documentation

◆ G4GDMLWriteParamvol()

G4GDMLWriteParamvol::G4GDMLWriteParamvol ( )
protected

Definition at line 53 of file G4GDMLWriteParamvol.cc.

55{
56}

◆ ~G4GDMLWriteParamvol()

G4GDMLWriteParamvol::~G4GDMLWriteParamvol ( )
protectedvirtual

Definition at line 58 of file G4GDMLWriteParamvol.cc.

60{
61}

Member Function Documentation

◆ Box_dimensionsWrite()

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

Definition at line 63 of file G4GDMLWriteParamvol.cc.

66{
67 xercesc::DOMElement* box_dimensionsElement = NewElement("box_dimensions");
68 box_dimensionsElement->
69 setAttributeNode(NewAttribute("x",2.0*box->GetXHalfLength()/mm));
70 box_dimensionsElement->
71 setAttributeNode(NewAttribute("y",2.0*box->GetYHalfLength()/mm));
72 box_dimensionsElement->
73 setAttributeNode(NewAttribute("z",2.0*box->GetZHalfLength()/mm));
74 box_dimensionsElement->
75 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:127
xercesc::DOMAttr * NewAttribute(const G4String &, const G4String &)
Definition: G4GDMLWrite.cc:103

Referenced by ParametersWrite().

◆ Cone_dimensionsWrite()

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

Definition at line 163 of file G4GDMLWriteParamvol.cc.

166{
167 xercesc::DOMElement* cone_dimensionsElement = NewElement("cone_dimensions");
168 cone_dimensionsElement->
169 setAttributeNode(NewAttribute("rmin1",cone->GetInnerRadiusMinusZ()/mm));
170 cone_dimensionsElement->
171 setAttributeNode(NewAttribute("rmax1",cone->GetOuterRadiusMinusZ()/mm));
172 cone_dimensionsElement->
173 setAttributeNode(NewAttribute("rmin2",cone->GetInnerRadiusPlusZ()/mm));
174 cone_dimensionsElement->
175 setAttributeNode(NewAttribute("rmax2",cone->GetOuterRadiusPlusZ()/mm));
176 cone_dimensionsElement->
177 setAttributeNode(NewAttribute("z",2.0*cone->GetZHalfLength()/mm));
178 cone_dimensionsElement->
179 setAttributeNode(NewAttribute("startphi",cone->GetStartPhiAngle()/degree));
180 cone_dimensionsElement->
181 setAttributeNode(NewAttribute("deltaphi",cone->GetDeltaPhiAngle()/degree));
182 cone_dimensionsElement->
183 setAttributeNode(NewAttribute("aunit","deg"));
184 cone_dimensionsElement->
185 setAttributeNode(NewAttribute("lunit","mm"));
186 parametersElement->appendChild(cone_dimensionsElement);
187}
G4double GetOuterRadiusPlusZ() const
G4double GetStartPhiAngle() const
G4double GetDeltaPhiAngle() const
G4double GetInnerRadiusMinusZ() const
G4double GetInnerRadiusPlusZ() const
G4double GetOuterRadiusMinusZ() const
G4double GetZHalfLength() const

Referenced by ParametersWrite().

◆ Hype_dimensionsWrite()

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

Definition at line 276 of file G4GDMLWriteParamvol.cc.

279{
280 xercesc::DOMElement* hype_dimensionsElement = NewElement("hype_dimensions");
281 hype_dimensionsElement->
282 setAttributeNode(NewAttribute("rmin",hype->GetInnerRadius()/mm));
283 hype_dimensionsElement->
284 setAttributeNode(NewAttribute("rmax",hype->GetOuterRadius()/mm));
285 hype_dimensionsElement->
286 setAttributeNode(NewAttribute("inst",hype->GetInnerStereo()/degree));
287 hype_dimensionsElement->
288 setAttributeNode(NewAttribute("outst",hype->GetOuterStereo()/degree));
289 hype_dimensionsElement->
290 setAttributeNode(NewAttribute("z",2.0*hype->GetZHalfLength()/mm));
291 hype_dimensionsElement->
292 setAttributeNode(NewAttribute("aunit","deg"));
293 hype_dimensionsElement->
294 setAttributeNode(NewAttribute("lunit","mm"));
295 parametersElement->appendChild(hype_dimensionsElement);
296}
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 212 of file G4GDMLWriteParamvol.cc.

215{
216 xercesc::DOMElement* orb_dimensionsElement = NewElement("orb_dimensions");
217 orb_dimensionsElement->setAttributeNode(NewAttribute("r",
218 orb->GetRadius()/mm));
219 orb_dimensionsElement->setAttributeNode(NewAttribute("lunit","mm"));
220 parametersElement->appendChild(orb_dimensionsElement);
221}
G4double GetRadius() const

Referenced by ParametersWrite().

◆ Para_dimensionsWrite()

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

Definition at line 246 of file G4GDMLWriteParamvol.cc.

249{
250 const G4ThreeVector simaxis = para->GetSymAxis();
251 const G4double alpha = std::atan(para->GetTanAlpha());
252 const G4double theta = std::acos(simaxis.z());
253 const G4double phi = (simaxis.z() != 1.0)
254 ? (std::atan(simaxis.y()/simaxis.x())) : (0.0);
255
256 xercesc::DOMElement* para_dimensionsElement = NewElement("para_dimensions");
257 para_dimensionsElement->
258 setAttributeNode(NewAttribute("x",2.0*para->GetXHalfLength()/mm));
259 para_dimensionsElement->
260 setAttributeNode(NewAttribute("y",2.0*para->GetYHalfLength()/mm));
261 para_dimensionsElement->
262 setAttributeNode(NewAttribute("z",2.0*para->GetZHalfLength()/mm));
263 para_dimensionsElement->
264 setAttributeNode(NewAttribute("alpha",alpha/degree));
265 para_dimensionsElement->
266 setAttributeNode(NewAttribute("theta",theta/degree));
267 para_dimensionsElement->
268 setAttributeNode(NewAttribute("phi",phi/degree));
269 para_dimensionsElement->
270 setAttributeNode(NewAttribute("aunit","deg"));
271 para_dimensionsElement->
272 setAttributeNode(NewAttribute("lunit","mm"));
273 parametersElement->appendChild(para_dimensionsElement);
274}
double G4double
Definition: G4Types.hh:64
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 298 of file G4GDMLWriteParamvol.cc.

301{
302 paramvol->GetParameterisation()
303 ->ComputeTransformation(index, const_cast<G4VPhysicalVolume*>(paramvol));
304 G4ThreeVector Angles;
305 G4String name = GenerateName(paramvol->GetName(),paramvol);
306 std::stringstream os;
307 os.precision(15);
308 os << index;
309 G4String sncopie = os.str();
310
311 xercesc::DOMElement* parametersElement = NewElement("parameters");
312 parametersElement->setAttributeNode(NewAttribute("number",index+1));
313
314 PositionWrite(parametersElement, name+sncopie+"_pos",
315 paramvol->GetObjectTranslation());
316 Angles=GetAngles(paramvol->GetObjectRotationValue());
317 if (Angles.mag2()>DBL_EPSILON)
318 {
319 RotationWrite(parametersElement, name+sncopie+"_rot",
320 GetAngles(paramvol->GetObjectRotationValue()));
321 }
322 paramvolElement->appendChild(parametersElement);
323
324 G4VSolid* solid = paramvol->GetLogicalVolume()->GetSolid();
325
326 if (G4Box* box = dynamic_cast<G4Box*>(solid))
327 {
328 paramvol->GetParameterisation()->ComputeDimensions(*box,index,
329 const_cast<G4VPhysicalVolume*>(paramvol));
330 Box_dimensionsWrite(parametersElement,box);
331 } else
332 if (G4Trd* trd = dynamic_cast<G4Trd*>(solid))
333 {
334 paramvol->GetParameterisation()->ComputeDimensions(*trd,index,
335 const_cast<G4VPhysicalVolume*>(paramvol));
336 Trd_dimensionsWrite(parametersElement,trd);
337 } else
338 if (G4Trap* trap = dynamic_cast<G4Trap*>(solid))
339 {
340 paramvol->GetParameterisation()->ComputeDimensions(*trap,index,
341 const_cast<G4VPhysicalVolume*>(paramvol));
342 Trap_dimensionsWrite(parametersElement,trap);
343 } else
344 if (G4Tubs* tube = dynamic_cast<G4Tubs*>(solid))
345 {
346 paramvol->GetParameterisation()->ComputeDimensions(*tube,index,
347 const_cast<G4VPhysicalVolume*>(paramvol));
348 Tube_dimensionsWrite(parametersElement,tube);
349 } else
350 if (G4Cons* cone = dynamic_cast<G4Cons*>(solid))
351 {
352 paramvol->GetParameterisation()->ComputeDimensions(*cone,index,
353 const_cast<G4VPhysicalVolume*>(paramvol));
354 Cone_dimensionsWrite(parametersElement,cone);
355 } else
356 if (G4Sphere* sphere = dynamic_cast<G4Sphere*>(solid))
357 {
358 paramvol->GetParameterisation()->ComputeDimensions(*sphere,index,
359 const_cast<G4VPhysicalVolume*>(paramvol));
360 Sphere_dimensionsWrite(parametersElement,sphere);
361 } else
362 if (G4Orb* orb = dynamic_cast<G4Orb*>(solid))
363 {
364 paramvol->GetParameterisation()->ComputeDimensions(*orb,index,
365 const_cast<G4VPhysicalVolume*>(paramvol));
366 Orb_dimensionsWrite(parametersElement,orb);
367 } else
368 if (G4Torus* torus = dynamic_cast<G4Torus*>(solid))
369 {
370 paramvol->GetParameterisation()->ComputeDimensions(*torus,index,
371 const_cast<G4VPhysicalVolume*>(paramvol));
372 Torus_dimensionsWrite(parametersElement,torus);
373 } else
374 if (G4Para* para = dynamic_cast<G4Para*>(solid))
375 {
376 paramvol->GetParameterisation()->ComputeDimensions(*para,index,
377 const_cast<G4VPhysicalVolume*>(paramvol));
378 Para_dimensionsWrite(parametersElement,para);
379 } else
380 if (G4Hype* hype = dynamic_cast<G4Hype*>(solid))
381 {
382 paramvol->GetParameterisation()->ComputeDimensions(*hype,index,
383 const_cast<G4VPhysicalVolume*>(paramvol));
384 Hype_dimensionsWrite(parametersElement,hype);
385 }
386 else
387 {
388 G4String error_msg = "Solid '" + solid->GetName()
389 + "' cannot be used in parameterised volume!";
390 G4Exception("G4GDMLWriteParamvol::ParametersWrite()",
391 "InvalidSetup", FatalException, error_msg);
392 }
393}
@ FatalException
double mag2() const
Definition: G4Box.hh:55
Definition: G4Cons.hh:75
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 Hype_dimensionsWrite(xercesc::DOMElement *, const G4Hype *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:90
Definition: G4Hype.hh:67
G4VSolid * GetSolid() const
Definition: G4Orb.hh:52
Definition: G4Para.hh:77
Definition: G4Trd.hh:63
Definition: G4Tubs.hh:77
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
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)
Definition: G4Exception.cc:41
#define DBL_EPSILON
Definition: templates.hh:87

Referenced by ParamvolAlgorithmWrite().

◆ ParamvolAlgorithmWrite()

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

Definition at line 416 of file G4GDMLWriteParamvol.cc.

419{
420 const G4String volumeref =
422 paramvol->GetLogicalVolume());
423
424 const G4int parameterCount = paramvol->GetMultiplicity();
425
426 for (G4int i=0; i<parameterCount; i++)
427 {
428 ParametersWrite(paramvolElement,paramvol,i);
429 }
430}
int G4int
Definition: G4Types.hh:66
void ParametersWrite(xercesc::DOMElement *, const G4VPhysicalVolume *const, const G4int &)
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 395 of file G4GDMLWriteParamvol.cc.

398{
399 const G4String volumeref =
401 paramvol->GetLogicalVolume());
402 xercesc::DOMElement* paramvolElement = NewElement("paramvol");
403 paramvolElement->setAttributeNode(NewAttribute("ncopies",
404 paramvol->GetMultiplicity()));
405 xercesc::DOMElement* volumerefElement = NewElement("volumeref");
406 volumerefElement->setAttributeNode(NewAttribute("ref",volumeref));
407
408 xercesc::DOMElement* algorithmElement =
409 NewElement("parameterised_position_size");
410 paramvolElement->appendChild(volumerefElement);
411 paramvolElement->appendChild(algorithmElement);
412 ParamvolAlgorithmWrite(algorithmElement,paramvol);
413 volumeElement->appendChild(paramvolElement);
414}
virtual void ParamvolAlgorithmWrite(xercesc::DOMElement *paramvolElement, const G4VPhysicalVolume *const paramvol)

Referenced by G4GDMLWriteStructure::TraverseVolumeTree().

◆ Sphere_dimensionsWrite()

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

Definition at line 189 of file G4GDMLWriteParamvol.cc.

192{
193 xercesc::DOMElement* sphere_dimensionsElement =
194 NewElement("sphere_dimensions");
195 sphere_dimensionsElement->setAttributeNode(NewAttribute("rmin",
196 sphere->GetInsideRadius()/mm));
197 sphere_dimensionsElement->setAttributeNode(NewAttribute("rmax",
198 sphere->GetOuterRadius()/mm));
199 sphere_dimensionsElement->setAttributeNode(NewAttribute("startphi",
200 sphere->GetStartPhiAngle()/degree));
201 sphere_dimensionsElement->setAttributeNode(NewAttribute("deltaphi",
202 sphere->GetDeltaPhiAngle()/degree));
203 sphere_dimensionsElement->setAttributeNode(NewAttribute("starttheta",
204 sphere->GetStartThetaAngle()/degree));
205 sphere_dimensionsElement->setAttributeNode(NewAttribute("deltatheta",
206 sphere->GetDeltaThetaAngle()/degree));
207 sphere_dimensionsElement->setAttributeNode(NewAttribute("aunit","deg"));
208 sphere_dimensionsElement->setAttributeNode(NewAttribute("lunit","mm"));
209 parametersElement->appendChild(sphere_dimensionsElement);
210}
G4double GetStartPhiAngle() const
G4double GetDeltaPhiAngle() const
G4double GetOuterRadius() const
G4double GetDeltaThetaAngle() const
G4double GetStartThetaAngle() const
G4double GetInsideRadius() const

Referenced by ParametersWrite().

◆ Torus_dimensionsWrite()

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

Definition at line 223 of file G4GDMLWriteParamvol.cc.

226{
227 xercesc::DOMElement* torus_dimensionsElement =
228 NewElement("torus_dimensions");
229 torus_dimensionsElement->
230 setAttributeNode(NewAttribute("rmin",torus->GetRmin()/mm));
231 torus_dimensionsElement->
232 setAttributeNode(NewAttribute("rmax",torus->GetRmax()/mm));
233 torus_dimensionsElement->
234 setAttributeNode(NewAttribute("rtor",torus->GetRtor()/mm));
235 torus_dimensionsElement->
236 setAttributeNode(NewAttribute("startphi",torus->GetSPhi()/degree));
237 torus_dimensionsElement->
238 setAttributeNode(NewAttribute("deltaphi",torus->GetDPhi()/degree));
239 torus_dimensionsElement->
240 setAttributeNode(NewAttribute("aunit","deg"));
241 torus_dimensionsElement->
242 setAttributeNode(NewAttribute("lunit","mm"));
243 parametersElement->appendChild(torus_dimensionsElement);
244}
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.

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

82{
83 xercesc::DOMElement* trd_dimensionsElement = NewElement("trd_dimensions");
84 trd_dimensionsElement->
85 setAttributeNode(NewAttribute("x1",2.0*trd->GetXHalfLength1()/mm));
86 trd_dimensionsElement->
87 setAttributeNode(NewAttribute("x2",2.0*trd->GetXHalfLength2()/mm));
88 trd_dimensionsElement->
89 setAttributeNode(NewAttribute("y1",2.0*trd->GetYHalfLength1()/mm));
90 trd_dimensionsElement->
91 setAttributeNode(NewAttribute("y2",2.0*trd->GetYHalfLength2()/mm));
92 trd_dimensionsElement->
93 setAttributeNode(NewAttribute("z",2.0*trd->GetZHalfLength()/mm));
94 trd_dimensionsElement->
95 setAttributeNode(NewAttribute("lunit","mm"));
96 parametersElement->appendChild(trd_dimensionsElement);
97}
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 140 of file G4GDMLWriteParamvol.cc.

143{
144 xercesc::DOMElement* tube_dimensionsElement = NewElement("tube_dimensions");
145 tube_dimensionsElement->
146 setAttributeNode(NewAttribute("InR",tube->GetInnerRadius()/mm));
147 tube_dimensionsElement->
148 setAttributeNode(NewAttribute("OutR",tube->GetOuterRadius()/mm));
149 tube_dimensionsElement->
150 setAttributeNode(NewAttribute("hz",2.0*tube->GetZHalfLength()/mm));
151 tube_dimensionsElement->
152 setAttributeNode(NewAttribute("StartPhi",tube->GetStartPhiAngle()/degree));
153 tube_dimensionsElement->
154 setAttributeNode(NewAttribute("DeltaPhi",tube->GetDeltaPhiAngle()/degree));
155 tube_dimensionsElement->
156 setAttributeNode(NewAttribute("aunit","deg"));
157 tube_dimensionsElement->
158 setAttributeNode(NewAttribute("lunit","mm"));
159 parametersElement->appendChild(tube_dimensionsElement);
160}
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: