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