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

#include <G4SmartVoxelStat.hh>

Classes

struct  ByCpu
 
struct  ByMemory
 

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
 
G4long nodes
 
G4long pointers
 

Detailed Description

Definition at line 50 of file G4SmartVoxelStat.hh.

Constructor & Destructor Documentation

◆ G4SmartVoxelStat()

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

Definition at line 49 of file G4SmartVoxelStat.cc.

53 : volume(theVolume),
54 voxel(theVoxel),
55 sysTime(theSysTime),
56 userTime(theUserTime),
57 heads(1),
58 nodes(0),
59 pointers(0)
60{
62}
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 133 of file G4SmartVoxelStat.cc.

134{
135 G4int numSlices = head->GetNoSlices();
136
137 pointers += numSlices;
138
139 const G4SmartVoxelProxy *lastProxy = 0;
140
141 for(G4int i=0;i<numSlices;++i) {
142 const G4SmartVoxelProxy *proxy = head->GetSlice(i);
143 if (proxy == lastProxy) continue;
144
145 lastProxy = proxy;
146
147 if (proxy->IsNode()) {
148 nodes++;
149 }
150 else {
151 heads++;
153 }
154 }
155}
int G4int
Definition: G4Types.hh:66
G4SmartVoxelProxy * GetSlice(G4int n) const
G4int GetNoSlices() const
G4bool IsNode() const
G4SmartVoxelHeader * GetHeader() const

Referenced by CountHeadsAndNodes(), and G4SmartVoxelStat().

◆ GetMemoryUse()

G4long G4SmartVoxelStat::GetMemoryUse ( ) const

Definition at line 112 of file G4SmartVoxelStat.cc.

113{
114 static const G4long headSize = sizeof(G4SmartVoxelHeader)
115 + sizeof(G4SmartVoxelProxy);
116
117 static const G4long nodeSize = sizeof(G4SmartVoxelNode)
118 + sizeof(G4SmartVoxelProxy);
119
120 static const G4long pointerSize = sizeof(G4SmartVoxelProxy*);
121
122 return nodes*nodeSize + heads*headSize + pointers*pointerSize;
123}
long G4long
Definition: G4Types.hh:68

Referenced by G4SmartVoxelStat::ByMemory::operator()().

◆ GetNumberHeads()

G4long G4SmartVoxelStat::GetNumberHeads ( ) const

Definition at line 93 of file G4SmartVoxelStat.cc.

94{
95 return heads;
96}

◆ GetNumberNodes()

G4long G4SmartVoxelStat::GetNumberNodes ( ) const

Definition at line 98 of file G4SmartVoxelStat.cc.

99{
100 return nodes;
101}

◆ GetNumberPointers()

G4long G4SmartVoxelStat::GetNumberPointers ( ) const

Definition at line 103 of file G4SmartVoxelStat.cc.

104{
105 return pointers;
106}

◆ GetSysTime()

G4double G4SmartVoxelStat::GetSysTime ( ) const

Definition at line 78 of file G4SmartVoxelStat.cc.

79{
80 return sysTime;
81}

◆ GetTotalTime()

G4double G4SmartVoxelStat::GetTotalTime ( ) const

Definition at line 88 of file G4SmartVoxelStat.cc.

89{
90 return sysTime + userTime;
91}

Referenced by G4SmartVoxelStat::ByCpu::operator()().

◆ GetUserTime()

G4double G4SmartVoxelStat::GetUserTime ( ) const

Definition at line 83 of file G4SmartVoxelStat.cc.

84{
85 return userTime;
86}

◆ GetVolume()

const G4LogicalVolume * G4SmartVoxelStat::GetVolume ( ) const

Definition at line 68 of file G4SmartVoxelStat.cc.

69{
70 return volume;
71}

◆ GetVoxel()

const G4SmartVoxelHeader * G4SmartVoxelStat::GetVoxel ( ) const

Definition at line 73 of file G4SmartVoxelStat.cc.

74{
75 return voxel;
76}

Member Data Documentation

◆ heads

G4long G4SmartVoxelStat::heads
protected

Definition at line 98 of file G4SmartVoxelStat.hh.

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

◆ nodes

G4long G4SmartVoxelStat::nodes
protected

Definition at line 99 of file G4SmartVoxelStat.hh.

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

◆ pointers

G4long G4SmartVoxelStat::pointers
protected

Definition at line 100 of file G4SmartVoxelStat.hh.

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

◆ sysTime

G4double G4SmartVoxelStat::sysTime
protected

Definition at line 95 of file G4SmartVoxelStat.hh.

Referenced by GetSysTime(), and GetTotalTime().

◆ userTime

G4double G4SmartVoxelStat::userTime
protected

Definition at line 96 of file G4SmartVoxelStat.hh.

Referenced by GetTotalTime(), and GetUserTime().

◆ volume

const G4LogicalVolume* G4SmartVoxelStat::volume
protected

Definition at line 92 of file G4SmartVoxelStat.hh.

Referenced by GetVolume().

◆ voxel

const G4SmartVoxelHeader* G4SmartVoxelStat::voxel
protected

Definition at line 93 of file G4SmartVoxelStat.hh.

Referenced by G4SmartVoxelStat(), and GetVoxel().


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