Geant4 10.7.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 (std::size_t n)
 
 ~G4TrackStack ()
 
G4TrackStackoperator= (const G4TrackStack &)=delete
 
G4bool operator== (const G4TrackStack &) const =delete
 
G4bool operator!= (const G4TrackStack &) const =delete
 
void PushToStack (const G4StackedTrack &aStackedTrack)
 
G4StackedTrack PopFromStack ()
 
void TransferTo (G4TrackStack *aStack)
 
void TransferTo (G4SmartTrackStack *aStack)
 
void clearAndDestroy ()
 
std::size_t GetNTrack () const
 
std::size_t GetMaxNTrack () const
 
G4int GetSafetyValue1 () const
 
G4int GetSafetyValue2 () const
 
G4int GetNStick () const
 
G4double getTotalEnergy (void) const
 
void SetSafetyValue2 (G4int x)
 

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) {}

◆ 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

◆ ~G4TrackStack()

G4TrackStack::~G4TrackStack ( )

Definition at line 36 of file G4TrackStack.cc.

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

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

◆ GetNTrack()

◆ GetSafetyValue1()

G4int G4TrackStack::GetSafetyValue1 ( ) const
inline

Definition at line 70 of file G4TrackStack.hh.

70{ return safetyValue1; }

Referenced by G4SmartTrackStack::PushToStack().

◆ GetSafetyValue2()

G4int G4TrackStack::GetSafetyValue2 ( ) const
inline

Definition at line 71 of file G4TrackStack.hh.

71{ return 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()

◆ 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; }

◆ 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

◆ 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().


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