--------------------------------------------------------------------
| 139 | |
| 140 | // -------------------------------------------------------------------- |
| 141 | void 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; |
nothing calls this directly
no test coverage detected