Geant4  10.03.p03
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
G4SmartVoxelStat Class Reference

#include <G4SmartVoxelStat.hh>

Collaboration diagram for G4SmartVoxelStat:

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 ( 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 }
const G4SmartVoxelHeader * voxel
const G4LogicalVolume * volume
void CountHeadsAndNodes(const G4SmartVoxelHeader *head)

Here is the call graph for this function:

Member Function Documentation

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++;
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

Here is the call graph for this function:

Here is the caller graph for this function:

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:80

Here is the caller graph for this function:

G4long G4SmartVoxelStat::GetNumberHeads ( ) const

Definition at line 93 of file G4SmartVoxelStat.cc.

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

Definition at line 98 of file G4SmartVoxelStat.cc.

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

Definition at line 103 of file G4SmartVoxelStat.cc.

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

Definition at line 78 of file G4SmartVoxelStat.cc.

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

Definition at line 88 of file G4SmartVoxelStat.cc.

89 {
90  return sysTime + userTime;
91 }

Here is the caller graph for this function:

G4double G4SmartVoxelStat::GetUserTime ( ) const

Definition at line 83 of file G4SmartVoxelStat.cc.

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

Definition at line 68 of file G4SmartVoxelStat.cc.

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

Definition at line 73 of file G4SmartVoxelStat.cc.

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

Member Data Documentation

G4long G4SmartVoxelStat::heads
protected

Definition at line 98 of file G4SmartVoxelStat.hh.

G4long G4SmartVoxelStat::nodes
protected

Definition at line 99 of file G4SmartVoxelStat.hh.

G4long G4SmartVoxelStat::pointers
protected

Definition at line 100 of file G4SmartVoxelStat.hh.

G4double G4SmartVoxelStat::sysTime
protected

Definition at line 95 of file G4SmartVoxelStat.hh.

G4double G4SmartVoxelStat::userTime
protected

Definition at line 96 of file G4SmartVoxelStat.hh.

const G4LogicalVolume* G4SmartVoxelStat::volume
protected

Definition at line 92 of file G4SmartVoxelStat.hh.

const G4SmartVoxelHeader* G4SmartVoxelStat::voxel
protected

Definition at line 93 of file G4SmartVoxelStat.hh.


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