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

Method DumpTrackInfo

source/run/src/G4ExceptionHandler.cc:141–225  ·  view source on GitHub ↗

--------------------------------------------------------------------

Source from the content-addressed store, hash-verified

139
140// --------------------------------------------------------------------
141void G4ExceptionHandler::DumpTrackInfo()
142{
143 const G4Track* theTrack = nullptr;
144 const G4Step* theStep = nullptr;
145 if (G4StateManager::GetStateManager()->GetCurrentState() == G4State_EventProc) {
146 G4SteppingManager* steppingMgr =
147 G4RunManagerKernel::GetRunManagerKernel()->GetTrackingManager()->GetSteppingManager();
148 theTrack = steppingMgr->GetfTrack();
149 theStep = steppingMgr->GetfStep();
150 }
151
152 if (theTrack == nullptr) {
153 G4cerr << " **** Track information is not available at this moment" << G4endl;
154 }
155 else {
156 G4cerr << "G4Track (" << theTrack << ") - track ID = " << theTrack->GetTrackID()
157 << ", parent ID = " << theTrack->GetParentID() << G4endl;
158 G4cerr << " Particle type : " << theTrack->GetParticleDefinition()->GetParticleName();
159 if (theTrack->GetCreatorProcess() != nullptr) {
160 G4cerr << " - creator process : " << theTrack->GetCreatorProcess()->GetProcessName()
161 << ", creator model : " << theTrack->GetCreatorModelName() << G4endl;
162 }
163 else {
164 G4cerr << " - creator process : not available" << G4endl;
165 }
166 G4cerr << " Kinetic energy : " << G4BestUnit(theTrack->GetKineticEnergy(), "Energy")
167 << " - Momentum direction : " << theTrack->GetMomentumDirection() << G4endl;
168 }
169
170 if (theStep == nullptr) {
171 G4cerr << " **** Step information is not available at this moment" << G4endl;
172 }
173 else {
174 G4cerr << " Step length : " << G4BestUnit(theStep->GetStepLength(), "Length")
175 << " - total energy deposit : " << G4BestUnit(theStep->GetTotalEnergyDeposit(), "Energy")
176 << G4endl;
177 G4cerr << " Pre-step point : " << theStep->GetPreStepPoint()->GetPosition();
178 G4cerr << " - Physical volume : ";
179 if (theStep->GetPreStepPoint()->GetPhysicalVolume() != nullptr) {
180 G4cerr << theStep->GetPreStepPoint()->GetPhysicalVolume()->GetName();
181 if (theStep->GetPreStepPoint()->GetMaterial() != nullptr) {
182 G4cerr << " (" << theStep->GetPreStepPoint()->GetMaterial()->GetName() << ")";
183 }
184 else {
185 G4cerr << " (material not available)";
186 }
187 }
188 else {
189 G4cerr << "not available";
190 }
191 G4cerr << G4endl;
192 if (theStep->GetPreStepPoint()->GetProcessDefinedStep() != nullptr) {
193 G4cerr << " - defined by : "
194 << theStep->GetPreStepPoint()->GetProcessDefinedStep()->GetProcessName()
195 << " - step status : " << theStep->GetPreStepPoint()->GetStepStatus() << G4endl;
196 }
197 else {
198 G4cerr << " - defined by : not available" << G4endl;

Callers

nothing calls this directly

Calls 15

G4BestUnitClass · 0.85
GetSteppingManagerMethod · 0.80
GetfTrackMethod · 0.80
GetfStepMethod · 0.80
GetMomentumDirectionMethod · 0.80
GetTrackingManagerMethod · 0.45
GetTrackIDMethod · 0.45
GetParentIDMethod · 0.45
GetParticleNameMethod · 0.45
GetParticleDefinitionMethod · 0.45
GetCreatorProcessMethod · 0.45
GetKineticEnergyMethod · 0.45

Tested by

no test coverage detected