Geant4 11.1.1
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
G4SteppingVerbose.cc
Go to the documentation of this file.
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// G4SteppingVerbose class implementation
27//
28// Contact:
29// Questions and comments to this code should be sent to
30// Katsuya Amako (e-mail: [email protected])
31// Takashi Sasaki (e-mail: [email protected])
32// --------------------------------------------------------------------
33
34#include "G4SteppingVerbose.hh"
35#include "G4SteppingManager.hh"
36#include "G4SystemOfUnits.hh"
37#include "G4VSensitiveDetector.hh" // Include from 'hits/digi'
38#include "G4StepStatus.hh" // Include from 'tracking'
39
40// #define G4_USE_G4BESTUNIT_FOR_VERBOSE 1
41
42#ifdef G4_USE_G4BESTUNIT_FOR_VERBOSE
43#include "G4UnitsTable.hh"
44#else
45#define G4BestUnit(a,b) a
46#endif
47
48G4int G4SteppingVerbose::useBestUnitPrecision = -1;
49
50//////////////////////////////////////////////////
52//////////////////////////////////////////////////
53{
54#ifdef G4_TRACKING_DEBUG
55 G4cout << "G4SteppingVerbose has instantiated" << G4endl;
56#endif
57}
58
59//////////////////////////////////////////////////
61//////////////////////////////////////////////////
62{
63}
64
65//////////////////////////////////////////////////
67//////////////////////////////////////////////////
68{
69}
70
71//////////////////////////////////////////////////
73//////////////////////////////////////////////////
74{
75 if(Silent==1) { return; }
76
77 G4VProcess* ptProcManager;
78 CopyState();
79
80 if(verboseLevel >= 3)
81 {
82 G4int npt=0;
83 G4cout << " **List of AtRestDoIt invoked:" << G4endl;
84 for(std::size_t np=0; np<MAXofAtRestLoops; ++np)
85 {
86 std::size_t npGPIL = MAXofAtRestLoops-np-1;
87 if( (*fSelectedAtRestDoItVector)[npGPIL] == G4ForceCondition::Forced )
88 {
89 ++npt;
90 ptProcManager = (*fAtRestDoItVector)[(G4int)np];
91 G4cout << " # " << npt << " : "
92 << ptProcManager->GetProcessName()
93 << " (Forced)" << G4endl;
94 }
95 else if ( (*fSelectedAtRestDoItVector)[npGPIL] == G4ForceCondition::NotForced )
96 {
97 ++npt;
98 ptProcManager = (*fAtRestDoItVector)[(G4int)np];
99 G4cout << " # " << npt << " : " << ptProcManager->GetProcessName()
100 << G4endl;
101 }
102 }
103
104 G4cout << " Generated secondries # : " << fN2ndariesAtRestDoIt << G4endl;
105
106 if( fN2ndariesAtRestDoIt > 0 )
107 {
108 G4cout << " -- List of secondaries generated : "
109 << "(x,y,z,kE,t,PID) --" << G4endl;
110 for( std::size_t lp1=(*fSecondary).size()-fN2ndariesAtRestDoIt;
111 lp1<(*fSecondary).size(); ++lp1)
112 {
113 G4cout << " "
114 << std::setw( 9)
115 << G4BestUnit((*fSecondary)[lp1]->GetPosition().x(),"Length")
116 << " " << std::setw( 9)
117 << G4BestUnit((*fSecondary)[lp1]->GetPosition().y(),"Length")
118 << " " << std::setw( 9)
119 << G4BestUnit((*fSecondary)[lp1]->GetPosition().z(),"Length")
120 << " " << std::setw( 9)
121 << G4BestUnit((*fSecondary)[lp1]->GetKineticEnergy(),"Energy")
122 << " " << std::setw( 9)
123 << G4BestUnit((*fSecondary)[lp1]->GetGlobalTime(),"Time")
124 << " " << std::setw(18)
125 << (*fSecondary)[lp1]->GetDefinition()->GetParticleName()
126 << G4endl;
127 }
128 }
129 }
130
131 if( verboseLevel >= 4 )
132 {
133 ShowStep();
134 G4cout << G4endl;
135 }
136}
137
138/////////////////////////////////////////////////////
140/////////////////////////////////////////////////////
141{
142 if(Silent==1){ return; }
143
144 G4VProcess* ptProcManager;
145
146 CopyState();
147
148 if(verboseLevel >= 3)
149 {
150 G4cout << G4endl;
151 G4cout << " >>AlongStepDoIt (after all invocations):" << G4endl;
152 G4cout << " ++List of invoked processes " << G4endl;
153
154 for(std::size_t ci=0; ci<MAXofAlongStepLoops; ++ci)
155 {
156 ptProcManager = (*fAlongStepDoItVector)((G4int)ci);
157 G4cout << " " << ci+1 << ") ";
158 if(ptProcManager != nullptr)
159 {
160 G4cout << ptProcManager->GetProcessName() << G4endl;
161 }
162 }
163
164 ShowStep();
165 G4cout << G4endl;
166 G4cout << " ++List of secondaries generated "
167 << "(x,y,z,kE,t,PID):"
168 << " No. of secondaries = "
169 << (*fSecondary).size() << G4endl;
170
171 if((*fSecondary).size()>0)
172 {
173 for(std::size_t lp1=0; lp1<(*fSecondary).size(); ++lp1)
174 {
175 G4cout << " "
176 << std::setw( 9)
177 << G4BestUnit((*fSecondary)[lp1]->GetPosition().x(),"Length")
178 << " " << std::setw( 9)
179 << G4BestUnit((*fSecondary)[lp1]->GetPosition().y(),"Length")
180 << " " << std::setw( 9)
181 << G4BestUnit((*fSecondary)[lp1]->GetPosition().z(),"Length")
182 << " " << std::setw( 9)
183 << G4BestUnit((*fSecondary)[lp1]->GetKineticEnergy(),"Energy")
184 << " " << std::setw( 9)
185 << G4BestUnit((*fSecondary)[lp1]->GetGlobalTime(),"Time")
186 << " " << std::setw(18)
187 << (*fSecondary)[lp1]->GetDefinition()->GetParticleName()
188 << G4endl;
189 }
190 }
191 }
192}
193
194////////////////////////////////////////////////////
196////////////////////////////////////////////////////
197{
198 if(Silent==1) { return; }
199
200 G4VProcess* ptProcManager;
201
202 CopyState();
203
205 (fCondition == Forced) |
209 {
210 if(verboseLevel >= 3)
211 {
212 G4int npt=0;
213 G4cout << G4endl;
214 G4cout << " **PostStepDoIt (after all invocations):" << G4endl;
215 G4cout << " ++List of invoked processes " << G4endl;
216
217 for(std::size_t np=0; np<MAXofPostStepLoops; ++np)
218 {
219 std::size_t npGPIL = MAXofPostStepLoops-np-1;
220 if( (*fSelectedPostStepDoItVector)[npGPIL] == G4ForceCondition::Forced )
221 {
222 ++npt;
223 ptProcManager = (*fPostStepDoItVector)[(G4int)np];
224 G4cout << " " << npt << ") "
225 << ptProcManager->GetProcessName()
226 << " (Forced)" << G4endl;
227 }
228 else if ( (*fSelectedPostStepDoItVector)[npGPIL] == G4ForceCondition::NotForced )
229 {
230 ++npt;
231 ptProcManager = (*fPostStepDoItVector)[(G4int)np];
232 G4cout << " " << npt << ") " << ptProcManager->GetProcessName()
233 << G4endl;
234 }
235 }
236
237 ShowStep();
238 G4cout << G4endl;
239 G4cout << " ++List of secondaries generated "
240 << "(x,y,z,kE,t,PID):"
241 << " No. of secodaries = "
242 << (*fSecondary).size() << G4endl;
243 G4cout << " [Note]Secondaries from AlongStepDoIt included."
244 << G4endl;
245
246 if((*fSecondary).size()>0)
247 {
248 for(std::size_t lp1=0; lp1<(*fSecondary).size(); ++lp1)
249 {
250 G4cout << " "
251 << std::setw( 9)
252 << G4BestUnit((*fSecondary)[lp1]->GetPosition().x(), "Length")
253 << " " << std::setw( 9)
254 << G4BestUnit((*fSecondary)[lp1]->GetPosition().y(), "Length")
255 << " " << std::setw( 9)
256 << G4BestUnit((*fSecondary)[lp1]->GetPosition().z(), "Length")
257 << " " << std::setw( 9)
258 << G4BestUnit((*fSecondary)[lp1]->GetKineticEnergy(), "Energy")
259 << " " << std::setw( 9)
260 << G4BestUnit((*fSecondary)[lp1]->GetGlobalTime(), "Time")
261 << " " << std::setw(18)
262 << (*fSecondary)[lp1]->GetDefinition()->GetParticleName()
263 << G4endl;
264 }
265 }
266 }
267 }
268}
269
270/////////////////////////////////////////
272/////////////////////////////////////////
273{
274 if(Silent==1) { return; }
275 if(SilentStepInfo==1) { return; }
276
277 CopyState();
278 G4cout.precision(16);
279 G4long prec = G4cout.precision(3);
280
281 if( verboseLevel >= 1 )
282 {
283 if( verboseLevel >= 4 ) VerboseTrack();
284 if( verboseLevel >= 3 )
285 {
286 G4cout << G4endl;
287#ifdef G4_USE_G4BESTUNIT_FOR_VERBOSE
288 G4cout << std::setw( 5) << "#Step#" << " "
289 << std::setw( 8) << "X" << " "
290 << std::setw( 8) << "Y" << " "
291 << std::setw( 8) << "Z" << " "
292 << std::setw( 9) << "KineE" << " "
293 << std::setw( 8) << "dE" << " "
294 << std::setw(12) << "StepLeng" << " "
295 << std::setw(12) << "TrackLeng" << " "
296 << std::setw(12) << "NextVolume" << " "
297 << std::setw( 8) << "ProcName" << G4endl;
298#else
299 G4cout << std::setw( 5) << "#Step#" << " "
300 << std::setw( 8) << "X(mm)" << " "
301 << std::setw( 8) << "Y(mm)" << " "
302 << std::setw( 8) << "Z(mm)" << " "
303 << std::setw( 9) << "KinE(MeV)" << " "
304 << std::setw( 8) << "dE(MeV)" << " "
305 << std::setw( 8) << "StepLeng" << " "
306 << std::setw( 9) << "TrackLeng" << " "
307 << std::setw(11) << "NextVolume" << " "
308 << std::setw( 8) << "ProcName" << G4endl;
309#endif
310 }
311 G4cout << std::setw( 5) << fTrack->GetCurrentStepNumber() << " "
312 << std::setw( 8)
313 << G4BestUnit(fTrack->GetPosition().x(), "Length") << " "
314 << std::setw( 8)
315 << G4BestUnit(fTrack->GetPosition().y(), "Length") << " "
316 << std::setw( 8)
317 << G4BestUnit(fTrack->GetPosition().z(), "Length") << " "
318 << std::setw( 9)
319 << G4BestUnit(fTrack->GetKineticEnergy(), "Energy") << " "
320 << std::setw( 8)
321 << G4BestUnit(fStep->GetTotalEnergyDeposit(), "Energy") << " "
322 << std::setw( 8)
323 << G4BestUnit(fStep->GetStepLength(), "Length") << " "
324 << std::setw( 9)
325 << G4BestUnit(fTrack->GetTrackLength(), "Length") << " ";
326
327 if( fTrack->GetNextVolume() != 0 )
328 {
329 G4cout << std::setw(11) << fTrack->GetNextVolume()->GetName() << " ";
330 }
331 else
332 {
333 G4cout << std::setw(11) << "OutOfWorld" << " ";
334 }
336 {
339 }
340 else
341 {
342 G4cout << "User Limit";
343 }
344 G4cout << G4endl;
345 if( verboseLevel == 2 )
346 {
349 if(tN2ndariesTot>0)
350 {
351 G4cout << " :----- List of 2ndaries - "
352 << "#SpawnInStep=" << std::setw(3) << tN2ndariesTot
353 << "(Rest=" << std::setw(2) << fN2ndariesAtRestDoIt
354 << ",Along=" << std::setw(2) << fN2ndariesAlongStepDoIt
355 << ",Post=" << std::setw(2) << fN2ndariesPostStepDoIt
356 << "), "
357 << "#SpawnTotal=" << std::setw(3) << (*fSecondary).size()
358 << " ---------------"
359 << G4endl;
360
361 for(std::size_t lp1=(*fSecondary).size()-tN2ndariesTot;
362 lp1<(*fSecondary).size(); ++lp1)
363 {
364 G4cout << " : "
365 << std::setw( 9)
366 << G4BestUnit((*fSecondary)[lp1]->GetPosition().x(), "Length")
367 << " " << std::setw( 9)
368 << G4BestUnit((*fSecondary)[lp1]->GetPosition().y(), "Length")
369 << " " << std::setw( 9)
370 << G4BestUnit((*fSecondary)[lp1]->GetPosition().z(), "Length")
371 << " " << std::setw( 9)
372 << G4BestUnit((*fSecondary)[lp1]->GetKineticEnergy(), "Energy")
373 << " " << std::setw(18)
374 << (*fSecondary)[lp1]->GetDefinition()->GetParticleName()
375 << G4endl;
376 }
377 G4cout << " :-----------------------------"
378 << "----------------------------------"
379 << "-- EndOf2ndaries Info ---------------" << G4endl;
380 }
381 }
382 }
383 G4cout.precision(prec);
384}
385
386////////////////////////////////////////////
388////////////////////////////////////////////
389{
390 if(Silent==1){ return; }
391 CopyState();
392
393 if( verboseLevel > 5 )
394 {
395 G4cout << G4endl
396 << " >>DefinePhysicalStepLength (List of proposed StepLengths): "
397 << G4endl;
398 }
399}
400
401//////////////////////////////////////////////
403//////////////////////////////////////////////
404{
405 if(Silent==1){ return; }
406 CopyState();
407
408 if( verboseLevel > 5 )
409 {
410 G4cout << G4endl << G4endl;
411 G4cout << "=== Defined Physical Step Length (DPSL)" << G4endl;
412 G4cout << " ++ProposedStep(UserLimit) = "
413 << std::setw( 9) << physIntLength
414 << " : ProcName = User defined maximum allowed Step" << G4endl;
415 }
416}
417
418/////////////////////////////////////////////
420/////////////////////////////////////////////
421{
422 if(Silent==1){ return; }
423 CopyState();
424
425 if( verboseLevel > 5 )
426 {
427 G4cout << " ++ProposedStep(PostStep ) = "
428 << std::setw( 9) << physIntLength
429 << " : ProcName = " << fCurrentProcess->GetProcessName() << " (";
431 {
432 G4cout << "ExclusivelyForced)" << G4endl;
433 }
434 else if(fCondition==StronglyForced)
435 {
436 G4cout << "StronglyForced)" << G4endl;
437 }
438 else if(fCondition==Conditionally)
439 {
440 G4cout << "Conditionally)" << G4endl;
441 }
442 else if(fCondition==Forced)
443 {
444 G4cout << "Forced)" << G4endl;
445 }
446 else
447 {
448 G4cout << "No ForceCondition)" << G4endl;
449 }
450 }
451}
452
453/////////////////////////////////////////////
455/////////////////////////////////////////////
456{
457 if(Silent==1){ return; }
458 CopyState();
459
460 if( verboseLevel > 5 )
461 {
462 G4cout << " ++ProposedStep(AlongStep) = "
463 << std::setw( 9) << G4BestUnit(physIntLength , "Length")
464 << " : ProcName = "
466 << " (";
468 {
469 G4cout << "CandidateForSelection)" << G4endl;
470 }
472 {
473 G4cout << "NotCandidateForSelection)" << G4endl;
474 }
475 else
476 {
477 G4cout << "?!?)" << G4endl;
478 }
479 }
480}
481
482////////////////////////////////////////////////
484////////////////////////////////////////////////
485{
486 if(Silent==1){ return; }
487
488 CopyState();
489
490 G4long prec = G4cout.precision(3);
491 if( verboseLevel > 0 )
492 {
493#ifdef G4_USE_G4BESTUNIT_FOR_VERBOSE
494 G4cout << std::setw( 5) << "Step#" << " "
495 << std::setw( 8) << "X" << " "
496 << std::setw( 8) << "Y" << " "
497 << std::setw( 8) << "Z" << " "
498 << std::setw( 9) << "KineE" << " "
499 << std::setw( 8) << "dE" << " "
500 << std::setw(12) << "StepLeng" << " "
501 << std::setw(12) << "TrackLeng" << " "
502 << std::setw(12) << "NextVolume" << " "
503 << std::setw( 8) << "ProcName" << G4endl;
504#else
505 G4cout << std::setw( 5) << "Step#" << " "
506 << std::setw( 8) << "X(mm)" << " "
507 << std::setw( 8) << "Y(mm)" << " "
508 << std::setw( 8) << "Z(mm)" << " "
509 << std::setw( 9) << "KinE(MeV)" << " "
510 << std::setw( 8) << "dE(MeV)" << " "
511 << std::setw( 8) << "StepLeng" << " "
512 << std::setw( 9) << "TrackLeng" << " "
513 << std::setw(11) << "NextVolume" << " "
514 << std::setw( 8) << "ProcName" << G4endl;
515#endif
516
517 G4cout << std::setw( 5) << fTrack->GetCurrentStepNumber() << " "
518 << std::setw( 8)
519 << G4BestUnit(fTrack->GetPosition().x(),"Length") << " "
520 << std::setw( 8)
521 << G4BestUnit(fTrack->GetPosition().y(),"Length") << " "
522 << std::setw( 8)
523 << G4BestUnit(fTrack->GetPosition().z(),"Length") << " "
524 << std::setw( 9)
525 << G4BestUnit(fTrack->GetKineticEnergy(),"Energy") << " "
526 << std::setw( 8)
527 << G4BestUnit(fStep->GetTotalEnergyDeposit(),"Energy") << " "
528 << std::setw( 8)
529 << G4BestUnit(fStep->GetStepLength(),"Length") << " "
530 << std::setw( 9)
531 << G4BestUnit(fTrack->GetTrackLength(),"Length") << " ";
532
533 if(fTrack->GetNextVolume())
534 {
535 G4cout << std::setw(11) << fTrack->GetNextVolume()->GetName() << " ";
536 }
537 else
538 {
539 G4cout << std::setw(11) << "OutOfWorld" << " ";
540 }
541 G4cout << "initStep" << G4endl;
542 }
543 G4cout.precision(prec);
544}
545
546//////////////////////////////////////////////////////
548//////////////////////////////////////////////////////
549{
550 if(Silent==1){ return; }
551
552 CopyState();
553
554 if(verboseLevel >= 4)
555 {
556 G4cout << G4endl;
557 G4cout << " >>AlongStepDoIt (process by process): "
558 << " Process Name = "
560
561 ShowStep();
562 G4cout << " "
563 << "!Note! Safety of PostStep is only valid "
564 << "after all DoIt invocations."
565 << G4endl;
566
568 G4cout << G4endl;
569
570 G4cout << " ++List of secondaries generated "
571 << "(x,y,z,kE,t,PID):"
572 << " No. of secodaries = "
574
576 {
577 for(std::size_t lp1=(*fSecondary).size()-fN2ndariesAlongStepDoIt;
578 lp1<(*fSecondary).size(); ++lp1)
579 {
580 G4cout << " "
581 << std::setw( 9)
582 << G4BestUnit((*fSecondary)[lp1]->GetPosition().x(), "Length")
583 << " " << std::setw( 9)
584 << G4BestUnit((*fSecondary)[lp1]->GetPosition().y(), "Length")
585 << " " << std::setw( 9)
586 << G4BestUnit((*fSecondary)[lp1]->GetPosition().z(), "Length")
587 << " " << std::setw( 9)
588 << G4BestUnit((*fSecondary)[lp1]->GetKineticEnergy(), "Energy")
589 << " " << std::setw( 9)
590 << G4BestUnit((*fSecondary)[lp1]->GetGlobalTime(), "Time")
591 << " " << std::setw(18)
592 << (*fSecondary)[lp1]->GetDefinition()->GetParticleName()
593 << G4endl;
594 }
595 }
596 }
597}
598
599//////////////////////////////////////////////////////
601//////////////////////////////////////////////////////
602{
603 if(Silent==1) { return; }
604
605 CopyState();
606
607 if(verboseLevel >= 4)
608 {
609 G4cout << G4endl;
610 G4cout << " >>PostStepDoIt (process by process): "
611 << " Process Name = "
613
614 ShowStep();
615 G4cout << G4endl;
617 G4cout << G4endl;
618
619 G4cout << " ++List of secondaries generated "
620 << "(x,y,z,kE,t,PID):"
621 << " No. of secodaries = "
623
625 {
626 for(std::size_t lp1=(*fSecondary).size()-fN2ndariesPostStepDoIt;
627 lp1<(*fSecondary).size(); ++lp1)
628 {
629 G4cout << " "
630 << std::setw( 9)
631 << G4BestUnit((*fSecondary)[lp1]->GetPosition().x(), "Length")
632 << " " << std::setw( 9)
633 << G4BestUnit((*fSecondary)[lp1]->GetPosition().y(), "Length")
634 << " " << std::setw( 9)
635 << G4BestUnit((*fSecondary)[lp1]->GetPosition().z(), "Length")
636 << " " << std::setw( 9)
637 << G4BestUnit((*fSecondary)[lp1]->GetKineticEnergy(), "Energy")
638 << " " << std::setw( 9)
639 << G4BestUnit((*fSecondary)[lp1]->GetGlobalTime(), "Time")
640 << " " << std::setw(18)
641 << (*fSecondary)[lp1]->GetDefinition()->GetParticleName()
642 << G4endl;
643 }
644 }
645 }
646}
647
648//////////////////////////////////////
650//////////////////////////////////////
651{
652 if(Silent==1){ return; }
653
654 CopyState();
655
656 G4cout << G4endl;
657 G4cout << " ++G4Track Information " << G4endl;
658 G4long prec = G4cout.precision(3);
659
660
661 G4cout << " -----------------------------------------------"
662 << G4endl;
663 G4cout << " G4Track Information " << std::setw(20) << G4endl;
664 G4cout << " -----------------------------------------------"
665 << G4endl;
666
667 G4cout << " Step number : "
668 << std::setw(20) << fTrack->GetCurrentStepNumber()
669 << G4endl;
670#ifdef G4_USE_G4BESTUNIT_FOR_VERBOSE
671 G4cout << " Position - x : "
672 << std::setw(20) << G4BestUnit(fTrack->GetPosition().x(), "Length")
673 << G4endl;
674 G4cout << " Position - y : "
675 << std::setw(20) << G4BestUnit(fTrack->GetPosition().y(), "Length")
676 << G4endl;
677 G4cout << " Position - z : "
678 << std::setw(20) << G4BestUnit(fTrack->GetPosition().z(), "Length")
679 << G4endl;
680 G4cout << " Global Time : "
681 << std::setw(20) << G4BestUnit(fTrack->GetGlobalTime(), "Time")
682 << G4endl;
683 G4cout << " Local Time : "
684 << std::setw(20) << G4BestUnit(fTrack->GetLocalTime(), "Time")
685 << G4endl;
686#else
687 G4cout << " Position - x (mm) : "
688 << std::setw(20) << fTrack->GetPosition().x() /mm
689 << G4endl;
690 G4cout << " Position - y (mm) : "
691 << std::setw(20) << fTrack->GetPosition().y() /mm
692 << G4endl;
693 G4cout << " Position - z (mm) : "
694 << std::setw(20) << fTrack->GetPosition().z() /mm
695 << G4endl;
696 G4cout << " Global Time (ns) : "
697 << std::setw(20) << fTrack->GetGlobalTime() /ns
698 << G4endl;
699 G4cout << " Local Time (ns) : "
700 << std::setw(20) << fTrack->GetLocalTime() /ns
701 << G4endl;
702#endif
703 G4cout << " Momentum Direct - x : "
704 << std::setw(20) << fTrack->GetMomentumDirection().x()
705 << G4endl;
706 G4cout << " Momentum Direct - y : "
707 << std::setw(20) << fTrack->GetMomentumDirection().y()
708 << G4endl;
709 G4cout << " Momentum Direct - z : "
710 << std::setw(20) << fTrack->GetMomentumDirection().z()
711 << G4endl;
712#ifdef G4_USE_G4BESTUNIT_FOR_VERBOSE
713 G4cout << " Kinetic Energy : "
714#else
715 G4cout << " Kinetic Energy (MeV): "
716#endif
717 << std::setw(20) << G4BestUnit(fTrack->GetKineticEnergy(), "Energy")
718 << G4endl;
719 G4cout << " Polarization - x : "
720 << std::setw(20) << fTrack->GetPolarization().x()
721 << G4endl;
722 G4cout << " Polarization - y : "
723 << std::setw(20) << fTrack->GetPolarization().y()
724 << G4endl;
725 G4cout << " Polarization - z : "
726 << std::setw(20) << fTrack->GetPolarization().z()
727 << G4endl;
728 G4cout << " Track Length : "
729 << std::setw(20) << G4BestUnit(fTrack->GetTrackLength(), "Length")
730 << G4endl;
731 G4cout << " Track ID # : "
732 << std::setw(20) << fTrack->GetTrackID()
733 << G4endl;
734 G4cout << " Parent Track ID # : "
735 << std::setw(20) << fTrack->GetParentID()
736 << G4endl;
737 G4cout << " Next Volume : "
738 << std::setw(20);
739 if( fTrack->GetNextVolume() != 0 )
740 {
741 G4cout << fTrack->GetNextVolume()->GetName() << " ";
742 }
743 else
744 {
745 G4cout << "OutOfWorld" << " ";
746 }
747 G4cout << G4endl;
748 G4cout << " Track Status : "
749 << std::setw(20);
750 if( fTrack->GetTrackStatus() == fAlive )
751 {
752 G4cout << " Alive";
753 }
754 else if( fTrack->GetTrackStatus() == fStopButAlive )
755 {
756 G4cout << " StopButAlive";
757 }
758 else if( fTrack->GetTrackStatus() == fStopAndKill )
759 {
760 G4cout << " StopAndKill";
761 }
763 {
764 G4cout << " KillTrackAndSecondaries";
765 }
766 else if( fTrack->GetTrackStatus() == fSuspend )
767 {
768 G4cout << " Suspend";
769 }
771 {
772 G4cout << " PostponeToNextEvent";
773 }
774 G4cout << G4endl;
775#ifdef G4_USE_G4BESTUNIT_FOR_VERBOSE
776 G4cout << " Vertex - x : "
777 << std::setw(20)
778 << G4BestUnit(fTrack->GetVertexPosition().x(),"Length")
779 << G4endl;
780 G4cout << " Vertex - y : "
781 << std::setw(20)
782 << G4BestUnit(fTrack->GetVertexPosition().y(),"Length")
783 << G4endl;
784 G4cout << " Vertex - z : "
785 << std::setw(20)
786 << G4BestUnit(fTrack->GetVertexPosition().z(),"Length")
787 << G4endl;
788#else
789 G4cout << " Vertex - x (mm) : "
790 << std::setw(20) << fTrack->GetVertexPosition().x()/mm
791 << G4endl;
792 G4cout << " Vertex - y (mm) : "
793 << std::setw(20) << fTrack->GetVertexPosition().y()/mm
794 << G4endl;
795 G4cout << " Vertex - z (mm) : "
796 << std::setw(20) << fTrack->GetVertexPosition().z()/mm
797 << G4endl;
798#endif
799 G4cout << " Vertex - Px (MomDir): "
800 << std::setw(20) << fTrack->GetVertexMomentumDirection().x()
801 << G4endl;
802 G4cout << " Vertex - Py (MomDir): "
803 << std::setw(20) << fTrack->GetVertexMomentumDirection().y()
804 << G4endl;
805 G4cout << " Vertex - Pz (MomDir): "
806 << std::setw(20) << fTrack->GetVertexMomentumDirection().z()
807 << G4endl;
808#ifdef G4_USE_G4BESTUNIT_FOR_VERBOSE
809 G4cout << " Vertex - KineE : "
810#else
811 G4cout << " Vertex - KineE (MeV): "
812#endif
813 << std::setw(20)
815 << G4endl;
816
817 G4cout << " Creator Process : "
818 << std::setw(20);
819 if( fTrack->GetCreatorProcess() == 0)
820 {
821 G4cout << " Event Generator" << G4endl;
822 }
823 else
824 {
826 }
827
828 G4cout << " -----------------------------------------------"
829 << G4endl;
830 G4cout.precision(prec);
831}
832
833///////////////////////////////////////////////
835///////////////////////////////////////////////
836{
837 if(Silent==1) { return; }
838
839 G4cout << G4endl;
840 G4cout << " ++G4ParticleChange Information " << G4endl;
842}
843
844/////////////////////////////////////////
846////////////////////////////////////////
847{
848 if(Silent==1){ return; }
849 G4String volName;
850 G4long oldprc;
851
852 // Show header
853 G4cout << G4endl;
854 G4cout << " ++G4Step Information " << G4endl;
855 oldprc = G4cout.precision(16);
856
857 // Show G4Step specific information
858 G4cout << " Address of G4Track : "
859 << fStep->GetTrack() << G4endl;
860 G4cout << " Step Length (mm) : "
862 G4cout << " Energy Deposit (MeV) : "
864
865 // Show G4StepPoint specific information
866 G4cout << " -------------------------------------------------------"
867 << "----------------" << G4endl;
868 G4cout << " StepPoint Information "
869 << std::setw(20) << "PreStep"
870 << std::setw(20) << "PostStep" << G4endl;
871 G4cout << " -------------------------------------------------------"
872 << "----------------" << G4endl;
873 G4cout << " Position - x (mm) : "
874 << std::setw(20) << fStep->GetPreStepPoint()->GetPosition().x()
875 << std::setw(20) << fStep->GetPostStepPoint()->GetPosition().x()
876 << G4endl;
877 G4cout << " Position - y (mm) : "
878 << std::setw(20) << fStep->GetPreStepPoint()->GetPosition().y()
879 << std::setw(20) << fStep->GetPostStepPoint()->GetPosition().y()
880 << G4endl;
881 G4cout << " Position - z (mm) : "
882 << std::setw(20) << fStep->GetPreStepPoint()->GetPosition().z()
883 << std::setw(20) << fStep->GetPostStepPoint()->GetPosition().z()
884 << G4endl;
885 G4cout << " Global Time (ns) : "
886 << std::setw(20) << fStep->GetPreStepPoint()->GetGlobalTime()
887 << std::setw(20) << fStep->GetPostStepPoint()->GetGlobalTime()
888 << G4endl;
889 G4cout << " Local Time (ns) : "
890 << std::setw(20) << fStep->GetPreStepPoint()->GetLocalTime()
891 << std::setw(20) << fStep->GetPostStepPoint()->GetLocalTime()
892 << G4endl;
893 G4cout << " Proper Time (ns) : "
894 << std::setw(20) << fStep->GetPreStepPoint()->GetProperTime()
895 << std::setw(20) << fStep->GetPostStepPoint()->GetProperTime()
896 << G4endl;
897 G4cout << " Momentum Direct - x : "
898 << std::setw(20) << fStep->GetPreStepPoint()->GetMomentumDirection().x()
899 << std::setw(20) << fStep->GetPostStepPoint()->GetMomentumDirection().x()
900 << G4endl;
901 G4cout << " Momentum Direct - y : "
902 << std::setw(20) << fStep->GetPreStepPoint()->GetMomentumDirection().y()
903 << std::setw(20) << fStep->GetPostStepPoint()->GetMomentumDirection().y()
904 << G4endl;
905 G4cout << " Momentum Direct - z : "
906 << std::setw(20) << fStep->GetPreStepPoint()->GetMomentumDirection().z()
907 << std::setw(20) << fStep->GetPostStepPoint()->GetMomentumDirection().z()
908 << G4endl;
909 G4cout << " Momentum - x (MeV/c): "
910 << std::setw(20) << fStep->GetPreStepPoint()->GetMomentum().x()
911 << std::setw(20) << fStep->GetPostStepPoint()->GetMomentum().x()
912 << G4endl;
913 G4cout << " Momentum - y (MeV/c): "
914 << std::setw(20) << fStep->GetPreStepPoint()->GetMomentum().y()
915 << std::setw(20) << fStep->GetPostStepPoint()->GetMomentum().y()
916 << G4endl;
917 G4cout << " Momentum - z (MeV/c): "
918 << std::setw(20) << fStep->GetPreStepPoint()->GetMomentum().z()
919 << std::setw(20) << fStep->GetPostStepPoint()->GetMomentum().z()
920 << G4endl;
921 G4cout << " Total Energy (MeV) : "
922 << std::setw(20) << fStep->GetPreStepPoint()->GetTotalEnergy()
923 << std::setw(20) << fStep->GetPostStepPoint()->GetTotalEnergy()
924 << G4endl;
925 G4cout << " Kinetic Energy (MeV): "
926 << std::setw(20) << fStep->GetPreStepPoint()->GetKineticEnergy()
927 << std::setw(20) << fStep->GetPostStepPoint()->GetKineticEnergy()
928 << G4endl;
929 G4cout << " Velocity (mm/ns) : "
930 << std::setw(20) << fStep->GetPreStepPoint()->GetVelocity()
931 << std::setw(20) << fStep->GetPostStepPoint()->GetVelocity()
932 << G4endl;
933 G4cout << " Volume Name : "
934 << std::setw(20)
937 {
939 }
940 else
941 {
942 volName = "OutOfWorld";
943 }
944 G4cout << std::setw(20) << volName << G4endl;
945 G4cout << " Safety (mm) : "
946 << std::setw(20) << fStep->GetPreStepPoint()->GetSafety()
947 << std::setw(20) << fStep->GetPostStepPoint()->GetSafety()
948 << G4endl;
949 G4cout << " Polarization - x : "
950 << std::setw(20) << fStep->GetPreStepPoint()->GetPolarization().x()
951 << std::setw(20) << fStep->GetPostStepPoint()->GetPolarization().x()
952 << G4endl;
953 G4cout << " Polarization - y : "
954 << std::setw(20) << fStep->GetPreStepPoint()->GetPolarization().y()
955 << std::setw(20) << fStep->GetPostStepPoint()->GetPolarization().y()
956 << G4endl;
957 G4cout << " Polarization - Z : "
958 << std::setw(20) << fStep->GetPreStepPoint()->GetPolarization().z()
959 << std::setw(20) << fStep->GetPostStepPoint()->GetPolarization().z()
960 << G4endl;
961 G4cout << " Weight : "
962 << std::setw(20) << fStep->GetPreStepPoint()->GetWeight()
963 << std::setw(20) << fStep->GetPostStepPoint()->GetWeight()
964 << G4endl;
965 G4cout << " Step Status : " ;
967 if( tStepStatus == fGeomBoundary )
968 {
969 G4cout << std::setw(20) << "Geom Limit";
970 }
971 else if ( tStepStatus == fAlongStepDoItProc )
972 {
973 G4cout << std::setw(20) << "AlongStep Proc.";
974 }
975 else if ( tStepStatus == fPostStepDoItProc )
976 {
977 G4cout << std::setw(20) << "PostStep Proc";
978 }
979 else if ( tStepStatus == fAtRestDoItProc )
980 {
981 G4cout << std::setw(20) << "AtRest Proc";
982 }
983 else if ( tStepStatus == fUndefined )
984 {
985 G4cout << std::setw(20) << "Undefined";
986 }
987
988 tStepStatus = fStep->GetPostStepPoint()->GetStepStatus();
989 if( tStepStatus == fGeomBoundary )
990 {
991 G4cout << std::setw(20) << "Geom Limit";
992 }
993 else if ( tStepStatus == fAlongStepDoItProc )
994 {
995 G4cout << std::setw(20) << "AlongStep Proc.";
996 }
997 else if ( tStepStatus == fPostStepDoItProc )
998 {
999 G4cout << std::setw(20) << "PostStep Proc";
1000 }
1001 else if ( tStepStatus == fAtRestDoItProc )
1002 {
1003 G4cout << std::setw(20) << "AtRest Proc";
1004 }
1005 else if ( tStepStatus == fUndefined )
1006 {
1007 G4cout << std::setw(20) << "Undefined";
1008 }
1009
1010 G4cout << G4endl;
1011 G4cout << " Process defined Step: " ;
1013 {
1014 G4cout << std::setw(20) << "Undefined";
1015 }
1016 else
1017 {
1018 G4cout << std::setw(20)
1021 }
1023 {
1024 G4cout << std::setw(20) << "Undefined";
1025 }
1026 else
1027 {
1028 G4cout << std::setw(20)
1031 }
1032 G4cout.precision(oldprc);
1033
1034 G4cout << G4endl;
1035 G4cout << " -------------------------------------------------------"
1036 << "----------------" << G4endl;
1037}
1038
1039//////////////////////////////////////////////////
1041//////////////////////////////////////////////////
1042{ useBestUnitPrecision = prec; }
1043
1044//////////////////////////////////////////////////
1046//////////////////////////////////////////////////
1047{ return useBestUnitPrecision; }
1048
@ StronglyForced
@ Conditionally
@ ExclusivelyForced
@ Forced
@ CandidateForSelection
@ NotCandidateForSelection
G4StepStatus
Definition: G4StepStatus.hh:40
@ fGeomBoundary
Definition: G4StepStatus.hh:43
@ fUndefined
Definition: G4StepStatus.hh:55
@ fPostStepDoItProc
Definition: G4StepStatus.hh:49
@ fAtRestDoItProc
Definition: G4StepStatus.hh:45
@ fAlongStepDoItProc
Definition: G4StepStatus.hh:47
#define G4BestUnit(a, b)
@ fKillTrackAndSecondaries
@ fSuspend
@ fAlive
@ fStopAndKill
@ fStopButAlive
@ fPostponeToNextEvent
long G4long
Definition: G4Types.hh:87
int G4int
Definition: G4Types.hh:85
#define G4endl
Definition: G4ios.hh:57
G4GLOB_DLL std::ostream G4cout
double z() const
double x() const
double y() const
G4double GetTotalEnergy() const
G4StepStatus GetStepStatus() const
G4double GetVelocity() const
G4double GetProperTime() const
G4double GetGlobalTime() const
G4double GetSafety() const
const G4VProcess * GetProcessDefinedStep() const
G4ThreeVector GetMomentum() const
const G4ThreeVector & GetPosition() const
const G4ThreeVector & GetMomentumDirection() const
G4double GetLocalTime() const
G4VPhysicalVolume * GetPhysicalVolume() const
const G4ThreeVector & GetPolarization() const
G4double GetKineticEnergy() const
G4double GetWeight() const
G4Track * GetTrack() const
G4StepPoint * GetPreStepPoint() const
G4double GetStepLength() const
G4double GetTotalEnergyDeposit() const
G4StepPoint * GetPostStepPoint() const
virtual void PostStepDoItAllDone()
virtual void DPSLStarted()
virtual void PostStepDoItOneByOne()
virtual void AtRestDoItInvoked()
virtual void AlongStepDoItAllDone()
virtual void NewStep()
virtual ~G4SteppingVerbose()
virtual void ShowStep() const
virtual void DPSLPostStep()
static void UseBestUnit(G4int prec=4)
virtual void DPSLUserLimit()
virtual void TrackingStarted()
virtual void AlongStepDoItOneByOne()
static G4int BestUnitPrecision()
virtual void StepInfo()
virtual void DPSLAlongStep()
virtual void VerboseTrack()
virtual void VerboseParticleChange()
G4TrackStatus GetTrackStatus() const
G4double GetVertexKineticEnergy() const
G4int GetTrackID() const
const G4VProcess * GetCreatorProcess() const
G4VPhysicalVolume * GetNextVolume() const
const G4ThreeVector & GetPosition() const
G4double GetTrackLength() const
const G4ThreeVector & GetVertexMomentumDirection() const
G4double GetGlobalTime() const
G4int GetCurrentStepNumber() const
const G4ThreeVector & GetVertexPosition() const
G4double GetLocalTime() const
const G4ThreeVector & GetMomentumDirection() const
G4double GetKineticEnergy() const
const G4ThreeVector & GetPolarization() const
G4double GetStepLength() const
G4int GetParentID() const
virtual void DumpInfo() const
const G4String & GetName() const
const G4String & GetProcessName() const
Definition: G4VProcess.hh:386
std::size_t MAXofAlongStepLoops
G4ForceCondition fCondition
G4GPILSelection fGPILSelection
G4VParticleChange * fParticleChange
G4SelectedPostStepDoItVector * fSelectedPostStepDoItVector
G4SelectedAtRestDoItVector * fSelectedAtRestDoItVector
G4VProcess * fCurrentProcess
static G4TRACKING_DLL G4ThreadLocal G4int SilentStepInfo
static G4TRACKING_DLL G4ThreadLocal G4int Silent
std::size_t MAXofPostStepLoops
G4TrackVector * fSecondary
#define ns(x)
Definition: xmltok.c:1649