Geant4 Cross Reference |
1 // 1 // 2 // ******************************************* 2 // ******************************************************************** 3 // * License and Disclaimer 3 // * License and Disclaimer * 4 // * 4 // * * 5 // * The Geant4 software is copyright of th 5 // * The Geant4 software is copyright of the Copyright Holders of * 6 // * the Geant4 Collaboration. It is provided 6 // * the Geant4 Collaboration. It is provided under the terms and * 7 // * conditions of the Geant4 Software License 7 // * conditions of the Geant4 Software License, included in the file * 8 // * LICENSE and available at http://cern.ch/ 8 // * LICENSE and available at http://cern.ch/geant4/license . These * 9 // * include a list of copyright holders. 9 // * include a list of copyright holders. * 10 // * 10 // * * 11 // * Neither the authors of this software syst 11 // * Neither the authors of this software system, nor their employing * 12 // * institutes,nor the agencies providing fin 12 // * institutes,nor the agencies providing financial support for this * 13 // * work make any representation or warran 13 // * work make any representation or warranty, express or implied, * 14 // * regarding this software system or assum 14 // * regarding this software system or assume any liability for its * 15 // * use. Please see the license in the file 15 // * use. Please see the license in the file LICENSE and URL above * 16 // * for the full disclaimer and the limitatio 16 // * for the full disclaimer and the limitation of liability. * 17 // * 17 // * * 18 // * This code implementation is the result 18 // * This code implementation is the result of the scientific and * 19 // * technical work of the GEANT4 collaboratio 19 // * technical work of the GEANT4 collaboration. * 20 // * By using, copying, modifying or distri 20 // * By using, copying, modifying or distributing the software (or * 21 // * any work based on the software) you ag 21 // * any work based on the software) you agree to acknowledge its * 22 // * use in resulting scientific publicati 22 // * use in resulting scientific publications, and indicate your * 23 // * acceptance of all terms of the Geant4 Sof 23 // * acceptance of all terms of the Geant4 Software license. * 24 // ******************************************* 24 // ******************************************************************** 25 // 25 // 26 /* 26 /* 27 * G4VITSteppingVerbose.cc 27 * G4VITSteppingVerbose.cc 28 * 28 * 29 * Created on: Jun 22, 2015 29 * Created on: Jun 22, 2015 30 * Author: mkaramit 30 * Author: mkaramit 31 */ 31 */ 32 32 33 #include <G4VITSteppingVerbose.hh> 33 #include <G4VITSteppingVerbose.hh> 34 #include <G4UIcmdWithAnInteger.hh> 34 #include <G4UIcmdWithAnInteger.hh> 35 35 36 //____________________________________________ 36 //______________________________________________________________________________ 37 37 38 G4VITSteppingVerbose::G4VITSteppingVerbose() 38 G4VITSteppingVerbose::G4VITSteppingVerbose() 39 { 39 { 40 fpStepProcessor = nullptr; << 40 fpStepProcessor = 0; 41 fpState = nullptr; << 41 fpState = 0; 42 fpProcessGeneralInfo = nullptr; << 42 fpProcessGeneralInfo = 0; 43 43 44 PhysicalStep = -1; 44 PhysicalStep = -1; 45 fStepStatus = fUndefined; 45 fStepStatus = fUndefined; 46 46 47 fParticleChange = nullptr; << 47 fParticleChange = 0; 48 fTrack = nullptr; << 48 fTrack = 0; 49 fSecondary = nullptr; << 49 fSecondary = 0; 50 fStep = nullptr; << 50 fStep = 0; 51 fPreStepPoint = nullptr; << 51 fPreStepPoint = 0; 52 fPostStepPoint = nullptr; << 52 fPostStepPoint = 0; 53 53 54 fCurrentVolume = nullptr; << 54 fCurrentVolume = 0; 55 // fSensitive = fpStepProcessor->GetfSensit 55 // fSensitive = fpStepProcessor->GetfSensitive(); 56 fCurrentProcess = nullptr; << 56 fCurrentProcess = 0; 57 57 58 fAtRestDoItVector = nullptr; << 58 fAtRestDoItVector = 0; 59 fAlongStepDoItVector = nullptr; << 59 fAlongStepDoItVector = 0; 60 fPostStepDoItVector = nullptr; << 60 fPostStepDoItVector = 0; 61 << 61 62 fAtRestGetPhysIntVector = nullptr; << 62 fAtRestGetPhysIntVector = 0; 63 fAlongStepGetPhysIntVector = nullptr; << 63 fAlongStepGetPhysIntVector = 0; 64 fPostStepGetPhysIntVector = nullptr; << 64 fPostStepGetPhysIntVector = 0; 65 65 66 MAXofAtRestLoops = 0; 66 MAXofAtRestLoops = 0; 67 MAXofAlongStepLoops = 0; 67 MAXofAlongStepLoops = 0; 68 MAXofPostStepLoops = 0; 68 MAXofPostStepLoops = 0; 69 69 70 fAtRestDoItProcTriggered = 0; 70 fAtRestDoItProcTriggered = 0; 71 fPostStepDoItProcTriggered = 0; 71 fPostStepDoItProcTriggered = 0; 72 72 73 fN2ndariesAtRestDoIt = 0; 73 fN2ndariesAtRestDoIt = 0; 74 fN2ndariesAlongStepDoIt = 0; 74 fN2ndariesAlongStepDoIt = 0; 75 fN2ndariesPostStepDoIt = 0; 75 fN2ndariesPostStepDoIt = 0; 76 76 77 // fNavigator = fpStepProcessor->GetfNaviga 77 // fNavigator = fpStepProcessor->GetfNavigator(); 78 78 79 fVerboseLevel = 0; 79 fVerboseLevel = 0; 80 fpVerboseUI = new G4UIcmdWithAnInteger("/che 80 fpVerboseUI = new G4UIcmdWithAnInteger("/chem/tracking/verbose", this); 81 81 82 fSelectedAtRestDoItVector = nullptr; << 82 fSelectedAtRestDoItVector = 0; 83 fSelectedPostStepDoItVector = nullptr; << 83 fSelectedPostStepDoItVector = 0; 84 84 85 fPreviousStepSize = 0.; 85 fPreviousStepSize = 0.; 86 86 87 fTouchableHandle = nullptr; << 87 fTouchableHandle = 0; 88 88 89 // StepControlFlag = fpStepProcessor->GetSt 89 // StepControlFlag = fpStepProcessor->GetStepControlFlag(); 90 90 91 physIntLength = 0; 91 physIntLength = 0; 92 fCondition = InActivated; 92 fCondition = InActivated; 93 fGPILSelection = NotCandidateForSelection; 93 fGPILSelection = NotCandidateForSelection; 94 94 95 } 95 } 96 96 97 //____________________________________________ 97 //______________________________________________________________________________ 98 98 99 G4VITSteppingVerbose::~G4VITSteppingVerbose() 99 G4VITSteppingVerbose::~G4VITSteppingVerbose() 100 { 100 { 101 delete fpVerboseUI; << 101 if(fpVerboseUI) delete fpVerboseUI; 102 } 102 } 103 103 104 //____________________________________________ 104 //______________________________________________________________________________ 105 105 106 void G4VITSteppingVerbose::CopyState() 106 void G4VITSteppingVerbose::CopyState() 107 { 107 { 108 108 109 if(fpState != nullptr) *fpState = *(fpStepPr << 109 if(fpState) *fpState = *(fpStepProcessor->GetProcessorState()); 110 else 110 else 111 { 111 { 112 fpState = new G4ITStepProcessorState(*fpSt 112 fpState = new G4ITStepProcessorState(*fpStepProcessor->GetProcessorState()); 113 } 113 } 114 114 115 fpProcessGeneralInfo = fpStepProcessor->GetC 115 fpProcessGeneralInfo = fpStepProcessor->GetCurrentProcessInfo(); 116 116 117 PhysicalStep = fpStepProcessor->GetPhysIntLe 117 PhysicalStep = fpStepProcessor->GetPhysIntLength(); 118 fStepStatus = fpState->fStepStatus; 118 fStepStatus = fpState->fStepStatus; 119 119 120 fParticleChange = fpStepProcessor->GetPartic 120 fParticleChange = fpStepProcessor->GetParticleChange(); 121 fTrack = fpStepProcessor->GetTrack(); 121 fTrack = fpStepProcessor->GetTrack(); 122 fSecondary = fpStepProcessor->GetSecondaries 122 fSecondary = fpStepProcessor->GetSecondaries(); 123 fStep = fpStepProcessor->GetStep(); 123 fStep = fpStepProcessor->GetStep(); 124 fPreStepPoint = fStep->GetPreStepPoint(); 124 fPreStepPoint = fStep->GetPreStepPoint(); 125 fPostStepPoint = fStep->GetPostStepPoint(); 125 fPostStepPoint = fStep->GetPostStepPoint(); 126 126 127 fCurrentVolume = fpStepProcessor->GetCurrent 127 fCurrentVolume = fpStepProcessor->GetCurrentVolume(); 128 // fSensitive = fpStepProcessor->GetfSensitiv 128 // fSensitive = fpStepProcessor->GetfSensitive(); 129 fCurrentProcess = fpStepProcessor->GetCurren 129 fCurrentProcess = fpStepProcessor->GetCurrentProcess(); 130 130 131 fAtRestDoItVector = fpProcessGeneralInfo->fp 131 fAtRestDoItVector = fpProcessGeneralInfo->fpAtRestDoItVector; 132 fAlongStepDoItVector = fpProcessGeneralInfo- 132 fAlongStepDoItVector = fpProcessGeneralInfo->fpAlongStepDoItVector; 133 fPostStepDoItVector = fpProcessGeneralInfo-> 133 fPostStepDoItVector = fpProcessGeneralInfo->fpPostStepDoItVector; 134 134 135 fAtRestGetPhysIntVector = fpProcessGeneralIn 135 fAtRestGetPhysIntVector = fpProcessGeneralInfo->fpAtRestGetPhysIntVector; 136 fAlongStepGetPhysIntVector = 136 fAlongStepGetPhysIntVector = 137 fpProcessGeneralInfo->fpAlongStepGetPhys 137 fpProcessGeneralInfo->fpAlongStepGetPhysIntVector; 138 fPostStepGetPhysIntVector = fpProcessGeneral 138 fPostStepGetPhysIntVector = fpProcessGeneralInfo->fpPostStepGetPhysIntVector; 139 139 140 MAXofAtRestLoops = fpProcessGeneralInfo->MAX 140 MAXofAtRestLoops = fpProcessGeneralInfo->MAXofAtRestLoops; 141 MAXofAlongStepLoops = fpProcessGeneralInfo-> 141 MAXofAlongStepLoops = fpProcessGeneralInfo->MAXofAlongStepLoops; 142 MAXofPostStepLoops = fpProcessGeneralInfo->M 142 MAXofPostStepLoops = fpProcessGeneralInfo->MAXofPostStepLoops; 143 143 144 fAtRestDoItProcTriggered = fpStepProcessor-> 144 fAtRestDoItProcTriggered = fpStepProcessor->GetAtRestDoItProcTriggered(); 145 fPostStepDoItProcTriggered = fpStepProcessor 145 fPostStepDoItProcTriggered = fpStepProcessor->GetPostStepDoItProcTriggered(); 146 146 147 fN2ndariesAtRestDoIt = fpStepProcessor->GetN 147 fN2ndariesAtRestDoIt = fpStepProcessor->GetN2ndariesAtRestDoIt(); 148 fN2ndariesAlongStepDoIt = fpStepProcessor->G 148 fN2ndariesAlongStepDoIt = fpStepProcessor->GetN2ndariesAlongStepDoIt(); 149 fN2ndariesPostStepDoIt = fpStepProcessor->Ge 149 fN2ndariesPostStepDoIt = fpStepProcessor->GetN2ndariesPostStepDoIt(); 150 150 151 // fNavigator = fpStepProcessor->GetfNavigato 151 // fNavigator = fpStepProcessor->GetfNavigator(); 152 152 153 fSelectedAtRestDoItVector = &(fpState->fSele 153 fSelectedAtRestDoItVector = &(fpState->fSelectedAtRestDoItVector); 154 fSelectedPostStepDoItVector = &(fpState->fSe 154 fSelectedPostStepDoItVector = &(fpState->fSelectedPostStepDoItVector); 155 155 156 fPreviousStepSize = fpState->fPreviousStepSi 156 fPreviousStepSize = fpState->fPreviousStepSize; 157 157 158 fTouchableHandle = fpState->fTouchableHandle 158 fTouchableHandle = fpState->fTouchableHandle; 159 159 160 // StepControlFlag = fpStepProcessor->GetStep 160 // StepControlFlag = fpStepProcessor->GetStepControlFlag(); 161 161 162 physIntLength = fpStepProcessor->GetPhysIntL 162 physIntLength = fpStepProcessor->GetPhysIntLength(); 163 fCondition = fpStepProcessor->GetCondition() 163 fCondition = fpStepProcessor->GetCondition(); 164 fGPILSelection = fpStepProcessor->GetGPILSel 164 fGPILSelection = fpStepProcessor->GetGPILSelection(); 165 } 165 } 166 166 167 //____________________________________________ 167 //______________________________________________________________________________ 168 168 169 void G4VITSteppingVerbose::SetNewValue(G4UIcom 169 void G4VITSteppingVerbose::SetNewValue(G4UIcommand* command, G4String newValue) 170 { 170 { 171 if(command == fpVerboseUI) 171 if(command == fpVerboseUI) 172 { 172 { 173 fVerboseLevel = fpVerboseUI->GetNewIntValu 173 fVerboseLevel = fpVerboseUI->GetNewIntValue(newValue); 174 } 174 } 175 } 175 } 176 176 177 //____________________________________________ 177 //______________________________________________________________________________ 178 178 179 G4String G4VITSteppingVerbose::GetCurrentValue 179 G4String G4VITSteppingVerbose::GetCurrentValue(G4UIcommand* command) 180 { 180 { 181 return command->ConvertToString(fVerboseLeve 181 return command->ConvertToString(fVerboseLevel); 182 } 182 } 183 183 184 //____________________________________________ 184 //______________________________________________________________________________ 185 185 186 void G4VITSteppingVerbose::TrackingStarted(G4T 186 void G4VITSteppingVerbose::TrackingStarted(G4Track* 187 #ifdef G4VERBOSE 187 #ifdef G4VERBOSE 188 tra 188 track 189 #endif 189 #endif 190 ) 190 ) 191 { 191 { 192 #ifdef G4VERBOSE 192 #ifdef G4VERBOSE 193 if(fVerboseLevel > 0) 193 if(fVerboseLevel > 0) 194 { 194 { 195 TrackBanner(track, "G4ITTrackingManager::S 195 TrackBanner(track, "G4ITTrackingManager::StartTracking : "); 196 } 196 } 197 #endif 197 #endif 198 198 199 } 199 } 200 200 201 //____________________________________________ 201 //______________________________________________________________________________ 202 202 203 void G4VITSteppingVerbose::TrackingEnded(G4Tra 203 void G4VITSteppingVerbose::TrackingEnded(G4Track* 204 #ifdef G4VERBOSE 204 #ifdef G4VERBOSE 205 track 205 track 206 #endif 206 #endif 207 ) 207 ) 208 { 208 { 209 #ifdef G4VERBOSE 209 #ifdef G4VERBOSE 210 if(fVerboseLevel > 0) 210 if(fVerboseLevel > 0) 211 { 211 { 212 TrackBanner(track, "G4ITTrackingManager::E 212 TrackBanner(track, "G4ITTrackingManager::EndTracking : "); 213 } 213 } 214 #endif 214 #endif 215 } 215 } 216 216 217 //____________________________________________ 217 //______________________________________________________________________________ 218 218 219 void G4VITSteppingVerbose::TrackBanner(G4Track 219 void G4VITSteppingVerbose::TrackBanner(G4Track* track, const G4String& message) 220 { 220 { 221 G4cout << G4endl; 221 G4cout << G4endl; 222 G4cout << "********************************* 222 G4cout << "*******************************************************" 223 << "********************************* 223 << "**************************************************" 224 << G4endl; 224 << G4endl; 225 if(!message.empty()) << 225 if(message != "") 226 { 226 { 227 G4cout << message; 227 G4cout << message; 228 } 228 } 229 G4cout << " * G4Track Information: " 229 G4cout << " * G4Track Information: " 230 << " Particle : " << track->GetDefi 230 << " Particle : " << track->GetDefinition()->GetParticleName() 231 << "," 231 << "," 232 << " Track ID : " << track->GetTrac 232 << " Track ID : " << track->GetTrackID() 233 << "," 233 << "," 234 << " Parent ID : " << track->GetPar 234 << " Parent ID : " << track->GetParentID() 235 << G4endl; 235 << G4endl; 236 G4cout << "********************************* 236 G4cout << "*******************************************************" 237 << "********************************* 237 << "**************************************************" 238 << G4endl; 238 << G4endl; 239 G4cout << G4endl; 239 G4cout << G4endl; 240 } 240 } 241 241