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 // $Id$ 27 // 28 // 28 //-------------------------------------------- 29 //--------------------------------------------------------------- 29 // 30 // 30 // G4ITSteppingVerbose.cc 31 // G4ITSteppingVerbose.cc 31 // 32 // 32 // Description: 33 // Description: 33 // Implementation of the G4ITSteppingVerbo 34 // Implementation of the G4ITSteppingVerbose class 34 // 35 // 35 //-------------------------------------------- 36 //--------------------------------------------------------------- 36 37 37 #include "G4ITSteppingVerbose.hh" 38 #include "G4ITSteppingVerbose.hh" 38 #include "G4ITStepProcessor.hh" 39 #include "G4ITStepProcessor.hh" 39 #include "G4SystemOfUnits.hh" 40 #include "G4SystemOfUnits.hh" >> 41 //#include "G4VSensitiveDetector.hh" // Include from 'hits/digi' 40 #include "G4StepStatus.hh" // Include from 42 #include "G4StepStatus.hh" // Include from 'tracking' 41 43 42 #include "G4IT.hh" 44 #include "G4IT.hh" 43 #include "G4IosFlagsSaver.hh" 45 #include "G4IosFlagsSaver.hh" 44 46 45 #define G4_USE_G4BESTUNIT_FOR_VERBOSE 1 47 #define G4_USE_G4BESTUNIT_FOR_VERBOSE 1 46 48 47 #ifdef G4_USE_G4BESTUNIT_FOR_VERBOSE 49 #ifdef G4_USE_G4BESTUNIT_FOR_VERBOSE 48 #include "G4UnitsTable.hh" 50 #include "G4UnitsTable.hh" 49 #else 51 #else 50 #define G4BestUnit(a,b) a 52 #define G4BestUnit(a,b) a 51 #endif 53 #endif 52 54 53 using namespace std; 55 using namespace std; 54 56 >> 57 ////////////////////////////////////////////////// 55 G4ITSteppingVerbose::G4ITSteppingVerbose() 58 G4ITSteppingVerbose::G4ITSteppingVerbose() 56 = default; << 59 ////////////////////////////////////////////////// >> 60 { >> 61 #ifdef G4_TRACKING_DEBUG >> 62 G4cout << "G4ITSteppingVerbose has instantiated" << G4endl; >> 63 #endif >> 64 } 57 65 >> 66 ////////////////////////////////////////////////// 58 G4ITSteppingVerbose::~G4ITSteppingVerbose() 67 G4ITSteppingVerbose::~G4ITSteppingVerbose() 59 = default; << 68 ////////////////////////////////////////////////// >> 69 { >> 70 } 60 71 61 ////////////////////////////////////////////// 72 ////////////////////////////////////////////////// 62 void G4ITSteppingVerbose::NewStep() 73 void G4ITSteppingVerbose::NewStep() 63 ////////////////////////////////////////////// 74 ////////////////////////////////////////////////// 64 { 75 { 65 } 76 } 66 77 67 ////////////////////////////////////////////// 78 ////////////////////////////////////////////////// 68 void G4ITSteppingVerbose::AtRestDoItInvoked() 79 void G4ITSteppingVerbose::AtRestDoItInvoked() 69 ////////////////////////////////////////////// 80 ////////////////////////////////////////////////// 70 { 81 { 71 if(fVerboseLevel == 0) 82 if(fVerboseLevel == 0) 72 { 83 { 73 return; 84 return; 74 } 85 } 75 86 76 G4VProcess* ptProcManager; 87 G4VProcess* ptProcManager; 77 CopyState(); 88 CopyState(); 78 89 79 if(fVerboseLevel >= 3) 90 if(fVerboseLevel >= 3) 80 { 91 { 81 G4int npt = 0; 92 G4int npt = 0; 82 G4cout << " **List of AtRestDoIt invoked:" 93 G4cout << " **List of AtRestDoIt invoked:" << G4endl; 83 for(std::size_t np = 0; np < MAXofAtRestLo << 94 for(size_t np = 0; np < MAXofAtRestLoops; np++) 84 { 95 { 85 std::size_t npGPIL = MAXofAtRestLoops - << 96 size_t npGPIL = MAXofAtRestLoops - np - 1; 86 if((*fSelectedAtRestDoItVector)[npGPIL] 97 if((*fSelectedAtRestDoItVector)[npGPIL] == 2) 87 { 98 { 88 ++npt; << 99 npt++; 89 ptProcManager = (*fAtRestDoItVector)[( << 100 ptProcManager = (*fAtRestDoItVector)[np]; 90 G4cout << " # " << npt << " : " << p 101 G4cout << " # " << npt << " : " << ptProcManager->GetProcessName() 91 << " (Forced)" << G4endl; 102 << " (Forced)" << G4endl; 92 } 103 } 93 else if ( (*fSelectedAtRestDoItVector)[n 104 else if ( (*fSelectedAtRestDoItVector)[npGPIL] == 1 ) 94 { 105 { 95 ++npt; << 106 npt++; 96 ptProcManager = (*fAtRestDoItVector)[( << 107 ptProcManager = (*fAtRestDoItVector)[np]; 97 G4cout << " # " << npt << " : " << p 108 G4cout << " # " << npt << " : " << ptProcManager->GetProcessName() 98 << G4endl; 109 << G4endl; 99 } 110 } 100 } 111 } 101 112 102 G4cout << " Generated secondries # : " < 113 G4cout << " Generated secondries # : " << fN2ndariesAtRestDoIt << G4endl; 103 114 104 if(fN2ndariesAtRestDoIt > 0) 115 if(fN2ndariesAtRestDoIt > 0) 105 { 116 { 106 G4cout << " -- List of secondaries gen 117 G4cout << " -- List of secondaries generated : " 107 << "(x,y,z,kE,t,PID) --" << G4end 118 << "(x,y,z,kE,t,PID) --" << G4endl; 108 for(std::size_t lp1=(*fSecondary).size() << 119 for( size_t lp1=(*fSecondary).size()-fN2ndariesAtRestDoIt; 109 lp1<(*fSecondary).size(); ++lp1) << 120 lp1<(*fSecondary).size(); lp1++) 110 { 121 { 111 G4cout << " " 122 G4cout << " " 112 << std::setw( 9) 123 << std::setw( 9) 113 << G4BestUnit((*fSecondary)[lp1]->GetP 124 << G4BestUnit((*fSecondary)[lp1]->GetPosition().x(),"Length") << " " 114 << std::setw( 9) 125 << std::setw( 9) 115 << G4BestUnit((*fSecondary)[lp1]->GetP 126 << G4BestUnit((*fSecondary)[lp1]->GetPosition().y(),"Length") << " " 116 << std::setw( 9) 127 << std::setw( 9) 117 << G4BestUnit((*fSecondary)[lp1]->GetP 128 << G4BestUnit((*fSecondary)[lp1]->GetPosition().z(),"Length") << " " 118 << std::setw( 9) 129 << std::setw( 9) 119 << G4BestUnit((*fSecondary)[lp1]->GetK 130 << G4BestUnit((*fSecondary)[lp1]->GetKineticEnergy(),"Energy") << " " 120 << std::setw( 9) 131 << std::setw( 9) 121 << G4BestUnit((*fSecondary)[lp1]->GetG 132 << G4BestUnit((*fSecondary)[lp1]->GetGlobalTime(),"Time") << " " 122 << std::setw(18) 133 << std::setw(18) 123 << (*fSecondary)[lp1]->GetDefinition() 134 << (*fSecondary)[lp1]->GetDefinition()->GetParticleName() << G4endl; 124 } 135 } 125 } 136 } 126 } 137 } 127 138 128 if(fVerboseLevel >= 4) 139 if(fVerboseLevel >= 4) 129 { 140 { 130 ShowStep(); 141 ShowStep(); 131 G4cout << G4endl; 142 G4cout << G4endl; 132 } 143 } 133 } 144 } 134 ////////////////////////////////////////////// 145 ///////////////////////////////////////////////////// 135 void G4ITSteppingVerbose::AlongStepDoItAllDone 146 void G4ITSteppingVerbose::AlongStepDoItAllDone() 136 ////////////////////////////////////////////// 147 ///////////////////////////////////////////////////// 137 { 148 { 138 if(fVerboseLevel == 0) 149 if(fVerboseLevel == 0) 139 { 150 { 140 return; 151 return; 141 } 152 } 142 153 143 G4VProcess* ptProcManager; 154 G4VProcess* ptProcManager; 144 155 145 CopyState(); 156 CopyState(); 146 157 147 if(fVerboseLevel >= 3) 158 if(fVerboseLevel >= 3) 148 { 159 { 149 G4cout << G4endl; 160 G4cout << G4endl; 150 G4cout << " >>AlongStepDoIt (after all inv 161 G4cout << " >>AlongStepDoIt (after all invocations):" << G4endl; 151 G4cout << " ++List of invoked processes 162 G4cout << " ++List of invoked processes " << G4endl; 152 163 153 for(std::size_t ci=0; ci<MAXofAlongStepLoo << 164 for(size_t ci=0; ci<MAXofAlongStepLoops; ci++) 154 { 165 { 155 ptProcManager = (*fAlongStepDoItVector)( << 166 ptProcManager = (*fAlongStepDoItVector)(ci); 156 G4cout << " " << ci+1 << ") "; 167 G4cout << " " << ci+1 << ") "; 157 if(ptProcManager != nullptr) << 168 if(ptProcManager != 0) 158 { 169 { 159 G4cout << ptProcManager->GetProcessNam 170 G4cout << ptProcManager->GetProcessName() << G4endl; 160 } 171 } 161 } 172 } 162 173 163 ShowStep(); 174 ShowStep(); 164 G4cout << G4endl; 175 G4cout << G4endl; 165 G4cout << " ++List of secondaries gener 176 G4cout << " ++List of secondaries generated " 166 << "(x,y,z,kE,t,PID):" 177 << "(x,y,z,kE,t,PID):" 167 << " No. of secodaries = " 178 << " No. of secodaries = " 168 << (*fSecondary).size() << G4endl; 179 << (*fSecondary).size() << G4endl; 169 180 170 if(!(*fSecondary).empty()) << 181 if((*fSecondary).size()>0) 171 { 182 { 172 for(auto lp1 : *fSecondary) << 183 for(size_t lp1=0; lp1<(*fSecondary).size(); lp1++) 173 { 184 { 174 G4cout << " " 185 G4cout << " " 175 << std::setw( 9) 186 << std::setw( 9) 176 << G4BestUnit(lp1->GetPosition().x()," << 187 << G4BestUnit((*fSecondary)[lp1]->GetPosition().x(),"Length") << " " 177 << std::setw( 9) 188 << std::setw( 9) 178 << G4BestUnit(lp1->GetPosition().y()," << 189 << G4BestUnit((*fSecondary)[lp1]->GetPosition().y(),"Length") << " " 179 << std::setw( 9) 190 << std::setw( 9) 180 << G4BestUnit(lp1->GetPosition().z()," << 191 << G4BestUnit((*fSecondary)[lp1]->GetPosition().z(),"Length") << " " 181 << std::setw( 9) 192 << std::setw( 9) 182 << G4BestUnit(lp1->GetKineticEnergy(), << 193 << G4BestUnit((*fSecondary)[lp1]->GetKineticEnergy(),"Energy") << " " 183 << std::setw( 9) 194 << std::setw( 9) 184 << G4BestUnit(lp1->GetGlobalTime(),"Ti << 195 << G4BestUnit((*fSecondary)[lp1]->GetGlobalTime(),"Time") << " " 185 << std::setw(18) 196 << std::setw(18) 186 << lp1->GetDefinition()->GetParticleNa << 197 << (*fSecondary)[lp1]->GetDefinition()->GetParticleName() << G4endl; 187 } 198 } 188 } 199 } 189 } 200 } 190 } 201 } 191 ////////////////////////////////////////////// 202 //////////////////////////////////////////////////// 192 void G4ITSteppingVerbose::PostStepDoItAllDone( 203 void G4ITSteppingVerbose::PostStepDoItAllDone() 193 ////////////////////////////////////////////// 204 //////////////////////////////////////////////////// 194 { 205 { 195 if(fVerboseLevel == 0) 206 if(fVerboseLevel == 0) 196 { 207 { 197 return; 208 return; 198 } 209 } 199 210 200 G4VProcess* ptProcManager; 211 G4VProcess* ptProcManager; 201 212 202 CopyState(); 213 CopyState(); 203 214 204 if(fVerboseLevel >= 3) 215 if(fVerboseLevel >= 3) 205 { 216 { 206 217 207 if((fStepStatus == fPostStepDoItProc) || ( << 218 if((fStepStatus == fPostStepDoItProc) | (fCondition == Forced) 208 || (fCondition == Conditionally) || (fC << 219 | (fCondition == Conditionally) | (fCondition == ExclusivelyForced) 209 || (fCondition == StronglyForced)) << 220 | (fCondition == StronglyForced)) 210 { 221 { 211 222 212 G4int npt = 0; 223 G4int npt = 0; 213 G4cout << G4endl; 224 G4cout << G4endl; 214 G4cout << " **PostStepDoIt (after all in 225 G4cout << " **PostStepDoIt (after all invocations):" << G4endl; 215 G4cout << " ++List of invoked process 226 G4cout << " ++List of invoked processes " << G4endl; 216 227 217 for(std::size_t np = 0; np < MAXofPostSt << 228 for(size_t np = 0; np < MAXofPostStepLoops; np++) 218 { 229 { 219 std::size_t npGPIL = MAXofPostStepLoop << 230 size_t npGPIL = MAXofPostStepLoops - np - 1; 220 if((*fSelectedPostStepDoItVector)[npGP 231 if((*fSelectedPostStepDoItVector)[npGPIL] == 2) 221 { 232 { 222 npt++; 233 npt++; 223 ptProcManager = (*fPostStepDoItVecto << 234 ptProcManager = (*fPostStepDoItVector)[np]; 224 G4cout << " " << npt << ") " << 235 G4cout << " " << npt << ") " << ptProcManager->GetProcessName() 225 << " (Forced)" << G4endl; 236 << " (Forced)" << G4endl; 226 } 237 } 227 else if ( (*fSelectedPostStepDoItVecto 238 else if ( (*fSelectedPostStepDoItVector)[npGPIL] == 1) 228 { 239 { 229 npt++; 240 npt++; 230 ptProcManager = (*fPostStepDoItVecto << 241 ptProcManager = (*fPostStepDoItVector)[np]; 231 G4cout << " " << npt << ") " 242 G4cout << " " << npt << ") " 232 << ptProcManager->GetProcessName() < 243 << ptProcManager->GetProcessName() << G4endl; 233 } 244 } 234 } 245 } 235 246 236 ShowStep(); 247 ShowStep(); 237 G4cout << G4endl; 248 G4cout << G4endl; 238 G4cout << " ++List of secondaries gen 249 G4cout << " ++List of secondaries generated " << "(x,y,z,kE,t,PID):" 239 << " No. of secodaries = " << (* 250 << " No. of secodaries = " << (*fSecondary).size() << G4endl; 240 G4cout << " [Note]Secondaries from 251 G4cout << " [Note]Secondaries from AlongStepDoIt included." << G4endl; 241 252 242 if(!(*fSecondary).empty()) << 253 if((*fSecondary).size() > 0) 243 { 254 { 244 for(auto lp1 : *fSecondary) << 255 for(size_t lp1 = 0; lp1 < (*fSecondary).size(); lp1++) 245 { 256 { 246 G4cout << " " << std::setw(9) 257 G4cout << " " << std::setw(9) 247 << G4BestUnit(lp1->GetPositio << 258 << G4BestUnit((*fSecondary)[lp1]->GetPosition().x(), "Length") 248 << " " << std::setw(9) 259 << " " << std::setw(9) 249 << G4BestUnit(lp1->GetPositio << 260 << G4BestUnit((*fSecondary)[lp1]->GetPosition().y(), "Length") 250 << " " << std::setw(9) 261 << " " << std::setw(9) 251 << G4BestUnit(lp1->GetPositio << 262 << G4BestUnit((*fSecondary)[lp1]->GetPosition().z(), "Length") 252 << " " << std::setw(9) 263 << " " << std::setw(9) 253 << G4BestUnit(lp1->GetKinetic << 264 << G4BestUnit((*fSecondary)[lp1]->GetKineticEnergy(), "Energy") 254 << " " << std::setw(9) 265 << " " << std::setw(9) 255 << G4BestUnit(lp1->GetGlobalT << 266 << G4BestUnit((*fSecondary)[lp1]->GetGlobalTime(), "Time") 256 << " " << std::setw(18) 267 << " " << std::setw(18) 257 << lp1->GetDefinition()->GetP << 268 << (*fSecondary)[lp1]->GetDefinition()->GetParticleName() 258 << G4endl; 269 << G4endl; 259 } 270 } 260 } 271 } 261 } 272 } 262 } 273 } 263 } 274 } 264 275 265 ///////////////////////////////////////// 276 ///////////////////////////////////////// 266 void G4ITSteppingVerbose::StepInfoForLeadingTr 277 void G4ITSteppingVerbose::StepInfoForLeadingTrack() 267 ///////////////////////////////////////// 278 ///////////////////////////////////////// 268 { 279 { 269 if(fVerboseLevel == 0) 280 if(fVerboseLevel == 0) 270 { 281 { 271 return; 282 return; 272 } 283 } 273 284 274 if(fVerboseLevel < 2) 285 if(fVerboseLevel < 2) 275 { 286 { 276 CopyState(); 287 CopyState(); 277 G4long prec = G4cout.precision(3); << 288 G4int prec = G4cout.precision(3); 278 // G4cout.precision(16); 289 // G4cout.precision(16); 279 290 280 if(fVerboseLevel >= 4) VerboseTrack(); 291 if(fVerboseLevel >= 4) VerboseTrack(); 281 if(fVerboseLevel >= 3) 292 if(fVerboseLevel >= 3) 282 { 293 { 283 G4cout << G4endl; 294 G4cout << G4endl; 284 G4cout << "StepInfo" << G4endl; 295 G4cout << "StepInfo" << G4endl; 285 #ifdef G4_USE_G4BESTUNIT_FOR_VERBOSE 296 #ifdef G4_USE_G4BESTUNIT_FOR_VERBOSE 286 G4cout << std::setw( 5) << "#TrackID" << 297 G4cout << std::setw( 5) << "#TrackID" << " " 287 << std::setw( 5) << "#Step#" << " " 298 << std::setw( 5) << "#Step#" << " " 288 << std::setw( 8) << "X" << " " << st 299 << std::setw( 8) << "X" << " " << std::setw( 8) << "Y" << " " 289 << std::setw( 8) << "Z" << " " 300 << std::setw( 8) << "Z" << " " 290 << std::setw( 9) << "KineE" << " " < 301 << std::setw( 9) << "KineE" << " " << std::setw( 8) << "dE" << " " 291 << std::setw(12) << "StepLeng" << " " << 302 << std::setw(12) << "StepLeng" << " " << std::setw(12) << "TrackLeng" << " " 292 << std::setw(12) << "NextVolume" << " " 303 << std::setw(12) << "NextVolume" << " " << std::setw( 8) << "ProcName" << G4endl; 293 #else 304 #else 294 G4cout << std::setw( 5) << "#TrackID" << 305 G4cout << std::setw( 5) << "#TrackID" << " " 295 << std::setw( 5) << "#Step#" << " " 306 << std::setw( 5) << "#Step#" << " " 296 << std::setw( 8) << "X(mm)" << " " << st 307 << std::setw( 8) << "X(mm)" << " " << std::setw( 8) << "Y(mm)" << " " 297 << std::setw( 8) << "Z(mm)" << " " 308 << std::setw( 8) << "Z(mm)" << " " 298 << std::setw( 9) << "KinE(MeV)" << " " < 309 << std::setw( 9) << "KinE(MeV)" << " " << std::setw( 8) << "dE(MeV)" << " " 299 << std::setw( 8) << "StepLeng" << " " << 310 << std::setw( 8) << "StepLeng" << " " << std::setw( 9) << "TrackLeng" << " " 300 << std::setw(11) << "NextVolume" << " " 311 << std::setw(11) << "NextVolume" << " " << std::setw( 8) << "ProcName" << G4endl; 301 #endif 312 #endif 302 } 313 } 303 G4cout << std::setw(5) << fTrack->GetTrack 314 G4cout << std::setw(5) << fTrack->GetTrackID() << " " << std::setw(5) 304 << fTrack->GetCurrentStepNumber() < 315 << fTrack->GetCurrentStepNumber() << " " << std::setw(8) 305 << G4BestUnit(fTrack->GetPosition() 316 << G4BestUnit(fTrack->GetPosition().x(), "Length") << " " 306 << std::setw(8) << G4BestUnit(fTrac 317 << std::setw(8) << G4BestUnit(fTrack->GetPosition().y(), "Length") 307 << " " << std::setw(8) 318 << " " << std::setw(8) 308 << G4BestUnit(fTrack->GetPosition() 319 << G4BestUnit(fTrack->GetPosition().z(), "Length") << " " 309 << std::setw(9) << G4BestUnit(fTrac 320 << std::setw(9) << G4BestUnit(fTrack->GetKineticEnergy(), "Energy") 310 << " " << std::setw(8) 321 << " " << std::setw(8) 311 << G4BestUnit(fStep->GetTotalEnergy 322 << G4BestUnit(fStep->GetTotalEnergyDeposit(), "Energy") << " " 312 << std::setw(8) << G4BestUnit(fStep 323 << std::setw(8) << G4BestUnit(fStep->GetStepLength(), "Length") 313 << " " << std::setw(9) 324 << " " << std::setw(9) 314 << G4BestUnit(fTrack->GetTrackLengt 325 << G4BestUnit(fTrack->GetTrackLength(), "Length") << " "; 315 326 316 // Put cut comment here 327 // Put cut comment here 317 if(fTrack->GetNextVolume() != nullptr) << 328 if(fTrack->GetNextVolume() != 0) 318 { 329 { 319 G4cout << std::setw(11) << fTrack->GetNe 330 G4cout << std::setw(11) << fTrack->GetNextVolume()->GetName() << " "; 320 } 331 } 321 else 332 else 322 { 333 { 323 G4cout << std::setw(11) << "OutOfWorld" 334 G4cout << std::setw(11) << "OutOfWorld" << " "; 324 } 335 } 325 if(fStep->GetPostStepPoint()->GetProcessDe << 336 if(fStep->GetPostStepPoint()->GetProcessDefinedStep() != 0) 326 { 337 { 327 G4cout 338 G4cout 328 << fStep->GetPostStepPoint()->GetPro 339 << fStep->GetPostStepPoint()->GetProcessDefinedStep()->GetProcessName(); 329 } 340 } 330 else 341 else 331 { 342 { 332 G4cout << "User Limit"; 343 G4cout << "User Limit"; 333 } 344 } 334 345 335 G4cout << G4endl; 346 G4cout << G4endl; 336 if(fVerboseLevel == 2) 347 if(fVerboseLevel == 2) 337 { 348 { 338 G4int tN2ndariesTot = fN2ndariesAtRestDo 349 G4int tN2ndariesTot = fN2ndariesAtRestDoIt + fN2ndariesAlongStepDoIt 339 + fN2ndariesPostSt 350 + fN2ndariesPostStepDoIt; 340 if(tN2ndariesTot > 0) 351 if(tN2ndariesTot > 0) 341 { 352 { 342 G4cout << " :----- List of 2ndaries 353 G4cout << " :----- List of 2ndaries - " << "#SpawnInStep=" 343 << std::setw(3) << tN2ndariesTo 354 << std::setw(3) << tN2ndariesTot << "(Rest=" << std::setw(2) 344 << fN2ndariesAtRestDoIt << ",Al 355 << fN2ndariesAtRestDoIt << ",Along=" << std::setw(2) 345 << fN2ndariesAlongStepDoIt << " 356 << fN2ndariesAlongStepDoIt << ",Post=" << std::setw(2) 346 << fN2ndariesPostStepDoIt << ") 357 << fN2ndariesPostStepDoIt << "), " << "#SpawnTotal=" 347 << std::setw(3) << (*fSecondary 358 << std::setw(3) << (*fSecondary).size() << " ---------------" 348 << G4endl; 359 << G4endl; 349 360 350 for(std::size_t lp1=(*fSecondary).size << 361 for(size_t lp1=(*fSecondary).size()-tN2ndariesTot; lp1<(*fSecondary).size(); lp1++) 351 lp1<(*fSecondary).size(); + << 352 { 362 { 353 G4cout << " : " 363 G4cout << " : " 354 << std::setw( 9) 364 << std::setw( 9) 355 << G4BestUnit((*fSecondary)[lp1]->Ge 365 << G4BestUnit((*fSecondary)[lp1]->GetPosition().x() , "Length")<< " " 356 << std::setw( 9) 366 << std::setw( 9) 357 << G4BestUnit((*fSecondary)[lp1]->Ge 367 << G4BestUnit((*fSecondary)[lp1]->GetPosition().y() , "Length")<< " " 358 << std::setw( 9) 368 << std::setw( 9) 359 << G4BestUnit((*fSecondary)[lp1]->Ge 369 << G4BestUnit((*fSecondary)[lp1]->GetPosition().z() , "Length") << " " 360 << std::setw( 9) 370 << std::setw( 9) 361 << G4BestUnit((*fSecondary)[lp1]->Ge 371 << G4BestUnit((*fSecondary)[lp1]->GetKineticEnergy() , "Energy")<< " " 362 << std::setw(18) 372 << std::setw(18) 363 << (*fSecondary)[lp1]->GetDefinition 373 << (*fSecondary)[lp1]->GetDefinition()->GetParticleName() << G4endl; 364 } 374 } 365 G4cout << " :---------------------- 375 G4cout << " :-----------------------------" << "----------------------------------" 366 << "-- EndOf2ndaries Info ------------ 376 << "-- EndOf2ndaries Info ---------------" << G4endl; 367 } 377 } 368 } 378 } 369 G4cout.precision(prec); 379 G4cout.precision(prec); 370 } 380 } 371 } 381 } 372 ///////////////////////////////////////// 382 ///////////////////////////////////////// 373 void G4ITSteppingVerbose::StepInfo() 383 void G4ITSteppingVerbose::StepInfo() 374 ///////////////////////////////////////// 384 ///////////////////////////////////////// 375 { 385 { 376 if(fVerboseLevel < 2) 386 if(fVerboseLevel < 2) 377 { 387 { 378 return; 388 return; 379 } 389 } 380 390 381 CopyState(); 391 CopyState(); 382 G4long prec = G4cout.precision(3); << 392 G4int prec = G4cout.precision(3); 383 // G4cout.precision(16); 393 // G4cout.precision(16); 384 394 385 if(fVerboseLevel >= 4) VerboseTrack(); 395 if(fVerboseLevel >= 4) VerboseTrack(); 386 if(fVerboseLevel >= 3) 396 if(fVerboseLevel >= 3) 387 { 397 { 388 G4cout << G4endl; 398 G4cout << G4endl; 389 G4cout << "StepInfo" << G4endl; 399 G4cout << "StepInfo" << G4endl; 390 #ifdef G4_USE_G4BESTUNIT_FOR_VERBOSE 400 #ifdef G4_USE_G4BESTUNIT_FOR_VERBOSE 391 G4cout << std::setw( 5) << "#TrackID" << " 401 G4cout << std::setw( 5) << "#TrackID" << " " 392 << std::setw( 5) << "#Step#" << " " 402 << std::setw( 5) << "#Step#" << " " 393 << std::setw( 8) << "X" << " " << std: 403 << std::setw( 8) << "X" << " " << std::setw( 8) << "Y" << " " 394 << std::setw( 8) << "Z" << " " 404 << std::setw( 8) << "Z" << " " 395 << std::setw( 9) << "KineE" << " " << 405 << std::setw( 9) << "KineE" << " " << std::setw( 8) << "dE" << " " 396 << std::setw(12) << "StepLeng" << " " << s 406 << std::setw(12) << "StepLeng" << " " << std::setw(12) << "TrackLeng" << " " 397 << std::setw(12) << "NextVolume" << " " << 407 << std::setw(12) << "NextVolume" << " " << std::setw( 8) << "ProcName" << G4endl; 398 #else 408 #else 399 G4cout << std::setw( 5) << "#TrackID" << " 409 G4cout << std::setw( 5) << "#TrackID" << " " 400 << std::setw( 5) << "#Step#" << " " 410 << std::setw( 5) << "#Step#" << " " 401 << std::setw( 8) << "X(mm)" << " " << std: 411 << std::setw( 8) << "X(mm)" << " " << std::setw( 8) << "Y(mm)" << " " 402 << std::setw( 8) << "Z(mm)" << " " 412 << std::setw( 8) << "Z(mm)" << " " 403 << std::setw( 9) << "KinE(MeV)" << " " << 413 << std::setw( 9) << "KinE(MeV)" << " " << std::setw( 8) << "dE(MeV)" << " " 404 << std::setw( 8) << "StepLeng" << " " << s 414 << std::setw( 8) << "StepLeng" << " " << std::setw( 9) << "TrackLeng" << " " 405 << std::setw(11) << "NextVolume" << " " << 415 << std::setw(11) << "NextVolume" << " " << std::setw( 8) << "ProcName" << G4endl; 406 #endif 416 #endif 407 } 417 } 408 G4cout << std::setw(5) << fTrack->GetTrackID 418 G4cout << std::setw(5) << fTrack->GetTrackID() << " " << std::setw(5) 409 << fTrack->GetCurrentStepNumber() << 419 << fTrack->GetCurrentStepNumber() << " " << std::setw(8) 410 << G4BestUnit(fTrack->GetPosition().x 420 << G4BestUnit(fTrack->GetPosition().x(), "Length") << " " 411 << std::setw(8) << G4BestUnit(fTrack- 421 << std::setw(8) << G4BestUnit(fTrack->GetPosition().y(), "Length") 412 << " " << std::setw(8) 422 << " " << std::setw(8) 413 << G4BestUnit(fTrack->GetPosition().z 423 << G4BestUnit(fTrack->GetPosition().z(), "Length") << " " 414 << std::setw(9) << G4BestUnit(fTrack- 424 << std::setw(9) << G4BestUnit(fTrack->GetKineticEnergy(), "Energy") 415 << " " << std::setw(8) 425 << " " << std::setw(8) 416 << G4BestUnit(fStep->GetTotalEnergyDe 426 << G4BestUnit(fStep->GetTotalEnergyDeposit(), "Energy") << " " 417 << std::setw(8) << G4BestUnit(fStep-> 427 << std::setw(8) << G4BestUnit(fStep->GetStepLength(), "Length") << " " 418 << std::setw(9) << G4BestUnit(fTrack- 428 << std::setw(9) << G4BestUnit(fTrack->GetTrackLength(), "Length") 419 << " "; 429 << " "; 420 430 421 // Put cut comment here 431 // Put cut comment here 422 if(fTrack->GetNextVolume() != nullptr) << 432 if(fTrack->GetNextVolume() != 0) 423 { 433 { 424 G4cout << std::setw(11) << fTrack->GetNext 434 G4cout << std::setw(11) << fTrack->GetNextVolume()->GetName() << " "; 425 } 435 } 426 else 436 else 427 { 437 { 428 G4cout << std::setw(11) << "OutOfWorld" << 438 G4cout << std::setw(11) << "OutOfWorld" << " "; 429 } 439 } 430 if(fStep->GetPostStepPoint()->GetProcessDefi << 440 if(fStep->GetPostStepPoint()->GetProcessDefinedStep() != 0) 431 { 441 { 432 G4cout 442 G4cout 433 << fStep->GetPostStepPoint()->GetProce 443 << fStep->GetPostStepPoint()->GetProcessDefinedStep()->GetProcessName(); 434 } 444 } 435 else 445 else 436 { 446 { 437 G4cout << "User Limit"; 447 G4cout << "User Limit"; 438 } 448 } 439 G4cout << G4endl; 449 G4cout << G4endl; 440 if(fVerboseLevel == 2) 450 if(fVerboseLevel == 2) 441 { 451 { 442 G4int tN2ndariesTot = fN2ndariesAtRestDoIt 452 G4int tN2ndariesTot = fN2ndariesAtRestDoIt + fN2ndariesAlongStepDoIt 443 + fN2ndariesPostStep 453 + fN2ndariesPostStepDoIt; 444 if(tN2ndariesTot > 0) 454 if(tN2ndariesTot > 0) 445 { 455 { 446 G4cout << " :----- List of 2ndaries - 456 G4cout << " :----- List of 2ndaries - " << "#SpawnInStep=" 447 << std::setw(3) << tN2ndariesTot 457 << std::setw(3) << tN2ndariesTot << "(Rest=" << std::setw(2) 448 << fN2ndariesAtRestDoIt << ",Alon 458 << fN2ndariesAtRestDoIt << ",Along=" << std::setw(2) 449 << fN2ndariesAlongStepDoIt << ",P 459 << fN2ndariesAlongStepDoIt << ",Post=" << std::setw(2) 450 << fN2ndariesPostStepDoIt << "), 460 << fN2ndariesPostStepDoIt << "), " << "#SpawnTotal=" 451 << std::setw(3) << (*fSecondary). 461 << std::setw(3) << (*fSecondary).size() << " ---------------" 452 << G4endl; 462 << G4endl; 453 463 454 for(std::size_t lp1=(*fSecondary).size() << 464 for(size_t lp1=(*fSecondary).size()-tN2ndariesTot; lp1<(*fSecondary).size(); lp1++) 455 lp1<(*fSecondary).size(); ++l << 456 { 465 { 457 G4cout << " : " 466 G4cout << " : " 458 << std::setw( 9) 467 << std::setw( 9) 459 << G4BestUnit((*fSecondary)[lp1]->GetP 468 << G4BestUnit((*fSecondary)[lp1]->GetPosition().x() , "Length")<< " " 460 << std::setw( 9) 469 << std::setw( 9) 461 << G4BestUnit((*fSecondary)[lp1]->GetP 470 << G4BestUnit((*fSecondary)[lp1]->GetPosition().y() , "Length")<< " " 462 << std::setw( 9) 471 << std::setw( 9) 463 << G4BestUnit((*fSecondary)[lp1]->GetP 472 << G4BestUnit((*fSecondary)[lp1]->GetPosition().z() , "Length") << " " 464 << std::setw( 9) 473 << std::setw( 9) 465 << G4BestUnit((*fSecondary)[lp1]->GetK 474 << G4BestUnit((*fSecondary)[lp1]->GetKineticEnergy() , "Energy")<< " " 466 << std::setw(18) 475 << std::setw(18) 467 << (*fSecondary)[lp1]->GetDefinition() 476 << (*fSecondary)[lp1]->GetDefinition()->GetParticleName() << G4endl; 468 } 477 } 469 G4cout << " :------------------------ 478 G4cout << " :-----------------------------" << "----------------------------------" 470 << "-- EndOf2ndaries Info -------------- 479 << "-- EndOf2ndaries Info ---------------" << G4endl; 471 } 480 } 472 } 481 } 473 G4cout.precision(prec); 482 G4cout.precision(prec); 474 } 483 } 475 // Put cut comment here if( fStepStatus != fWo 484 // Put cut comment here if( fStepStatus != fWorldBoundary){ 476 485 477 //////////////////////////////////////////// 486 //////////////////////////////////////////// 478 void G4ITSteppingVerbose::DPSLStarted() 487 void G4ITSteppingVerbose::DPSLStarted() 479 //////////////////////////////////////////// 488 //////////////////////////////////////////// 480 { 489 { 481 if(fVerboseLevel == 0) 490 if(fVerboseLevel == 0) 482 { 491 { 483 return; 492 return; 484 } 493 } 485 CopyState(); 494 CopyState(); 486 495 487 if(fVerboseLevel > 5) 496 if(fVerboseLevel > 5) 488 { 497 { 489 G4cout << G4endl<< " >>DefinePhysicalStepL 498 G4cout << G4endl<< " >>DefinePhysicalStepLength (List of proposed StepLengths): " << G4endl; 490 } 499 } 491 } 500 } 492 ////////////////////////////////////////////// 501 ////////////////////////////////////////////// 493 void G4ITSteppingVerbose::DPSLUserLimit() 502 void G4ITSteppingVerbose::DPSLUserLimit() 494 ////////////////////////////////////////////// 503 ////////////////////////////////////////////// 495 { 504 { 496 if(fVerboseLevel == 0) 505 if(fVerboseLevel == 0) 497 { 506 { 498 return; 507 return; 499 } 508 } 500 CopyState(); 509 CopyState(); 501 510 502 if(fVerboseLevel > 5) 511 if(fVerboseLevel > 5) 503 { 512 { 504 G4cout << G4endl<< G4endl; 513 G4cout << G4endl<< G4endl; 505 G4cout << "=== Defined Physical Step Lengt 514 G4cout << "=== Defined Physical Step Length (DPSL)" << G4endl; 506 G4cout << " ++ProposedStep(UserLimit) = 515 G4cout << " ++ProposedStep(UserLimit) = " << std::setw( 9) << physIntLength 507 << " : ProcName = User defined maximum all 516 << " : ProcName = User defined maximum allowed Step" << G4endl; 508 } 517 } 509 } 518 } 510 ///////////////////////////////////////////// 519 ///////////////////////////////////////////// 511 void G4ITSteppingVerbose::DPSLPostStep() 520 void G4ITSteppingVerbose::DPSLPostStep() 512 ///////////////////////////////////////////// 521 ///////////////////////////////////////////// 513 { 522 { 514 if(fVerboseLevel == 0) 523 if(fVerboseLevel == 0) 515 { 524 { 516 return; 525 return; 517 } 526 } 518 527 519 if(fVerboseLevel > 5) 528 if(fVerboseLevel > 5) 520 { 529 { 521 CopyState(); 530 CopyState(); 522 531 523 G4cout << " ++ProposedStep(PostStep ) = 532 G4cout << " ++ProposedStep(PostStep ) = " << std::setw(9) 524 << physIntLength << " : ProcName = 533 << physIntLength << " : ProcName = " 525 << fCurrentProcess->GetProcessName( 534 << fCurrentProcess->GetProcessName() << " ("; 526 if(fCondition == ExclusivelyForced) 535 if(fCondition == ExclusivelyForced) 527 { 536 { 528 G4cout << "ExclusivelyForced)" << G4endl 537 G4cout << "ExclusivelyForced)" << G4endl; 529 } 538 } 530 else if(fCondition==StronglyForced) 539 else if(fCondition==StronglyForced) 531 { 540 { 532 G4cout << "StronglyForced)" << G4endl; 541 G4cout << "StronglyForced)" << G4endl; 533 } 542 } 534 else if(fCondition==Conditionally) 543 else if(fCondition==Conditionally) 535 { 544 { 536 G4cout << "Conditionally)" << G4endl; 545 G4cout << "Conditionally)" << G4endl; 537 } 546 } 538 else if(fCondition==Forced) 547 else if(fCondition==Forced) 539 { 548 { 540 G4cout << "Forced)" << G4endl; 549 G4cout << "Forced)" << G4endl; 541 } 550 } 542 else 551 else 543 { 552 { 544 G4cout << "No ForceCondition)" << G4endl 553 G4cout << "No ForceCondition)" << G4endl; 545 } 554 } 546 } 555 } 547 } 556 } 548 ///////////////////////////////////////////// 557 ///////////////////////////////////////////// 549 void G4ITSteppingVerbose::DPSLAlongStep() 558 void G4ITSteppingVerbose::DPSLAlongStep() 550 ///////////////////////////////////////////// 559 ///////////////////////////////////////////// 551 { 560 { 552 if(fVerboseLevel == 0) 561 if(fVerboseLevel == 0) 553 { 562 { 554 return; 563 return; 555 } 564 } 556 565 557 if(fVerboseLevel > 5) 566 if(fVerboseLevel > 5) 558 { 567 { 559 CopyState(); 568 CopyState(); 560 569 561 G4cout << " ++ProposedStep(AlongStep) = 570 G4cout << " ++ProposedStep(AlongStep) = " << std::setw(9) 562 << G4BestUnit(physIntLength, "Lengt 571 << G4BestUnit(physIntLength, "Length") << " : ProcName = " 563 << fCurrentProcess->GetProcessName( 572 << fCurrentProcess->GetProcessName() << " ("; 564 if(fGPILSelection == CandidateForSelection 573 if(fGPILSelection == CandidateForSelection) 565 { 574 { 566 G4cout << "CandidateForSelection)" << G4 575 G4cout << "CandidateForSelection)" << G4endl; 567 } 576 } 568 else if(fGPILSelection==NotCandidateForSel 577 else if(fGPILSelection==NotCandidateForSelection) 569 { 578 { 570 G4cout << "NotCandidateForSelection)" << 579 G4cout << "NotCandidateForSelection)" << G4endl; 571 } 580 } 572 else 581 else 573 { 582 { 574 G4cout << "?!?)" << G4endl; 583 G4cout << "?!?)" << G4endl; 575 } 584 } 576 } 585 } 577 } 586 } 578 587 579 ////////////////////////////////////////////// 588 //////////////////////////////////////////////// 580 void G4ITSteppingVerbose::TrackingStarted(G4Tr 589 void G4ITSteppingVerbose::TrackingStarted(G4Track* track) 581 ////////////////////////////////////////////// 590 //////////////////////////////////////////////// 582 { 591 { 583 if(fVerboseLevel <= 1) 592 if(fVerboseLevel <= 1) 584 { 593 { 585 return; 594 return; 586 } 595 } 587 596 588 G4long prec = G4cout.precision(3); << 597 G4int prec = G4cout.precision(3); 589 if(fVerboseLevel > 0) 598 if(fVerboseLevel > 0) 590 { 599 { 591 fTrack = track; 600 fTrack = track; 592 fStep = track->GetStep(); 601 fStep = track->GetStep(); 593 602 594 //#ifdef G4_USE_G4BESTUNIT_FOR_VERBOSE 603 //#ifdef G4_USE_G4BESTUNIT_FOR_VERBOSE 595 // G4cout << std::setw(5) << "TrackID" << " 604 // G4cout << std::setw(5) << "TrackID" << " " << std::setw(5) << "Step#" << " " 596 // << std::setw(8) << "X" << " " 605 // << std::setw(8) << "X" << " " << std::setw(8) << "Y" << " " 597 // << std::setw(8) << "Z" << " " 606 // << std::setw(8) << "Z" << " " << std::setw(9) << "KineE" 598 // << " " << std::setw(8) << "dE 607 // << " " << std::setw(8) << "dE" << " " << std::setw(12) 599 // << "StepLeng" << " " << std::setw 608 // << "StepLeng" << " " << std::setw(12) << "TrackLeng" << " " 600 // << std::setw(12) << "NextVolume" 609 // << std::setw(12) << "NextVolume" << " " << std::setw(8) << "ProcName" 601 // << G4endl; 610 // << G4endl; 602 //#else 611 //#else 603 // G4cout << std::setw(5) << "TrackID" << s 612 // G4cout << std::setw(5) << "TrackID" << std::setw(5) << "Step#" << " " 604 // << std::setw(8) << "X(mm)" << " " << std 613 // << std::setw(8) << "X(mm)" << " " << std::setw(8) << "Y(mm)" << " " 605 // << std::setw(8) << "Z(mm)" << " " << std 614 // << std::setw(8) << "Z(mm)" << " " << std::setw(9) << "KinE(MeV)" 606 // << " " << std::setw(8) << "dE(MeV)" << " 615 // << " " << std::setw(8) << "dE(MeV)" << " " << std::setw(8) 607 // << "StepLeng" << " " << std::setw(9) << 616 // << "StepLeng" << " " << std::setw(9) << "TrackLeng" << " " 608 // << std::setw(11) << "NextVolume" << " " 617 // << std::setw(11) << "NextVolume" << " " << std::setw(8) << "ProcName" 609 // << G4endl; 618 // << G4endl; 610 //#endif 619 //#endif 611 620 612 G4cout << "Start tracking : " 621 G4cout << "Start tracking : " 613 << GetIT(fTrack)->GetName() 622 << GetIT(fTrack)->GetName() 614 << " (" << fTrack->GetTrackID() << 623 << " (" << fTrack->GetTrackID() << ") from position " 615 << std::setw(8) 624 << std::setw(8) 616 << G4BestUnit(fTrack->GetPosition() 625 << G4BestUnit(fTrack->GetPosition().x(), "Length") << " " 617 << std::setw(8) 626 << std::setw(8) 618 << G4BestUnit(fTrack->GetPosition() 627 << G4BestUnit(fTrack->GetPosition().y(), "Length") << " " 619 << std::setw(8) 628 << std::setw(8) 620 << G4BestUnit(fTrack->GetPosition() 629 << G4BestUnit(fTrack->GetPosition().z(), "Length") << " "; 621 630 622 // G4cout << std::setw(5) << fTrack->GetTra 631 // G4cout << std::setw(5) << fTrack->GetTrackID() << std::setw(5) 623 // << fTrack->GetCurrentStepNumber() 632 // << fTrack->GetCurrentStepNumber() << " " << std::setw(8) 624 // << G4BestUnit(fTrack->GetPosition 633 // << G4BestUnit(fTrack->GetPosition().x(), "Length") << " " 625 // << std::setw(8) << G4BestUnit(fTr 634 // << std::setw(8) << G4BestUnit(fTrack->GetPosition().y(), "Length") 626 // << " " << std::setw(8) 635 // << " " << std::setw(8) 627 // << G4BestUnit(fTrack->GetPosition 636 // << G4BestUnit(fTrack->GetPosition().z(), "Length") << " " 628 // << std::setw(9) << G4BestUnit(fTr 637 // << std::setw(9) << G4BestUnit(fTrack->GetKineticEnergy(), "Energy") 629 // << " " << std::setw(8) 638 // << " " << std::setw(8) 630 // << G4BestUnit(fStep->GetTotalEner 639 // << G4BestUnit(fStep->GetTotalEnergyDeposit(), "Energy") << " " 631 // << std::setw(8) << G4BestUnit(fSt 640 // << std::setw(8) << G4BestUnit(fStep->GetStepLength(), "Length") 632 // << " " << std::setw(9) 641 // << " " << std::setw(9) 633 // << G4BestUnit(fTrack->GetTrackLen 642 // << G4BestUnit(fTrack->GetTrackLength(), "Length") << " "; 634 643 635 if(fTrack->GetNextVolume() != nullptr) << 644 if(fTrack->GetNextVolume()) 636 { 645 { 637 G4cout << std::setw(11) << fTrack->GetNe 646 G4cout << std::setw(11) << fTrack->GetNextVolume()->GetName() << " "; 638 } 647 } 639 else 648 else 640 { 649 { 641 G4cout << std::setw(11) << "OutOfWorld" 650 G4cout << std::setw(11) << "OutOfWorld" << " "; 642 } 651 } 643 G4cout << "initStep" << G4endl; 652 G4cout << "initStep" << G4endl; 644 } 653 } 645 G4cout.precision(prec); 654 G4cout.precision(prec); 646 } 655 } 647 656 648 ////////////////////////////////////////////// 657 //////////////////////////////////////////////// 649 void G4ITSteppingVerbose::TrackingEnded(G4Trac 658 void G4ITSteppingVerbose::TrackingEnded(G4Track* track) 650 ////////////////////////////////////////////// 659 //////////////////////////////////////////////// 651 { 660 { 652 if(fVerboseLevel <= 1) return; 661 if(fVerboseLevel <= 1) return; 653 662 654 G4cout << " * End tracking : " << " Partic 663 G4cout << " * End tracking : " << " Particle : " 655 << track->GetDefinition()->GetParticl 664 << track->GetDefinition()->GetParticleName() << "," << " Track ID : " 656 << track->GetTrackID(); 665 << track->GetTrackID(); 657 666 658 if(track->GetNextVolume() != nullptr) << 667 if(track->GetNextVolume()) 659 { 668 { 660 G4cout << std::setw(11) << track->GetNextV 669 G4cout << std::setw(11) << track->GetNextVolume()->GetName() << " "; 661 } 670 } 662 671 663 G4cout << G4endl; 672 G4cout << G4endl; 664 } 673 } 665 674 666 ////////////////////////////////////////////// 675 ////////////////////////////////////////////////////// 667 void G4ITSteppingVerbose::AlongStepDoItOneByOn 676 void G4ITSteppingVerbose::AlongStepDoItOneByOne() 668 ////////////////////////////////////////////// 677 ////////////////////////////////////////////////////// 669 { 678 { 670 if(fVerboseLevel < 4) 679 if(fVerboseLevel < 4) 671 { 680 { 672 return; 681 return; 673 } 682 } 674 683 675 CopyState(); 684 CopyState(); 676 685 677 G4cout << G4endl; 686 G4cout << G4endl; 678 G4cout << " >>AlongStepDoIt (process by proc 687 G4cout << " >>AlongStepDoIt (process by process): " << " Process Name = " 679 << fCurrentProcess->GetProcessName() 688 << fCurrentProcess->GetProcessName() << G4endl; 680 689 681 ShowStep(); 690 ShowStep(); 682 G4cout << " " << "!Note! Safety of 691 G4cout << " " << "!Note! Safety of PostStep is only valid " 683 << "after all DoIt invocations." << G 692 << "after all DoIt invocations." << G4endl; 684 693 685 VerboseParticleChange(); 694 VerboseParticleChange(); 686 G4cout << G4endl; 695 G4cout << G4endl; 687 696 688 G4cout << " ++List of secondaries generat 697 G4cout << " ++List of secondaries generated " << "(x,y,z,kE,t,PID):" 689 << " No. of secodaries = " << fN2nda 698 << " No. of secodaries = " << fN2ndariesAlongStepDoIt << G4endl; 690 699 691 if(fN2ndariesAlongStepDoIt > 0) 700 if(fN2ndariesAlongStepDoIt > 0) 692 { 701 { 693 for(std::size_t lp1 = (*fSecondary).size() << 702 for(size_t lp1 = (*fSecondary).size() - fN2ndariesAlongStepDoIt; 694 lp1 < (*fSecondary).size(); ++lp1) << 703 lp1 < (*fSecondary).size(); lp1++) 695 { 704 { 696 G4cout << " " << std::setw(9) 705 G4cout << " " << std::setw(9) 697 << G4BestUnit((*fSecondary)[lp1]- 706 << G4BestUnit((*fSecondary)[lp1]->GetPosition().x(), "Length") 698 << " " << std::setw(9) 707 << " " << std::setw(9) 699 << G4BestUnit((*fSecondary)[lp1]- 708 << G4BestUnit((*fSecondary)[lp1]->GetPosition().y(), "Length") 700 << " " << std::setw(9) 709 << " " << std::setw(9) 701 << G4BestUnit((*fSecondary)[lp1]- 710 << G4BestUnit((*fSecondary)[lp1]->GetPosition().z(), "Length") 702 << " " << std::setw(9) 711 << " " << std::setw(9) 703 << G4BestUnit((*fSecondary)[lp1]- 712 << G4BestUnit((*fSecondary)[lp1]->GetKineticEnergy(), "Energy") 704 << " " << std::setw(9) 713 << " " << std::setw(9) 705 << G4BestUnit((*fSecondary)[lp1]- 714 << G4BestUnit((*fSecondary)[lp1]->GetGlobalTime(), "Time") << " " 706 << std::setw(18) 715 << std::setw(18) 707 << (*fSecondary)[lp1]->GetDefinit 716 << (*fSecondary)[lp1]->GetDefinition()->GetParticleName() << G4endl; 708 } 717 } 709 } 718 } 710 } 719 } 711 ////////////////////////////////////////////// 720 ////////////////////////////////////////////////////// 712 void G4ITSteppingVerbose::PostStepDoItOneByOne 721 void G4ITSteppingVerbose::PostStepDoItOneByOne() 713 ////////////////////////////////////////////// 722 ////////////////////////////////////////////////////// 714 { 723 { 715 if(fVerboseLevel < 4) 724 if(fVerboseLevel < 4) 716 { 725 { 717 return; 726 return; 718 } 727 } 719 728 720 CopyState(); 729 CopyState(); 721 G4cout << G4endl; 730 G4cout << G4endl; 722 G4cout << " >>PostStepDoIt (process by proce 731 G4cout << " >>PostStepDoIt (process by process): " << " Process Name = " 723 << fCurrentProcess->GetProcessName() 732 << fCurrentProcess->GetProcessName() << G4endl; 724 733 725 ShowStep(); 734 ShowStep(); 726 G4cout << G4endl; 735 G4cout << G4endl; 727 VerboseParticleChange(); 736 VerboseParticleChange(); 728 G4cout << G4endl; 737 G4cout << G4endl; 729 738 730 G4cout << " ++List of secondaries generat 739 G4cout << " ++List of secondaries generated " << "(x,y,z,kE,t,PID):" 731 << " No. of secodaries = " << fN2nda 740 << " No. of secodaries = " << fN2ndariesPostStepDoIt << G4endl; 732 741 733 if(fN2ndariesPostStepDoIt > 0) 742 if(fN2ndariesPostStepDoIt > 0) 734 { 743 { 735 for(std::size_t lp1 = (*fSecondary).size() << 744 for(size_t lp1 = (*fSecondary).size() - fN2ndariesPostStepDoIt; 736 lp1 < (*fSecondary).size(); ++lp1) << 745 lp1 < (*fSecondary).size(); lp1++) 737 { 746 { 738 G4cout << " " << std::setw(9) 747 G4cout << " " << std::setw(9) 739 << G4BestUnit((*fSecondary)[lp1]- 748 << G4BestUnit((*fSecondary)[lp1]->GetPosition().x(), "Length") 740 << " " << std::setw(9) 749 << " " << std::setw(9) 741 << G4BestUnit((*fSecondary)[lp1]- 750 << G4BestUnit((*fSecondary)[lp1]->GetPosition().y(), "Length") 742 << " " << std::setw(9) 751 << " " << std::setw(9) 743 << G4BestUnit((*fSecondary)[lp1]- 752 << G4BestUnit((*fSecondary)[lp1]->GetPosition().z(), "Length") 744 << " " << std::setw(9) 753 << " " << std::setw(9) 745 << G4BestUnit((*fSecondary)[lp1]- 754 << G4BestUnit((*fSecondary)[lp1]->GetKineticEnergy(), "Energy") 746 << " " << std::setw(9) 755 << " " << std::setw(9) 747 << G4BestUnit((*fSecondary)[lp1]- 756 << G4BestUnit((*fSecondary)[lp1]->GetGlobalTime(), "Time") << " " 748 << std::setw(18) 757 << std::setw(18) 749 << (*fSecondary)[lp1]->GetDefinit 758 << (*fSecondary)[lp1]->GetDefinition()->GetParticleName() << G4endl; 750 } 759 } 751 } 760 } 752 } 761 } 753 762 754 ////////////////////////////////////// 763 ////////////////////////////////////// 755 void G4ITSteppingVerbose::VerboseTrack() 764 void G4ITSteppingVerbose::VerboseTrack() 756 ////////////////////////////////////// 765 ////////////////////////////////////// 757 { 766 { 758 if(fVerboseLevel == 0) 767 if(fVerboseLevel == 0) 759 { 768 { 760 return; 769 return; 761 } 770 } 762 771 763 CopyState(); 772 CopyState(); 764 // Show header 773 // Show header 765 G4cout << G4endl; 774 G4cout << G4endl; 766 G4cout << " ++G4Track Information " << G4 775 G4cout << " ++G4Track Information " << G4endl; 767 G4long prec = G4cout.precision(3); << 776 G4int prec = G4cout.precision(3); 768 777 769 G4cout << " --------------------------- 778 G4cout << " -----------------------------------------------" << G4endl; 770 G4cout << " G4Track Information " << 779 G4cout << " G4Track Information " << std::setw(20) << G4endl; 771 G4cout << " --------------------------- 780 G4cout << " -----------------------------------------------" << G4endl; 772 781 773 G4cout << " Step number : " < 782 G4cout << " Step number : " << std::setw(20) 774 << fTrack->GetCurrentStepNumber() << 783 << fTrack->GetCurrentStepNumber() << G4endl; 775 #ifdef G4_USE_G4BESTUNIT_FOR_VERBOSE 784 #ifdef G4_USE_G4BESTUNIT_FOR_VERBOSE 776 G4cout << " Position - x : " < 785 G4cout << " Position - x : " << std::setw(20) 777 << G4BestUnit(fTrack->GetPosition().x 786 << G4BestUnit(fTrack->GetPosition().x(), "Length") << G4endl; 778 G4cout << " Position - y : " < 787 G4cout << " Position - y : " << std::setw(20) 779 << G4BestUnit(fTrack->GetPosition().y 788 << G4BestUnit(fTrack->GetPosition().y(), "Length") << G4endl; 780 G4cout << " Position - z : " < 789 G4cout << " Position - z : " << std::setw(20) 781 << G4BestUnit(fTrack->GetPosition().z 790 << G4BestUnit(fTrack->GetPosition().z(), "Length") << G4endl; 782 G4cout << " Global Time : " < 791 G4cout << " Global Time : " << std::setw(20) 783 << G4BestUnit(fTrack->GetGlobalTime() 792 << G4BestUnit(fTrack->GetGlobalTime(), "Time") << G4endl; 784 G4cout << " Local Time : " < 793 G4cout << " Local Time : " << std::setw(20) 785 << G4BestUnit(fTrack->GetLocalTime(), 794 << G4BestUnit(fTrack->GetLocalTime(), "Time") << G4endl; 786 #else 795 #else 787 G4cout << " Position - x (mm) : " < 796 G4cout << " Position - x (mm) : " << std::setw(20) 788 << fTrack->GetPosition().x() / mm << G4endl; 797 << fTrack->GetPosition().x() / mm << G4endl; 789 G4cout << " Position - y (mm) : " < 798 G4cout << " Position - y (mm) : " << std::setw(20) 790 << fTrack->GetPosition().y() / mm << G4endl; 799 << fTrack->GetPosition().y() / mm << G4endl; 791 G4cout << " Position - z (mm) : " < 800 G4cout << " Position - z (mm) : " << std::setw(20) 792 << fTrack->GetPosition().z() / mm << G4endl; 801 << fTrack->GetPosition().z() / mm << G4endl; 793 G4cout << " Global Time (ns) : " < 802 G4cout << " Global Time (ns) : " << std::setw(20) 794 << fTrack->GetGlobalTime() / ns << G4endl; 803 << fTrack->GetGlobalTime() / ns << G4endl; 795 G4cout << " Local Time (ns) : " < 804 G4cout << " Local Time (ns) : " << std::setw(20) 796 << fTrack->GetLocalTime() / ns << G4endl; 805 << fTrack->GetLocalTime() / ns << G4endl; 797 #endif 806 #endif 798 G4cout << " Momentum Direct - x : " < 807 G4cout << " Momentum Direct - x : " << std::setw(20) 799 << fTrack->GetMomentumDirection().x() 808 << fTrack->GetMomentumDirection().x() << G4endl; 800 G4cout << " Momentum Direct - y : " < 809 G4cout << " Momentum Direct - y : " << std::setw(20) 801 << fTrack->GetMomentumDirection().y() 810 << fTrack->GetMomentumDirection().y() << G4endl; 802 G4cout << " Momentum Direct - z : " < 811 G4cout << " Momentum Direct - z : " << std::setw(20) 803 << fTrack->GetMomentumDirection().z() 812 << fTrack->GetMomentumDirection().z() << G4endl; 804 #ifdef G4_USE_G4BESTUNIT_FOR_VERBOSE 813 #ifdef G4_USE_G4BESTUNIT_FOR_VERBOSE 805 G4cout << " Kinetic Energy : " 814 G4cout << " Kinetic Energy : " 806 #else 815 #else 807 G4cout << " Kinetic Energy (Me 816 G4cout << " Kinetic Energy (MeV): " 808 #endif 817 #endif 809 << std::setw(20) 818 << std::setw(20) 810 << G4BestUnit(fTrack->GetKineticEnerg 819 << G4BestUnit(fTrack->GetKineticEnergy(), "Energy") << G4endl; 811 G4cout << " Polarization - x : " < 820 G4cout << " Polarization - x : " << std::setw(20) 812 << fTrack->GetPolarization().x() << G 821 << fTrack->GetPolarization().x() << G4endl; 813 G4cout << " Polarization - y : " < 822 G4cout << " Polarization - y : " << std::setw(20) 814 << fTrack->GetPolarization().y() << G 823 << fTrack->GetPolarization().y() << G4endl; 815 G4cout << " Polarization - z : " < 824 G4cout << " Polarization - z : " << std::setw(20) 816 << fTrack->GetPolarization().z() << G 825 << fTrack->GetPolarization().z() << G4endl; 817 G4cout << " Track Length : " < 826 G4cout << " Track Length : " << std::setw(20) 818 << G4BestUnit(fTrack->GetTrackLength( 827 << G4BestUnit(fTrack->GetTrackLength(), "Length") << G4endl; 819 G4cout << " Track ID # : " < 828 G4cout << " Track ID # : " << std::setw(20) 820 << fTrack->GetTrackID() << G4endl; 829 << fTrack->GetTrackID() << G4endl; 821 G4cout << " Parent Track ID # : " < 830 G4cout << " Parent Track ID # : " << std::setw(20) 822 << fTrack->GetParentID() << G4endl; 831 << fTrack->GetParentID() << G4endl; 823 G4cout << " Next Volume : " < 832 G4cout << " Next Volume : " << std::setw(20); 824 if(fTrack->GetNextVolume() != nullptr) << 833 if(fTrack->GetNextVolume() != 0) 825 { 834 { 826 G4cout << fTrack->GetNextVolume()->GetName 835 G4cout << fTrack->GetNextVolume()->GetName() << " "; 827 } 836 } 828 else 837 else 829 { 838 { 830 G4cout << "OutOfWorld" << " "; 839 G4cout << "OutOfWorld" << " "; 831 } 840 } 832 G4cout << G4endl; 841 G4cout << G4endl; 833 G4cout << " Track Status : " < 842 G4cout << " Track Status : " << std::setw(20); 834 if(fTrack->GetTrackStatus() == fAlive) 843 if(fTrack->GetTrackStatus() == fAlive) 835 { 844 { 836 G4cout << " Alive"; 845 G4cout << " Alive"; 837 } 846 } 838 else if(fTrack->GetTrackStatus() == fStopBut 847 else if(fTrack->GetTrackStatus() == fStopButAlive) 839 { 848 { 840 G4cout << " StopButAlive"; 849 G4cout << " StopButAlive"; 841 } 850 } 842 else if(fTrack->GetTrackStatus() == fStopAnd 851 else if(fTrack->GetTrackStatus() == fStopAndKill) 843 { 852 { 844 G4cout << " StopAndKill"; 853 G4cout << " StopAndKill"; 845 } 854 } 846 else if(fTrack->GetTrackStatus() == fKillTra 855 else if(fTrack->GetTrackStatus() == fKillTrackAndSecondaries) 847 { 856 { 848 G4cout << " KillTrackAndSecondaries"; 857 G4cout << " KillTrackAndSecondaries"; 849 } 858 } 850 else if(fTrack->GetTrackStatus() == fSuspend 859 else if(fTrack->GetTrackStatus() == fSuspend) 851 { 860 { 852 G4cout << " Suspend"; 861 G4cout << " Suspend"; 853 } 862 } 854 else if(fTrack->GetTrackStatus() == fPostpon 863 else if(fTrack->GetTrackStatus() == fPostponeToNextEvent) 855 { 864 { 856 G4cout << " PostponeToNextEvent"; 865 G4cout << " PostponeToNextEvent"; 857 } 866 } 858 G4cout << G4endl; 867 G4cout << G4endl; 859 #ifdef G4_USE_G4BESTUNIT_FOR_VERBOSE 868 #ifdef G4_USE_G4BESTUNIT_FOR_VERBOSE 860 G4cout << " Vertex - x : " < 869 G4cout << " Vertex - x : " << std::setw(20) 861 << G4BestUnit(fTrack->GetVertexPositi 870 << G4BestUnit(fTrack->GetVertexPosition().x(), "Length") << G4endl; 862 G4cout << " Vertex - y : " < 871 G4cout << " Vertex - y : " << std::setw(20) 863 << G4BestUnit(fTrack->GetVertexPositi 872 << G4BestUnit(fTrack->GetVertexPosition().y(), "Length") << G4endl; 864 G4cout << " Vertex - z : " < 873 G4cout << " Vertex - z : " << std::setw(20) 865 << G4BestUnit(fTrack->GetVertexPositi 874 << G4BestUnit(fTrack->GetVertexPosition().z(), "Length") << G4endl; 866 #else 875 #else 867 G4cout << " Vertex - x (mm) : " < 876 G4cout << " Vertex - x (mm) : " << std::setw(20) 868 << fTrack->GetVertexPosition().x() / mm << G 877 << fTrack->GetVertexPosition().x() / mm << G4endl; 869 G4cout << " Vertex - y (mm) : " < 878 G4cout << " Vertex - y (mm) : " << std::setw(20) 870 << fTrack->GetVertexPosition().y() / mm << G 879 << fTrack->GetVertexPosition().y() / mm << G4endl; 871 G4cout << " Vertex - z (mm) : " < 880 G4cout << " Vertex - z (mm) : " << std::setw(20) 872 << fTrack->GetVertexPosition().z() / mm << G 881 << fTrack->GetVertexPosition().z() / mm << G4endl; 873 #endif 882 #endif 874 G4cout << " Vertex - Px (MomDir): " < 883 G4cout << " Vertex - Px (MomDir): " << std::setw(20) 875 << fTrack->GetVertexMomentumDirection 884 << fTrack->GetVertexMomentumDirection().x() << G4endl; 876 G4cout << " Vertex - Py (MomDir): " < 885 G4cout << " Vertex - Py (MomDir): " << std::setw(20) 877 << fTrack->GetVertexMomentumDirection 886 << fTrack->GetVertexMomentumDirection().y() << G4endl; 878 G4cout << " Vertex - Pz (MomDir): " < 887 G4cout << " Vertex - Pz (MomDir): " << std::setw(20) 879 << fTrack->GetVertexMomentumDirection 888 << fTrack->GetVertexMomentumDirection().z() << G4endl; 880 #ifdef G4_USE_G4BESTUNIT_FOR_VERBOSE 889 #ifdef G4_USE_G4BESTUNIT_FOR_VERBOSE 881 G4cout << " Vertex - KineE : " 890 G4cout << " Vertex - KineE : " 882 #else 891 #else 883 G4cout << " Vertex - KineE (Me 892 G4cout << " Vertex - KineE (MeV): " 884 #endif 893 #endif 885 << std::setw(20) 894 << std::setw(20) 886 << G4BestUnit(fTrack->GetVertexKineti 895 << G4BestUnit(fTrack->GetVertexKineticEnergy(), "Energy") << G4endl; 887 896 888 G4cout << " Creator Process : " < 897 G4cout << " Creator Process : " << std::setw(20); 889 if(fTrack->GetCreatorProcess() == nullptr) << 898 if(fTrack->GetCreatorProcess() == 0) 890 { 899 { 891 G4cout << " Event Generator" << G4endl; 900 G4cout << " Event Generator" << G4endl; 892 } 901 } 893 else 902 else 894 { 903 { 895 G4cout << fTrack->GetCreatorProcess()->Get 904 G4cout << fTrack->GetCreatorProcess()->GetProcessName() << G4endl; 896 } 905 } 897 906 898 G4cout << " --------------------------- 907 G4cout << " -----------------------------------------------" << G4endl; 899 908 900 G4cout.precision(prec); 909 G4cout.precision(prec); 901 } 910 } 902 911 903 ////////////////////////////////////////////// 912 /////////////////////////////////////////////// 904 void G4ITSteppingVerbose::VerboseParticleChang 913 void G4ITSteppingVerbose::VerboseParticleChange() 905 ////////////////////////////////////////////// 914 /////////////////////////////////////////////// 906 { 915 { 907 if(fVerboseLevel == 0) 916 if(fVerboseLevel == 0) 908 { 917 { 909 return; 918 return; 910 } 919 } 911 // Show header 920 // Show header 912 G4cout << G4endl; 921 G4cout << G4endl; 913 G4cout << " ++G4ParticleChange Informatio 922 G4cout << " ++G4ParticleChange Information " << G4endl; 914 fParticleChange->DumpInfo(); 923 fParticleChange->DumpInfo(); 915 } 924 } 916 ///////////////////////////////////////// 925 ///////////////////////////////////////// 917 void G4ITSteppingVerbose::ShowStep() const 926 void G4ITSteppingVerbose::ShowStep() const 918 //////////////////////////////////////// 927 //////////////////////////////////////// 919 { 928 { 920 if(fVerboseLevel == 0) 929 if(fVerboseLevel == 0) 921 { 930 { 922 return; 931 return; 923 } 932 } 924 933 925 G4String volName; 934 G4String volName; 926 G4long oldprc; << 935 G4int oldprc; 927 936 928 // Show header 937 // Show header 929 G4cout << G4endl; 938 G4cout << G4endl; 930 G4cout << " ++G4Step Information " << G4e 939 G4cout << " ++G4Step Information " << G4endl; 931 oldprc = G4cout.precision(16); 940 oldprc = G4cout.precision(16); 932 941 933 // Show G4Step specific information 942 // Show G4Step specific information 934 G4cout << " Address of G4Track : " < 943 G4cout << " Address of G4Track : " << fStep->GetTrack() << G4endl; 935 G4cout << " Step Length (mm) : " 944 G4cout << " Step Length (mm) : " 936 << fStep->GetTrack()->GetStepLength() 945 << fStep->GetTrack()->GetStepLength() << G4endl; 937 G4cout << " Energy Deposit (MeV) : " < 946 G4cout << " Energy Deposit (MeV) : " << fStep->GetTotalEnergyDeposit() 938 << G4endl; 947 << G4endl; 939 948 940 // Show G4StepPoint specific information 949 // Show G4StepPoint specific information 941 G4cout << " --------------------------- 950 G4cout << " -------------------------------------------------------" 942 << "----------------" << G4endl; 951 << "----------------" << G4endl; 943 G4cout << " StepPoint Information " 952 G4cout << " StepPoint Information " << std::setw(20) << "PreStep" 944 << std::setw(20) << "PostStep" << G4e 953 << std::setw(20) << "PostStep" << G4endl; 945 G4cout << " --------------------------- 954 G4cout << " -------------------------------------------------------" 946 << "----------------" << G4endl; 955 << "----------------" << G4endl; 947 G4cout << " Position - x (mm) : " 956 G4cout << " Position - x (mm) : " << std::setw(20) 948 << fStep->GetPreStepPoint()->GetPosit 957 << fStep->GetPreStepPoint()->GetPosition().x() << std::setw(20) 949 << fStep->GetPostStepPoint()->GetPosi 958 << fStep->GetPostStepPoint()->GetPosition().x() << G4endl; 950 G4cout << " Position - y (mm) : " 959 G4cout << " Position - y (mm) : " << std::setw(20) 951 << fStep->GetPreStepPoint()->GetPosit 960 << fStep->GetPreStepPoint()->GetPosition().y() << std::setw(20) 952 << fStep->GetPostStepPoint()->GetPosi 961 << fStep->GetPostStepPoint()->GetPosition().y() << G4endl; 953 G4cout << " Position - z (mm) : " 962 G4cout << " Position - z (mm) : " << std::setw(20) 954 << fStep->GetPreStepPoint()->GetPosit 963 << fStep->GetPreStepPoint()->GetPosition().z() << std::setw(20) 955 << fStep->GetPostStepPoint()->GetPosi 964 << fStep->GetPostStepPoint()->GetPosition().z() << G4endl; 956 G4cout << " Global Time (ns) : " 965 G4cout << " Global Time (ns) : " << std::setw(20) 957 << fStep->GetPreStepPoint()->GetGloba 966 << fStep->GetPreStepPoint()->GetGlobalTime() << std::setw(20) 958 << fStep->GetPostStepPoint()->GetGlob 967 << fStep->GetPostStepPoint()->GetGlobalTime() << G4endl; 959 G4cout << " Local Time (ns) : " 968 G4cout << " Local Time (ns) : " << std::setw(20) 960 << fStep->GetPreStepPoint()->GetLocal 969 << fStep->GetPreStepPoint()->GetLocalTime() << std::setw(20) 961 << fStep->GetPostStepPoint()->GetLoca 970 << fStep->GetPostStepPoint()->GetLocalTime() << G4endl; 962 G4cout << " Proper Time (ns) : " 971 G4cout << " Proper Time (ns) : " << std::setw(20) 963 << fStep->GetPreStepPoint()->GetPrope 972 << fStep->GetPreStepPoint()->GetProperTime() << std::setw(20) 964 << fStep->GetPostStepPoint()->GetProp 973 << fStep->GetPostStepPoint()->GetProperTime() << G4endl; 965 G4cout << " Momentum Direct - x : " 974 G4cout << " Momentum Direct - x : " << std::setw(20) 966 << fStep->GetPreStepPoint()->GetMomen 975 << fStep->GetPreStepPoint()->GetMomentumDirection().x() 967 << std::setw(20) 976 << std::setw(20) 968 << fStep->GetPostStepPoint()->GetMome 977 << fStep->GetPostStepPoint()->GetMomentumDirection().x() << G4endl; 969 G4cout << " Momentum Direct - y : " 978 G4cout << " Momentum Direct - y : " << std::setw(20) 970 << fStep->GetPreStepPoint()->GetMomen 979 << fStep->GetPreStepPoint()->GetMomentumDirection().y() 971 << std::setw(20) 980 << std::setw(20) 972 << fStep->GetPostStepPoint()->GetMome 981 << fStep->GetPostStepPoint()->GetMomentumDirection().y() << G4endl; 973 G4cout << " Momentum Direct - z : " 982 G4cout << " Momentum Direct - z : " << std::setw(20) 974 << fStep->GetPreStepPoint()->GetMomen 983 << fStep->GetPreStepPoint()->GetMomentumDirection().z() 975 << std::setw(20) 984 << std::setw(20) 976 << fStep->GetPostStepPoint()->GetMome 985 << fStep->GetPostStepPoint()->GetMomentumDirection().z() << G4endl; 977 G4cout << " Momentum - x (MeV/c): " 986 G4cout << " Momentum - x (MeV/c): " << std::setw(20) 978 << fStep->GetPreStepPoint()->GetMomen 987 << fStep->GetPreStepPoint()->GetMomentum().x() << std::setw(20) 979 << fStep->GetPostStepPoint()->GetMome 988 << fStep->GetPostStepPoint()->GetMomentum().x() << G4endl; 980 G4cout << " Momentum - y (MeV/c): " 989 G4cout << " Momentum - y (MeV/c): " << std::setw(20) 981 << fStep->GetPreStepPoint()->GetMomen 990 << fStep->GetPreStepPoint()->GetMomentum().y() << std::setw(20) 982 << fStep->GetPostStepPoint()->GetMome 991 << fStep->GetPostStepPoint()->GetMomentum().y() << G4endl; 983 G4cout << " Momentum - z (MeV/c): " 992 G4cout << " Momentum - z (MeV/c): " << std::setw(20) 984 << fStep->GetPreStepPoint()->GetMomen 993 << fStep->GetPreStepPoint()->GetMomentum().z() << std::setw(20) 985 << fStep->GetPostStepPoint()->GetMome 994 << fStep->GetPostStepPoint()->GetMomentum().z() << G4endl; 986 G4cout << " Total Energy (MeV) : " 995 G4cout << " Total Energy (MeV) : " << std::setw(20) 987 << fStep->GetPreStepPoint()->GetTotal 996 << fStep->GetPreStepPoint()->GetTotalEnergy() << std::setw(20) 988 << fStep->GetPostStepPoint()->GetTota 997 << fStep->GetPostStepPoint()->GetTotalEnergy() << G4endl; 989 G4cout << " Kinetic Energy (MeV): " 998 G4cout << " Kinetic Energy (MeV): " << std::setw(20) 990 << fStep->GetPreStepPoint()->GetKinet 999 << fStep->GetPreStepPoint()->GetKineticEnergy() << std::setw(20) 991 << fStep->GetPostStepPoint()->GetKine 1000 << fStep->GetPostStepPoint()->GetKineticEnergy() << G4endl; 992 G4cout << " Velocity (mm/ns) : " 1001 G4cout << " Velocity (mm/ns) : " << std::setw(20) 993 << fStep->GetPreStepPoint()->GetVeloc 1002 << fStep->GetPreStepPoint()->GetVelocity() << std::setw(20) 994 << fStep->GetPostStepPoint()->GetVelo 1003 << fStep->GetPostStepPoint()->GetVelocity() << G4endl; 995 G4cout << " Volume Name : " 1004 G4cout << " Volume Name : " << std::setw(20) 996 << fStep->GetPreStepPoint()->GetPhysi 1005 << fStep->GetPreStepPoint()->GetPhysicalVolume()->GetName(); 997 if(fStep->GetPostStepPoint()->GetPhysicalVol << 1006 if(fStep->GetPostStepPoint()->GetPhysicalVolume()) 998 { 1007 { 999 volName = fStep->GetPostStepPoint()->GetPh 1008 volName = fStep->GetPostStepPoint()->GetPhysicalVolume()->GetName(); 1000 } 1009 } 1001 else 1010 else 1002 { 1011 { 1003 volName = "OutOfWorld"; 1012 volName = "OutOfWorld"; 1004 } 1013 } 1005 G4cout << std::setw(20) << volName << G4end 1014 G4cout << std::setw(20) << volName << G4endl; 1006 G4cout << " Safety (mm) : " 1015 G4cout << " Safety (mm) : " << std::setw(20) 1007 << fStep->GetPreStepPoint()->GetSafe 1016 << fStep->GetPreStepPoint()->GetSafety() << std::setw(20) 1008 << fStep->GetPostStepPoint()->GetSaf 1017 << fStep->GetPostStepPoint()->GetSafety() << G4endl; 1009 G4cout << " Polarization - x : " 1018 G4cout << " Polarization - x : " << std::setw(20) 1010 << fStep->GetPreStepPoint()->GetPola 1019 << fStep->GetPreStepPoint()->GetPolarization().x() << std::setw(20) 1011 << fStep->GetPostStepPoint()->GetPol 1020 << fStep->GetPostStepPoint()->GetPolarization().x() << G4endl; 1012 G4cout << " Polarization - y : " 1021 G4cout << " Polarization - y : " << std::setw(20) 1013 << fStep->GetPreStepPoint()->GetPola 1022 << fStep->GetPreStepPoint()->GetPolarization().y() << std::setw(20) 1014 << fStep->GetPostStepPoint()->GetPol 1023 << fStep->GetPostStepPoint()->GetPolarization().y() << G4endl; 1015 G4cout << " Polarization - Z : " 1024 G4cout << " Polarization - Z : " << std::setw(20) 1016 << fStep->GetPreStepPoint()->GetPola 1025 << fStep->GetPreStepPoint()->GetPolarization().z() << std::setw(20) 1017 << fStep->GetPostStepPoint()->GetPol 1026 << fStep->GetPostStepPoint()->GetPolarization().z() << G4endl; 1018 G4cout << " Weight : " 1027 G4cout << " Weight : " << std::setw(20) 1019 << fStep->GetPreStepPoint()->GetWeig 1028 << fStep->GetPreStepPoint()->GetWeight() << std::setw(20) 1020 << fStep->GetPostStepPoint()->GetWei 1029 << fStep->GetPostStepPoint()->GetWeight() << G4endl; 1021 G4cout << " Step Status : " 1030 G4cout << " Step Status : "; 1022 G4StepStatus tStepStatus = fStep->GetPreSte 1031 G4StepStatus tStepStatus = fStep->GetPreStepPoint()->GetStepStatus(); 1023 if(tStepStatus == fGeomBoundary) 1032 if(tStepStatus == fGeomBoundary) 1024 { 1033 { 1025 G4cout << std::setw(20) << "Geom Limit"; 1034 G4cout << std::setw(20) << "Geom Limit"; 1026 } 1035 } 1027 else if(tStepStatus == fAlongStepDoItProc) 1036 else if(tStepStatus == fAlongStepDoItProc) 1028 { 1037 { 1029 G4cout << std::setw(20) << "AlongStep Pro 1038 G4cout << std::setw(20) << "AlongStep Proc."; 1030 } 1039 } 1031 else if(tStepStatus == fPostStepDoItProc) 1040 else if(tStepStatus == fPostStepDoItProc) 1032 { 1041 { 1033 G4cout << std::setw(20) << "PostStep Proc 1042 G4cout << std::setw(20) << "PostStep Proc"; 1034 } 1043 } 1035 else if(tStepStatus == fAtRestDoItProc) 1044 else if(tStepStatus == fAtRestDoItProc) 1036 { 1045 { 1037 G4cout << std::setw(20) << "AtRest Proc"; 1046 G4cout << std::setw(20) << "AtRest Proc"; 1038 } 1047 } 1039 else if(tStepStatus == fUndefined) 1048 else if(tStepStatus == fUndefined) 1040 { 1049 { 1041 G4cout << std::setw(20) << "Undefined"; 1050 G4cout << std::setw(20) << "Undefined"; 1042 } 1051 } 1043 1052 1044 tStepStatus = fStep->GetPostStepPoint()->Ge 1053 tStepStatus = fStep->GetPostStepPoint()->GetStepStatus(); 1045 if(tStepStatus == fGeomBoundary) 1054 if(tStepStatus == fGeomBoundary) 1046 { 1055 { 1047 G4cout << std::setw(20) << "Geom Limit"; 1056 G4cout << std::setw(20) << "Geom Limit"; 1048 } 1057 } 1049 else if(tStepStatus == fAlongStepDoItProc) 1058 else if(tStepStatus == fAlongStepDoItProc) 1050 { 1059 { 1051 G4cout << std::setw(20) << "AlongStep Pro 1060 G4cout << std::setw(20) << "AlongStep Proc."; 1052 } 1061 } 1053 else if(tStepStatus == fPostStepDoItProc) 1062 else if(tStepStatus == fPostStepDoItProc) 1054 { 1063 { 1055 G4cout << std::setw(20) << "PostStep Proc 1064 G4cout << std::setw(20) << "PostStep Proc"; 1056 } 1065 } 1057 else if(tStepStatus == fAtRestDoItProc) 1066 else if(tStepStatus == fAtRestDoItProc) 1058 { 1067 { 1059 G4cout << std::setw(20) << "AtRest Proc"; 1068 G4cout << std::setw(20) << "AtRest Proc"; 1060 } 1069 } 1061 else if(tStepStatus == fUndefined) 1070 else if(tStepStatus == fUndefined) 1062 { 1071 { 1063 G4cout << std::setw(20) << "Undefined"; 1072 G4cout << std::setw(20) << "Undefined"; 1064 } 1073 } 1065 1074 1066 G4cout << G4endl; 1075 G4cout << G4endl; 1067 G4cout << " Process defined Step: " 1076 G4cout << " Process defined Step: "; 1068 if(fStep->GetPreStepPoint()->GetProcessDefi << 1077 if(fStep->GetPreStepPoint()->GetProcessDefinedStep() == 0) 1069 { 1078 { 1070 G4cout << std::setw(20) << "Undefined"; 1079 G4cout << std::setw(20) << "Undefined"; 1071 } 1080 } 1072 else 1081 else 1073 { 1082 { 1074 G4cout 1083 G4cout 1075 << std::setw(20) 1084 << std::setw(20) 1076 << fStep->GetPreStepPoint()->GetProce 1085 << fStep->GetPreStepPoint()->GetProcessDefinedStep()->GetProcessName(); 1077 } 1086 } 1078 if(fStep->GetPostStepPoint()->GetProcessDef << 1087 if(fStep->GetPostStepPoint()->GetProcessDefinedStep() == 0) 1079 { 1088 { 1080 G4cout << std::setw(20) << "Undefined"; 1089 G4cout << std::setw(20) << "Undefined"; 1081 } 1090 } 1082 else 1091 else 1083 { 1092 { 1084 G4cout 1093 G4cout 1085 << std::setw(20) 1094 << std::setw(20) 1086 << fStep->GetPostStepPoint()->GetProc 1095 << fStep->GetPostStepPoint()->GetProcessDefinedStep()->GetProcessName(); 1087 } 1096 } 1088 G4cout.precision(oldprc); 1097 G4cout.precision(oldprc); 1089 1098 1090 G4cout << G4endl; 1099 G4cout << G4endl; 1091 G4cout << " -------------------------- 1100 G4cout << " -------------------------------------------------------" 1092 << "----------------" << G4endl; 1101 << "----------------" << G4endl; 1093 } 1102 } 1094 1103 1095 void G4ITSteppingVerbose::DoItStarted() 1104 void G4ITSteppingVerbose::DoItStarted() 1096 { 1105 { 1097 if(fVerboseLevel <= 0) return; 1106 if(fVerboseLevel <= 0) return; 1098 1107 1099 G4IosFlagsSaver ios_saver(G4cout); 1108 G4IosFlagsSaver ios_saver(G4cout); 1100 #ifdef USE_COLOR 1109 #ifdef USE_COLOR 1101 G4cout << LIGHT_RED; 1110 G4cout << LIGHT_RED; 1102 #endif 1111 #endif 1103 G4cout << "*** G4ITStepProcessor::DoIt ***" 1112 G4cout << "*** G4ITStepProcessor::DoIt ***" << G4endl; 1104 G4cout << std::setw(18) << left << "#Name" 1113 G4cout << std::setw(18) << left << "#Name" << std::setw(15) << "trackID" 1105 << std::setw(35) << "Position" << st 1114 << std::setw(35) << "Position" << std::setw(25) << "Pre step volume" 1106 << std::setw(25) << "Post step volum 1115 << std::setw(25) << "Post step volume" << std::setw(22) << "Process" 1107 << G4endl; 1116 << G4endl; 1108 #ifdef USE_COLOR 1117 #ifdef USE_COLOR 1109 G4cout << RESET_COLOR; 1118 G4cout << RESET_COLOR; 1110 #endif 1119 #endif 1111 } 1120 } 1112 1121 1113 void G4ITSteppingVerbose::PreStepVerbose(G4Tr 1122 void G4ITSteppingVerbose::PreStepVerbose(G4Track* track) 1114 { 1123 { 1115 if(fVerboseLevel <= 0) return; 1124 if(fVerboseLevel <= 0) return; 1116 1125 1117 G4IosFlagsSaver ios_saver(G4cout); 1126 G4IosFlagsSaver ios_saver(G4cout); 1118 1127 1119 ///// 1128 ///// 1120 // PRE STEP VERBOSE 1129 // PRE STEP VERBOSE 1121 1130 1122 #ifdef DEBUG 1131 #ifdef DEBUG 1123 #ifdef USE_COLOR 1132 #ifdef USE_COLOR 1124 G4cout << LIGHT_RED; 1133 G4cout << LIGHT_RED; 1125 #endif 1134 #endif 1126 G4cout << "*DoIt* " << GetIT(track)->GetNam 1135 G4cout << "*DoIt* " << GetIT(track)->GetName() 1127 << " ID: " << track->GetTrackID() 1136 << " ID: " << track->GetTrackID() 1128 << " at time : " << track->GetGlobalTime() 1137 << " at time : " << track->GetGlobalTime() 1129 << G4endl; 1138 << G4endl; 1130 #ifdef USE_COLOR 1139 #ifdef USE_COLOR 1131 G4cout << RESET_COLOR; 1140 G4cout << RESET_COLOR; 1132 #endif 1141 #endif 1133 #endif 1142 #endif 1134 1143 1135 G4String volumeName; 1144 G4String volumeName; 1136 1145 1137 G4TouchableHandle nextTouchable = track->Ge 1146 G4TouchableHandle nextTouchable = track->GetNextTouchableHandle(); 1138 G4VPhysicalVolume* volume(nullptr); << 1147 G4VPhysicalVolume* volume(0); 1139 1148 1140 if(nextTouchable && ((volume = nextTouchabl << 1149 if(nextTouchable && (volume = nextTouchable->GetVolume())) 1141 { 1150 { 1142 volumeName = volume->GetName(); 1151 volumeName = volume->GetName(); 1143 1152 1144 if(volume->IsParameterised() || volume->I 1153 if(volume->IsParameterised() || volume->IsReplicated()) 1145 { 1154 { 1146 volumeName += " "; 1155 volumeName += " "; 1147 volumeName += (char)nextTouchable->GetR << 1156 volumeName += nextTouchable->GetReplicaNumber(); 1148 } 1157 } 1149 } 1158 } 1150 else 1159 else 1151 { 1160 { 1152 volumeName = "OutOfWorld"; 1161 volumeName = "OutOfWorld"; 1153 } 1162 } 1154 1163 1155 G4cout << setw(18) << left << GetIT(track)- 1164 G4cout << setw(18) << left << GetIT(track)->GetName() << setw(15) 1156 << track->GetTrackID() << std::setpr 1165 << track->GetTrackID() << std::setprecision(3) << setw(35) 1157 << G4String(G4BestUnit(track->GetPos 1166 << G4String(G4BestUnit(track->GetPosition(), "Length")) << setw(25) 1158 << volumeName << setw(25) << "---" < 1167 << volumeName << setw(25) << "---" << G4endl; 1159 1168 1160 } 1169 } 1161 1170 1162 void G4ITSteppingVerbose::PostStepVerbose(G4T 1171 void G4ITSteppingVerbose::PostStepVerbose(G4Track* track) 1163 { 1172 { 1164 if(fVerboseLevel <= 0) return; 1173 if(fVerboseLevel <= 0) return; 1165 1174 1166 G4IosFlagsSaver ios_saver(G4cout); 1175 G4IosFlagsSaver ios_saver(G4cout); 1167 1176 1168 ///// 1177 ///// 1169 // POST STEP VERBOSE 1178 // POST STEP VERBOSE 1170 1179 1171 G4cout << setw(18) << left << GetIT(track)- 1180 G4cout << setw(18) << left << GetIT(track)->GetName() << setw(15) 1172 << track->GetTrackID() << std::setpr 1181 << track->GetTrackID() << std::setprecision(3) << setw(35) 1173 << G4String(G4BestUnit(track->GetPos 1182 << G4String(G4BestUnit(track->GetPosition(), "Length")) << setw(25) 1174 << "---"; 1183 << "---"; 1175 1184 1176 G4TouchableHandle nextTouchable = track->Ge 1185 G4TouchableHandle nextTouchable = track->GetNextTouchableHandle(); 1177 G4VPhysicalVolume* volume(nullptr); << 1186 G4VPhysicalVolume* volume(0); 1178 1187 1179 if(nextTouchable && ((volume = nextTouchabl << 1188 if(nextTouchable && (volume = nextTouchable->GetVolume())) 1180 { 1189 { 1181 G4String volumeName = volume->GetName(); 1190 G4String volumeName = volume->GetName(); 1182 1191 1183 if(volume->IsParameterised() || volume->I 1192 if(volume->IsParameterised() || volume->IsReplicated()) 1184 { 1193 { 1185 volumeName += " "; 1194 volumeName += " "; 1186 volumeName += (char)nextTouchable->GetR << 1195 volumeName += nextTouchable->GetReplicaNumber(); 1187 } 1196 } 1188 1197 1189 G4cout << setw(25) << volumeName; 1198 G4cout << setw(25) << volumeName; 1190 } 1199 } 1191 else 1200 else 1192 { 1201 { 1193 G4cout << setw(25) << "OutOfWorld"; 1202 G4cout << setw(25) << "OutOfWorld"; 1194 } 1203 } 1195 if(track->GetStep()->GetPostStepPoint()->Ge << 1204 if(track->GetStep()->GetPostStepPoint()->GetProcessDefinedStep()) 1196 { 1205 { 1197 G4cout 1206 G4cout 1198 << setw(22) 1207 << setw(22) 1199 << track->GetStep()->GetPostStepPoint 1208 << track->GetStep()->GetPostStepPoint()->GetProcessDefinedStep() 1200 ->GetProcessName(); 1209 ->GetProcessName(); 1201 } 1210 } 1202 else 1211 else 1203 { 1212 { 1204 G4cout << "---"; 1213 G4cout << "---"; 1205 } 1214 } 1206 G4cout << G4endl; 1215 G4cout << G4endl; 1207 1216 1208 if(fVerboseLevel > 2) 1217 if(fVerboseLevel > 2) 1209 { 1218 { 1210 const G4TrackVector* secondaries = nullpt << 1219 const G4TrackVector* secondaries = 0; 1211 if((secondaries = track->GetStep()->GetSe << 1220 if((secondaries = track->GetStep()->GetSecondary())) 1212 { 1221 { 1213 if(!secondaries->empty()) << 1222 if(secondaries->empty() == false) 1214 { 1223 { 1215 G4cout << "\t\t ---->"; 1224 G4cout << "\t\t ---->"; 1216 for(const auto secondarie : *secondar << 1225 for(size_t j = 0; j < secondaries->size(); ++j) 1217 { 1226 { 1218 G4cout << GetIT(secondarie)->GetNam << 1227 G4cout << GetIT((*secondaries)[j])->GetName() << "(" 1219 << secondarie->GetTrackID() << 1228 << (*secondaries)[j]->GetTrackID() << ")" << " "; 1220 } 1229 } 1221 G4cout << G4endl; 1230 G4cout << G4endl; 1222 } 1231 } 1223 } 1232 } 1224 } 1233 } 1225 1234 1226 G4cout << G4endl; 1235 G4cout << G4endl; 1227 } 1236 } 1228 1237 1229 void G4ITSteppingVerbose::AtRestDoItOneByOne( 1238 void G4ITSteppingVerbose::AtRestDoItOneByOne() 1230 { 1239 { 1231 CopyState(); 1240 CopyState(); 1232 1241 1233 G4cout << " Invoke at rest process : " 1242 G4cout << " Invoke at rest process : " 1234 << fCurrentProcess->GetProcessName( 1243 << fCurrentProcess->GetProcessName() 1235 << G4endl; 1244 << G4endl; 1236 } 1245 } 1237 1246