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

#include <G4ITTrackHolder.hh>

+ Inheritance diagram for PriorityList:

Public Types

enum  Type { MainList = 0 , SecondariesList = 1 , WaitingList = 2 , Undefined = -1 }
 

Public Member Functions

 PriorityList ()
 
 PriorityList (G4TrackManyList &allMainList)
 
 PriorityList (const PriorityList &right)
 
virtual ~PriorityList ()
 
virtual void NotifyDeletingList (G4TrackList *__list)
 
void NewMainList (G4TrackList *__list, G4TrackManyList &allMainList)
 
G4TrackListNewMainList (G4TrackManyList &allMainList)
 
void PushToMainList (G4Track *__track, G4TrackManyList &allMainList)
 
void TransferToMainList (G4TrackList *&__list, G4TrackManyList &allMainList)
 
void PushToListOfSecondaries (G4Track *__track, G4TrackManyList &listOfAllSecondaries)
 
void PushToWaitingList (G4Track *__track)
 
void TransferSecondariesToMainList ()
 
void PushToMainList (G4Track *track)
 
void MergeWithMainList (G4TrackList *trackList)
 
G4TrackListGetMainList ()
 
G4TrackListGetSecondariesList ()
 
void SetWaitingList (G4TrackList *__list)
 
G4TrackListGet (Type type)
 
int GetNTracks ()
 

Detailed Description

Definition at line 40 of file G4ITTrackHolder.hh.

Member Enumeration Documentation

◆ Type

Enumerator
MainList 
SecondariesList 
WaitingList 
Undefined 

Definition at line 43 of file G4ITTrackHolder.hh.

44 {
45 MainList = 0,
47 WaitingList = 2,
48 Undefined = -1
49 };

Constructor & Destructor Documentation

◆ PriorityList() [1/3]

PriorityList::PriorityList ( )

Definition at line 44 of file G4ITTrackHolder.cc.

44 :
45 G4TrackList::Watcher(), fpMainList(0), fpWaitingList(0)
46{
47}

◆ PriorityList() [2/3]

PriorityList::PriorityList ( G4TrackManyList allMainList)

Definition at line 49 of file G4ITTrackHolder.cc.

49 :
50 G4TrackList::Watcher(), fpMainList(0), fpWaitingList(0)
51{
52 NewMainList(allMainList);
53}
void NewMainList(G4TrackList *__list, G4TrackManyList &allMainList)

◆ PriorityList() [3/3]

PriorityList::PriorityList ( const PriorityList right)

Definition at line 55 of file G4ITTrackHolder.cc.

55 :
56 G4TrackList::Watcher(),
57 fpMainList(right.fpMainList),
58 fpWaitingList(right.fpWaitingList)
59{
60}

◆ ~PriorityList()

PriorityList::~PriorityList ( )
virtual

Definition at line 62 of file G4ITTrackHolder.cc.

63{
64 if (fpMainList)
65 {
66 delete fpMainList;
67 fpMainList = 0;
68 }
69 if (fpWaitingList)
70 {
71 delete fpWaitingList;
72 fpWaitingList = 0;
73 }
74}

Member Function Documentation

◆ Get()

G4TrackList * PriorityList::Get ( Type  type)
inline

Definition at line 92 of file G4ITTrackHolder.hh.

93 {
94 switch (type)
95 {
96 case MainList:
97 return fpMainList;
98 break;
99 case SecondariesList:
100 return &fSecondaries;
101 break;
102 case WaitingList:
103 return fpWaitingList;
104 break;
105 case Undefined:
106 return 0;
107 }
108 return 0;
109 }

◆ GetMainList()

G4TrackList * PriorityList::GetMainList ( )
inline

Definition at line 77 of file G4ITTrackHolder.hh.

78 {
79 return fpMainList;
80 }

Referenced by G4ITTrackHolder::GetMainList(), and G4ITTrackHolder::MergeNextTimeToMainList().

◆ GetNTracks()

int PriorityList::GetNTracks ( )

Definition at line 167 of file G4ITTrackHolder.cc.

168{
169 int nTracks = 0;
170
171 if (fpMainList)
172 {
173 nTracks += fpMainList->size();
174 }
175
176 if (fpWaitingList)
177 {
178 nTracks += fpWaitingList->size();
179 }
180
181 nTracks += fSecondaries.size();
182
183 return nTracks;
184}
G4int size() const
Definition: G4FastList.hh:357

◆ GetSecondariesList()

G4TrackList * PriorityList::GetSecondariesList ( )
inline

Definition at line 82 of file G4ITTrackHolder.hh.

83 {
84 return &fSecondaries;
85 }

◆ MergeWithMainList()

void PriorityList::MergeWithMainList ( G4TrackList trackList)

Definition at line 161 of file G4ITTrackHolder.cc.

162{
163 if (fpMainList == 0) fpMainList = new G4TrackList();
164 trackList->transferTo(trackList);
165}
G4FastList< G4Track > G4TrackList
Definition: G4TrackList.hh:56
void transferTo(G4FastList< OBJECT > *)

◆ NewMainList() [1/2]

void PriorityList::NewMainList ( G4TrackList __list,
G4TrackManyList allMainList 
)

Definition at line 90 of file G4ITTrackHolder.cc.

92{
93 fpMainList = __list;
94 allMainList.Add(__list);
95 Watch(fpMainList);
96}
void Add(G4FastList< OBJECT > *__list)

Referenced by NewMainList(), PriorityList(), PushToMainList(), and TransferToMainList().

◆ NewMainList() [2/2]

G4TrackList * PriorityList::NewMainList ( G4TrackManyList allMainList)

Definition at line 98 of file G4ITTrackHolder.cc.

99{
100 G4TrackList* trackList = new G4TrackList();
101 NewMainList(trackList, allMainList);
102 return fpMainList;
103}

◆ NotifyDeletingList()

void PriorityList::NotifyDeletingList ( G4TrackList __list)
virtual

Definition at line 76 of file G4ITTrackHolder.cc.

77{
78 if (__list == fpMainList)
79 {
80// StopWatching(fpMainList);
81 fpMainList = 0;
82 }
83 else if (__list == fpWaitingList)
84 {
85// StopWatching(fpWaitingList);
86 fpWaitingList = 0;
87 }
88}

◆ PushToListOfSecondaries()

void PriorityList::PushToListOfSecondaries ( G4Track __track,
G4TrackManyList listOfAllSecondaries 
)

Definition at line 130 of file G4ITTrackHolder.cc.

132{
133 // if (priorityList->fSecondaries.empty())
134 if (fSecondaries.GetListNode())
135 {
136 listOfAllSecondaries.Add(&fSecondaries);
137 }
138 fSecondaries.push_back(__track);
139}
G4FastListNode< G4FastList< OBJECT > > * GetListNode()
Definition: G4FastList.hh:333
void push_back(OBJECT *__track)

Referenced by G4ITTrackHolder::PushTo().

◆ PushToMainList() [1/2]

void PriorityList::PushToMainList ( G4Track __track,
G4TrackManyList allMainList 
)

Definition at line 105 of file G4ITTrackHolder.cc.

107{
108 if (fpMainList == 0)
109 {
110 NewMainList(allMainList);
111 }
112 fpMainList->push_back(__track);
113}

Referenced by G4ITTrackHolder::PushTo().

◆ PushToMainList() [2/2]

void PriorityList::PushToMainList ( G4Track track)

Definition at line 155 of file G4ITTrackHolder.cc.

156{
157 if (fpMainList == 0) fpMainList = new G4TrackList();
158 fpMainList->push_back(track);
159}

◆ PushToWaitingList()

void PriorityList::PushToWaitingList ( G4Track __track)

Definition at line 141 of file G4ITTrackHolder.cc.

142{
143 if (fpWaitingList == 0)
144 {
145 fpWaitingList = new G4TrackList();
146 }
147 fpWaitingList->push_back(__track);
148}

Referenced by G4ITTrackHolder::PushTo().

◆ SetWaitingList()

void PriorityList::SetWaitingList ( G4TrackList __list)
inline

Definition at line 87 of file G4ITTrackHolder.hh.

88 {
89 fpWaitingList = __list;
90 }

◆ TransferSecondariesToMainList()

void PriorityList::TransferSecondariesToMainList ( )

Definition at line 150 of file G4ITTrackHolder.cc.

151{
152 fSecondaries.transferTo(fpMainList);
153}

◆ TransferToMainList()

void PriorityList::TransferToMainList ( G4TrackList *&  __list,
G4TrackManyList allMainList 
)

Definition at line 115 of file G4ITTrackHolder.cc.

117{
118 if (fpMainList)
119 {
120 __list->transferTo(fpMainList);
121 delete __list;
122 __list = 0;
123 }
124 else
125 {
126 NewMainList(__list, allMainList);
127 }
128}

Referenced by G4ITTrackHolder::MergeNextTimeToMainList().


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