ECCE @ EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
G4SteppingVerbose.cc
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file G4SteppingVerbose.cc
1 //
2 // ********************************************************************
3 // * License and Disclaimer *
4 // * *
5 // * The Geant4 software is copyright of the Copyright Holders of *
6 // * the Geant4 Collaboration. It is provided under the terms and *
7 // * conditions of the Geant4 Software License, included in the file *
8 // * LICENSE and available at http://cern.ch/geant4/license . These *
9 // * include a list of copyright holders. *
10 // * *
11 // * Neither the authors of this software system, nor their employing *
12 // * institutes,nor the agencies providing financial support for this *
13 // * work make any representation or warranty, express or implied, *
14 // * regarding this software system or assume any liability for its *
15 // * use. Please see the license in the file LICENSE and URL above *
16 // * for the full disclaimer and the limitation of liability. *
17 // * *
18 // * This code implementation is the result of the scientific and *
19 // * technical work of the GEANT4 collaboration. *
20 // * By using, copying, modifying or distributing the software (or *
21 // * any work based on the software) you agree to acknowledge its *
22 // * use in resulting scientific publications, and indicate your *
23 // * acceptance of all terms of the Geant4 Software license. *
24 // ********************************************************************
25 //
26 //
27 //
28 //---------------------------------------------------------------
29 //
30 // G4SteppingVerbose.cc
31 //
32 // Description:
33 // Implementation of the G4SteppingVerbose class
34 // Contact:
35 // Questions and comments to this code should be sent to
36 // Katsuya Amako (e-mail: Katsuya.Amako@kek.jp)
37 // Takashi Sasaki (e-mail: Takashi.Sasaki@kek.jp)
38 //
39 //---------------------------------------------------------------
40 
41 #include "G4SteppingVerbose.hh"
42 #include "G4SteppingManager.hh"
43 #include "G4SystemOfUnits.hh"
44 #include "G4VSensitiveDetector.hh" // Include from 'hits/digi'
45 #include "G4StepStatus.hh" // Include from 'tracking'
46 
48 
49 #ifdef G4_USE_G4BESTUNIT_FOR_VERBOSE
50 #include "G4UnitsTable.hh"
51 #else
52 #define G4BestUnit(a,b) a
53 #endif
54 
58 {
59 #ifdef G4_TRACKING_DEBUG
60  G4cout << "G4SteppingVerbose has instantiated" << G4endl;
61 #endif
62 }
63 
67 {
68 }
69 
73 {
74 }
75 
79  {
80  if(Silent==1){ return; }
81 
82  G4VProcess* ptProcManager;
83  CopyState();
84 
85  if(verboseLevel >= 3 ){
86  G4int npt=0;
87  G4cout << " **List of AtRestDoIt invoked:" << G4endl;
88  for(size_t np=0; np < MAXofAtRestLoops; np++){
89  size_t npGPIL = MAXofAtRestLoops-np-1;
90  if( (*fSelectedAtRestDoItVector)[npGPIL] == 2 ){
91  npt++;
92  ptProcManager = (*fAtRestDoItVector)[np];
93  G4cout << " # " << npt << " : "
94  << ptProcManager->GetProcessName()
95  << " (Forced)" << G4endl;
96  } else if ( (*fSelectedAtRestDoItVector)[npGPIL] == 1 ){
97  npt++;
98  ptProcManager = (*fAtRestDoItVector)[np];
99  G4cout << " # " << npt << " : " << ptProcManager->GetProcessName() << G4endl;
100  }
101  }
102 
103  G4cout << " Generated secondries # : " << fN2ndariesAtRestDoIt << G4endl;
104 
105  if( fN2ndariesAtRestDoIt > 0 ){
106  G4cout << " -- List of secondaries generated : " << "(x,y,z,kE,t,PID) --" << G4endl;
107  for( size_t lp1=(*fSecondary).size()-fN2ndariesAtRestDoIt;
108  lp1<(*fSecondary).size(); lp1++) {
109  G4cout << " "
110  << std::setw( 9)
111  << G4BestUnit((*fSecondary)[lp1]->GetPosition().x(),"Length") << " "
112  << std::setw( 9)
113  << G4BestUnit((*fSecondary)[lp1]->GetPosition().y(),"Length") << " "
114  << std::setw( 9)
115  << G4BestUnit((*fSecondary)[lp1]->GetPosition().z(),"Length") << " "
116  << std::setw( 9)
117  << G4BestUnit((*fSecondary)[lp1]->GetKineticEnergy(),"Energy") << " "
118  << std::setw( 9)
119  << G4BestUnit((*fSecondary)[lp1]->GetGlobalTime(),"Time") << " "
120  << std::setw(18)
121  << (*fSecondary)[lp1]->GetDefinition()->GetParticleName() << G4endl;
122  }
123  }
124  }
125 
126  if( verboseLevel >= 4 ){
127  ShowStep();
128  G4cout << G4endl;
129  }
130 }
134 {
135  if(Silent==1){ return; }
136 
137  G4VProcess* ptProcManager;
138 
139  CopyState();
140 
141  if(verboseLevel >= 3){
142  G4cout << G4endl;
143  G4cout << " >>AlongStepDoIt (after all invocations):" << G4endl;
144  G4cout << " ++List of invoked processes " << G4endl;
145 
146  for(size_t ci=0; ci<MAXofAlongStepLoops; ci++){
147  ptProcManager = (*fAlongStepDoItVector)(ci);
148  G4cout << " " << ci+1 << ") ";
149  if(ptProcManager != 0){
150  G4cout << ptProcManager->GetProcessName() << G4endl;
151  }
152  }
153 
154  ShowStep();
155  G4cout << G4endl;
156  G4cout << " ++List of secondaries generated "
157  << "(x,y,z,kE,t,PID):"
158  << " No. of secodaries = "
159  << (*fSecondary).size() << G4endl;
160 
161  if((*fSecondary).size()>0){
162  for(size_t lp1=0; lp1<(*fSecondary).size(); lp1++){
163  G4cout << " "
164  << std::setw( 9)
165  << G4BestUnit((*fSecondary)[lp1]->GetPosition().x(),"Length") << " "
166  << std::setw( 9)
167  << G4BestUnit((*fSecondary)[lp1]->GetPosition().y(),"Length") << " "
168  << std::setw( 9)
169  << G4BestUnit((*fSecondary)[lp1]->GetPosition().z(),"Length") << " "
170  << std::setw( 9)
171  << G4BestUnit((*fSecondary)[lp1]->GetKineticEnergy(),"Energy") << " "
172  << std::setw( 9)
173  << G4BestUnit((*fSecondary)[lp1]->GetGlobalTime(),"Time") << " "
174  << std::setw(18)
175  << (*fSecondary)[lp1]->GetDefinition()->GetParticleName() << G4endl;
176  }
177  }
178  }
179 }
183 {
184  if(Silent==1){ return; }
185 
186  G4VProcess* ptProcManager;
187 
188  CopyState();
189 
190  if( (fStepStatus == fPostStepDoItProc) |
191  (fCondition == Forced) |
194  (fCondition == StronglyForced) ){
195 
196  if(verboseLevel >= 3){
197  G4int npt=0;
198  G4cout << G4endl;
199  G4cout << " **PostStepDoIt (after all invocations):" << G4endl;
200  G4cout << " ++List of invoked processes " << G4endl;
201 
202  for(size_t np=0; np < MAXofPostStepLoops; np++){
203  size_t npGPIL = MAXofPostStepLoops-np-1;
204  if( (*fSelectedPostStepDoItVector)[npGPIL] == 2){
205  npt++;
206  ptProcManager = (*fPostStepDoItVector)[np];
207  G4cout << " " << npt << ") "
208  << ptProcManager->GetProcessName()
209  << " (Forced)" << G4endl;
210  } else if ( (*fSelectedPostStepDoItVector)[npGPIL] == 1){
211  npt++;
212  ptProcManager = (*fPostStepDoItVector)[np];
213  G4cout << " " << npt << ") " << ptProcManager->GetProcessName() << G4endl;
214  }
215  }
216 
217  ShowStep();
218  G4cout << G4endl;
219  G4cout << " ++List of secondaries generated "
220  << "(x,y,z,kE,t,PID):"
221  << " No. of secodaries = "
222  << (*fSecondary).size() << G4endl;
223  G4cout << " [Note]Secondaries from AlongStepDoIt included." << G4endl;
224 
225  if((*fSecondary).size()>0){
226  for(size_t lp1=0; lp1<(*fSecondary).size(); lp1++){
227  G4cout << " "
228  << std::setw( 9)
229  << G4BestUnit((*fSecondary)[lp1]->GetPosition().x() , "Length") << " "
230  << std::setw( 9)
231  << G4BestUnit((*fSecondary)[lp1]->GetPosition().y() , "Length") << " "
232  << std::setw( 9)
233  << G4BestUnit((*fSecondary)[lp1]->GetPosition().z() , "Length") << " "
234  << std::setw( 9)
235  << G4BestUnit((*fSecondary)[lp1]->GetKineticEnergy() , "Energy") << " "
236  << std::setw( 9)
237  << G4BestUnit((*fSecondary)[lp1]->GetGlobalTime() , "Time") << " "
238  << std::setw(18)
239  << (*fSecondary)[lp1]->GetDefinition()->GetParticleName() << G4endl;
240  }
241  }
242  }
243  }
244 }
245 
249 {
250  if(Silent==1){ return; }
251  if(SilentStepInfo==1){ return; }
252 
253  CopyState();
254  G4cout.precision(16);
255  G4int prec = G4cout.precision(3);
256 
257  if( verboseLevel >= 1 ){
258  if( verboseLevel >= 4 ) VerboseTrack();
259  if( verboseLevel >= 3 ){
260  G4cout << G4endl;
261 #ifdef G4_USE_G4BESTUNIT_FOR_VERBOSE
262  G4cout << std::setw( 5) << "#Step#" << " "
263  << std::setw( 8) << "X" << " " << std::setw( 8) << "Y" << " "
264  << std::setw( 8) << "Z" << " "
265  << std::setw( 9) << "KineE" << " " << std::setw( 8) << "dE" << " "
266  << std::setw(12) << "StepLeng" << " " << std::setw(12) << "TrackLeng" << " "
267  << std::setw(12) << "NextVolume" << " " << std::setw( 8) << "ProcName" << G4endl;
268 #else
269  G4cout << std::setw( 5) << "#Step#" << " "
270  << std::setw( 8) << "X(mm)" << " " << std::setw( 8) << "Y(mm)" << " "
271  << std::setw( 8) << "Z(mm)" << " "
272  << std::setw( 9) << "KinE(MeV)" << " " << std::setw( 8) << "dE(MeV)" << " "
273  << std::setw( 8) << "StepLeng" << " " << std::setw( 9) << "TrackLeng" << " "
274  << std::setw(11) << "NextVolume" << " " << std::setw( 8) << "ProcName" << G4endl;
275 #endif
276  }
277  G4cout << std::setw( 5) << fTrack->GetCurrentStepNumber() << " "
278  << std::setw( 8) << G4BestUnit(fTrack->GetPosition().x() , "Length") << " "
279  << std::setw( 8) << G4BestUnit(fTrack->GetPosition().y() , "Length") << " "
280  << std::setw( 8) << G4BestUnit(fTrack->GetPosition().z() , "Length") << " "
281  << std::setw( 9) << G4BestUnit(fTrack->GetKineticEnergy() , "Energy") << " "
282  << std::setw( 8) << G4BestUnit(fStep->GetTotalEnergyDeposit(), "Energy") << " "
283  << std::setw( 8) << G4BestUnit(fStep->GetStepLength() , "Length") << " "
284  << std::setw( 9) << G4BestUnit(fTrack->GetTrackLength() , "Length") << " ";
285 
286  // Put cut comment here
287  if( fTrack->GetNextVolume() != 0 ) {
288  G4cout << std::setw(11) << fTrack->GetNextVolume()->GetName() << " ";
289  } else {
290  G4cout << std::setw(11) << "OutOfWorld" << " ";
291  }
294  } else {
295  G4cout << "User Limit";
296  }
297  G4cout << G4endl;
298  if( verboseLevel == 2 )
299  {
301  if(tN2ndariesTot>0){
302  G4cout << " :----- List of 2ndaries - "
303  << "#SpawnInStep=" << std::setw(3) << tN2ndariesTot
304  << "(Rest=" << std::setw(2) << fN2ndariesAtRestDoIt
305  << ",Along=" << std::setw(2) << fN2ndariesAlongStepDoIt
306  << ",Post=" << std::setw(2) << fN2ndariesPostStepDoIt
307  << "), "
308  << "#SpawnTotal=" << std::setw(3) << (*fSecondary).size()
309  << " ---------------"
310  << G4endl;
311 
312  for(size_t lp1=(*fSecondary).size()-tN2ndariesTot; lp1<(*fSecondary).size(); lp1++){
313  G4cout << " : "
314  << std::setw( 9)
315  << G4BestUnit((*fSecondary)[lp1]->GetPosition().x() , "Length")<< " "
316  << std::setw( 9)
317  << G4BestUnit((*fSecondary)[lp1]->GetPosition().y() , "Length")<< " "
318  << std::setw( 9)
319  << G4BestUnit((*fSecondary)[lp1]->GetPosition().z() , "Length") << " "
320  << std::setw( 9)
321  << G4BestUnit((*fSecondary)[lp1]->GetKineticEnergy() , "Energy")<< " "
322  << std::setw(18)
323  << (*fSecondary)[lp1]->GetDefinition()->GetParticleName() << G4endl;
324  }
325  G4cout << " :-----------------------------" << "----------------------------------"
326  << "-- EndOf2ndaries Info ---------------" << G4endl;
327  }
328  }
329  }
330  G4cout.precision(prec);
331 }
332 // Put cut comment here if( fStepStatus != fWorldBoundary){
333 
337 {
338  if(Silent==1){ return; }
339  CopyState();
340 
341  if( verboseLevel > 5 ){
342  G4cout << G4endl << " >>DefinePhysicalStepLength (List of proposed StepLengths): " << G4endl;
343  }
344 }
348 {
349  if(Silent==1){ return; }
350  CopyState();
351 
352  if( verboseLevel > 5 ){
353  G4cout << G4endl << G4endl;
354  G4cout << "=== Defined Physical Step Length (DPSL)" << G4endl;
355  G4cout << " ++ProposedStep(UserLimit) = " << std::setw( 9) << physIntLength
356  << " : ProcName = User defined maximum allowed Step" << G4endl;
357  }
358 }
362 {
363  if(Silent==1){ return; }
364  CopyState();
365 
366  if( verboseLevel > 5 ){
367  G4cout << " ++ProposedStep(PostStep ) = " << std::setw( 9) << physIntLength
368  << " : ProcName = " << fCurrentProcess->GetProcessName() << " (";
370  G4cout << "ExclusivelyForced)" << G4endl;
371  }
372  else if(fCondition==StronglyForced){
373  G4cout << "StronglyForced)" << G4endl;
374  }
375  else if(fCondition==Conditionally){
376  G4cout << "Conditionally)" << G4endl;
377  }
378  else if(fCondition==Forced){
379  G4cout << "Forced)" << G4endl;
380  }
381  else{
382  G4cout << "No ForceCondition)" << G4endl;
383  }
384  }
385 }
389 {
390  if(Silent==1){ return; }
391  CopyState();
392 
393  if( verboseLevel > 5 ){
394  G4cout << " ++ProposedStep(AlongStep) = "
395  << std::setw( 9) << G4BestUnit(physIntLength , "Length")
396  << " : ProcName = "
398  << " (";
400  G4cout << "CandidateForSelection)" << G4endl;
401  }
403  G4cout << "NotCandidateForSelection)" << G4endl;
404  }
405  else{
406  G4cout << "?!?)" << G4endl;
407  }
408  }
409 }
410 
411 
415 {
416  if(Silent==1){ return; }
417 
418  CopyState();
419 
420  G4int prec = G4cout.precision(3);
421  if( verboseLevel > 0 ){
422 
423 #ifdef G4_USE_G4BESTUNIT_FOR_VERBOSE
424  G4cout << std::setw( 5) << "Step#" << " "
425  << std::setw( 8) << "X" << " "
426  << std::setw( 8) << "Y" << " "
427  << std::setw( 8) << "Z" << " "
428  << std::setw( 9) << "KineE" << " "
429  << std::setw( 8) << "dE" << " "
430  << std::setw(12) << "StepLeng" << " "
431  << std::setw(12) << "TrackLeng" << " "
432  << std::setw(12) << "NextVolume" << " "
433  << std::setw( 8) << "ProcName" << G4endl;
434 #else
435  G4cout << std::setw( 5) << "Step#" << " "
436  << std::setw( 8) << "X(mm)" << " "
437  << std::setw( 8) << "Y(mm)" << " "
438  << std::setw( 8) << "Z(mm)" << " "
439  << std::setw( 9) << "KinE(MeV)" << " "
440  << std::setw( 8) << "dE(MeV)" << " "
441  << std::setw( 8) << "StepLeng" << " "
442  << std::setw( 9) << "TrackLeng" << " "
443  << std::setw(11) << "NextVolume" << " "
444  << std::setw( 8) << "ProcName" << G4endl;
445 #endif
446 
447  G4cout << std::setw( 5) << fTrack->GetCurrentStepNumber() << " "
448  << std::setw( 8) << G4BestUnit(fTrack->GetPosition().x(),"Length")<< " "
449  << std::setw( 8) << G4BestUnit(fTrack->GetPosition().y(),"Length") << " "
450  << std::setw( 8) << G4BestUnit(fTrack->GetPosition().z(),"Length")<< " "
451  << std::setw( 9) << G4BestUnit(fTrack->GetKineticEnergy(),"Energy")<< " "
452  << std::setw( 8) << G4BestUnit(fStep->GetTotalEnergyDeposit(),"Energy") << " "
453  << std::setw( 8) << G4BestUnit(fStep->GetStepLength(),"Length")<< " "
454  << std::setw( 9) << G4BestUnit(fTrack->GetTrackLength(),"Length") << " ";
455 
456  if(fTrack->GetNextVolume()){
457  G4cout << std::setw(11) << fTrack->GetNextVolume()->GetName() << " ";
458  } else {
459  G4cout << std::setw(11) << "OutOfWorld" << " ";
460  }
461  G4cout << "initStep" << G4endl;
462  }
463  G4cout.precision(prec);
464 }
468 {
469  if(Silent==1){ return; }
470 
471  CopyState();
472 
473  if(verboseLevel >= 4){
474  G4cout << G4endl;
475  G4cout << " >>AlongStepDoIt (process by process): "
476  << " Process Name = "
478 
479  ShowStep();
480  G4cout << " "
481  << "!Note! Safety of PostStep is only valid "
482  << "after all DoIt invocations."
483  << G4endl;
484 
486  G4cout << G4endl;
487 
488  G4cout << " ++List of secondaries generated "
489  << "(x,y,z,kE,t,PID):"
490  << " No. of secodaries = "
492 
494  for(size_t lp1=(*fSecondary).size()-fN2ndariesAlongStepDoIt; lp1<(*fSecondary).size(); lp1++){
495  G4cout << " "
496  << std::setw( 9)
497  << G4BestUnit((*fSecondary)[lp1]->GetPosition().x() , "Length")<< " "
498  << std::setw( 9)
499  << G4BestUnit((*fSecondary)[lp1]->GetPosition().y() , "Length")<< " "
500  << std::setw( 9)
501  << G4BestUnit((*fSecondary)[lp1]->GetPosition().z() , "Length")<< " "
502  << std::setw( 9)
503  << G4BestUnit((*fSecondary)[lp1]->GetKineticEnergy() , "Energy")<< " "
504  << std::setw( 9)
505  << G4BestUnit((*fSecondary)[lp1]->GetGlobalTime() , "Time")<< " "
506  << std::setw(18)
507  << (*fSecondary)[lp1]->GetDefinition()->GetParticleName() << G4endl;
508  }
509  }
510  }
511 }
515 {
516  if(Silent==1){ return; }
517 
518  CopyState();
519 
520  if(verboseLevel >= 4){
521  G4cout << G4endl;
522  G4cout << " >>PostStepDoIt (process by process): "
523  << " Process Name = "
525 
526  ShowStep();
527  G4cout << G4endl;
529  G4cout << G4endl;
530 
531  G4cout << " ++List of secondaries generated "
532  << "(x,y,z,kE,t,PID):"
533  << " No. of secodaries = "
535 
537  for(size_t lp1=(*fSecondary).size()-fN2ndariesPostStepDoIt; lp1<(*fSecondary).size(); lp1++){
538  G4cout << " "
539  << std::setw( 9)
540  << G4BestUnit((*fSecondary)[lp1]->GetPosition().x() , "Length")<< " "
541  << std::setw( 9)
542  << G4BestUnit((*fSecondary)[lp1]->GetPosition().y(), "Length") << " "
543  << std::setw( 9)
544  << G4BestUnit((*fSecondary)[lp1]->GetPosition().z(), "Length") << " "
545  << std::setw( 9)
546  << G4BestUnit((*fSecondary)[lp1]->GetKineticEnergy(), "Energy") << " "
547  << std::setw( 9)
548  << G4BestUnit((*fSecondary)[lp1]->GetGlobalTime(), "Time") << " "
549  << std::setw(18)
550  << (*fSecondary)[lp1]->GetDefinition()->GetParticleName() << G4endl;
551  }
552  }
553  }
554 }
555 
556 
560 {
561  if(Silent==1){ return; }
562 
563  CopyState();
564 // Show header
565  G4cout << G4endl;
566  G4cout << " ++G4Track Information " << G4endl;
567  G4int prec = G4cout.precision(3);
568 
569 
570  G4cout << " -----------------------------------------------"
571  << G4endl;
572  G4cout << " G4Track Information " << std::setw(20) << G4endl;
573  G4cout << " -----------------------------------------------"
574  << G4endl;
575 
576  G4cout << " Step number : "
577  << std::setw(20) << fTrack->GetCurrentStepNumber()
578  << G4endl;
579 #ifdef G4_USE_G4BESTUNIT_FOR_VERBOSE
580  G4cout << " Position - x : "
581  << std::setw(20) << G4BestUnit(fTrack->GetPosition().x(), "Length")
582  << G4endl;
583  G4cout << " Position - y : "
584  << std::setw(20) << G4BestUnit(fTrack->GetPosition().y(), "Length")
585  << G4endl;
586  G4cout << " Position - z : "
587  << std::setw(20) << G4BestUnit(fTrack->GetPosition().z(), "Length")
588  << G4endl;
589  G4cout << " Global Time : "
590  << std::setw(20) << G4BestUnit(fTrack->GetGlobalTime(), "Time")
591  << G4endl;
592  G4cout << " Local Time : "
593  << std::setw(20) << G4BestUnit(fTrack->GetLocalTime(), "Time")
594  << G4endl;
595 #else
596  G4cout << " Position - x (mm) : "
597  << std::setw(20) << fTrack->GetPosition().x() /mm
598  << G4endl;
599  G4cout << " Position - y (mm) : "
600  << std::setw(20) << fTrack->GetPosition().y() /mm
601  << G4endl;
602  G4cout << " Position - z (mm) : "
603  << std::setw(20) << fTrack->GetPosition().z() /mm
604  << G4endl;
605  G4cout << " Global Time (ns) : "
606  << std::setw(20) << fTrack->GetGlobalTime() /ns
607  << G4endl;
608  G4cout << " Local Time (ns) : "
609  << std::setw(20) << fTrack->GetLocalTime() /ns
610  << G4endl;
611 #endif
612  G4cout << " Momentum Direct - x : "
613  << std::setw(20) << fTrack->GetMomentumDirection().x()
614  << G4endl;
615  G4cout << " Momentum Direct - y : "
616  << std::setw(20) << fTrack->GetMomentumDirection().y()
617  << G4endl;
618  G4cout << " Momentum Direct - z : "
619  << std::setw(20) << fTrack->GetMomentumDirection().z()
620  << G4endl;
621 #ifdef G4_USE_G4BESTUNIT_FOR_VERBOSE
622  G4cout << " Kinetic Energy : "
623 #else
624  G4cout << " Kinetic Energy (MeV): "
625 #endif
626  << std::setw(20) << G4BestUnit(fTrack->GetKineticEnergy(), "Energy")
627  << G4endl;
628  G4cout << " Polarization - x : "
629  << std::setw(20) << fTrack->GetPolarization().x()
630  << G4endl;
631  G4cout << " Polarization - y : "
632  << std::setw(20) << fTrack->GetPolarization().y()
633  << G4endl;
634  G4cout << " Polarization - z : "
635  << std::setw(20) << fTrack->GetPolarization().z()
636  << G4endl;
637  G4cout << " Track Length : "
638  << std::setw(20) << G4BestUnit(fTrack->GetTrackLength(), "Length")
639  << G4endl;
640  G4cout << " Track ID # : "
641  << std::setw(20) << fTrack->GetTrackID()
642  << G4endl;
643  G4cout << " Parent Track ID # : "
644  << std::setw(20) << fTrack->GetParentID()
645  << G4endl;
646  G4cout << " Next Volume : "
647  << std::setw(20);
648  if( fTrack->GetNextVolume() != 0 ) {
649  G4cout << fTrack->GetNextVolume()->GetName() << " ";
650  } else {
651  G4cout << "OutOfWorld" << " ";
652  }
653  G4cout << G4endl;
654  G4cout << " Track Status : "
655  << std::setw(20);
656  if( fTrack->GetTrackStatus() == fAlive ){
657  G4cout << " Alive";
658  } else if( fTrack->GetTrackStatus() == fStopButAlive ){
659  G4cout << " StopButAlive";
660  } else if( fTrack->GetTrackStatus() == fStopAndKill ){
661  G4cout << " StopAndKill";
663  G4cout << " KillTrackAndSecondaries";
664  } else if( fTrack->GetTrackStatus() == fSuspend ){
665  G4cout << " Suspend";
666  } else if( fTrack->GetTrackStatus() == fPostponeToNextEvent ){
667  G4cout << " PostponeToNextEvent";
668  }
669  G4cout << G4endl;
670 #ifdef G4_USE_G4BESTUNIT_FOR_VERBOSE
671  G4cout << " Vertex - x : "
672  << std::setw(20) << G4BestUnit(fTrack->GetVertexPosition().x(),"Length")
673  << G4endl;
674  G4cout << " Vertex - y : "
675  << std::setw(20) << G4BestUnit(fTrack->GetVertexPosition().y(),"Length")
676  << G4endl;
677  G4cout << " Vertex - z : "
678  << std::setw(20) << G4BestUnit(fTrack->GetVertexPosition().z(),"Length")
679  << G4endl;
680 #else
681  G4cout << " Vertex - x (mm) : "
682  << std::setw(20) << fTrack->GetVertexPosition().x()/mm
683  << G4endl;
684  G4cout << " Vertex - y (mm) : "
685  << std::setw(20) << fTrack->GetVertexPosition().y()/mm
686  << G4endl;
687  G4cout << " Vertex - z (mm) : "
688  << std::setw(20) << fTrack->GetVertexPosition().z()/mm
689  << G4endl;
690 #endif
691  G4cout << " Vertex - Px (MomDir): "
692  << std::setw(20) << fTrack->GetVertexMomentumDirection().x()
693  << G4endl;
694  G4cout << " Vertex - Py (MomDir): "
695  << std::setw(20) << fTrack->GetVertexMomentumDirection().y()
696  << G4endl;
697  G4cout << " Vertex - Pz (MomDir): "
698  << std::setw(20) << fTrack->GetVertexMomentumDirection().z()
699  << G4endl;
700 #ifdef G4_USE_G4BESTUNIT_FOR_VERBOSE
701  G4cout << " Vertex - KineE : "
702 #else
703  G4cout << " Vertex - KineE (MeV): "
704 #endif
705  << std::setw(20) << G4BestUnit(fTrack->GetVertexKineticEnergy(),"Energy")
706  << G4endl;
707 
708  G4cout << " Creator Process : "
709  << std::setw(20);
710  if( fTrack->GetCreatorProcess() == 0){
711  G4cout << " Event Generator" << G4endl;
712  } else {
714  }
715 
716  G4cout << " -----------------------------------------------"
717  << G4endl;
718 
719  G4cout.precision(prec);
720 }
721 
722 
726 {
727  if(Silent==1){ return; }
728 // Show header
729  G4cout << G4endl;
730  G4cout << " ++G4ParticleChange Information " << G4endl;
732 }
736 {
737  if(Silent==1){ return; }
738  G4String volName;
739  G4int oldprc;
740 
741 // Show header
742  G4cout << G4endl;
743  G4cout << " ++G4Step Information " << G4endl;
744  oldprc = G4cout.precision(16);
745 
746 // Show G4Step specific information
747  G4cout << " Address of G4Track : " << fStep->GetTrack() << G4endl;
748  G4cout << " Step Length (mm) : " << fStep->GetTrack()->GetStepLength() << G4endl;
749  G4cout << " Energy Deposit (MeV) : " << fStep->GetTotalEnergyDeposit() << G4endl;
750 
751 // Show G4StepPoint specific information
752  G4cout << " -------------------------------------------------------"
753  << "----------------" << G4endl;
754  G4cout << " StepPoint Information " << std::setw(20) << "PreStep"
755  << std::setw(20) << "PostStep" << G4endl;
756  G4cout << " -------------------------------------------------------"
757  << "----------------" << G4endl;
758  G4cout << " Position - x (mm) : "
759  << std::setw(20) << fStep->GetPreStepPoint()->GetPosition().x()
760  << std::setw(20) << fStep->GetPostStepPoint()->GetPosition().x() << G4endl;
761  G4cout << " Position - y (mm) : "
762  << std::setw(20) << fStep->GetPreStepPoint()->GetPosition().y()
763  << std::setw(20) << fStep->GetPostStepPoint()->GetPosition().y() << G4endl;
764  G4cout << " Position - z (mm) : "
765  << std::setw(20) << fStep->GetPreStepPoint()->GetPosition().z()
766  << std::setw(20) << fStep->GetPostStepPoint()->GetPosition().z() << G4endl;
767  G4cout << " Global Time (ns) : "
768  << std::setw(20) << fStep->GetPreStepPoint()->GetGlobalTime()
769  << std::setw(20) << fStep->GetPostStepPoint()->GetGlobalTime() << G4endl;
770  G4cout << " Local Time (ns) : "
771  << std::setw(20) << fStep->GetPreStepPoint()->GetLocalTime()
772  << std::setw(20) << fStep->GetPostStepPoint()->GetLocalTime() << G4endl;
773  G4cout << " Proper Time (ns) : "
774  << std::setw(20) << fStep->GetPreStepPoint()->GetProperTime()
775  << std::setw(20) << fStep->GetPostStepPoint()->GetProperTime() << G4endl;
776  G4cout << " Momentum Direct - x : "
777  << std::setw(20) << fStep->GetPreStepPoint()->GetMomentumDirection().x()
778  << std::setw(20) << fStep->GetPostStepPoint()->GetMomentumDirection().x() << G4endl;
779  G4cout << " Momentum Direct - y : "
780  << std::setw(20) << fStep->GetPreStepPoint()->GetMomentumDirection().y()
781  << std::setw(20) << fStep->GetPostStepPoint()->GetMomentumDirection().y() << G4endl;
782  G4cout << " Momentum Direct - z : "
783  << std::setw(20) << fStep->GetPreStepPoint()->GetMomentumDirection().z()
784  << std::setw(20) << fStep->GetPostStepPoint()->GetMomentumDirection().z() << G4endl;
785  G4cout << " Momentum - x (MeV/c): "
786  << std::setw(20) << fStep->GetPreStepPoint()->GetMomentum().x()
787  << std::setw(20) << fStep->GetPostStepPoint()->GetMomentum().x() << G4endl;
788  G4cout << " Momentum - y (MeV/c): "
789  << std::setw(20) << fStep->GetPreStepPoint()->GetMomentum().y()
790  << std::setw(20) << fStep->GetPostStepPoint()->GetMomentum().y() << G4endl;
791  G4cout << " Momentum - z (MeV/c): "
792  << std::setw(20) << fStep->GetPreStepPoint()->GetMomentum().z()
793  << std::setw(20) << fStep->GetPostStepPoint()->GetMomentum().z() << G4endl;
794  G4cout << " Total Energy (MeV) : "
795  << std::setw(20) << fStep->GetPreStepPoint()->GetTotalEnergy()
796  << std::setw(20) << fStep->GetPostStepPoint()->GetTotalEnergy() << G4endl;
797  G4cout << " Kinetic Energy (MeV): "
798  << std::setw(20) << fStep->GetPreStepPoint()->GetKineticEnergy()
799  << std::setw(20) << fStep->GetPostStepPoint()->GetKineticEnergy() << G4endl;
800  G4cout << " Velocity (mm/ns) : "
801  << std::setw(20) << fStep->GetPreStepPoint()->GetVelocity()
802  << std::setw(20) << fStep->GetPostStepPoint()->GetVelocity() << G4endl;
803  G4cout << " Volume Name : "
804  << std::setw(20) << fStep->GetPreStepPoint()->GetPhysicalVolume()->GetName();
806  {
807  volName = fStep->GetPostStepPoint()->GetPhysicalVolume()->GetName();
808  }
809  else
810  {
811  volName = "OutOfWorld";
812  }
813  G4cout << std::setw(20) << volName << G4endl;
814  G4cout << " Safety (mm) : "
815  << std::setw(20) << fStep->GetPreStepPoint()->GetSafety()
816  << std::setw(20) << fStep->GetPostStepPoint()->GetSafety() << G4endl;
817  G4cout << " Polarization - x : "
818  << std::setw(20) << fStep->GetPreStepPoint()->GetPolarization().x()
819  << std::setw(20) << fStep->GetPostStepPoint()->GetPolarization().x() << G4endl;
820  G4cout << " Polarization - y : "
821  << std::setw(20) << fStep->GetPreStepPoint()->GetPolarization().y()
822  << std::setw(20) << fStep->GetPostStepPoint()->GetPolarization().y() << G4endl;
823  G4cout << " Polarization - Z : "
824  << std::setw(20) << fStep->GetPreStepPoint()->GetPolarization().z()
825  << std::setw(20) << fStep->GetPostStepPoint()->GetPolarization().z() << G4endl;
826  G4cout << " Weight : "
827  << std::setw(20) << fStep->GetPreStepPoint()->GetWeight()
828  << std::setw(20) << fStep->GetPostStepPoint()->GetWeight() << G4endl;
829  G4cout << " Step Status : " ;
830  G4StepStatus tStepStatus = fStep->GetPreStepPoint()->GetStepStatus();
831  if( tStepStatus == fGeomBoundary ){
832  G4cout << std::setw(20) << "Geom Limit";
833  } else if ( tStepStatus == fAlongStepDoItProc ){
834  G4cout << std::setw(20) << "AlongStep Proc.";
835  } else if ( tStepStatus == fPostStepDoItProc ){
836  G4cout << std::setw(20) << "PostStep Proc";
837  } else if ( tStepStatus == fAtRestDoItProc ){
838  G4cout << std::setw(20) << "AtRest Proc";
839  } else if ( tStepStatus == fUndefined ){
840  G4cout << std::setw(20) << "Undefined";
841  }
842 
843  tStepStatus = fStep->GetPostStepPoint()->GetStepStatus();
844  if( tStepStatus == fGeomBoundary ){
845  G4cout << std::setw(20) << "Geom Limit";
846  } else if ( tStepStatus == fAlongStepDoItProc ){
847  G4cout << std::setw(20) << "AlongStep Proc.";
848  } else if ( tStepStatus == fPostStepDoItProc ){
849  G4cout << std::setw(20) << "PostStep Proc";
850  } else if ( tStepStatus == fAtRestDoItProc ){
851  G4cout << std::setw(20) << "AtRest Proc";
852  } else if ( tStepStatus == fUndefined ){
853  G4cout << std::setw(20) << "Undefined";
854  }
855 
856  G4cout << G4endl;
857  G4cout << " Process defined Step: " ;
859  G4cout << std::setw(20) << "Undefined";
860  } else {
861  G4cout << std::setw(20) << fStep->GetPreStepPoint()->GetProcessDefinedStep()->GetProcessName();
862  }
864  G4cout << std::setw(20) << "Undefined";
865  } else {
866  G4cout << std::setw(20) << fStep->GetPostStepPoint()->GetProcessDefinedStep()->GetProcessName();
867  }
868  G4cout.precision(oldprc);
869 
870  G4cout << G4endl;
871  G4cout << " -------------------------------------------------------"
872  << "----------------" << G4endl;
873 }
874 
875