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

Data Structures

struct  ByCpu
struct  ByMemory


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.

00053     : volume(theVolume),
00054       voxel(theVoxel),
00055       sysTime(theSysTime),
00056       userTime(theUserTime),
00057       heads(1),
00058       nodes(0),
00059       pointers(0)
00060 {
00061   CountHeadsAndNodes( voxel );
00062 }


Member Function Documentation

void G4SmartVoxelStat::CountHeadsAndNodes ( const G4SmartVoxelHeader head  )  [protected]

Definition at line 133 of file G4SmartVoxelStat.cc.

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

Referenced by G4SmartVoxelStat().

00134 {
00135   G4int numSlices = head->GetNoSlices();
00136   
00137   pointers += numSlices;
00138   
00139   const G4SmartVoxelProxy *lastProxy = 0;
00140   
00141   for(G4int i=0;i<numSlices;++i) {
00142     const G4SmartVoxelProxy *proxy = head->GetSlice(i);
00143     if (proxy == lastProxy) continue;
00144     
00145     lastProxy = proxy;
00146     
00147     if (proxy->IsNode()) {
00148       nodes++;
00149     }
00150     else {
00151       heads++;
00152       CountHeadsAndNodes(proxy->GetHeader());
00153     }
00154   }
00155 }

G4long G4SmartVoxelStat::GetMemoryUse (  )  const

Definition at line 112 of file G4SmartVoxelStat.cc.

References heads, nodes, and pointers.

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

00113 {
00114   static const G4long headSize = sizeof(G4SmartVoxelHeader)
00115                                + sizeof(G4SmartVoxelProxy);
00116 
00117   static const G4long nodeSize = sizeof(G4SmartVoxelNode)
00118                                + sizeof(G4SmartVoxelProxy);
00119 
00120   static const G4long pointerSize = sizeof(G4SmartVoxelProxy*);
00121   
00122   return nodes*nodeSize + heads*headSize + pointers*pointerSize;
00123 }

G4long G4SmartVoxelStat::GetNumberHeads (  )  const

Definition at line 93 of file G4SmartVoxelStat.cc.

References heads.

00094 {
00095   return heads;
00096 }

G4long G4SmartVoxelStat::GetNumberNodes (  )  const

Definition at line 98 of file G4SmartVoxelStat.cc.

References nodes.

00099 {
00100   return nodes;
00101 }

G4long G4SmartVoxelStat::GetNumberPointers (  )  const

Definition at line 103 of file G4SmartVoxelStat.cc.

References pointers.

00104 {
00105   return pointers;
00106 }

G4double G4SmartVoxelStat::GetSysTime (  )  const

Definition at line 78 of file G4SmartVoxelStat.cc.

References sysTime.

00079 {
00080   return sysTime;
00081 }

G4double G4SmartVoxelStat::GetTotalTime (  )  const

Definition at line 88 of file G4SmartVoxelStat.cc.

References sysTime, and userTime.

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

00089 {
00090   return sysTime + userTime;
00091 }

G4double G4SmartVoxelStat::GetUserTime (  )  const

Definition at line 83 of file G4SmartVoxelStat.cc.

References userTime.

00084 {
00085   return userTime;
00086 }

const G4LogicalVolume * G4SmartVoxelStat::GetVolume (  )  const

Definition at line 68 of file G4SmartVoxelStat.cc.

References volume.

00069 {
00070   return volume;
00071 }

const G4SmartVoxelHeader * G4SmartVoxelStat::GetVoxel (  )  const

Definition at line 73 of file G4SmartVoxelStat.cc.

References voxel.

00074 {
00075   return voxel;
00076 }


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:
Generated on Mon May 27 17:53:24 2013 for Geant4 by  doxygen 1.4.7