MCPcopy Create free account
hub / github.com/Geant4/geant4 / PushOneTrack

Method PushOneTrack

source/event/src/G4StackManager.cc:87–135  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

85}
86
87G4int G4StackManager::
88PushOneTrack(G4Track* newTrack, G4VTrajectory* newTrajectory)
89{
90 DefineDefaultClassification( newTrack );
91 G4ClassificationOfNewTrack classification = fDefaultClassification;
92 if(userStackingAction!=nullptr)
93 {
94 classification = userStackingAction->ClassifyNewTrack( newTrack );
95 if(classification != fDefaultClassification)
96 {
97 if(fExceptionSeverity!=G4ExceptionSeverity::IgnoreTheIssue)
98 {
99 G4ExceptionDescription ed;
100 ed << "UserStackingAction has changed the track classification from "
101 << fDefaultClassification << " to " << classification << ". ";
102 G4Exception("G4StackManager::PushOneTrack","Event10052",
103 fExceptionSeverity,ed);
104 }
105 }
106 }
107 if(newTrack->GetTrackStatus() == fSuspendAndWait && classification > 0)
108 // to avoid this track sent to Waiting stack again
109 { newTrack->SetTrackStatus( fSuspend ); }
110
111#ifdef G4VERBOSE
112 if( verboseLevel > 1 )
113 {
114 G4cout << "### Storing a track ("
115 << newTrack->GetParticleDefinition()->GetParticleName()
116 << ",trackID=" << newTrack->GetTrackID()
117 << ",parentID=" << newTrack->GetParentID() << ") ";
118 if(newTrack->GetParentID()==0)
119 { G4cout << "created by a primary particle generator "; }
120 else
121 {
122 const G4VProcess* vp = newTrack->GetCreatorProcess();
123 if(vp != nullptr)
124 { G4cout << "created by " << vp->GetProcessName() << " "; }
125 else
126 { G4cout << "creaded by unknown process "; }
127 }
128 G4cout << "into stack #" << classification << G4endl;
129 }
130#endif
131 G4StackedTrack newStackedTrack( newTrack, newTrajectory );
132 SortOut(newStackedTrack,classification);
133
134 return GetNUrgentTrack();
135}
136
137G4Track* G4StackManager::PopNextTrack(G4VTrajectory** newTrajectory)
138{

Callers

nothing calls this directly

Calls 8

G4ExceptionFunction · 0.85
GetTrackStatusMethod · 0.80
ClassifyNewTrackMethod · 0.45
GetParticleNameMethod · 0.45
GetParticleDefinitionMethod · 0.45
GetTrackIDMethod · 0.45
GetParentIDMethod · 0.45
GetCreatorProcessMethod · 0.45

Tested by

no test coverage detected