Geant4.10
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Data Structures | Public Member Functions | Protected Member Functions | Protected Attributes
G4SmartVoxelStat Class Reference

#include <G4SmartVoxelStat.hh>

Data Structures

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 ( const G4LogicalVolume theVolume,
const G4SmartVoxelHeader theVoxel,
G4double  theSysTime,
G4double  theUserTime 
)

Definition at line 49 of file G4SmartVoxelStat.cc.

References CountHeadsAndNodes(), and voxel.

53  : volume(theVolume),
54  voxel(theVoxel),
55  sysTime(theSysTime),
56  userTime(theUserTime),
57  heads(1),
58  nodes(0),
59  pointers(0)
60 {
62 }
const G4SmartVoxelHeader * voxel
const G4LogicalVolume * volume
void CountHeadsAndNodes(const G4SmartVoxelHeader *head)

Member Function Documentation

void G4SmartVoxelStat::CountHeadsAndNodes ( const G4SmartVoxelHeader head)
protected

Definition at line 133 of file G4SmartVoxelStat.cc.

References G4SmartVoxelProxy::GetHeader(), G4SmartVoxelHeader::GetNoSlices(), G4SmartVoxelHeader::GetSlice(), heads, G4SmartVoxelProxy::IsNode(), nodes, and pointers.

Referenced by G4SmartVoxelStat().

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++;
152  CountHeadsAndNodes(proxy->GetHeader());
153  }
154  }
155 }
G4SmartVoxelHeader * GetHeader() const
int G4int
Definition: G4Types.hh:78
G4bool IsNode() const
G4int GetNoSlices() const
void CountHeadsAndNodes(const G4SmartVoxelHeader *head)
G4SmartVoxelProxy * GetSlice(G4int n) const
G4long G4SmartVoxelStat::GetMemoryUse ( ) const

Definition at line 112 of file G4SmartVoxelStat.cc.

References heads, nodes, and pointers.

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

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:80
G4long G4SmartVoxelStat::GetNumberHeads ( ) const

Definition at line 93 of file G4SmartVoxelStat.cc.

References heads.

94 {
95  return heads;
96 }
G4long G4SmartVoxelStat::GetNumberNodes ( ) const

Definition at line 98 of file G4SmartVoxelStat.cc.

References nodes.

99 {
100  return nodes;
101 }
G4long G4SmartVoxelStat::GetNumberPointers ( ) const

Definition at line 103 of file G4SmartVoxelStat.cc.

References pointers.

104 {
105  return pointers;
106 }
G4double G4SmartVoxelStat::GetSysTime ( ) const

Definition at line 78 of file G4SmartVoxelStat.cc.

References sysTime.

79 {
80  return sysTime;
81 }
G4double G4SmartVoxelStat::GetTotalTime ( ) const

Definition at line 88 of file G4SmartVoxelStat.cc.

References sysTime, and userTime.

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

89 {
90  return sysTime + userTime;
91 }
G4double G4SmartVoxelStat::GetUserTime ( ) const

Definition at line 83 of file G4SmartVoxelStat.cc.

References userTime.

84 {
85  return userTime;
86 }
const G4LogicalVolume * G4SmartVoxelStat::GetVolume ( ) const

Definition at line 68 of file G4SmartVoxelStat.cc.

References volume.

69 {
70  return volume;
71 }
const G4LogicalVolume * volume
const G4SmartVoxelHeader * G4SmartVoxelStat::GetVoxel ( ) const

Definition at line 73 of file G4SmartVoxelStat.cc.

References voxel.

74 {
75  return voxel;
76 }
const G4SmartVoxelHeader * voxel

Field Documentation

G4long G4SmartVoxelStat::heads
protected

Definition at line 98 of file G4SmartVoxelStat.hh.

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

G4long G4SmartVoxelStat::nodes
protected

Definition at line 99 of file G4SmartVoxelStat.hh.

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

G4long G4SmartVoxelStat::pointers
protected

Definition at line 100 of file G4SmartVoxelStat.hh.

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

G4double G4SmartVoxelStat::sysTime
protected

Definition at line 95 of file G4SmartVoxelStat.hh.

Referenced by GetSysTime(), and GetTotalTime().

G4double G4SmartVoxelStat::userTime
protected

Definition at line 96 of file G4SmartVoxelStat.hh.

Referenced by GetTotalTime(), and GetUserTime().

const G4LogicalVolume* G4SmartVoxelStat::volume
protected

Definition at line 92 of file G4SmartVoxelStat.hh.

Referenced by GetVolume().

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: