Geant4 11.2.2
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 ()=default
 
 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 () const
 
void SetSafetyValue2 (G4int x)
 

Detailed Description

Definition at line 44 of file G4TrackStack.hh.

Constructor & Destructor Documentation

◆ G4TrackStack() [1/2]

G4TrackStack::G4TrackStack ( )
default

◆ G4TrackStack() [2/2]

G4TrackStack::G4TrackStack ( std::size_t n)
inlineexplicit

Definition at line 49 of file G4TrackStack.hh.

50 : safetyValue1(G4int(4*n/5)),
51 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()

Member Function Documentation

◆ clearAndDestroy()

void G4TrackStack::clearAndDestroy ( )

Definition at line 41 of file G4TrackStack.cc.

42{
43 for(auto & i : *this)
44 {
45 delete i.GetTrack();
46 delete i.GetTrajectory();
47 }
48 clear();
49}

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

◆ GetMaxNTrack()

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

Definition at line 71 of file G4TrackStack.hh.

71{ return maxEntry; }

Referenced by G4StackManager::~G4StackManager().

◆ GetNStick()

G4int G4TrackStack::GetNStick ( ) const
inline

Definition at line 74 of file G4TrackStack.hh.

74{ return nstick; }

◆ GetNTrack()

◆ GetSafetyValue1()

G4int G4TrackStack::GetSafetyValue1 ( ) const
inline

Definition at line 72 of file G4TrackStack.hh.

72{ return safetyValue1; }

◆ GetSafetyValue2()

G4int G4TrackStack::GetSafetyValue2 ( ) const
inline

Definition at line 73 of file G4TrackStack.hh.

73{ return safetyValue2; }

◆ getTotalEnergy()

G4double G4TrackStack::getTotalEnergy ( ) const

Definition at line 68 of file G4TrackStack.cc.

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

◆ 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

Definition at line 58 of file G4TrackStack.hh.

59 {
60 push_back(aStackedTrack);
61 if(size()>maxEntry) maxEntry = size();
62 }

Referenced by G4StackManager::TransferOneStackedTrack().

◆ SetSafetyValue2()

void G4TrackStack::SetSafetyValue2 ( G4int x)
inline

Definition at line 77 of file G4TrackStack.hh.

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

◆ TransferTo() [1/2]

void G4TrackStack::TransferTo ( G4SmartTrackStack * aStack)

Definition at line 60 of file G4TrackStack.cc.

61{
62 while (!this->empty())
63 {
64 aStack->PushToStack(PopFromStack());
65 }
66}
void PushToStack(const G4StackedTrack &aStackedTrack)
G4StackedTrack PopFromStack()

◆ TransferTo() [2/2]

void G4TrackStack::TransferTo ( G4TrackStack * aStack)

Definition at line 51 of file G4TrackStack.cc.

52{
53 for(auto & i : *this)
54 {
55 aStack->push_back(i);
56 }
57 clear();
58}

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


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