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

#include <G4TrackStack.hh>

+ Inheritance diagram for G4TrackStack:

Public Member Functions

 G4TrackStack ()
 
 G4TrackStack (size_t n)
 
 ~G4TrackStack ()
 
void PushToStack (const G4StackedTrack &aStackedTrack)
 
G4StackedTrack PopFromStack ()
 
void TransferTo (G4TrackStack *aStack)
 
void TransferTo (G4SmartTrackStack *aStack)
 
void clearAndDestroy ()
 
G4int GetNTrack () const
 
G4int GetMaxNTrack () const
 
G4int GetSafetyValve1 () const
 
G4int GetSafetyValve2 () const
 
G4int GetNStick () const
 
G4double getTotalEnergy (void) const
 
void SetSafetyValve2 (int x)
 

Detailed Description

Definition at line 49 of file G4TrackStack.hh.

Constructor & Destructor Documentation

◆ G4TrackStack() [1/2]

G4TrackStack::G4TrackStack ( )
inline

Definition at line 52 of file G4TrackStack.hh.

52: safetyValve1(0), safetyValve2(0), nstick(0) {}

◆ G4TrackStack() [2/2]

G4TrackStack::G4TrackStack ( size_t  n)
inline

Definition at line 53 of file G4TrackStack.hh.

53: safetyValve1(4*n/5), safetyValve2(4*n/5-100), nstick(100) { reserve(n);}

◆ ~G4TrackStack()

G4TrackStack::~G4TrackStack ( )

Definition at line 35 of file G4TrackStack.cc.

36{
38}
void clearAndDestroy()
Definition: G4TrackStack.cc:40

Member Function Documentation

◆ clearAndDestroy()

void G4TrackStack::clearAndDestroy ( )

Definition at line 40 of file G4TrackStack.cc.

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

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

◆ GetMaxNTrack()

G4int G4TrackStack::GetMaxNTrack ( ) const
inline

Definition at line 75 of file G4TrackStack.hh.

75{ return max_size(); }

Referenced by G4StackManager::~G4StackManager().

◆ GetNStick()

G4int G4TrackStack::GetNStick ( ) const
inline

Definition at line 78 of file G4TrackStack.hh.

78{ return nstick; }

◆ GetNTrack()

◆ GetSafetyValve1()

G4int G4TrackStack::GetSafetyValve1 ( ) const
inline

Definition at line 76 of file G4TrackStack.hh.

76{ return safetyValve1; }

Referenced by G4SmartTrackStack::PushToStack().

◆ GetSafetyValve2()

G4int G4TrackStack::GetSafetyValve2 ( ) const
inline

Definition at line 77 of file G4TrackStack.hh.

77{ return safetyValve2; }

Referenced by G4SmartTrackStack::PushToStack().

◆ getTotalEnergy()

G4double G4TrackStack::getTotalEnergy ( void  ) const

Definition at line 61 of file G4TrackStack.cc.

62{
63 G4double totalEnergy = 0.0;
64 for (const_iterator i = begin(); i != end(); i++) {
65 totalEnergy += (*i).GetTrack()->GetDynamicParticle()->GetTotalEnergy();
66 }
67 return totalEnergy;
68}
double G4double
Definition: G4Types.hh:64

Referenced by G4SmartTrackStack::dumpStatistics().

◆ PopFromStack()

◆ PushToStack()

void G4TrackStack::PushToStack ( const G4StackedTrack aStackedTrack)
inline

◆ SetSafetyValve2()

void G4TrackStack::SetSafetyValve2 ( int  x)
inline

Definition at line 81 of file G4TrackStack.hh.

81{ safetyValve2 = x < 0 ? 0 : x; }

◆ TransferTo() [1/2]

void G4TrackStack::TransferTo ( G4SmartTrackStack aStack)

Definition at line 55 of file G4TrackStack.cc.

56{
57 while(size()) { aStack->PushToStack(PopFromStack()); }
58}
void PushToStack(const G4StackedTrack &aStackedTrack)
G4StackedTrack PopFromStack()
Definition: G4TrackStack.hh:63

◆ TransferTo() [2/2]

void G4TrackStack::TransferTo ( G4TrackStack aStack)

Definition at line 49 of file G4TrackStack.cc.

49 {
50 for(iterator i = begin(); i != end(); i++) aStack->push_back(*i);
51 clear();
52}

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


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