Geant4 Cross Reference |
>> 1 // This code implementation is the intellectual property of >> 2 // the GEANT4 collaboration. 1 // 3 // 2 // ******************************************* << 4 // By copying, distributing or modifying the Program (or any work 3 // * License and Disclaimer << 5 // based on the Program) you indicate your acceptance of this statement, 4 // * << 6 // and all its terms. 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 // 7 // 26 // G4SteppingVerbose class implementation << 8 // $Id: G4SteppingVerbose.cc,v 1.6 1999/12/15 14:53:58 gunter Exp $ >> 9 // GEANT4 tag $Name: geant4-02-00 $ 27 // 10 // >> 11 // >> 12 //--------------------------------------------------------------- >> 13 // >> 14 // G4SteppingVerbose.cc >> 15 // >> 16 // Description: >> 17 // Implementation of the G4SteppingVerbose class 28 // Contact: 18 // Contact: 29 // Questions and comments to this code shoul 19 // Questions and comments to this code should be sent to 30 // Katsuya Amako (e-mail: Katsuya.Amako@k 20 // Katsuya Amako (e-mail: Katsuya.Amako@kek.jp) 31 // Takashi Sasaki (e-mail: Takashi.Sasaki@ 21 // Takashi Sasaki (e-mail: Takashi.Sasaki@kek.jp) 32 // ------------------------------------------- << 22 // >> 23 //--------------------------------------------------------------- 33 24 34 #include "G4SteppingVerbose.hh" 25 #include "G4SteppingVerbose.hh" 35 << 36 #include "G4StepStatus.hh" // Include from 't << 37 #include "G4SteppingManager.hh" 26 #include "G4SteppingManager.hh" 38 #include "G4SystemOfUnits.hh" << 39 #include "G4VSensitiveDetector.hh" // Include << 40 27 41 // #define G4_USE_G4BESTUNIT_FOR_VERBOSE 1 << 28 #include "G4VSensitiveDetector.hh" // Include from 'hits/digi' >> 29 #include "G4StepStatus.hh" // Include from 'tracking' >> 30 >> 31 ///#define G4_USE_G4BESTUNIT_FOR_VERBOSE 1 42 32 43 #ifdef G4_USE_G4BESTUNIT_FOR_VERBOSE 33 #ifdef G4_USE_G4BESTUNIT_FOR_VERBOSE 44 # include "G4UnitsTable.hh" << 34 #include "G4UnitsTable.hh" 45 #else 35 #else 46 # define G4BestUnit(a, b) a << 36 #define G4BestUnit(a,b) a 47 #endif 37 #endif 48 38 49 G4int G4SteppingVerbose::useBestUnitPrecision << 50 << 51 ////////////////////////////////////////////// 39 ////////////////////////////////////////////////// 52 void G4SteppingVerbose::NewStep() << 40 G4SteppingVerbose::G4SteppingVerbose() 53 ////////////////////////////////////////////// 41 ////////////////////////////////////////////////// 54 {} << 42 { >> 43 #ifdef G4_TRACKING_DEBUG >> 44 G4cout << "G4SteppingVerbose has instantiated" << G4endl; >> 45 #endif >> 46 } 55 47 56 ////////////////////////////////////////////// 48 ////////////////////////////////////////////////// 57 void G4SteppingVerbose::AtRestDoItInvoked() << 49 G4SteppingVerbose::~G4SteppingVerbose() 58 ////////////////////////////////////////////// 50 ////////////////////////////////////////////////// 59 { 51 { 60 if (Silent == 1) { << 52 } 61 return; << 62 } << 63 << 64 G4VProcess* ptProcManager; << 65 CopyState(); << 66 53 67 if (verboseLevel >= 3) { << 54 ////////////////////////////////////////////////// 68 G4int npt = 0; << 55 void G4SteppingVerbose::NewStep() 69 G4cout << " **List of AtRestDoIt invoked:" << 56 ////////////////////////////////////////////////// 70 for (std::size_t np = 0; np < MAXofAtRestL << 57 { 71 std::size_t npGPIL = MAXofAtRestLoops - << 58 } 72 if ((*fSelectedAtRestDoItVector)[npGPIL] << 73 ++npt; << 74 ptProcManager = (*fAtRestDoItVector)[( << 75 G4cout << " # " << npt << " : " << p << 76 << G4endl; << 77 } << 78 else if ((*fSelectedAtRestDoItVector)[np << 79 ++npt; << 80 ptProcManager = (*fAtRestDoItVector)[( << 81 G4cout << " # " << npt << " : " << p << 82 } << 83 } << 84 59 85 G4cout << " Generated secondries # : " < << 60 ////////////////////////////////////////////////// >> 61 void G4SteppingVerbose::AtRestDoItInvoked() >> 62 ////////////////////////////////////////////////// >> 63 { >> 64 G4VProcess* ptProcManager; 86 65 87 if (fN2ndariesAtRestDoIt > 0) { << 66 CopyState(); 88 G4cout << " -- List of secondaries gen << 89 << "(x,y,z,kE,t,PID) --" << G4end << 90 for (std::size_t lp1 = (*fSecondary).siz << 91 lp1 < (*fSecondary).size(); ++lp1) << 92 { << 93 G4cout << " " << std::setw(9) << 94 << G4BestUnit((*fSecondary)[lp1 << 95 << G4BestUnit((*fSecondary)[lp1 << 96 << G4BestUnit((*fSecondary)[lp1 << 97 << G4BestUnit((*fSecondary)[lp1 << 98 << std::setw(9) << G4BestUnit(( << 99 << std::setw(18) << (*fSecondar << 100 } << 101 } << 102 } << 103 67 104 if (verboseLevel >= 4) { << 68 if(verboseLevel >= 3 ){ 105 ShowStep(); << 69 G4int npt=0; 106 G4cout << G4endl; << 70 G4cout << " **List of AtRestDoIt invoked:" << G4endl; 107 } << 71 for(size_t np=0; np < MAXofAtRestLoops; np++){ >> 72 size_t npGPIL = MAXofAtRestLoops-np-1; >> 73 if( (*fSelectedAtRestDoItVector)(npGPIL) == 2 ){ >> 74 npt++; >> 75 ptProcManager = (*fAtRestDoItVector)(np); >> 76 G4cout << " # " << npt << " : " >> 77 << ptProcManager->GetProcessName() >> 78 << " (Forced)" << G4endl; >> 79 } else if ( (*fSelectedAtRestDoItVector)(npGPIL) == 1 ){ >> 80 npt++; >> 81 ptProcManager = (*fAtRestDoItVector)(np); >> 82 G4cout << " # " << npt << " : " >> 83 << ptProcManager->GetProcessName() << G4endl; >> 84 } >> 85 } >> 86 >> 87 G4cout << " Generated secondries # : " << fN2ndariesAtRestDoIt << G4endl; >> 88 >> 89 if( fN2ndariesAtRestDoIt > 0 ){ >> 90 G4cout << " -- List of secondaries generated : " >> 91 << "(x,y,z,kE,t,PID) --" << G4endl; >> 92 for( G4int lp1=(*fSecondary).entries()-fN2ndariesAtRestDoIt; >> 93 lp1<(*fSecondary).entries(); lp1++){ >> 94 G4cout << " " >> 95 << G4std::setw( 9) >> 96 << G4BestUnit((*fSecondary)[lp1]->GetPosition().x(),"Length") << " " >> 97 << G4std::setw( 9) >> 98 << G4BestUnit((*fSecondary)[lp1]->GetPosition().y(),"Length") << " " >> 99 << G4std::setw( 9) >> 100 << G4BestUnit((*fSecondary)[lp1]->GetPosition().z(),"Length") << " " >> 101 << G4std::setw( 9) >> 102 << G4BestUnit((*fSecondary)[lp1]->GetKineticEnergy(),"Energy") << " " >> 103 << G4std::setw( 9) >> 104 << G4BestUnit((*fSecondary)[lp1]->GetGlobalTime(),"Time") << " " >> 105 << G4std::setw(18) >> 106 << (*fSecondary)[lp1]->GetDefinition() >> 107 ->GetParticleName(); >> 108 G4cout << G4endl; >> 109 } >> 110 } >> 111 } >> 112 >> 113 if( verboseLevel >= 4 ){ >> 114 ShowStep(); >> 115 G4cout << G4endl; >> 116 } 108 } 117 } 109 << 110 ////////////////////////////////////////////// 118 ///////////////////////////////////////////////////// 111 void G4SteppingVerbose::AlongStepDoItAllDone() 119 void G4SteppingVerbose::AlongStepDoItAllDone() 112 ////////////////////////////////////////////// 120 ///////////////////////////////////////////////////// 113 { 121 { 114 if (Silent == 1) { << 122 G4VProcess* ptProcManager; 115 return; << 116 } << 117 << 118 G4VProcess* ptProcManager; << 119 123 120 CopyState(); << 124 CopyState(); 121 << 122 if (verboseLevel >= 3) { << 123 G4cout << G4endl; << 124 G4cout << " >>AlongStepDoIt (after all inv << 125 G4cout << " ++List of invoked processes << 126 125 127 for (std::size_t ci = 0; ci < MAXofAlongSt << 126 if(verboseLevel >= 3){ 128 ptProcManager = (*fAlongStepDoItVector)( << 127 G4cout << G4endl; 129 G4cout << " " << ci + 1 << ") "; << 128 G4cout << " >>AlongStepDoIt (after all invocations):" << G4endl; 130 if (ptProcManager != nullptr) { << 129 G4cout << " ++List of invoked processes " << G4endl; 131 G4cout << ptProcManager->GetProcessNam << 130 132 } << 131 for(size_t ci=0; ci<MAXofAlongStepLoops; ci++){ 133 } << 132 ptProcManager = (*fAlongStepDoItVector)(ci); >> 133 G4cout << " " << ci+1 << ") "; >> 134 if(ptProcManager != NULL){ >> 135 G4cout << ptProcManager->GetProcessName() << G4endl; >> 136 } >> 137 } >> 138 >> 139 ShowStep(); >> 140 G4cout << G4endl; >> 141 G4cout << " ++List of secondaries generated " >> 142 << "(x,y,z,kE,t,PID):" >> 143 << " No. of secodaries = " >> 144 << (*fSecondary).entries() << G4endl; 134 145 135 ShowStep(); << 146 if((*fSecondary).entries()>0){ 136 G4cout << G4endl; << 147 for(G4int lp1=0; lp1<(*fSecondary).entries(); lp1++){ 137 G4cout << " ++List of secondaries gener << 148 G4cout << " " 138 << "(x,y,z,kE,t,PID):" << 149 << G4std::setw( 9) 139 << " No. of secondaries = " << (*f << 150 << G4BestUnit((*fSecondary)[lp1]->GetPosition().x(),"Length") << " " 140 << 151 << G4std::setw( 9) 141 if (! (*fSecondary).empty()) { << 152 << G4BestUnit((*fSecondary)[lp1]->GetPosition().y(),"Length") << " " 142 for (auto& lp1 : *fSecondary) { << 153 << G4std::setw( 9) 143 G4cout << " " << std::setw(9) << << 154 << G4BestUnit((*fSecondary)[lp1]->GetPosition().z(),"Length") << " " 144 << std::setw(9) << G4BestUnit(l << 155 << G4std::setw( 9) 145 << std::setw(9) << G4BestUnit(l << 156 << G4BestUnit((*fSecondary)[lp1]->GetKineticEnergy(),"Energy") << " " 146 << std::setw(9) << G4BestUnit(l << 157 << G4std::setw( 9) 147 << std::setw(9) << G4BestUnit(l << 158 << G4BestUnit((*fSecondary)[lp1]->GetGlobalTime(),"Time") << " " 148 << lp1->GetDefinition()->GetPar << 159 << G4std::setw(18) 149 } << 160 << (*fSecondary)[lp1]->GetDefinition() 150 } << 161 ->GetParticleName(); 151 } << 162 G4cout << G4endl; >> 163 } >> 164 } >> 165 } 152 } 166 } 153 << 154 ////////////////////////////////////////////// 167 //////////////////////////////////////////////////// 155 void G4SteppingVerbose::PostStepDoItAllDone() 168 void G4SteppingVerbose::PostStepDoItAllDone() 156 ////////////////////////////////////////////// 169 //////////////////////////////////////////////////// 157 { 170 { 158 if (Silent == 1) { << 171 G4VProcess* ptProcManager; 159 return; << 160 } << 161 << 162 G4VProcess* ptProcManager; << 163 << 164 CopyState(); << 165 172 166 if ((fStepStatus == fPostStepDoItProc) || (f << 173 CopyState(); 167 (fCondition == Conditionally) || (fCondi << 168 (fCondition == StronglyForced)) << 169 { << 170 if (verboseLevel >= 3) { << 171 G4int npt = 0; << 172 G4cout << G4endl; << 173 G4cout << " **PostStepDoIt (after all in << 174 G4cout << " ++List of invoked process << 175 174 176 for (std::size_t np = 0; np < MAXofPostS << 175 if(fStepStatus != fPostStepDoItProc) return; 177 std::size_t npGPIL = MAXofPostStepLoop << 178 if ((*fSelectedPostStepDoItVector)[npG << 179 ++npt; << 180 ptProcManager = (*fPostStepDoItVecto << 181 G4cout << " " << npt << ") " << << 182 << G4endl; << 183 } << 184 else if ((*fSelectedPostStepDoItVector << 185 ++npt; << 186 ptProcManager = (*fPostStepDoItVecto << 187 G4cout << " " << npt << ") " << << 188 } << 189 } << 190 176 191 ShowStep(); << 177 if(verboseLevel >= 3){ 192 G4cout << G4endl; << 178 G4int npt=0; 193 G4cout << " ++List of secondaries gen << 179 G4cout << G4endl; >> 180 G4cout << " **PostStepDoIt (after all invocations):" << G4endl; >> 181 G4cout << " ++List of invoked processes " << G4endl; >> 182 >> 183 for(size_t np=0; np < MAXofPostStepLoops; np++){ >> 184 size_t npGPIL = MAXofPostStepLoops-np-1; >> 185 if((*fSelectedPostStepDoItVector)(npGPIL) == 2){ >> 186 npt++; >> 187 ptProcManager = (*fPostStepDoItVector)(np); >> 188 G4cout << " " << npt << ") " >> 189 << ptProcManager->GetProcessName() >> 190 << " (Forced)" << G4endl; >> 191 } else if ((*fSelectedPostStepDoItVector)(npGPIL) == 1){ >> 192 npt++; >> 193 ptProcManager = (*fPostStepDoItVector)(np); >> 194 G4cout << " " << npt << ") " >> 195 << ptProcManager->GetProcessName() << G4endl; >> 196 } >> 197 } >> 198 >> 199 ShowStep(); >> 200 G4cout << G4endl; >> 201 G4cout << " ++List of secondaries generated " 194 << "(x,y,z,kE,t,PID):" 202 << "(x,y,z,kE,t,PID):" 195 << " No. of secodaries = " << (* << 203 << " No. of secodaries = " 196 G4cout << " [Note]Secondaries from << 204 << (*fSecondary).entries() << G4endl; 197 << 205 G4cout << " [Note]Secondaries from AlongStepDoIt included." 198 if (! (*fSecondary).empty()) { << 206 << G4endl; 199 for (auto& lp1 : *fSecondary) { << 207 200 G4cout << " " << std::setw(9) < << 208 if((*fSecondary).entries()>0){ 201 << std::setw(9) << G4BestUnit << 209 for(G4int lp1=0; lp1<(*fSecondary).entries(); lp1++){ 202 << std::setw(9) << G4BestUnit << 210 G4cout << " " 203 << std::setw(9) << G4BestUnit << 211 << G4std::setw( 9) 204 << std::setw(9) << G4BestUnit << 212 << G4BestUnit((*fSecondary)[lp1]->GetPosition().x() , "Length") << " " 205 << lp1->GetDefinition()->GetP << 213 << G4std::setw( 9) 206 } << 214 << G4BestUnit((*fSecondary)[lp1]->GetPosition().y() , "Length") << " " >> 215 << G4std::setw( 9) >> 216 << G4BestUnit((*fSecondary)[lp1]->GetPosition().z() , "Length") << " " >> 217 << G4std::setw( 9) >> 218 << G4BestUnit((*fSecondary)[lp1]->GetKineticEnergy() , "Energy") << " " >> 219 << G4std::setw( 9) >> 220 << G4BestUnit((*fSecondary)[lp1]->GetGlobalTime() , "Time") << " " >> 221 << G4std::setw(18) >> 222 << (*fSecondary)[lp1]->GetDefinition() >> 223 ->GetParticleName(); >> 224 G4cout << G4endl; >> 225 } >> 226 } 207 } 227 } 208 } << 209 } << 210 } << 211 228 >> 229 } 212 ///////////////////////////////////////// 230 ///////////////////////////////////////// 213 void G4SteppingVerbose::StepInfo() 231 void G4SteppingVerbose::StepInfo() 214 ///////////////////////////////////////// 232 ///////////////////////////////////////// 215 { 233 { 216 if (Silent == 1) { << 217 return; << 218 } << 219 if (SilentStepInfo == 1) { << 220 return; << 221 } << 222 << 223 CopyState(); 234 CopyState(); 224 G4cout.precision(16); << 235 225 G4long prec = G4cout.precision(3); << 236 G4int prec = G4cout.precision(3); 226 237 227 if (verboseLevel >= 1) { << 238 if( verboseLevel >= 1 ){ 228 if (verboseLevel >= 4) VerboseTrack(); << 239 if( verboseLevel >= 4 ) VerboseTrack(); 229 if (verboseLevel >= 3) { << 240 if( verboseLevel >= 3 ){ 230 G4cout << G4endl; 241 G4cout << G4endl; 231 #ifdef G4_USE_G4BESTUNIT_FOR_VERBOSE << 242 #ifdef G4_USE_G4BESTUNIT_FOR_VERBOSE 232 G4cout << std::setw(5) << "#Step#" << 243 G4cout << G4std::setw( 5) << "#Step#" << " " 233 << " " << std::setw(8) << "X" << 244 << G4std::setw( 8) << "X" << " " 234 << " " << std::setw(8) << "Y" << 245 << G4std::setw( 8) << "Y" << " " 235 << " " << std::setw(8) << "Z" << 246 << G4std::setw( 8) << "Z" << " " 236 << " " << std::setw(9) << "Ki << 247 << G4std::setw( 9) << "KineE" << " " 237 << " " << std::setw(8) << "dE << 248 << G4std::setw( 8) << "dE" << " " 238 << " " << std::setw(12) << "S << 249 << G4std::setw(12) << "StepLeng" << " " 239 << " " << std::setw(12) << "Track << 250 << G4std::setw(12) << "TrackLeng" << " " 240 << " " << std::setw(12) << "NextV << 251 << G4std::setw(12) << "NextVolume" << " " 241 << " " << std::setw(8) << "ProcNa << 252 << G4std::setw( 8) << "ProcName" << G4endl; 242 #else 253 #else 243 G4cout << std::setw(5) << "#Step#" << 254 G4cout << G4std::setw( 5) << "#Step#" << " " 244 << " " << std::setw(8) << "X(mm)" << 255 << G4std::setw( 8) << "X(mm)" << " " 245 << " " << std::setw(8) << "Y(mm)" << 256 << G4std::setw( 8) << "Y(mm)" << " " 246 << " " << std::setw(8) << "Z(mm)" << 257 << G4std::setw( 8) << "Z(mm)" << " " 247 << " " << std::setw(9) << "KinE(M << 258 << G4std::setw( 9) << "KinE(MeV)" << " " 248 << " " << std::setw(8) << "dE(MeV << 259 << G4std::setw( 8) << "dE(MeV)" << " " 249 << " " << std::setw(8) << "StepLe << 260 << G4std::setw( 8) << "StepLeng" << " " 250 << " " << std::setw(9) << "TrackL << 261 << G4std::setw( 9) << "TrackLeng" << " " 251 << " " << std::setw(11) << "NextV << 262 << G4std::setw(11) << "NextVolume" << " " 252 << " " << std::setw(8) << "ProcNa << 263 << G4std::setw( 8) << "ProcName" << G4endl; 253 #endif << 264 #endif 254 } << 265 } 255 G4cout << std::setw(5) << fTrack->GetCurre << 266 256 << G4BestUnit(fTrack->GetPosition() << 267 G4cout << G4std::setw( 5) << fTrack->GetCurrentStepNumber() << " " 257 << G4BestUnit(fTrack->GetPosition() << 268 << G4std::setw( 8) << G4BestUnit(fTrack->GetPosition().x() , "Length") << " " 258 << G4BestUnit(fTrack->GetPosition() << 269 << G4std::setw( 8) << G4BestUnit(fTrack->GetPosition().y() , "Length") << " " 259 << G4BestUnit(fTrack->GetKineticEne << 270 << G4std::setw( 8) << G4BestUnit(fTrack->GetPosition().z() , "Length") << " " 260 << G4BestUnit(fStep->GetTotalEnergy << 271 << G4std::setw( 9) << G4BestUnit(fTrack->GetKineticEnergy() , "Energy") << " " 261 << G4BestUnit(fStep->GetStepLength( << 272 << G4std::setw( 8) << G4BestUnit(fStep->GetTotalEnergyDeposit(), "Energy") << " " 262 << G4BestUnit(fTrack->GetTrackLengt << 273 << G4std::setw( 8) << G4BestUnit(fStep->GetStepLength() , "Length") << " " 263 << 274 << G4std::setw( 9) << G4BestUnit(fTrack->GetTrackLength() , "Length") << " "; 264 if (fTrack->GetNextVolume() != nullptr) { << 275 265 G4cout << std::setw(11) << fTrack->GetNe << 276 // if( fStepStatus != fWorldBoundary){ 266 } << 277 if( fTrack->GetNextVolume() != 0 ) { 267 else { << 278 G4cout << G4std::setw(11) << fTrack->GetNextVolume()->GetName() << " "; 268 G4cout << std::setw(11) << "OutOfWorld" << 279 } else { 269 << " "; << 280 G4cout << G4std::setw(11) << "OutOfWorld" << " "; 270 } << 281 } 271 if (fStep->GetPostStepPoint()->GetProcessD << 282 272 G4cout << fStep->GetPostStepPoint()->Get << 283 if(fStep->GetPostStepPoint()->GetProcessDefinedStep() != NULL){ 273 } << 284 G4cout << fStep->GetPostStepPoint()->GetProcessDefinedStep() 274 else { << 285 ->GetProcessName(); >> 286 } else { 275 G4cout << "User Limit"; 287 G4cout << "User Limit"; 276 } 288 } >> 289 277 G4cout << G4endl; 290 G4cout << G4endl; 278 if (verboseLevel == 2) { << 291 279 G4int tN2ndariesTot = fN2ndariesAtRestDo << 292 if( verboseLevel == 2 ){ 280 if (tN2ndariesTot > 0) { << 293 G4int tN2ndariesTot = fN2ndariesAtRestDoIt + 281 G4cout << " :----- List of 2ndaries << 294 fN2ndariesAlongStepDoIt + 282 << "#SpawnInStep=" << std::setw << 295 fN2ndariesPostStepDoIt; 283 << fN2ndariesAtRestDoIt << ",Al << 296 if(tN2ndariesTot>0){ 284 << ",Post=" << std::setw(2) << << 297 G4cout << " :----- List of 2ndaries - " 285 << "#SpawnTotal=" << std::setw( << 298 << "#SpawnInStep=" << G4std::setw(3) << tN2ndariesTot 286 << G4endl; << 299 << "(Rest=" << G4std::setw(2) << fN2ndariesAtRestDoIt 287 << 300 << ",Along=" << G4std::setw(2) << fN2ndariesAlongStepDoIt 288 for (std::size_t lp1 = (*fSecondary).s << 301 << ",Post=" << G4std::setw(2) << fN2ndariesPostStepDoIt 289 ++lp1) << 302 << "), " 290 { << 303 << "#SpawnTotal=" << G4std::setw(3) << (*fSecondary).entries() 291 G4cout << " : " << std::setw(9) << 304 << " ---------------" 292 << G4BestUnit((*fSecondary)[l << 305 << G4endl; 293 << std::setw(9) << G4BestUnit << 306 294 << " " << std::setw(9) << 307 for(G4int lp1=(*fSecondary).entries()-tN2ndariesTot; 295 << G4BestUnit((*fSecondary)[l << 308 lp1<(*fSecondary).entries(); lp1++){ 296 << std::setw(9) << G4BestUnit << 309 G4cout << " : " 297 << " " << std::setw(18) << (* << 310 << G4std::setw( 9) 298 << G4endl; << 311 << G4BestUnit((*fSecondary)[lp1]->GetPosition().x() , "Length")<< " " 299 } << 312 << G4std::setw( 9) 300 G4cout << " :---------------------- << 313 << G4BestUnit((*fSecondary)[lp1]->GetPosition().y() , "Length")<< " " 301 << "--------------------------- << 314 << G4std::setw( 9) 302 << "-- EndOf2ndaries Info ----- << 315 << G4BestUnit((*fSecondary)[lp1]->GetPosition().z() , "Length") << " " >> 316 << G4std::setw( 9) >> 317 << G4BestUnit((*fSecondary)[lp1]->GetKineticEnergy() , "Energy")<< " " >> 318 << G4std::setw(18) >> 319 << (*fSecondary)[lp1]->GetDefinition() >> 320 ->GetParticleName(); >> 321 G4cout << G4endl; >> 322 } >> 323 >> 324 G4cout << " :-----------------------------" >> 325 << "----------------------------------" >> 326 << "-- EndOf2ndaries Info ---------------" >> 327 << G4endl; 303 } 328 } 304 } 329 } >> 330 305 } 331 } 306 G4cout.precision(prec); 332 G4cout.precision(prec); 307 } 333 } 308 334 309 //////////////////////////////////////////// 335 //////////////////////////////////////////// 310 void G4SteppingVerbose::DPSLStarted() 336 void G4SteppingVerbose::DPSLStarted() 311 //////////////////////////////////////////// 337 //////////////////////////////////////////// 312 { 338 { 313 if (Silent == 1) { << 314 return; << 315 } << 316 CopyState(); 339 CopyState(); 317 340 318 if (verboseLevel > 5) { << 341 if( verboseLevel > 5 ){ 319 G4cout << G4endl << " >>DefinePhysicalStep << 342 G4cout << G4endl; >> 343 G4cout << " >>DefinePhysicalStepLength (List of proposed StepLengths): " >> 344 << G4endl; 320 } 345 } 321 } 346 } 322 << 323 ////////////////////////////////////////////// 347 ////////////////////////////////////////////// 324 void G4SteppingVerbose::DPSLUserLimit() 348 void G4SteppingVerbose::DPSLUserLimit() 325 ////////////////////////////////////////////// 349 ////////////////////////////////////////////// 326 { 350 { 327 if (Silent == 1) { << 328 return; << 329 } << 330 CopyState(); 351 CopyState(); 331 352 332 if (verboseLevel > 5) { << 353 if( verboseLevel > 5 ){ 333 G4cout << G4endl << G4endl; 354 G4cout << G4endl << G4endl; 334 G4cout << "=== Defined Physical Step Lengt 355 G4cout << "=== Defined Physical Step Length (DPSL)" << G4endl; 335 G4cout << " ++ProposedStep(UserLimit) = << 356 G4cout << " ++ProposedStep(UserLimit) = " 336 << " : ProcName = User defined maxi << 357 << G4std::setw( 9) << physIntLength >> 358 << " : ProcName = User defined maximum allowed Step" >> 359 << G4endl; 337 } 360 } 338 } 361 } 339 << 340 ///////////////////////////////////////////// 362 ///////////////////////////////////////////// 341 void G4SteppingVerbose::DPSLPostStep() 363 void G4SteppingVerbose::DPSLPostStep() 342 ///////////////////////////////////////////// 364 ///////////////////////////////////////////// 343 { 365 { 344 if (Silent == 1) { << 345 return; << 346 } << 347 CopyState(); 366 CopyState(); 348 367 349 if (verboseLevel > 5) { << 368 if( verboseLevel > 5 ){ 350 G4cout << " ++ProposedStep(PostStep ) = << 369 G4cout << " ++ProposedStep(PostStep ) = " 351 << " : ProcName = " << fCurrentProc << 370 << G4std::setw( 9) << physIntLength 352 if (fCondition == ExclusivelyForced) { << 371 << " : ProcName = " >> 372 << fCurrentProcess->GetProcessName() >> 373 << " ("; >> 374 if(fCondition==ExclusivelyForced){ 353 G4cout << "ExclusivelyForced)" << G4endl 375 G4cout << "ExclusivelyForced)" << G4endl; 354 } 376 } 355 else if (fCondition == StronglyForced) { << 377 else if(fCondition==Conditionally){ 356 G4cout << "StronglyForced)" << G4endl; << 357 } << 358 else if (fCondition == Conditionally) { << 359 G4cout << "Conditionally)" << G4endl; 378 G4cout << "Conditionally)" << G4endl; 360 } 379 } 361 else if (fCondition == Forced) { << 380 else if(fCondition==Forced){ 362 G4cout << "Forced)" << G4endl; 381 G4cout << "Forced)" << G4endl; 363 } 382 } 364 else { << 383 else{ 365 G4cout << "No ForceCondition)" << G4endl 384 G4cout << "No ForceCondition)" << G4endl; 366 } 385 } 367 } 386 } 368 } 387 } 369 << 370 ///////////////////////////////////////////// 388 ///////////////////////////////////////////// 371 void G4SteppingVerbose::DPSLAlongStep() 389 void G4SteppingVerbose::DPSLAlongStep() 372 ///////////////////////////////////////////// 390 ///////////////////////////////////////////// 373 { 391 { 374 if (Silent == 1) { << 375 return; << 376 } << 377 CopyState(); 392 CopyState(); 378 << 393 if( verboseLevel > 5 ){ 379 if (verboseLevel > 5) { << 394 G4cout << " ++ProposedStep(AlongStep) = " 380 G4cout << " ++ProposedStep(AlongStep) = << 395 << G4std::setw( 9) << G4BestUnit(physIntLength , "Length") 381 << G4BestUnit(physIntLength, "Lengt << 396 << " : ProcName = " 382 << " : ProcName = " << fCurrentProc << 397 << fCurrentProcess->GetProcessName() 383 if (fGPILSelection == CandidateForSelectio << 398 << " ("; >> 399 if(fGPILSelection==CandidateForSelection){ 384 G4cout << "CandidateForSelection)" << G4 400 G4cout << "CandidateForSelection)" << G4endl; 385 } 401 } 386 else if (fGPILSelection == NotCandidateFor << 402 else if(fGPILSelection==NotCandidateForSelection){ 387 G4cout << "NotCandidateForSelection)" << 403 G4cout << "NotCandidateForSelection)" << G4endl; 388 } 404 } 389 else { << 405 else{ 390 G4cout << "?!?)" << G4endl; << 406 G4cout << "???)" << G4endl; 391 } 407 } 392 } 408 } 393 } 409 } 394 410 >> 411 395 ////////////////////////////////////////////// 412 //////////////////////////////////////////////// 396 void G4SteppingVerbose::TrackingStarted() 413 void G4SteppingVerbose::TrackingStarted() 397 ////////////////////////////////////////////// 414 //////////////////////////////////////////////// 398 { 415 { 399 if (Silent == 1) { << 400 return; << 401 } << 402 416 403 CopyState(); 417 CopyState(); >> 418 G4int prec = G4cout.precision(3); >> 419 if( verboseLevel > 0 ){ 404 420 405 G4long prec = G4cout.precision(3); << 406 if (verboseLevel > 0) { << 407 #ifdef G4_USE_G4BESTUNIT_FOR_VERBOSE 421 #ifdef G4_USE_G4BESTUNIT_FOR_VERBOSE 408 G4cout << std::setw(5) << "Step#" << 422 G4cout << G4std::setw( 5) << "Step#" << " " 409 << " " << std::setw(8) << "X" << 423 << G4std::setw( 8) << "X" << " " 410 << " " << std::setw(8) << "Y" << 424 << G4std::setw( 8) << "Y" << " " 411 << " " << std::setw(8) << "Z" << 425 << G4std::setw( 8) << "Z" << " " 412 << " " << std::setw(9) << "Kine << 426 << G4std::setw( 9) << "KineE" << " " 413 << " " << std::setw(8) << "dE" << 427 << G4std::setw( 8) << "dE" << " " 414 << " " << std::setw(12) << "Ste << 428 << G4std::setw(12) << "StepLeng" << " " 415 << " " << std::setw(12) << "TrackLe << 429 << G4std::setw(12) << "TrackLeng" << " " 416 << " " << std::setw(12) << "NextVol << 430 << G4std::setw(12) << "NextVolume" << " " 417 << " " << std::setw(8) << "ProcName << 431 << G4std::setw( 8) << "ProcName" << G4endl; 418 #else 432 #else 419 G4cout << std::setw(5) << "Step#" << 433 G4cout << G4std::setw( 5) << "Step#" << " " 420 << " " << std::setw(8) << "X(mm)" << 434 << G4std::setw( 8) << "X(mm)" << " " 421 << " " << std::setw(8) << "Y(mm)" << 435 << G4std::setw( 8) << "Y(mm)" << " " 422 << " " << std::setw(8) << "Z(mm)" << 436 << G4std::setw( 8) << "Z(mm)" << " " 423 << " " << std::setw(9) << "KinE(MeV << 437 << G4std::setw( 9) << "KinE(MeV)" << " " 424 << " " << std::setw(8) << "dE(MeV)" << 438 << G4std::setw( 8) << "dE(MeV)" << " " 425 << " " << std::setw(8) << "StepLeng << 439 << G4std::setw( 8) << "StepLeng" << " " 426 << " " << std::setw(9) << "TrackLen << 440 << G4std::setw( 9) << "TrackLeng" << " " 427 << " " << std::setw(11) << "NextVol << 441 << G4std::setw(11) << "NextVolume" << " " 428 << " " << std::setw(8) << "ProcName << 442 << G4std::setw( 8) << "ProcName" << G4endl; 429 #endif 443 #endif 430 444 431 G4cout << std::setw(5) << fTrack->GetCurre << 445 G4cout << G4std::setw( 5) << fTrack->GetCurrentStepNumber() << " " 432 << G4BestUnit(fTrack->GetPosition() << 446 << G4std::setw( 8) << G4BestUnit(fTrack->GetPosition().x(),"Length")<< " " 433 << G4BestUnit(fTrack->GetPosition() << 447 << G4std::setw( 8) << G4BestUnit(fTrack->GetPosition().y(),"Length") << " " 434 << G4BestUnit(fTrack->GetPosition() << 448 << G4std::setw( 8) << G4BestUnit(fTrack->GetPosition().z(),"Length")<< " " 435 << G4BestUnit(fTrack->GetKineticEne << 449 << G4std::setw( 9) << G4BestUnit(fTrack->GetKineticEnergy(),"Energy")<< " " 436 << G4BestUnit(fStep->GetTotalEnergy << 450 << G4std::setw( 8) << G4BestUnit(fStep->GetTotalEnergyDeposit(),"Energy") << " " 437 << G4BestUnit(fStep->GetStepLength( << 451 << G4std::setw( 8) << G4BestUnit(fStep->GetStepLength(),"Length")<< " " 438 << G4BestUnit(fTrack->GetTrackLengt << 452 << G4std::setw( 9) << G4BestUnit(fTrack->GetTrackLength(),"Length") << " "; 439 << 453 440 if (fTrack->GetNextVolume() != nullptr) { << 454 if(fTrack->GetNextVolume()){ 441 G4cout << std::setw(11) << fTrack->GetNe << 455 G4cout << G4std::setw(11) << fTrack->GetNextVolume()->GetName() << " "; 442 } << 456 } else { 443 else { << 457 G4cout << G4std::setw(11) << "OutOfWorld" << " "; 444 G4cout << std::setw(11) << "OutOfWorld" << 445 << " "; << 446 } 458 } 447 G4cout << "initStep" << G4endl; 459 G4cout << "initStep" << G4endl; 448 } 460 } 449 G4cout.precision(prec); 461 G4cout.precision(prec); 450 } 462 } 451 << 452 ////////////////////////////////////////////// 463 ////////////////////////////////////////////////////// 453 void G4SteppingVerbose::AlongStepDoItOneByOne( 464 void G4SteppingVerbose::AlongStepDoItOneByOne() 454 ////////////////////////////////////////////// 465 ////////////////////////////////////////////////////// 455 { << 466 { 456 if (Silent == 1) { << 457 return; << 458 } << 459 << 460 CopyState(); 467 CopyState(); >> 468 if(verboseLevel >= 4){ >> 469 G4cout << G4endl; >> 470 G4cout << " >>AlongStepDoIt (process by process): " >> 471 << " Process Name = " >> 472 << fCurrentProcess->GetProcessName() << G4endl; >> 473 >> 474 ShowStep(); >> 475 G4cout << " " >> 476 << "!Note! Safety of PostStep is only valid " >> 477 << "after all DoIt invocations." >> 478 << G4endl; >> 479 >> 480 VerboseParticleChange(); >> 481 G4cout << G4endl; >> 482 >> 483 G4cout << " ++List of secondaries generated " >> 484 << "(x,y,z,kE,t,PID):" >> 485 << " No. of secodaries = " >> 486 << fN2ndariesAlongStepDoIt << G4endl; >> 487 >> 488 if(fN2ndariesAlongStepDoIt>0){ >> 489 for(G4int lp1=(*fSecondary).entries()-fN2ndariesAlongStepDoIt; >> 490 lp1<(*fSecondary).entries(); lp1++){ >> 491 G4cout << " " >> 492 << G4std::setw( 9) >> 493 << G4BestUnit((*fSecondary)[lp1]->GetPosition().x() , "Length")<< " " >> 494 << G4std::setw( 9) >> 495 << G4BestUnit((*fSecondary)[lp1]->GetPosition().y() , "Length")<< " " >> 496 << G4std::setw( 9) >> 497 << G4BestUnit((*fSecondary)[lp1]->GetPosition().z() , "Length")<< " " >> 498 << G4std::setw( 9) >> 499 << G4BestUnit((*fSecondary)[lp1]->GetKineticEnergy() , "Energy")<< " " >> 500 << G4std::setw( 9) >> 501 << G4BestUnit((*fSecondary)[lp1]->GetGlobalTime() , "Time")<< " " >> 502 << G4std::setw(18) >> 503 << (*fSecondary)[lp1]->GetDefinition() >> 504 ->GetParticleName(); >> 505 G4cout << G4endl; >> 506 } >> 507 } >> 508 } 461 509 462 if (verboseLevel >= 4) { << 463 G4cout << G4endl; << 464 G4cout << " >>AlongStepDoIt (process by pr << 465 << " Process Name = " << fCurrent << 466 << 467 ShowStep(); << 468 G4cout << " " << 469 << "!Note! Safety of PostStep is on << 470 << "after all DoIt invocations." << << 471 << 472 VerboseParticleChange(); << 473 G4cout << G4endl; << 474 << 475 G4cout << " ++List of secondaries gener << 476 << "(x,y,z,kE,t,PID):" << 477 << " No. of secodaries = " << fN2n << 478 << 479 if (fN2ndariesAlongStepDoIt > 0) { << 480 for (std::size_t lp1 = (*fSecondary).siz << 481 lp1 < (*fSecondary).size(); ++lp1) << 482 { << 483 G4cout << " " << std::setw(9) << 484 << G4BestUnit((*fSecondary)[lp1 << 485 << G4BestUnit((*fSecondary)[lp1 << 486 << G4BestUnit((*fSecondary)[lp1 << 487 << G4BestUnit((*fSecondary)[lp1 << 488 << std::setw(9) << G4BestUnit(( << 489 << std::setw(18) << (*fSecondar << 490 } << 491 } << 492 } << 493 } 510 } 494 << 495 ////////////////////////////////////////////// 511 ////////////////////////////////////////////////////// 496 void G4SteppingVerbose::PostStepDoItOneByOne() 512 void G4SteppingVerbose::PostStepDoItOneByOne() 497 ////////////////////////////////////////////// 513 ////////////////////////////////////////////////////// 498 { 514 { 499 if (Silent == 1) { << 500 return; << 501 } << 502 << 503 CopyState(); 515 CopyState(); >> 516 if(fStepStatus != fPostStepDoItProc) return; 504 517 505 if (verboseLevel >= 4) { << 518 if(verboseLevel >= 4){ 506 G4cout << G4endl; << 519 G4cout << G4endl; 507 G4cout << " >>PostStepDoIt (process by pro << 520 G4cout << " >>PostStepDoIt (process by process): " 508 << " Process Name = " << fCurrent << 521 << " Process Name = " >> 522 << fCurrentProcess->GetProcessName() << G4endl; >> 523 >> 524 ShowStep(); >> 525 G4cout << G4endl; >> 526 VerboseParticleChange(); >> 527 G4cout << G4endl; >> 528 >> 529 G4cout << " ++List of secondaries generated " >> 530 << "(x,y,z,kE,t,PID):" >> 531 << " No. of secodaries = " >> 532 << fN2ndariesPostStepDoIt << G4endl; 509 533 510 ShowStep(); << 534 if(fN2ndariesPostStepDoIt>0){ 511 G4cout << G4endl; << 535 for(G4int lp1=(*fSecondary).entries()-fN2ndariesPostStepDoIt; 512 VerboseParticleChange(); << 536 lp1<(*fSecondary).entries(); lp1++){ 513 G4cout << G4endl; << 537 G4cout << " " >> 538 << G4std::setw( 9) >> 539 << G4BestUnit((*fSecondary)[lp1]->GetPosition().x() , "Length")<< " " >> 540 << G4std::setw( 9) >> 541 << G4BestUnit((*fSecondary)[lp1]->GetPosition().y(), "Length") << " " >> 542 << G4std::setw( 9) >> 543 << G4BestUnit((*fSecondary)[lp1]->GetPosition().z(), "Length") << " " >> 544 << G4std::setw( 9) >> 545 << G4BestUnit((*fSecondary)[lp1]->GetKineticEnergy(), "Energy") << " " >> 546 << G4std::setw( 9) >> 547 << G4BestUnit((*fSecondary)[lp1]->GetGlobalTime(), "Time") << " " >> 548 << G4std::setw(18) >> 549 << (*fSecondary)[lp1]->GetDefinition() >> 550 ->GetParticleName(); >> 551 G4cout << G4endl; >> 552 } >> 553 } >> 554 } 514 555 515 G4cout << " ++List of secondaries gener << 516 << "(x,y,z,kE,t,PID):" << 517 << " No. of secodaries = " << fN2n << 518 << 519 if (fN2ndariesPostStepDoIt > 0) { << 520 for (std::size_t lp1 = (*fSecondary).siz << 521 lp1 < (*fSecondary).size(); ++lp1) << 522 { << 523 G4cout << " " << std::setw(9) << 524 << G4BestUnit((*fSecondary)[lp1 << 525 << G4BestUnit((*fSecondary)[lp1 << 526 << G4BestUnit((*fSecondary)[lp1 << 527 << G4BestUnit((*fSecondary)[lp1 << 528 << std::setw(9) << G4BestUnit(( << 529 << std::setw(18) << (*fSecondar << 530 } << 531 } << 532 } << 533 } 556 } 534 557 >> 558 535 ////////////////////////////////////// 559 ////////////////////////////////////// 536 void G4SteppingVerbose::VerboseTrack() 560 void G4SteppingVerbose::VerboseTrack() 537 ////////////////////////////////////// 561 ////////////////////////////////////// 538 { 562 { 539 if (Silent == 1) { << 540 return; << 541 } << 542 << 543 CopyState(); 563 CopyState(); 544 << 564 // Show header 545 G4cout << G4endl; 565 G4cout << G4endl; 546 G4cout << " ++G4Track Information " << G4 566 G4cout << " ++G4Track Information " << G4endl; 547 G4long prec = G4cout.precision(3); << 567 G4int prec = G4cout.precision(3); 548 568 549 G4cout << " --------------------------- << 550 G4cout << " G4Track Information " << << 551 G4cout << " --------------------------- << 552 569 553 G4cout << " Step number : " < << 570 G4cout << " -----------------------------------------------" 554 << G4endl; << 571 << G4endl; >> 572 G4cout << " G4Track Information " << G4std::setw(20) << G4endl; >> 573 G4cout << " -----------------------------------------------" >> 574 << G4endl; >> 575 >> 576 G4cout << " Step number : " >> 577 << G4std::setw(20) << fTrack->GetCurrentStepNumber() >> 578 << G4endl; 555 #ifdef G4_USE_G4BESTUNIT_FOR_VERBOSE 579 #ifdef G4_USE_G4BESTUNIT_FOR_VERBOSE 556 G4cout << " Position - x : " < << 580 G4cout << " Position - x : " 557 << G4BestUnit(fTrack->GetPosition().x << 581 << G4std::setw(20) << G4BestUnit(fTrack->GetPosition().x(), "Length") 558 G4cout << " Position - y : " < << 582 << G4endl; 559 << G4BestUnit(fTrack->GetPosition().y << 583 G4cout << " Position - y : " 560 G4cout << " Position - z : " < << 584 << G4std::setw(20) << G4BestUnit(fTrack->GetPosition().y(), "Length") 561 << G4BestUnit(fTrack->GetPosition().z << 585 << G4endl; 562 G4cout << " Global Time : " < << 586 G4cout << " Position - z : " 563 << G4BestUnit(fTrack->GetGlobalTime() << 587 << G4std::setw(20) << G4BestUnit(fTrack->GetPosition().z(), "Length") 564 G4cout << " Local Time : " < << 588 << G4endl; 565 << G4BestUnit(fTrack->GetLocalTime(), << 589 G4cout << " Global Time : " >> 590 << G4std::setw(20) << G4BestUnit(fTrack->GetGlobalTime(), "Time") >> 591 << G4endl; >> 592 G4cout << " Local Time : " >> 593 << G4std::setw(20) << G4BestUnit(fTrack->GetLocalTime(), "Time") >> 594 << G4endl; 566 #else 595 #else 567 G4cout << " Position - x (mm) : " < << 596 G4cout << " Position - x (mm) : " 568 << G4endl; << 597 << G4std::setw(20) << fTrack->GetPosition().x() /mm 569 G4cout << " Position - y (mm) : " < << 598 << G4endl; 570 << G4endl; << 599 G4cout << " Position - y (mm) : " 571 G4cout << " Position - z (mm) : " < << 600 << G4std::setw(20) << fTrack->GetPosition().y() /mm 572 << G4endl; << 601 << G4endl; 573 G4cout << " Global Time (ns) : " < << 602 G4cout << " Position - z (mm) : " 574 << G4endl; << 603 << G4std::setw(20) << fTrack->GetPosition().z() /mm 575 G4cout << " Local Time (ns) : " < << 604 << G4endl; 576 << G4endl; << 605 G4cout << " Global Time (ns) : " >> 606 << G4std::setw(20) << fTrack->GetGlobalTime() /ns >> 607 << G4endl; >> 608 G4cout << " Local Time (ns) : " >> 609 << G4std::setw(20) << fTrack->GetLocalTime() /ns >> 610 << G4endl; 577 #endif 611 #endif 578 G4cout << " Momentum Direct - x : " < << 612 G4cout << " Momentum Direct - x : " 579 << G4endl; << 613 << G4std::setw(20) << fTrack->GetMomentumDirection().x() 580 G4cout << " Momentum Direct - y : " < << 614 << G4endl; 581 << G4endl; << 615 G4cout << " Momentum Direct - y : " 582 G4cout << " Momentum Direct - z : " < << 616 << G4std::setw(20) << fTrack->GetMomentumDirection().y() 583 << G4endl; << 617 << G4endl; >> 618 G4cout << " Momentum Direct - z : " >> 619 << G4std::setw(20) << fTrack->GetMomentumDirection().z() >> 620 << G4endl; 584 #ifdef G4_USE_G4BESTUNIT_FOR_VERBOSE 621 #ifdef G4_USE_G4BESTUNIT_FOR_VERBOSE 585 G4cout << " Kinetic Energy : " << 622 G4cout << " Kinetic Energy : " 586 #else 623 #else 587 G4cout << " Kinetic Energy (MeV): " << 624 G4cout << " Kinetic Energy (MeV): " 588 #endif 625 #endif 589 << std::setw(20) << G4BestUnit(fTrack << 626 << G4std::setw(20) << G4BestUnit(fTrack->GetKineticEnergy(), "Energy") 590 G4cout << " Polarization - x : " < << 627 << G4endl; 591 << G4endl; << 628 G4cout << " Polarization - x : " 592 G4cout << " Polarization - y : " < << 629 << G4std::setw(20) << fTrack->GetPolarization().x() 593 << G4endl; << 630 << G4endl; 594 G4cout << " Polarization - z : " < << 631 G4cout << " Polarization - y : " 595 << G4endl; << 632 << G4std::setw(20) << fTrack->GetPolarization().y() 596 G4cout << " Track Length : " < << 633 << G4endl; 597 << G4BestUnit(fTrack->GetTrackLength( << 634 G4cout << " Polarization - z : " 598 G4cout << " Track ID # : " < << 635 << G4std::setw(20) << fTrack->GetPolarization().z() 599 G4cout << " Parent Track ID # : " < << 636 << G4endl; 600 G4cout << " Next Volume : " < << 637 G4cout << " Track Length : " 601 if (fTrack->GetNextVolume() != nullptr) { << 638 << G4std::setw(20) << G4BestUnit(fTrack->GetTrackLength(), "Length") 602 G4cout << fTrack->GetNextVolume()->GetName << 639 << G4endl; 603 } << 640 G4cout << " Track ID # : " 604 else { << 641 << G4std::setw(20) << fTrack->GetTrackID() 605 G4cout << "OutOfWorld" << 642 << G4endl; 606 << " "; << 643 G4cout << " Parent Track ID # : " 607 } << 644 << G4std::setw(20) << fTrack->GetParentID() 608 G4cout << G4endl; << 645 << G4endl; 609 G4cout << " Track Status : " < << 646 G4cout << " Next Volume : " 610 if (fTrack->GetTrackStatus() == fAlive) { << 647 << G4std::setw(20); 611 G4cout << " Alive"; << 648 if( fTrack->GetNextVolume() != 0 ) { 612 } << 649 G4cout << fTrack->GetNextVolume()->GetName() << " "; 613 else if (fTrack->GetTrackStatus() == fStopBu << 650 } else { 614 G4cout << " StopButAlive"; << 651 G4cout << "OutOfWorld" << " "; 615 } << 652 } 616 else if (fTrack->GetTrackStatus() == fStopAn << 653 G4cout << G4endl; 617 G4cout << " StopAndKill"; << 654 G4cout << " Track Status : " 618 } << 655 << G4std::setw(20); 619 else if (fTrack->GetTrackStatus() == fKillTr << 656 if( fTrack->GetTrackStatus() == fAlive ){ 620 G4cout << " KillTrackAndSecondaries"; << 657 G4cout << " Alive"; 621 } << 658 } else if( fTrack->GetTrackStatus() == fStopButAlive ){ 622 else if (fTrack->GetTrackStatus() == fSuspen << 659 G4cout << " StopButAlive"; 623 G4cout << " Suspend"; << 660 } else if( fTrack->GetTrackStatus() == fStopAndKill ){ 624 } << 661 G4cout << " StopAndKill"; 625 else if (fTrack->GetTrackStatus() == fPostpo << 662 } else if( fTrack->GetTrackStatus() == fKillTrackAndSecondaries ){ 626 G4cout << " PostponeToNextEvent"; << 663 G4cout << " KillTrackAndSecondaries"; 627 } << 664 } else if( fTrack->GetTrackStatus() == fSuspend ){ 628 G4cout << G4endl; << 665 G4cout << " Suspend"; >> 666 } else if( fTrack->GetTrackStatus() == fPostponeToNextEvent ){ >> 667 G4cout << " PostponeToNextEvent"; >> 668 } >> 669 G4cout << G4endl; 629 #ifdef G4_USE_G4BESTUNIT_FOR_VERBOSE 670 #ifdef G4_USE_G4BESTUNIT_FOR_VERBOSE 630 G4cout << " Vertex - x : " < << 671 G4cout << " Vertex - x : " 631 << G4BestUnit(fTrack->GetVertexPositi << 672 << G4std::setw(20) << G4BestUnit(fTrack->GetVertexPosition().x(),"Length") 632 G4cout << " Vertex - y : " < << 673 << G4endl; 633 << G4BestUnit(fTrack->GetVertexPositi << 674 G4cout << " Vertex - y : " 634 G4cout << " Vertex - z : " < << 675 << G4std::setw(20) << G4BestUnit(fTrack->GetVertexPosition().y(),"Length") 635 << G4BestUnit(fTrack->GetVertexPositi << 676 << G4endl; >> 677 G4cout << " Vertex - z : " >> 678 << G4std::setw(20) << G4BestUnit(fTrack->GetVertexPosition().z(),"Length") >> 679 << G4endl; 636 #else 680 #else 637 G4cout << " Vertex - x (mm) : " < << 681 G4cout << " Vertex - x (mm) : " 638 << fTrack->GetVertexPosition().x() / << 682 << G4std::setw(20) << fTrack->GetVertexPosition().x()/mm 639 G4cout << " Vertex - y (mm) : " < << 683 << G4endl; 640 << fTrack->GetVertexPosition().y() / << 684 G4cout << " Vertex - y (mm) : " 641 G4cout << " Vertex - z (mm) : " < << 685 << G4std::setw(20) << fTrack->GetVertexPosition().y()/mm 642 << fTrack->GetVertexPosition().z() / << 686 << G4endl; >> 687 G4cout << " Vertex - z (mm) : " >> 688 << G4std::setw(20) << fTrack->GetVertexPosition().z()/mm >> 689 << G4endl; 643 #endif 690 #endif 644 G4cout << " Vertex - Px (MomDir): " < << 691 G4cout << " Vertex - Px (MomDir): " 645 << fTrack->GetVertexMomentumDirection << 692 << G4std::setw(20) << fTrack->GetVertexMomentumDirection().x() 646 G4cout << " Vertex - Py (MomDir): " < << 693 << G4endl; 647 << fTrack->GetVertexMomentumDirection << 694 G4cout << " Vertex - Py (MomDir): " 648 G4cout << " Vertex - Pz (MomDir): " < << 695 << G4std::setw(20) << fTrack->GetVertexMomentumDirection().y() 649 << fTrack->GetVertexMomentumDirection << 696 << G4endl; >> 697 G4cout << " Vertex - Pz (MomDir): " >> 698 << G4std::setw(20) << fTrack->GetVertexMomentumDirection().z() >> 699 << G4endl; 650 #ifdef G4_USE_G4BESTUNIT_FOR_VERBOSE 700 #ifdef G4_USE_G4BESTUNIT_FOR_VERBOSE 651 G4cout << " Vertex - KineE : " << 701 G4cout << " Vertex - KineE : " 652 #else 702 #else 653 G4cout << " Vertex - KineE (MeV): " << 703 G4cout << " Vertex - KineE (MeV): " 654 #endif 704 #endif 655 << std::setw(20) << G4BestUnit(fTrack << 705 << G4std::setw(20) << G4BestUnit(fTrack->GetVertexKineticEnergy(),"Energy") 656 << 706 << G4endl; 657 G4cout << " Creator Process : " < << 707 658 if (fTrack->GetCreatorProcess() == nullptr) << 708 G4cout << " Creator Process : " >> 709 << G4std::setw(20); >> 710 if( fTrack->GetCreatorProcess() == NULL){ 659 G4cout << " Event Generator" << G4endl; 711 G4cout << " Event Generator" << G4endl; 660 } << 712 } else { 661 else { << 662 G4cout << fTrack->GetCreatorProcess()->Get 713 G4cout << fTrack->GetCreatorProcess()->GetProcessName() << G4endl; 663 } 714 } 664 715 665 G4cout << " --------------------------- << 716 G4cout << " -----------------------------------------------" 666 G4cout.precision(prec); << 717 << G4endl; >> 718 >> 719 G4cout.precision(prec); 667 } 720 } 668 721 >> 722 669 ////////////////////////////////////////////// 723 /////////////////////////////////////////////// 670 void G4SteppingVerbose::VerboseParticleChange( 724 void G4SteppingVerbose::VerboseParticleChange() 671 ////////////////////////////////////////////// 725 /////////////////////////////////////////////// 672 { 726 { 673 if (Silent == 1) { << 674 return; << 675 } << 676 727 >> 728 // Show header 677 G4cout << G4endl; 729 G4cout << G4endl; 678 G4cout << " ++G4ParticleChange Informatio 730 G4cout << " ++G4ParticleChange Information " << G4endl; 679 fParticleChange->DumpInfo(); 731 fParticleChange->DumpInfo(); 680 } 732 } 681 << 682 ///////////////////////////////////////// 733 ///////////////////////////////////////// 683 void G4SteppingVerbose::ShowStep() const 734 void G4SteppingVerbose::ShowStep() const 684 //////////////////////////////////////// 735 //////////////////////////////////////// 685 { 736 { 686 if (Silent == 1) { << 687 return; << 688 } << 689 G4String volName; << 690 G4long oldprc; << 691 737 692 // Show header << 738 // Show header 693 G4cout << G4endl; << 739 G4cout << G4endl; 694 G4cout << " ++G4Step Information " << G4e << 740 G4cout << " ++G4Step Information " << G4endl; 695 oldprc = G4cout.precision(16); << 741 G4cout.precision(3); 696 << 742 697 // Show G4Step specific information << 743 // Show G4Step specific information 698 G4cout << " Address of G4Track : " < << 744 G4cout << " Address of G4Track : " << fStep->GetTrack() << G4endl; 699 G4cout << " Step Length (mm) : " < << 745 G4cout << " Step Length (mm) : " << fStep->GetTrack()->GetStepLength() << G4endl; 700 G4cout << " Energy Deposit (MeV) : " < << 746 G4cout << " Energy Deposit (MeV) : " << fStep->GetTotalEnergyDeposit() << G4endl; 701 << 747 702 // Show G4StepPoint specific information << 748 // Show G4StepPoint specific information 703 G4cout << " --------------------------- << 749 G4cout << " -------------------------------------------------------" 704 << "----------------" << G4endl; << 750 << "----------------" << G4endl; 705 G4cout << " StepPoint Information " << 751 G4cout << " StepPoint Information " << G4std::setw(20) << "PreStep" 706 << "PostStep" << G4endl; << 752 << G4std::setw(20) << "PostStep" << G4endl; 707 G4cout << " --------------------------- << 753 G4cout << " -------------------------------------------------------" 708 << "----------------" << G4endl; << 754 << "----------------" << G4endl; 709 G4cout << " Position - x (mm) : " << 755 G4cout << " Position - x (mm) : " 710 << fStep->GetPreStepPoint()->GetPosit << 756 << G4std::setw(20) << fStep->GetPreStepPoint()->GetPosition().x() 711 << fStep->GetPostStepPoint()->GetPosi << 757 << G4std::setw(20) << fStep->GetPostStepPoint()->GetPosition().x() << G4endl; 712 G4cout << " Position - y (mm) : " << 758 G4cout << " Position - y (mm) : " 713 << fStep->GetPreStepPoint()->GetPosit << 759 << G4std::setw(20) << fStep->GetPreStepPoint()->GetPosition().y() 714 << fStep->GetPostStepPoint()->GetPosi << 760 << G4std::setw(20) << fStep->GetPostStepPoint()->GetPosition().y() << G4endl; 715 G4cout << " Position - z (mm) : " << 761 G4cout << " Position - z (mm) : " 716 << fStep->GetPreStepPoint()->GetPosit << 762 << G4std::setw(20) << fStep->GetPreStepPoint()->GetPosition().z() 717 << fStep->GetPostStepPoint()->GetPosi << 763 << G4std::setw(20) << fStep->GetPostStepPoint()->GetPosition().z() << G4endl; 718 G4cout << " Global Time (ns) : " << 764 G4cout << " Global Time (ns) : " 719 << fStep->GetPreStepPoint()->GetGloba << 765 << G4std::setw(20) << fStep->GetPreStepPoint()->GetGlobalTime() 720 << fStep->GetPostStepPoint()->GetGlob << 766 << G4std::setw(20) << fStep->GetPostStepPoint()->GetGlobalTime() << G4endl; 721 G4cout << " Local Time (ns) : " << 767 G4cout << " Local Time (ns) : " 722 << fStep->GetPreStepPoint()->GetLocal << 768 << G4std::setw(20) << fStep->GetPreStepPoint()->GetLocalTime() 723 << fStep->GetPostStepPoint()->GetLoca << 769 << G4std::setw(20) << fStep->GetPostStepPoint()->GetLocalTime() << G4endl; 724 G4cout << " Proper Time (ns) : " << 770 G4cout << " Proper Time (ns) : " 725 << fStep->GetPreStepPoint()->GetPrope << 771 << G4std::setw(20) << fStep->GetPreStepPoint()->GetProperTime() 726 << fStep->GetPostStepPoint()->GetProp << 772 << G4std::setw(20) << fStep->GetPostStepPoint()->GetProperTime() << G4endl; 727 G4cout << " Momentum Direct - x : " << 773 G4cout << " Momentum Direct - x : " 728 << fStep->GetPreStepPoint()->GetMomen << 774 << G4std::setw(20) << fStep->GetPreStepPoint()->GetMomentumDirection().x() 729 << fStep->GetPostStepPoint()->GetMome << 775 << G4std::setw(20) << fStep->GetPostStepPoint()->GetMomentumDirection().x() << G4endl; 730 G4cout << " Momentum Direct - y : " << 776 G4cout << " Momentum Direct - y : " 731 << fStep->GetPreStepPoint()->GetMomen << 777 << G4std::setw(20) << fStep->GetPreStepPoint()->GetMomentumDirection().y() 732 << fStep->GetPostStepPoint()->GetMome << 778 << G4std::setw(20) << fStep->GetPostStepPoint()->GetMomentumDirection().y() << G4endl; 733 G4cout << " Momentum Direct - z : " << 779 G4cout << " Momentum Direct - z : " 734 << fStep->GetPreStepPoint()->GetMomen << 780 << G4std::setw(20) << fStep->GetPreStepPoint()->GetMomentumDirection().z() 735 << fStep->GetPostStepPoint()->GetMome << 781 << G4std::setw(20) << fStep->GetPostStepPoint()->GetMomentumDirection().z() << G4endl; 736 G4cout << " Momentum - x (MeV/c): " << 782 G4cout << " Momentum - x (MeV/c): " 737 << fStep->GetPreStepPoint()->GetMomen << 783 << G4std::setw(20) << fStep->GetPreStepPoint()->GetMomentum().x() 738 << fStep->GetPostStepPoint()->GetMome << 784 << G4std::setw(20) << fStep->GetPostStepPoint()->GetMomentum().x() << G4endl; 739 G4cout << " Momentum - y (MeV/c): " << 785 G4cout << " Momentum - y (MeV/c): " 740 << fStep->GetPreStepPoint()->GetMomen << 786 << G4std::setw(20) << fStep->GetPreStepPoint()->GetMomentum().y() 741 << fStep->GetPostStepPoint()->GetMome << 787 << G4std::setw(20) << fStep->GetPostStepPoint()->GetMomentum().y() << G4endl; 742 G4cout << " Momentum - z (MeV/c): " << 788 G4cout << " Momentum - z (MeV/c): " 743 << fStep->GetPreStepPoint()->GetMomen << 789 << G4std::setw(20) << fStep->GetPreStepPoint()->GetMomentum().z() 744 << fStep->GetPostStepPoint()->GetMome << 790 << G4std::setw(20) << fStep->GetPostStepPoint()->GetMomentum().z() << G4endl; 745 G4cout << " Total Energy (MeV) : " << 791 G4cout << " Total Energy (MeV) : " 746 << fStep->GetPreStepPoint()->GetTotal << 792 << G4std::setw(20) << fStep->GetPreStepPoint()->GetTotalEnergy() 747 << fStep->GetPostStepPoint()->GetTota << 793 << G4std::setw(20) << fStep->GetPostStepPoint()->GetTotalEnergy() << G4endl; 748 G4cout << " Kinetic Energy (MeV): " << 794 G4cout << " Kinetic Energy (MeV): " 749 << fStep->GetPreStepPoint()->GetKinet << 795 << G4std::setw(20) << fStep->GetPreStepPoint()->GetKineticEnergy() 750 << fStep->GetPostStepPoint()->GetKine << 796 << G4std::setw(20) << fStep->GetPostStepPoint()->GetKineticEnergy() << G4endl; 751 G4cout << " Velocity (mm/ns) : " << 797 G4cout << " Velocity (mm/ns) : " 752 << fStep->GetPreStepPoint()->GetVeloc << 798 << G4std::setw(20) << fStep->GetPreStepPoint()->GetVelocity() 753 << fStep->GetPostStepPoint()->GetVelo << 799 << G4std::setw(20) << fStep->GetPostStepPoint()->GetVelocity() << G4endl; 754 G4cout << " Volume Name : " << 800 G4cout << " Volume Name : " 755 << fStep->GetPreStepPoint()->GetPhysi << 801 << G4std::setw(20) << fStep->GetPreStepPoint()->GetPhysicalVolume()->GetName() 756 if (fStep->GetPostStepPoint()->GetPhysicalVo << 802 << G4std::setw(20) << fStep->GetPostStepPoint()->GetPhysicalVolume()->GetName() << G4endl; 757 volName = fStep->GetPostStepPoint()->GetPh << 803 G4cout << " Safety (mm) : " 758 } << 804 << G4std::setw(20) << fStep->GetPreStepPoint()->GetSafety() 759 else { << 805 << G4std::setw(20) << fStep->GetPostStepPoint()->GetSafety() << G4endl; 760 volName = "OutOfWorld"; << 806 G4cout << " Polarization - x : " 761 } << 807 << G4std::setw(20) << fStep->GetPreStepPoint()->GetPolarization().x() 762 G4cout << std::setw(20) << volName << G4endl << 808 << G4std::setw(20) << fStep->GetPostStepPoint()->GetPolarization().x() << G4endl; 763 G4cout << " Safety (mm) : " << 809 G4cout << " Polarization - y : " 764 << fStep->GetPreStepPoint()->GetSafet << 810 << G4std::setw(20) << fStep->GetPreStepPoint()->GetPolarization().y() 765 << fStep->GetPostStepPoint()->GetSafe << 811 << G4std::setw(20) << fStep->GetPostStepPoint()->GetPolarization().y() << G4endl; 766 G4cout << " Polarization - x : " << 812 G4cout << " Polarization - Z : " 767 << fStep->GetPreStepPoint()->GetPolar << 813 << G4std::setw(20) << fStep->GetPreStepPoint()->GetPolarization().z() 768 << fStep->GetPostStepPoint()->GetPola << 814 << G4std::setw(20) << fStep->GetPostStepPoint()->GetPolarization().z() << G4endl; 769 G4cout << " Polarization - y : " << 815 G4cout << " Weight : " 770 << fStep->GetPreStepPoint()->GetPolar << 816 << G4std::setw(20) << fStep->GetPreStepPoint()->GetWeight() 771 << fStep->GetPostStepPoint()->GetPola << 817 << G4std::setw(20) << fStep->GetPostStepPoint()->GetWeight() << G4endl; 772 G4cout << " Polarization - Z : " << 818 G4cout << " Step Status : " ; 773 << fStep->GetPreStepPoint()->GetPolar << 819 G4StepStatus tStepStatus = fStep->GetPreStepPoint()->GetStepStatus(); 774 << fStep->GetPostStepPoint()->GetPola << 820 if( tStepStatus == fGeomBoundary ){ 775 G4cout << " Weight : " << 821 G4cout << G4std::setw(20) << "Geom Limit"; 776 << fStep->GetPreStepPoint()->GetWeigh << 822 } else if ( tStepStatus == fAlongStepDoItProc ){ 777 << fStep->GetPostStepPoint()->GetWeig << 823 G4cout << G4std::setw(20) << "AlongStep Proc."; 778 G4cout << " Step Status : "; << 824 } else if ( tStepStatus == fPostStepDoItProc ){ 779 G4StepStatus tStepStatus = fStep->GetPreStep << 825 G4cout << G4std::setw(20) << "PostStep Proc"; 780 if (tStepStatus == fGeomBoundary) { << 826 } else if ( tStepStatus == fAtRestDoItProc ){ 781 G4cout << std::setw(20) << "Geom Limit"; << 827 G4cout << G4std::setw(20) << "AtRest Proc"; 782 } << 828 } else if ( tStepStatus == fUndefined ){ 783 else if (tStepStatus == fAlongStepDoItProc) << 829 G4cout << G4std::setw(20) << "Undefined"; 784 G4cout << std::setw(20) << "AlongStep Proc << 830 } 785 } << 786 else if (tStepStatus == fPostStepDoItProc) { << 787 G4cout << std::setw(20) << "PostStep Proc" << 788 } << 789 else if (tStepStatus == fAtRestDoItProc) { << 790 G4cout << std::setw(20) << "AtRest Proc"; << 791 } << 792 else if (tStepStatus == fUndefined) { << 793 G4cout << std::setw(20) << "Undefined"; << 794 } << 795 831 796 tStepStatus = fStep->GetPostStepPoint()->Get << 832 tStepStatus = fStep->GetPostStepPoint()->GetStepStatus(); 797 if (tStepStatus == fGeomBoundary) { << 833 if( tStepStatus == fGeomBoundary ){ 798 G4cout << std::setw(20) << "Geom Limit"; << 834 G4cout << G4std::setw(20) << "Geom Limit"; 799 } << 835 } else if ( tStepStatus == fAlongStepDoItProc ){ 800 else if (tStepStatus == fAlongStepDoItProc) << 836 G4cout << G4std::setw(20) << "AlongStep Proc."; 801 G4cout << std::setw(20) << "AlongStep Proc << 837 } else if ( tStepStatus == fPostStepDoItProc ){ 802 } << 838 G4cout << G4std::setw(20) << "PostStep Proc"; 803 else if (tStepStatus == fPostStepDoItProc) { << 839 } else if ( tStepStatus == fAtRestDoItProc ){ 804 G4cout << std::setw(20) << "PostStep Proc" << 840 G4cout << G4std::setw(20) << "AtRest Proc"; 805 } << 841 } else if ( tStepStatus == fUndefined ){ 806 else if (tStepStatus == fAtRestDoItProc) { << 842 G4cout << G4std::setw(20) << "Undefined"; 807 G4cout << std::setw(20) << "AtRest Proc"; << 843 } 808 } << 809 else if (tStepStatus == fUndefined) { << 810 G4cout << std::setw(20) << "Undefined"; << 811 } << 812 844 813 G4cout << G4endl; << 845 G4cout << G4endl; 814 G4cout << " Process defined Step: "; << 846 G4cout << " Process defined Step: " ; 815 if (fStep->GetPreStepPoint()->GetProcessDefi << 847 if( fStep->GetPreStepPoint()->GetProcessDefinedStep() == NULL ){ 816 G4cout << std::setw(20) << "Undefined"; << 848 G4cout << G4std::setw(20) << "Undefined"; 817 } << 849 } else { 818 else { << 850 G4cout << G4std::setw(20) << fStep->GetPreStepPoint()->GetProcessDefinedStep() 819 G4cout << std::setw(20) << fStep->GetPreSt << 851 ->GetProcessName(); 820 } << 852 } 821 if (fStep->GetPostStepPoint()->GetProcessDef << 853 if( fStep->GetPostStepPoint()->GetProcessDefinedStep() == NULL){ 822 G4cout << std::setw(20) << "Undefined"; << 854 G4cout << G4std::setw(20) << "Undefined"; 823 } << 855 } else { 824 else { << 856 G4cout << G4std::setw(20) << fStep->GetPostStepPoint()->GetProcessDefinedStep() 825 G4cout << std::setw(20) << fStep->GetPostS << 857 ->GetProcessName(); 826 } << 858 } 827 G4cout.precision(oldprc); << 828 859 829 G4cout << G4endl; << 860 G4cout << G4endl; 830 G4cout << " --------------------------- << 861 G4cout << " -------------------------------------------------------" 831 << "----------------" << G4endl; << 862 << "----------------" << G4endl; 832 } 863 } 833 864 834 ////////////////////////////////////////////// << 835 void G4SteppingVerbose::UseBestUnit(G4int prec << 836 ////////////////////////////////////////////// << 837 { << 838 useBestUnitPrecision = prec; << 839 } << 840 865 841 ////////////////////////////////////////////// << 842 G4int G4SteppingVerbose::BestUnitPrecision() << 843 ////////////////////////////////////////////// << 844 { << 845 return useBestUnitPrecision; << 846 } << 847 866