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