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

#include <G4ITTrackHolder.hh>

+ Inheritance diagram for G4ITTrackHolder:

Public Types

using Key = int
 
using MapOfPriorityLists = std::map<Key, PriorityList*>
 
using MapOfDelayedLists = std::map<double, std::map<Key, G4TrackList*> >
 

Public Member Functions

 G4ITTrackHolder ()
 
 ~G4ITTrackHolder () override
 
double GetNextTime ()
 
void Push (G4Track *) override
 
void PushToKill (G4Track *track)
 
bool MergeNextTimeToMainList (double &time)
 
void MergeSecondariesWithMainList ()
 
void MoveMainToWaitingList ()
 
void KillTracks ()
 
void Clear ()
 
bool AddWatcher (int, G4TrackList::Watcher *, PriorityList::Type=PriorityList::MainList)
 
void AddWatcherForMainList (G4TrackList::Watcher *)
 
void AddWatcherForKillList (G4TrackList::Watcher *)
 
MapOfPriorityListsGetLists ()
 
PriorityListGetPriorityList (Key)
 
G4TrackListGetMainList (Key)
 
G4TrackManyListGetMainList ()
 
G4TrackManyListGetSecondariesList ()
 
MapOfDelayedListsGetDelayedLists ()
 
size_t GetNTracks () override
 
bool MainListsNOTEmpty ()
 
bool SecondaryListsNOTEmpty ()
 
bool DelayListsNOTEmpty ()
 
bool CheckMapIsNOTEmpty (MapOfPriorityLists &mapOfLists, PriorityList::Type type)
 
void SetVerbose (int verbose)
 
G4TrackListGetKillList ()
 
- Public Member Functions inherited from G4VITTrackHolder

Static Public Member Functions

static G4ITTrackHolderInstance ()
 
static G4ITTrackHolderMasterInstance ()
 
static void PushToMaster (G4Track *)
 
- Static Public Member Functions inherited from G4VITTrackHolder
static G4VITTrackHolderInstance ()
 

Protected Member Functions

void AddTrackID (G4Track *track)
 
void _PushTrack (G4Track *track)
 
void PushTo (G4Track *, PriorityList::Type)
 
void PushDelayed (G4Track *track)
 
- Protected Member Functions inherited from G4VITTrackHolder
 G4VITTrackHolder ()
 
virtual ~G4VITTrackHolder ()
 

Protected Attributes

std::map< Key, PriorityList * > fLists
 
MapOfDelayedLists fDelayedList
 
G4TrackList fToBeKilledList
 
bool fMainListHaveBeenSet
 
int fVerbose
 
int fNbTracks
 
double fPostActivityGlobalTime
 
G4TrackManyList fAllMainList
 
G4TrackManyList fAllSecondariesList
 

Friends

class G4Scheduler
 
class G4ITStepProcessor
 
class G4ITModelProcessor
 

Additional Inherited Members

- Static Protected Attributes inherited from G4VITTrackHolder
static G4ThreadLocal G4VITTrackHolderfInstance
 

Detailed Description

Definition at line 121 of file G4ITTrackHolder.hh.

Member Typedef Documentation

◆ Key

using G4ITTrackHolder::Key = int

Definition at line 138 of file G4ITTrackHolder.hh.

◆ MapOfDelayedLists

using G4ITTrackHolder::MapOfDelayedLists = std::map<double, std::map<Key, G4TrackList*> >

Definition at line 140 of file G4ITTrackHolder.hh.

◆ MapOfPriorityLists

Definition at line 139 of file G4ITTrackHolder.hh.

Constructor & Destructor Documentation

◆ G4ITTrackHolder()

G4ITTrackHolder::G4ITTrackHolder ( )

Definition at line 223 of file G4ITTrackHolder.cc.

224{
225 fNbTracks = -1;
226 fMainListHaveBeenSet = false;
227 fVerbose = 0;
228
230// fPreActivityGlobalTime = -1;
231}

Referenced by Instance(), and MasterInstance().

◆ ~G4ITTrackHolder()

G4ITTrackHolder::~G4ITTrackHolder ( )
override

Definition at line 233 of file G4ITTrackHolder.cc.

234{
235 auto end = fLists.end();
236
237 for (auto it = fLists.begin(); it != end;
238 it++)
239 {
240 delete it->second;
241 it->second = 0;
242 }
243
244 if (!fDelayedList.empty())
245 {
246 auto fDelayedList_i = fDelayedList.begin();
247 auto fDelayedList_end = fDelayedList.end();
248
249 for (; fDelayedList_i != fDelayedList_end; fDelayedList_i++)
250 {
251 auto it = fDelayedList_i->second.begin();
252 auto __end =
253 fDelayedList_i->second.end();
254
255 for (; it != __end; it++)
256 {
257 delete (it->second);
258 it->second = 0;
259 }
260 }
261 fDelayedList.clear();
262 }
263
266 fNbTracks = -1;
267}
G4TrackManyList fAllMainList
MapOfDelayedLists fDelayedList
std::map< Key, PriorityList * > fLists
G4TrackManyList fAllSecondariesList

Member Function Documentation

◆ _PushTrack()

void G4ITTrackHolder::_PushTrack ( G4Track * track)
protected

Definition at line 446 of file G4ITTrackHolder.cc.

447{
448 if (track == nullptr)
449 {
450 G4ExceptionDescription exceptionDescription;
451 exceptionDescription
452 << "You are trying to push a non-existing track (track pointer is null)"
453 << G4endl;
454
455 G4Exception("G4ITTrackHolder::_PushTrack", "ITStepManager014",
456 FatalErrorInArgument, exceptionDescription);
457 }
458
459 G4double globalTime = track->GetGlobalTime();
460
461 if (track->GetTrackID() == 0)
462 {
463 // Set track ID
464 AddTrackID(track);
465 }
466
467 double currentGlobalTime = G4Scheduler::Instance()->GetGlobalTime();
468
469#ifdef G4VERBOSE
470 if (fVerbose != 0)
471 {
472 G4cout << G4endl;
473 G4cout << "\t"<< ">> Pushing a track --> ";
474 G4cout << GetIT(track)->GetName() << " (" << track->GetTrackID() <<")"
475 << " -- ";
476 G4cout << "Global current time: " << G4BestUnit(currentGlobalTime,"Time")
477 << "\t";
478 G4cout << "Track's time: " << G4BestUnit(track->GetGlobalTime(),"Time")
479 << G4endl;
480 }
481#endif
482
483 if (!G4Scheduler::Instance()->IsRunning())
484 {
485 if (globalTime < currentGlobalTime)
486 {
487 G4ExceptionDescription exceptionDescription;
488 exceptionDescription
489 << "You are trying to push a track with a global time"
490 << " inferior to the current simulation time." << G4endl<< "The time is going back : " << G4endl
491 << "The time in the step manager : "
492 << G4BestUnit(currentGlobalTime,"Time")
493 << G4endl
494 << "The time of the track : "
495 << G4BestUnit(globalTime,"Time")
496 << G4endl
497 << "(ITStepManager is not yet running)"
498 << G4endl;
499
500 G4Exception("G4ITTrackHolder::_PushTrack", "ITStepManager014",
501 FatalErrorInArgument, exceptionDescription);
502 }
503
504 // Push the track to the rigth track list :
505 // If the track time is the same as the main track list,
506 // it will be push to the main track list
507 // otherwise, it will be pushed to the delayed track list.
509 {
510 PushDelayed(track);
511 }
512 else
513 {
514 if (globalTime == currentGlobalTime)
515 {
516 #ifdef G4VERBOSE
517 if (fVerbose != 0)
518 {
519 G4cout << G4endl;
520 G4cout << "\t"<< ">> Pushing to *main* list --> ";
521 G4cout << GetIT(track)->GetName() << " (" << track->GetTrackID() <<")"
522 << " -- ";
523 G4cout << "Global current time: " << G4BestUnit(currentGlobalTime,"Time")
524 << "\t";
525 G4cout << "Track's time: " << G4BestUnit(track->GetGlobalTime(),"Time")
526 << G4endl;
527 }
528 #endif
530 }
531 else
532 {
533 // if(currentGlobalTime > 1*CLHEP::picosecond) abort();
534 #ifdef G4VERBOSE
535 if (fVerbose != 0)
536 {
537 G4cout << G4endl;
538 G4cout << "\t"<< ">> Pushing to *delayed* list --> ";
539 G4cout << GetIT(track)->GetName() << " (" << track->GetTrackID() <<")"
540 << " -- ";
541 G4cout << "Global current time: " << G4BestUnit(currentGlobalTime,"Time")
542 << "\t";
543 G4cout << "Track's time: " << G4BestUnit(track->GetGlobalTime(),"Time")
544 << G4endl;
545 }
546 #endif
547 PushDelayed(track);
548 }
549 }
550 }
551 else // Is running
552 {
553 double timeDifference = globalTime - currentGlobalTime;
554 double timeTolerance = G4Scheduler::Instance()->GetTimeTolerance();
555
556 if (timeDifference < -1 * timeTolerance)
557 {
558 G4ExceptionDescription exceptionDescription;
559 exceptionDescription
560 << "You are trying to push a track with a global time"
561 << " inferior to the current simulation time." << G4endl<< "The time is going back : "
562 << G4endl
563 << "The time in the step manager : "
564 << G4BestUnit(timeDifference,"Time")
565 << G4endl
566 << "The time of the track : " << G4BestUnit(globalTime,"Time")
567 << G4endl
568 << "(ITStepManager is running)"
569 << G4endl;
570
571 G4Exception("G4ITTrackHolder::_PushTrack", "ITStepManager015",
572 FatalErrorInArgument, exceptionDescription);
573 }
574
575 // Push the track to the rigth track list :
576 // If the track time is the same as the main track list,
577 // it will be push to the secondary list
578 // otherwise, it will be pushed to the delayed track list.
579 if (fabs(timeDifference) < timeTolerance)
580 {
581// G4cout << "Is pushing " << GetIT(track)->GetName() << G4endl;
582
583 #ifdef G4VERBOSE
584 if (fVerbose != 0)
585 {
586 G4cout << G4endl;
587 G4cout << "\t"<< ">> Pushing to *secondary* list --> ";
588 G4cout << GetIT(track)->GetName() << " (" << track->GetTrackID() <<")"
589 << " -- ";
590 G4cout << "Global current time: " << G4BestUnit(currentGlobalTime,"Time")
591 << "\t";
592 G4cout << "Track's time: " << G4BestUnit(track->GetGlobalTime(),"Time")
593 << G4endl;
594 }
595 #endif
597 }
598 else // globalTime < fGlobalTime already taken into account above
599 {
600 G4ExceptionDescription exceptionDescription;
601 exceptionDescription
602 << "While running you cannot push a track"
603 << " with a bigger global time than the current global time" << G4endl<< "The time in the step manager : "
604 << G4BestUnit(currentGlobalTime,"Time")
605 << G4endl
606 << "The time of the track : " << G4BestUnit(globalTime,"Time")
607 << G4endl
608 << "(ITStepManager is running)"
609 << G4endl;
610
611 G4Exception("G4ITTrackHolder::_PushTrack", "ITStepManager016",
612 FatalErrorInArgument, exceptionDescription);
613 // PushDelayed(track, globalTime);
614 }
615 }
616}
@ FatalErrorInArgument
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)
std::ostringstream G4ExceptionDescription
G4IT * GetIT(const G4Track *track)
Definition G4IT.cc:48
#define G4BestUnit(a, b)
double G4double
Definition G4Types.hh:83
#define G4endl
Definition G4ios.hh:67
G4GLOB_DLL std::ostream G4cout
void PushTo(G4Track *, PriorityList::Type)
void AddTrackID(G4Track *track)
void PushDelayed(G4Track *track)
virtual const G4String & GetName() const =0
G4double GetTimeTolerance() const override
static G4Scheduler * Instance()
G4double GetGlobalTime() const override
G4int GetTrackID() const
G4double GetGlobalTime() const

Referenced by Push(), and G4ITStepProcessor::PushSecondaries().

◆ AddTrackID()

void G4ITTrackHolder::AddTrackID ( G4Track * track)
protected

Definition at line 376 of file G4ITTrackHolder.cc.

377{
378 //if(fNbTracks == 0) fNbTracks = -1;
379 track->SetTrackID(fNbTracks);
380 fNbTracks--;
381}
void SetTrackID(const G4int aValue)

Referenced by _PushTrack().

◆ AddWatcher()

bool G4ITTrackHolder::AddWatcher ( int id,
G4TrackList::Watcher * watcher,
PriorityList::Type type = PriorityList::MainList )

Definition at line 782 of file G4ITTrackHolder.cc.

785{
786 auto it = fLists.find(id);
787 if (it == fLists.end()) return false;
788
789 G4TrackList* trackList = it->second->Get(type);
790 if (trackList == nullptr) return false;
791 trackList->AddWatcher(watcher);
792 return true;
793}
void AddWatcher(Watcher *watcher)

◆ AddWatcherForKillList()

void G4ITTrackHolder::AddWatcherForKillList ( G4TrackList::Watcher * watcher)

Definition at line 800 of file G4ITTrackHolder.cc.

801{
802 watcher->Watch(&fToBeKilledList);
803}
G4TrackList fToBeKilledList

◆ AddWatcherForMainList()

void G4ITTrackHolder::AddWatcherForMainList ( G4TrackList::Watcher * watcher)

Definition at line 795 of file G4ITTrackHolder.cc.

796{
798}
void AddGlobalWatcher(typename G4FastList< OBJECT >::Watcher *watcher)

◆ CheckMapIsNOTEmpty()

bool G4ITTrackHolder::CheckMapIsNOTEmpty ( MapOfPriorityLists & mapOfLists,
PriorityList::Type type )

Definition at line 879 of file G4ITTrackHolder.cc.

881{
882 auto it = mapOfLists.begin();
883 auto end = mapOfLists.end();
884 for (; it != end; it++)
885 {
886 if (PriorityList* lists = it->second)
887 {
888 if (G4TrackList* trackList = lists->Get(type))
889 {
890 if (!(trackList->empty())) return true;
891 }
892 }
893 }
894 return false;
895}

Referenced by MainListsNOTEmpty(), and SecondaryListsNOTEmpty().

◆ Clear()

void G4ITTrackHolder::Clear ( )

Definition at line 725 of file G4ITTrackHolder.cc.

726{
729// fAllMainList.RemoveLists();
730// fAllSecondariesList.RemoveLists();
731
732 auto it = fLists.begin();
733
734 for (; it != fLists.end(); it++)
735 {
736 delete it->second;
737 it->second = 0;
738 }
739 fLists.clear();
740
741 auto it1 = fDelayedList.begin();
742
743 for (; it1 != fDelayedList.end(); it1++)
744 {
745 auto it2 = it1->second.begin();
746
747 for (; it2 != it1->second.end(); it2++)
748 {
749 delete it2->second;
750 it2->second = 0;
751 }
752 }
753
754 fDelayedList.clear();
755
756// fAllMainList.ClearLists();
757// fAllSecondariesList.ClearLists();
760 KillTracks();
761
762 fNbTracks = -1;
763}

Referenced by G4Scheduler::ClearList().

◆ DelayListsNOTEmpty()

bool G4ITTrackHolder::DelayListsNOTEmpty ( )

Definition at line 856 of file G4ITTrackHolder.cc.

857{
858 auto __it = fDelayedList.begin();
859 auto __end = fDelayedList.end();
860 for (; __it != __end; __it++)
861 {
862 std::map<Key, G4TrackList*>& mapOfLists = __it->second;
863 if (!mapOfLists.empty())
864 {
865 auto it = mapOfLists.begin();
866 auto end = mapOfLists.end();
867 for (; it != end; it++)
868 {
869 if (G4TrackList* mainList = it->second)
870 {
871 if (!(mainList->empty())) return true;
872 }
873 }
874 }
875 }
876 return false;
877}

Referenced by G4Scheduler::Process().

◆ GetDelayedLists()

MapOfDelayedLists & G4ITTrackHolder::GetDelayedLists ( )
inline

Definition at line 206 of file G4ITTrackHolder.hh.

207 {
208 return fDelayedList;
209 }

◆ GetKillList()

G4TrackList * G4ITTrackHolder::GetKillList ( )
inline

Definition at line 235 of file G4ITTrackHolder.hh.

236 {
237 return &fToBeKilledList;
238 }

◆ GetLists()

MapOfPriorityLists & G4ITTrackHolder::GetLists ( )
inline

Definition at line 192 of file G4ITTrackHolder.hh.

193 { return fLists;}

◆ GetMainList() [1/2]

G4TrackManyList * G4ITTrackHolder::GetMainList ( )
inline

Definition at line 196 of file G4ITTrackHolder.hh.

197 {
198 return &fAllMainList;
199 }

◆ GetMainList() [2/2]

◆ GetNextTime()

double G4ITTrackHolder::GetNextTime ( )
inline

Definition at line 152 of file G4ITTrackHolder.hh.

153 {
154 if (fDelayedList.empty()) return DBL_MAX;
155 return fDelayedList.begin()->first;
156 }
#define DBL_MAX
Definition templates.hh:62

Referenced by G4Scheduler::Process(), and G4Scheduler::SynchronizeTracks().

◆ GetNTracks()

size_t G4ITTrackHolder::GetNTracks ( )
overridevirtual

Reimplemented from G4VITTrackHolder.

Definition at line 814 of file G4ITTrackHolder.cc.

815{
816 size_t nTracks(0);
817 nTracks += fAllMainList.size();
818 nTracks += fAllSecondariesList.size();
819
820 // G4cout << "nTracks = " << nTracks << G4endl;
821
822 auto delayedmap_it = fDelayedList.begin();
823 auto delayedmap_end = fDelayedList.end();
824
825 for (; delayedmap_it != delayedmap_end; delayedmap_it++)
826 {
827 auto it = delayedmap_it->second.begin();
828 auto end = delayedmap_it->second.end();
829
830 for (; it != end; it++)
831 {
832 if (it->second != nullptr) nTracks += it->second->size();
833 }
834 }
835
836 // G4cout << "nTracks = " << nTracks << G4endl;
837
838 return nTracks;
839}
size_t size() const

Referenced by G4Scheduler::GetNTracks().

◆ GetPriorityList()

PriorityList * G4ITTrackHolder::GetPriorityList ( Key i)

Definition at line 765 of file G4ITTrackHolder.cc.

766{
767 auto it = fLists.find(i);
768 if (it == fLists.end()) return nullptr;
769 return it->second;
770}

Referenced by GetMainList().

◆ GetSecondariesList()

G4TrackManyList * G4ITTrackHolder::GetSecondariesList ( )
inline

Definition at line 201 of file G4ITTrackHolder.hh.

202 {
203 return &fAllSecondariesList;
204 }

Referenced by G4Scheduler::EndTracking().

◆ Instance()

◆ KillTracks()

void G4ITTrackHolder::KillTracks ( )

Definition at line 695 of file G4ITTrackHolder.cc.

696{
697 if (fToBeKilledList.empty()) return;
698#ifdef G4VERBOSE
699 if (fVerbose > 1)
700 {
701 G4cout << "*** G4ITTrackHolder::KillTracks , step #"
703 << " ***" << G4endl;
704 G4cout << "Nb of tracks to kill "<< fToBeKilledList.size() << G4endl;
705 G4cout << setw(25) << left << "#Name"
706 << setw(25) << "track ID"<< G4endl;
707
709 for(; it != fToBeKilledList.end();)
710 {
711 G4Track* toBeErased = *it;
712
713 G4cout << setw(25) << GetIT(toBeErased)->GetName()
714 << setw(25) << toBeErased->GetTrackID()
715 << G4endl;
716
717 it = fToBeKilledList.erase(toBeErased);
718 }
719 }
720 else
721#endif
723}
G4int size() const
iterator begin()
bool empty() const
iterator end()
iterator erase(OBJECT *)
static G4VScheduler * Instance()
virtual G4int GetNbSteps() const

Referenced by Clear(), G4ITModelProcessor::ComputeTrackReaction(), and G4ITStepProcessor::DoIt().

◆ MainListsNOTEmpty()

bool G4ITTrackHolder::MainListsNOTEmpty ( )
inline

Definition at line 215 of file G4ITTrackHolder.hh.

216 {
218 }
bool CheckMapIsNOTEmpty(MapOfPriorityLists &mapOfLists, PriorityList::Type type)

Referenced by G4Scheduler::DoProcess(), G4Scheduler::EndTracking(), and G4Scheduler::PrintWhyDoYouStop().

◆ MasterInstance()

G4ITTrackHolder * G4ITTrackHolder::MasterInstance ( )
static

Definition at line 212 of file G4ITTrackHolder.cc.

213{
215 if (fgMasterInstance == nullptr)
216 {
217 fgMasterInstance = new G4ITTrackHolder();
218 }
219 lock.unlock();
220 return fgMasterInstance;
221}
G4Mutex creationOfTheMasterInstance

Referenced by PushToMaster().

◆ MergeNextTimeToMainList()

bool G4ITTrackHolder::MergeNextTimeToMainList ( double & time)

Definition at line 288 of file G4ITTrackHolder.cc.

289{
290// G4cout << "G4ITTrackHolder::MergeNextTimeToMainList" << G4endl;
291 if (fDelayedList.empty())
292 {
293 return false;
294 }
295
296// G4cout << "fDelayedList.size = " << fDelayedList.size() <<G4endl;
297
298 auto it =
299 fDelayedList.begin()->second.begin();
300 auto end =
301 fDelayedList.begin()->second.end();
302 if (it == end) return false;
303
304 bool output = false;
305 for (; it != end; it++)
306 {
307 PriorityList* right_listUnion(nullptr);
308
309 auto it_listUnion = fLists.find(
310 it->first);
311 if (it_listUnion == fLists.end())
312 {
313 right_listUnion = (fLists[it->first] = new PriorityList());
314 }
315 else
316 {
317 if (it_listUnion->second == 0)
318 {
319 it_listUnion->second = new PriorityList();
320 }
321 right_listUnion = it_listUnion->second;
322 }
323
324 if (it->second == 0) continue;
325
326 /*
327 if (right_listUnion->GetMainList() == 0)
328 {
329 // right_listUnion->fpMainList = new G4TrackList();
330 // if(it->second)
331 // {
332 right_listUnion->NewMainList(it->second, fAllMainList);
333 // }
334 }
335 else
336 {
337 right_listUnion->TransferToMainList(it->second);
338 delete it->second;
339 }*/
340
341 right_listUnion->TransferToMainList(it->second, fAllMainList);
342
343 if (!output)
344 {
345 if (static_cast<int>(!right_listUnion->GetMainList()->empty()) != 0)
346 {
347 output = true;
348 }
349 }
350 it->second = 0;
351 }
352
353 if (output) time = fDelayedList.begin()->first;
354 fDelayedList.erase(fDelayedList.begin());
355 return output;
356}

Referenced by G4Scheduler::SynchronizeTracks().

◆ MergeSecondariesWithMainList()

void G4ITTrackHolder::MergeSecondariesWithMainList ( )

Definition at line 358 of file G4ITTrackHolder.cc.

359{
360 auto it = fLists.begin();
361 auto end = fLists.end();
362
363 for (; it != end; it++)
364 {
365 if (it->second->GetMainList() == nullptr)
366 {
367 it->second->NewMainList(fAllMainList);
368 }
369
370 it->second->TransferSecondariesToMainList();
371 }
372}

Referenced by G4ITModelProcessor::ComputeTrackReaction(), G4ITStepProcessor::DoIt(), G4Scheduler::EndTracking(), and G4DNAIRT::MakeReaction().

◆ MoveMainToWaitingList()

void G4ITTrackHolder::MoveMainToWaitingList ( )

Definition at line 841 of file G4ITTrackHolder.cc.

842{
843 auto it = fLists.begin();
844 auto end = fLists.end();
845 for (; it != end; it++)
846 {
847 if (PriorityList* lists = it->second)
848 {
849 lists->SetWaitingList(lists->GetMainList());
850 //TODO
851 }
852 }
854}

◆ Push()

void G4ITTrackHolder::Push ( G4Track * track)
overridevirtual

Reimplemented from G4VITTrackHolder.

Definition at line 385 of file G4ITTrackHolder.cc.

386{
387// if (G4VScheduler::Instance()->IsRunning())
388// {
389// G4ExceptionDescription exceptionDescription;
390// exceptionDescription
391// << "G4ITTrackHolder::PushTrack : You are trying to push tracks while the "
392// "ITStepManager is running";
393// G4Exception("G4ITTrackHolder::PushTrack", "ITStepManager012",
394// FatalErrorInArgument, exceptionDescription);
395// }
396 _PushTrack(track);
397
398// G4MIConstituent::NotifyEntityAdded(track);
399}
void _PushTrack(G4Track *track)

Referenced by G4DNAIRT::MakeReaction(), G4DNAMakeReaction::MakeReaction(), G4DNAMolecularReaction::MakeReaction(), G4DNAScavengerProcess::PostStepDoIt(), G4DNAChemistryManager::PushTrack(), and G4DNAIRT::Sampling().

◆ PushDelayed()

void G4ITTrackHolder::PushDelayed ( G4Track * track)
protected

Definition at line 620 of file G4ITTrackHolder.cc.

621{
622#ifdef G4VERBOSE
623 if (fVerbose != 0)
624 {
625 G4cout << "\t" << ">> Pushing a delayed track" << G4endl;
626 }
627#endif
628
629 int moleculeID = GetIT(track)->GetITSubType();
630 // std::map<int, PriorityList>::iterator it = fLists.find(moleculeID);
631
632 G4double globalTime = track->GetGlobalTime();
633
634 auto it_delayed =
635 fDelayedList.find(globalTime);
636
637 if (it_delayed == fDelayedList.end())
638 {
639 (fDelayedList[globalTime][moleculeID] = new G4TrackList())->push_back(
640 track);
641 }
642 else
643 {
644 auto it_trackList =
645 it_delayed->second.find(moleculeID);
646
647 if (it_trackList == it_delayed->second.end())
648 {
649 (it_delayed->second[moleculeID] = new G4TrackList())->push_back(track);
650 }
651 else
652 {
653 if (it_trackList->second != 0)
654 {
655 it_trackList->second->push_back(track);
656 }
657 }
658 }
659
660 // fDelayedList[globalTime][moleculeID]
661
662 /*
663 std::map<double,std::map<int, G4TrackList* > >::iterator it_delayed =
664 fDelayedList.begin();
665
666 std::map<double,std::map<int, G4TrackList* > >::iterator end_delayed =
667 fDelayedList.end();
668
669 for(it_delayed != end_delayed ; it_delayed++)
670 {
671 std::map<int, G4TrackList*> & trackListMap = it->second;
672
673
674 }
675 */
676 /*
677 std::map<double,G4TrackList* > :: iterator
678 fDelayedList_i = fDelayedList.find(globalTime) ;
679
680 if(fDelayedList_i == fDelayedList.end())
681 {
682
683 G4TrackList* newList = new G4TrackList ;
684 newList -> push_back(track);
685 fDelayedList[globalTime] = newList ;
686 }
687 else
688 {
689 fDelayedList_i->second-> push_back(track);
690 }
691 */
692}
G4FastList< G4Track > G4TrackList
virtual G4ITType GetITSubType() const
Definition G4IT.hh:159

Referenced by _PushTrack(), and PushToMaster().

◆ PushTo()

void G4ITTrackHolder::PushTo ( G4Track * track,
PriorityList::Type type )
protected

Definition at line 401 of file G4ITTrackHolder.cc.

402{
403 int moleculeID = GetIT(track)->GetITSubType();
404 auto it = fLists.find(moleculeID);
405
406 PriorityList* priorityList(nullptr);
407
408 if (it == fLists.end())
409 {
410 priorityList = new PriorityList(fAllMainList);
411 fLists[moleculeID] = priorityList;
412 }
413 else
414 {
415 priorityList = it->second;
416 }
417
418 switch (type)
419 {
421 {
422 priorityList->PushToMainList(track, fAllMainList);
423 break;
424 }
426 {
427 priorityList->PushToListOfSecondaries(track, fAllSecondariesList);
428 break;
429 }
431 {
432 priorityList->PushToWaitingList(track);
433 return;
434 break;
435 }
436
437 default:
438 {
439 return;
440 break;
441 }
442 }
443}

Referenced by _PushTrack().

◆ PushToKill()

void G4ITTrackHolder::PushToKill ( G4Track * track)
inline

Definition at line 164 of file G4ITTrackHolder.hh.

165 {
166 G4TrackList::Pop(track);
168
171 }
172 }
@ fKillTrackAndSecondaries
@ fStopAndKill
static void Pop(G4Track *)
void push_back(OBJECT *__track)
G4TrackStatus GetTrackStatus() const
void SetTrackStatus(const G4TrackStatus aTrackStatus)

Referenced by G4ITTrackingManager::EndTracking().

◆ PushToMaster()

void G4ITTrackHolder::PushToMaster ( G4Track * track)
static

Definition at line 805 of file G4ITTrackHolder.cc.

806{
807 G4ITTrackHolder* trackHolder = MasterInstance();
808
810 trackHolder->PushDelayed(track);
811 lock.unlock();
812}
G4Mutex pushToTheMasterInstance
static G4ITTrackHolder * MasterInstance()

◆ SecondaryListsNOTEmpty()

bool G4ITTrackHolder::SecondaryListsNOTEmpty ( )
inline

Definition at line 220 of file G4ITTrackHolder.hh.

Referenced by G4Scheduler::EndTracking().

◆ SetVerbose()

void G4ITTrackHolder::SetVerbose ( int verbose)
inline

Definition at line 230 of file G4ITTrackHolder.hh.

231 {
232 fVerbose = verbose;
233 }

Friends And Related Symbol Documentation

◆ G4ITModelProcessor

friend class G4ITModelProcessor
friend

Definition at line 134 of file G4ITTrackHolder.hh.

◆ G4ITStepProcessor

friend class G4ITStepProcessor
friend

Definition at line 133 of file G4ITTrackHolder.hh.

◆ G4Scheduler

friend class G4Scheduler
friend

Definition at line 132 of file G4ITTrackHolder.hh.

Member Data Documentation

◆ fAllMainList

◆ fAllSecondariesList

G4TrackManyList G4ITTrackHolder::fAllSecondariesList
protected

Definition at line 258 of file G4ITTrackHolder.hh.

Referenced by Clear(), GetNTracks(), GetSecondariesList(), PushTo(), and ~G4ITTrackHolder().

◆ fDelayedList

◆ fLists

◆ fMainListHaveBeenSet

bool G4ITTrackHolder::fMainListHaveBeenSet
protected

Definition at line 250 of file G4ITTrackHolder.hh.

Referenced by _PushTrack(), and G4ITTrackHolder().

◆ fNbTracks

int G4ITTrackHolder::fNbTracks
protected

Definition at line 252 of file G4ITTrackHolder.hh.

Referenced by AddTrackID(), Clear(), G4ITTrackHolder(), and ~G4ITTrackHolder().

◆ fPostActivityGlobalTime

double G4ITTrackHolder::fPostActivityGlobalTime
protected

Definition at line 254 of file G4ITTrackHolder.hh.

Referenced by G4ITTrackHolder().

◆ fToBeKilledList

G4TrackList G4ITTrackHolder::fToBeKilledList
protected

Definition at line 249 of file G4ITTrackHolder.hh.

Referenced by AddWatcherForKillList(), GetKillList(), KillTracks(), and PushToKill().

◆ fVerbose

int G4ITTrackHolder::fVerbose
protected

Definition at line 251 of file G4ITTrackHolder.hh.

Referenced by _PushTrack(), G4ITTrackHolder(), KillTracks(), PushDelayed(), and SetVerbose().


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