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

#include <G4SmartVoxelStat.hh>

Public Member Functions

 G4SmartVoxelStat (const G4LogicalVolume *theVolume, const G4SmartVoxelHeader *theVoxel, G4double theSysTime, G4double theUserTime)
 
const G4LogicalVolumeGetVolume () const
 
const G4SmartVoxelHeaderGetVoxel () const
 
G4double GetSysTime () const
 
G4double GetUserTime () const
 
G4double GetTotalTime () const
 
G4long GetNumberHeads () const
 
G4long GetNumberNodes () const
 
G4long GetNumberPointers () const
 
G4long GetMemoryUse () const
 

Protected Member Functions

void CountHeadsAndNodes (const G4SmartVoxelHeader *head)
 

Protected Attributes

const G4LogicalVolumevolume
 
const G4SmartVoxelHeadervoxel
 
G4double sysTime
 
G4double userTime
 
G4long heads = 1
 
G4long nodes = 0
 
G4long pointers = 0
 

Detailed Description

Definition at line 43 of file G4SmartVoxelStat.hh.

Constructor & Destructor Documentation

◆ G4SmartVoxelStat()

G4SmartVoxelStat::G4SmartVoxelStat ( const G4LogicalVolume * theVolume,
const G4SmartVoxelHeader * theVoxel,
G4double theSysTime,
G4double theUserTime )

Definition at line 42 of file G4SmartVoxelStat.cc.

46 : volume(theVolume),
47 voxel(theVoxel),
48 sysTime(theSysTime),
49 userTime(theUserTime)
50{
52}
void CountHeadsAndNodes(const G4SmartVoxelHeader *head)
const G4SmartVoxelHeader * voxel
const G4LogicalVolume * volume

Member Function Documentation

◆ CountHeadsAndNodes()

void G4SmartVoxelStat::CountHeadsAndNodes ( const G4SmartVoxelHeader * head)
protected

Definition at line 119 of file G4SmartVoxelStat.cc.

120{
121 std::size_t numSlices = head->GetNoSlices();
122
123 pointers += numSlices;
124
125 const G4SmartVoxelProxy* lastProxy = nullptr;
126
127 for(std::size_t i=0; i<numSlices; ++i)
128 {
129 const G4SmartVoxelProxy *proxy = head->GetSlice(i);
130 if (proxy == lastProxy) continue;
131
132 lastProxy = proxy;
133
134 if (proxy->IsNode())
135 {
136 ++nodes;
137 }
138 else
139 {
140 ++heads;
142 }
143 }
144}
std::size_t GetNoSlices() const
G4SmartVoxelProxy * GetSlice(std::size_t n) const
G4bool IsNode() const
G4SmartVoxelHeader * GetHeader() const

Referenced by CountHeadsAndNodes(), and G4SmartVoxelStat().

◆ GetMemoryUse()

G4long G4SmartVoxelStat::GetMemoryUse ( ) const

Definition at line 100 of file G4SmartVoxelStat.cc.

101{
102 static const G4long headSize = sizeof(G4SmartVoxelHeader)
103 + sizeof(G4SmartVoxelProxy);
104
105 static const G4long nodeSize = sizeof(G4SmartVoxelNode)
106 + sizeof(G4SmartVoxelProxy);
107
108 static const G4long pointerSize = sizeof(G4SmartVoxelProxy*);
109
110 return nodes*nodeSize + heads*headSize + pointers*pointerSize;
111}
long G4long
Definition G4Types.hh:87

Referenced by G4RunManager::ReOptimize().

◆ GetNumberHeads()

G4long G4SmartVoxelStat::GetNumberHeads ( ) const

Definition at line 82 of file G4SmartVoxelStat.cc.

83{
84 return heads;
85}

Referenced by G4RunManager::ReOptimize().

◆ GetNumberNodes()

G4long G4SmartVoxelStat::GetNumberNodes ( ) const

Definition at line 87 of file G4SmartVoxelStat.cc.

88{
89 return nodes;
90}

Referenced by G4RunManager::ReOptimize().

◆ GetNumberPointers()

G4long G4SmartVoxelStat::GetNumberPointers ( ) const

Definition at line 92 of file G4SmartVoxelStat.cc.

93{
94 return pointers;
95}

Referenced by G4RunManager::ReOptimize().

◆ GetSysTime()

G4double G4SmartVoxelStat::GetSysTime ( ) const

Definition at line 67 of file G4SmartVoxelStat.cc.

68{
69 return sysTime;
70}

Referenced by G4RunManager::ReOptimize().

◆ GetTotalTime()

G4double G4SmartVoxelStat::GetTotalTime ( ) const

Definition at line 77 of file G4SmartVoxelStat.cc.

78{
79 return sysTime + userTime;
80}

Referenced by G4RunManager::ReOptimize().

◆ GetUserTime()

G4double G4SmartVoxelStat::GetUserTime ( ) const

Definition at line 72 of file G4SmartVoxelStat.cc.

73{
74 return userTime;
75}

◆ GetVolume()

const G4LogicalVolume * G4SmartVoxelStat::GetVolume ( ) const

Definition at line 57 of file G4SmartVoxelStat.cc.

58{
59 return volume;
60}

◆ GetVoxel()

const G4SmartVoxelHeader * G4SmartVoxelStat::GetVoxel ( ) const

Definition at line 62 of file G4SmartVoxelStat.cc.

63{
64 return voxel;
65}

Member Data Documentation

◆ heads

G4long G4SmartVoxelStat::heads = 1
protected

Definition at line 91 of file G4SmartVoxelStat.hh.

Referenced by CountHeadsAndNodes(), GetMemoryUse(), and GetNumberHeads().

◆ nodes

G4long G4SmartVoxelStat::nodes = 0
protected

Definition at line 92 of file G4SmartVoxelStat.hh.

Referenced by CountHeadsAndNodes(), GetMemoryUse(), and GetNumberNodes().

◆ pointers

G4long G4SmartVoxelStat::pointers = 0
protected

Definition at line 93 of file G4SmartVoxelStat.hh.

Referenced by CountHeadsAndNodes(), GetMemoryUse(), and GetNumberPointers().

◆ sysTime

G4double G4SmartVoxelStat::sysTime
protected

Definition at line 88 of file G4SmartVoxelStat.hh.

Referenced by GetSysTime(), and GetTotalTime().

◆ userTime

G4double G4SmartVoxelStat::userTime
protected

Definition at line 89 of file G4SmartVoxelStat.hh.

Referenced by GetTotalTime(), and GetUserTime().

◆ volume

const G4LogicalVolume* G4SmartVoxelStat::volume
protected

Definition at line 85 of file G4SmartVoxelStat.hh.

Referenced by GetVolume().

◆ voxel

const G4SmartVoxelHeader* G4SmartVoxelStat::voxel
protected

Definition at line 86 of file G4SmartVoxelStat.hh.

Referenced by G4SmartVoxelStat(), and GetVoxel().


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