Geant4-11
Public Types | Public Member Functions | Private Attributes | Static Private Attributes
G4Mesh Class Reference

#include <G4Mesh.hh>

Public Types

enum  MeshType { invalid , rectangle , cylinder , sphere }
 

Public Member Functions

 G4Mesh (G4VPhysicalVolume *containerVolume, const G4Transform3D &)
 
G4VPhysicalVolumeGetContainerVolume () const
 
const std::map< G4int, G4String > & GetEnumMap () const
 
G4int GetMeshDepth () const
 
MeshType GetMeshType () const
 
const G4Transform3DGetTransform () const
 
virtual ~G4Mesh ()
 

Private Attributes

G4int fMeshDepth
 
MeshType fMeshType
 
G4VPhysicalVolumefpContainerVolume
 
G4Transform3D fTransform
 

Static Private Attributes

static std::map< G4int, G4StringfEnumMap
 

Detailed Description

Definition at line 46 of file G4Mesh.hh.

Member Enumeration Documentation

◆ MeshType

Enumerator
invalid 
rectangle 
cylinder 
sphere 

Definition at line 49 of file G4Mesh.hh.

50 {
51 invalid,
54 sphere
55 };
@ invalid
Definition: G4Mesh.hh:51
@ rectangle
Definition: G4Mesh.hh:52
@ sphere
Definition: G4Mesh.hh:54
@ cylinder
Definition: G4Mesh.hh:53

Constructor & Destructor Documentation

◆ G4Mesh()

G4Mesh::G4Mesh ( G4VPhysicalVolume containerVolume,
const G4Transform3D transform 
)

Definition at line 49 of file G4Mesh.cc.

50: fpContainerVolume(containerVolume)
52, fMeshDepth(0)
54{
55 if (fpContainerVolume == nullptr) return;
56
57 static G4bool first = true;
58 if (first) {
59 first = false;
60 fEnumMap[invalid] = "invalid";
61 fEnumMap[rectangle] = "rectangle";
62 fEnumMap[cylinder] = "cylinder";
63 fEnumMap[sphere] = "sphere";
64 }
65
67
68 // check if this is a container for a nested parameterisation
69 G4bool isContainer = false;
70 if (pLV->GetNoDaughters()) {
71 fMeshDepth++;
72 const auto d0 = pLV->GetDaughter(0);
73 const auto d0LV = d0->GetLogicalVolume();
74 if (d0LV->GetNoDaughters()) {
75 fMeshDepth++;
76 const auto d00 = d0LV->GetDaughter(0);
77 const auto pvParam00 = dynamic_cast<G4PVParameterised*>(d00);
78 if (pvParam00) {
79 const auto param00 = pvParam00->GetParameterisation();
80 const auto nestedParam00 = dynamic_cast<G4VNestedParameterisation*>(param00);
81 if (nestedParam00) { // 2-deep mesh
82 isContainer = true;
83 }
84 } else {
85 const auto d00LV = d00->GetLogicalVolume();
86 if (d00LV->GetNoDaughters()) {
87 fMeshDepth++;
88 const auto d000 = d00LV->GetDaughter(0);
89 const auto pvParam000 = dynamic_cast<G4PVParameterised*>(d000);
90 if (pvParam000) {
91 const auto param000 = pvParam000->GetParameterisation();
92 const auto nestedParam000 = dynamic_cast<G4VNestedParameterisation*>(param000);
93 if (nestedParam000) { // 3-deep mesh
94 isContainer = true;
95 }
96 }
97 }
98 }
99 }
100 }
101 if (isContainer) {
102 // Get type
103 G4VSolid* pSol = pLV -> GetSolid ();
104 if (dynamic_cast<G4Box*>(pSol)) {
106 } else if (dynamic_cast<G4Tubs*>(pSol)) {
108 } else if (dynamic_cast<G4Sphere*>(pSol)) {
110 }
111 }
112}
bool G4bool
Definition: G4Types.hh:86
Definition: G4Box.hh:56
size_t GetNoDaughters() const
G4VPhysicalVolume * GetDaughter(const G4int i) const
G4Transform3D fTransform
Definition: G4Mesh.hh:71
static std::map< G4int, G4String > fEnumMap
Definition: G4Mesh.hh:67
G4int fMeshDepth
Definition: G4Mesh.hh:70
MeshType fMeshType
Definition: G4Mesh.hh:69
G4VPhysicalVolume * fpContainerVolume
Definition: G4Mesh.hh:68
G4VPVParameterisation * GetParameterisation() const
Definition: G4Tubs.hh:75
G4LogicalVolume * GetLogicalVolume() const
G4bool transform(G4String &input, const G4String &type)

References cylinder, fEnumMap, fMeshDepth, fMeshType, fpContainerVolume, G4LogicalVolume::GetDaughter(), G4VPhysicalVolume::GetLogicalVolume(), G4LogicalVolume::GetNoDaughters(), G4PVParameterised::GetParameterisation(), invalid, rectangle, and sphere.

◆ ~G4Mesh()

G4Mesh::~G4Mesh ( )
virtual

Definition at line 114 of file G4Mesh.cc.

114{}

Member Function Documentation

◆ GetContainerVolume()

G4VPhysicalVolume * G4Mesh::GetContainerVolume ( ) const
inline

◆ GetEnumMap()

const std::map< G4int, G4String > & G4Mesh::GetEnumMap ( ) const
inline

Definition at line 60 of file G4Mesh.hh.

60{ return fEnumMap; }

References fEnumMap.

Referenced by operator<<().

◆ GetMeshDepth()

G4int G4Mesh::GetMeshDepth ( ) const
inline

◆ GetMeshType()

MeshType G4Mesh::GetMeshType ( ) const
inline

◆ GetTransform()

const G4Transform3D & G4Mesh::GetTransform ( ) const
inline

Field Documentation

◆ fEnumMap

std::map< G4int, G4String > G4Mesh::fEnumMap
staticprivate

Definition at line 67 of file G4Mesh.hh.

Referenced by G4Mesh(), and GetEnumMap().

◆ fMeshDepth

G4int G4Mesh::fMeshDepth
private

Definition at line 70 of file G4Mesh.hh.

Referenced by G4Mesh(), and GetMeshDepth().

◆ fMeshType

MeshType G4Mesh::fMeshType
private

Definition at line 69 of file G4Mesh.hh.

Referenced by G4Mesh(), and GetMeshType().

◆ fpContainerVolume

G4VPhysicalVolume* G4Mesh::fpContainerVolume
private

Definition at line 68 of file G4Mesh.hh.

Referenced by G4Mesh(), and GetContainerVolume().

◆ fTransform

G4Transform3D G4Mesh::fTransform
private

Definition at line 71 of file G4Mesh.hh.

Referenced by GetTransform().


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