Geant4-11
Public Member Functions | Private Attributes
G4TrackStack Class Reference

#include <G4TrackStack.hh>

Inheritance diagram for G4TrackStack:

Public Member Functions

void clearAndDestroy ()
 
 G4TrackStack ()
 
 G4TrackStack (std::size_t n)
 
std::size_t GetMaxNTrack () const
 
G4int GetNStick () const
 
std::size_t GetNTrack () const
 
G4int GetSafetyValue1 () const
 
G4int GetSafetyValue2 () const
 
G4double getTotalEnergy (void) const
 
G4bool operator!= (const G4TrackStack &) const =delete
 
G4TrackStackoperator= (const G4TrackStack &)=delete
 
G4bool operator== (const G4TrackStack &) const =delete
 
G4StackedTrack PopFromStack ()
 
void PushToStack (const G4StackedTrack &aStackedTrack)
 
void SetSafetyValue2 (G4int x)
 
void TransferTo (G4SmartTrackStack *aStack)
 
void TransferTo (G4TrackStack *aStack)
 
 ~G4TrackStack ()
 

Private Attributes

G4int nstick
 
G4int safetyValue1
 
G4int safetyValue2
 

Detailed Description

Definition at line 44 of file G4TrackStack.hh.

Constructor & Destructor Documentation

◆ G4TrackStack() [1/2]

G4TrackStack::G4TrackStack ( )
inline

Definition at line 48 of file G4TrackStack.hh.

49 : safetyValue1(0), safetyValue2(0), nstick(0) {}
G4int safetyValue2
Definition: G4TrackStack.hh:80
G4int safetyValue1
Definition: G4TrackStack.hh:79

◆ G4TrackStack() [2/2]

G4TrackStack::G4TrackStack ( std::size_t  n)
inline

Definition at line 50 of file G4TrackStack.hh.

51 : safetyValue1(G4int(4*n/5)),
52 safetyValue2(G4int(4*n/5-100)), nstick(100) { reserve(n); }
int G4int
Definition: G4Types.hh:85

References CLHEP::detail::n.

◆ ~G4TrackStack()

G4TrackStack::~G4TrackStack ( )

Definition at line 36 of file G4TrackStack.cc.

37{
39}
void clearAndDestroy()
Definition: G4TrackStack.cc:41

References clearAndDestroy().

Member Function Documentation

◆ clearAndDestroy()

void G4TrackStack::clearAndDestroy ( )

Definition at line 41 of file G4TrackStack.cc.

42{
43 for( auto i = begin(); i != end(); ++i )
44 {
45 delete (*i).GetTrack();
46 delete (*i).GetTrajectory();
47 }
48 clear();
49}

Referenced by G4SmartTrackStack::clearAndDestroy(), G4StackManager::ClearPostponeStack(), G4StackManager::ClearUrgentStack(), G4StackManager::ClearWaitingStack(), G4StackManager::PrepareNewEvent(), G4StackManager::TransferStackedTracks(), and ~G4TrackStack().

◆ GetMaxNTrack()

std::size_t G4TrackStack::GetMaxNTrack ( ) const
inline

Definition at line 69 of file G4TrackStack.hh.

69{ return max_size(); }

Referenced by G4StackManager::~G4StackManager().

◆ GetNStick()

G4int G4TrackStack::GetNStick ( ) const
inline

Definition at line 72 of file G4TrackStack.hh.

72{ return nstick; }

References nstick.

◆ GetNTrack()

std::size_t G4TrackStack::GetNTrack ( ) const
inline

◆ GetSafetyValue1()

G4int G4TrackStack::GetSafetyValue1 ( ) const
inline

Definition at line 70 of file G4TrackStack.hh.

70{ return safetyValue1; }

References safetyValue1.

Referenced by G4SmartTrackStack::PushToStack().

◆ GetSafetyValue2()

G4int G4TrackStack::GetSafetyValue2 ( ) const
inline

Definition at line 71 of file G4TrackStack.hh.

71{ return safetyValue2; }

References safetyValue2.

Referenced by G4SmartTrackStack::PushToStack().

◆ getTotalEnergy()

G4double G4TrackStack::getTotalEnergy ( void  ) const

Definition at line 68 of file G4TrackStack.cc.

69{
70 G4double totalEnergy = 0.0;
71 for ( auto i = cbegin(); i != cend(); ++i )
72 {
73 totalEnergy += (*i).GetTrack()->GetDynamicParticle()->GetTotalEnergy();
74 }
75 return totalEnergy;
76}
double G4double
Definition: G4Types.hh:83

Referenced by G4SmartTrackStack::dumpStatistics().

◆ operator!=()

G4bool G4TrackStack::operator!= ( const G4TrackStack ) const
delete

◆ operator=()

G4TrackStack & G4TrackStack::operator= ( const G4TrackStack )
delete

◆ operator==()

G4bool G4TrackStack::operator== ( const G4TrackStack ) const
delete

◆ PopFromStack()

G4StackedTrack G4TrackStack::PopFromStack ( )
inline

◆ PushToStack()

void G4TrackStack::PushToStack ( const G4StackedTrack aStackedTrack)
inline

◆ SetSafetyValue2()

void G4TrackStack::SetSafetyValue2 ( G4int  x)
inline

Definition at line 75 of file G4TrackStack.hh.

75{ safetyValue2 = x < 0 ? 0 : x; }

References safetyValue2.

◆ TransferTo() [1/2]

void G4TrackStack::TransferTo ( G4SmartTrackStack aStack)

Definition at line 60 of file G4TrackStack.cc.

61{
62 while (size())
63 {
64 aStack->PushToStack(PopFromStack());
65 }
66}
void PushToStack(const G4StackedTrack &aStackedTrack)
G4StackedTrack PopFromStack()
Definition: G4TrackStack.hh:61

References PopFromStack(), and G4SmartTrackStack::PushToStack().

◆ TransferTo() [2/2]

void G4TrackStack::TransferTo ( G4TrackStack aStack)

Definition at line 51 of file G4TrackStack.cc.

52{
53 for(auto i = begin(); i != end(); ++i)
54 {
55 aStack->push_back(*i);
56 }
57 clear();
58}

Referenced by G4StackManager::PopNextTrack(), G4StackManager::PrepareNewEvent(), G4StackManager::ReClassify(), G4StackManager::TransferStackedTracks(), and G4SmartTrackStack::TransferTo().

Field Documentation

◆ nstick

G4int G4TrackStack::nstick
private

Definition at line 81 of file G4TrackStack.hh.

Referenced by GetNStick().

◆ safetyValue1

G4int G4TrackStack::safetyValue1
private

Definition at line 79 of file G4TrackStack.hh.

Referenced by GetSafetyValue1().

◆ safetyValue2

G4int G4TrackStack::safetyValue2
private

Definition at line 80 of file G4TrackStack.hh.

Referenced by GetSafetyValue2(), and SetSafetyValue2().


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