Geant4-11
G4SteppingVerboseWithUnits.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//
28//
29//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
30//
31// Stepping Verbose with units for all the applicable double values
32// This class is ported from TestEm2 extended example
33// Original author : Michel Maire (LAPP)
34// Porting with addition of UI command : Makoto Asai (SLAC) Feb.23.2021
35//
36//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
37
39
40#include "G4SteppingManager.hh"
41#include "G4UnitsTable.hh"
42#include "G4GenericMessenger.hh"
43
44//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
45
47 : G4SteppingVerbose(), fprec(prec)
48{
49}
50
51//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
52
54{
55 delete fmessenger;
56}
57
58//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
59
61{
62 fManager = fMan;
63 fmessenger = new G4GenericMessenger(this,"/tracking/",
64 "precision of verbose output");
65 auto& cmd = fmessenger->DeclareProperty("setVerbosePrecision",fprec,
66 "set precision of verbose output");
68}
69
70//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
71
73{
74 CopyState();
75 G4int oldprec = G4cout.precision(fprec);
76
77 // Step zero
78 //
79 if( verboseLevel > 0 )
80 {
81 G4cout << std::setw( 5) << "Step#" << " "
82 << std::setw(fprec+3) << "X" << " "
83 << std::setw(fprec+3) << "Y" << " "
84 << std::setw(fprec+3) << "Z" << " "
85 << std::setw(fprec+6) << "KineE" << " "
86 << std::setw(fprec+10) << "dEStep" << " "
87 << std::setw(fprec+7) << "StepLeng"
88 << std::setw(fprec+7) << "TrakLeng"
89 << std::setw( 10) << "Volume" << " "
90 << std::setw( 10) << "Process" << G4endl;
91
92 G4cout << std::setw(5) << fTrack->GetCurrentStepNumber() << " "
93 << std::setw(fprec+3) << G4BestUnit(fTrack->GetPosition().x(),"Length")
94 << std::setw(fprec+3) << G4BestUnit(fTrack->GetPosition().y(),"Length")
95 << std::setw(fprec+3) << G4BestUnit(fTrack->GetPosition().z(),"Length")
96 << std::setw(fprec+3) << G4BestUnit(fTrack->GetKineticEnergy(),"Energy")
97 << std::setw(fprec+7) << G4BestUnit(fStep->GetTotalEnergyDeposit(),"Energy")
98 << std::setw(fprec+3) << G4BestUnit(fStep->GetStepLength(),"Length")
99 << std::setw(fprec+3) << G4BestUnit(fTrack->GetTrackLength(),"Length")
100 << std::setw(10) << fTrack->GetVolume()->GetName()
101 << std::setw( 9) << " initStep" << G4endl;
102 }
103 G4cout.precision(oldprec);
104}
105
106//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
107
109{
110 CopyState();
111 G4int oldprec = G4cout.precision(fprec);
112
113 if( verboseLevel >= 1 )
114 {
115 if( verboseLevel >= 4 ) VerboseTrack();
116 if( verboseLevel >= 3 )
117 {
118 G4cout << G4endl;
119 G4cout << std::setw(5) << "#Step#" << " "
120 << std::setw(fprec+3) << "X" << " "
121 << std::setw(fprec+3) << "Y" << " "
122 << std::setw(fprec+3) << "Z" << " "
123 << std::setw(fprec+6) << "KineE" << " "
124 << std::setw(fprec+10) << "dEStep" << " "
125 << std::setw(fprec+7) << "StepLeng"
126 << std::setw(fprec+7) << "TrakLeng"
127 << std::setw(10) << "Volume" << " "
128 << std::setw(10) << "Process" << G4endl;
129 }
130
131 G4cout << std::setw(5) << fTrack->GetCurrentStepNumber() << " "
132 << std::setw(fprec+3) << G4BestUnit(fTrack->GetPosition().x(),"Length")
133 << std::setw(fprec+3) << G4BestUnit(fTrack->GetPosition().y(),"Length")
134 << std::setw(fprec+3) << G4BestUnit(fTrack->GetPosition().z(),"Length")
135 << std::setw(fprec+3) << G4BestUnit(fTrack->GetKineticEnergy(),"Energy")
136 << std::setw(fprec+7) << G4BestUnit(fStep->GetTotalEnergyDeposit(),"Energy")
137 << std::setw(fprec+3) << G4BestUnit(fStep->GetStepLength(),"Length")
138 << std::setw(fprec+3) << G4BestUnit(fTrack->GetTrackLength(),"Length")
139 << std::setw(10) << fTrack->GetVolume()->GetName();
140
141 const G4VProcess* process
143 G4String procName = " UserLimit";
144 if (process != nullptr) procName = process->GetProcessName();
145 if (fStepStatus == fWorldBoundary) procName = "OutOfWorld";
146 G4cout << " " << std::setw( 9) << procName;
147 G4cout << G4endl;
148
149 if (verboseLevel == 2)
150 {
151 const std::vector<const G4Track*>* secondary
153 std::size_t nbtrk = (*secondary).size();
154 if (nbtrk)
155 {
156 G4cout << "\n :----- List of secondaries ----------------" << G4endl;
157 G4cout.precision(4);
158 for (std::size_t lp=0; lp<(*secondary).size(); ++lp)
159 {
160 G4cout << " "
161 << std::setw(13)
162 << (*secondary)[lp]->GetDefinition()->GetParticleName()
163 << ": energy ="
164 << std::setw(6)
165 << G4BestUnit((*secondary)[lp]->GetKineticEnergy(),"Energy")
166 << " time ="
167 << std::setw(6)
168 << G4BestUnit((*secondary)[lp]->GetGlobalTime(),"Time");
169 G4cout << G4endl;
170 }
171
172 G4cout << " :------------------------------------------\n" << G4endl;
173 }
174 }
175 }
176 G4cout.precision(oldprec);
177}
178
179//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
180
182{
183 G4VProcess* ptProcManager;
184 CopyState();
185
186 if(verboseLevel >= 3)
187 {
188 G4int npt=0;
189 G4cout << " **List of AtRestDoIt invoked:" << G4endl;
190 for(std::size_t np=0; np<MAXofAtRestLoops; ++np)
191 {
192 std::size_t npGPIL = MAXofAtRestLoops-np-1;
194 {
195 ++npt;
196 ptProcManager = (*fAtRestDoItVector)[np];
197 G4cout << " # " << npt << " : "
198 << ptProcManager->GetProcessName()
199 << " (Forced)" << G4endl;
200 }
202 {
203 ++npt;
204 ptProcManager = (*fAtRestDoItVector)[np];
205 G4cout << " # " << npt << " : " << ptProcManager->GetProcessName()
206 << G4endl;
207 }
208 }
209
210 G4cout << " Generated secondaries = " << fN2ndariesAtRestDoIt << G4endl;
211
212 if( fN2ndariesAtRestDoIt > 0 )
213 {
214 G4cout << " -- List of secondaries generated : "
215 << "(x,y,z,kE,t,PID) --" << G4endl;
216 for( std::size_t lp1=(*fSecondary).size()-fN2ndariesAtRestDoIt;
217 lp1<(*fSecondary).size(); ++lp1)
218 {
219 G4cout << " "
220 << std::setw( 9)
221 << G4BestUnit((*fSecondary)[lp1]->GetPosition().x(),"Length")
222 << " " << std::setw( 9)
223 << G4BestUnit((*fSecondary)[lp1]->GetPosition().y(),"Length")
224 << " " << std::setw( 9)
225 << G4BestUnit((*fSecondary)[lp1]->GetPosition().z(),"Length")
226 << " " << std::setw( 9)
227 << G4BestUnit((*fSecondary)[lp1]->GetKineticEnergy(),"Energy")
228 << " " << std::setw( 9)
229 << G4BestUnit((*fSecondary)[lp1]->GetGlobalTime(),"Time")
230 << " " << std::setw(18)
231 << (*fSecondary)[lp1]->GetDefinition()->GetParticleName()
232 << G4endl;
233 }
234 }
235 }
236
237 if( verboseLevel >= 4 )
238 {
239 ShowStep();
240 G4cout << G4endl;
241 }
242}
243
244//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
245
247{
248 G4VProcess* ptProcManager;
249
250 CopyState();
251
252 if(verboseLevel >= 3)
253 {
254 G4cout << G4endl;
255 G4cout << " >>AlongStepDoIt (after all invocations):" << G4endl;
256 G4cout << " ++List of invoked processes " << G4endl;
257
258 for(std::size_t ci=0; ci<MAXofAlongStepLoops; ++ci)
259 {
260 ptProcManager = (*fAlongStepDoItVector)(ci);
261 G4cout << " " << ci+1 << ") ";
262 if(ptProcManager != nullptr)
263 {
264 G4cout << ptProcManager->GetProcessName() << G4endl;
265 }
266 }
267
268 ShowStep();
269 G4cout << G4endl;
270 G4cout << " ++List of secondaries generated "
271 << "(x,y,z,kE,t,PID):"
272 << " No. of secondaries = "
273 << (*fSecondary).size() << G4endl;
274
275 if((*fSecondary).size()>0)
276 {
277 for(std::size_t lp1=0; lp1<(*fSecondary).size(); ++lp1)
278 {
279 G4cout << " "
280 << std::setw( 9)
281 << G4BestUnit((*fSecondary)[lp1]->GetPosition().x(),"Length")
282 << " " << std::setw( 9)
283 << G4BestUnit((*fSecondary)[lp1]->GetPosition().y(),"Length")
284 << " " << std::setw( 9)
285 << G4BestUnit((*fSecondary)[lp1]->GetPosition().z(),"Length")
286 << " " << std::setw( 9)
287 << G4BestUnit((*fSecondary)[lp1]->GetKineticEnergy(),"Energy")
288 << " " << std::setw( 9)
289 << G4BestUnit((*fSecondary)[lp1]->GetGlobalTime(),"Time")
290 << " " << std::setw(18)
291 << (*fSecondary)[lp1]->GetDefinition()->GetParticleName()
292 << G4endl;
293 }
294 }
295 }
296}
297
298//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
299
301{
302 G4VProcess* ptProcManager;
303
304 CopyState();
305
307 (fCondition == Forced) |
311 {
312 if(verboseLevel >= 3)
313 {
314 G4int npt=0;
315 G4cout << G4endl;
316 G4cout << " **PostStepDoIt (after all invocations):" << G4endl;
317 G4cout << " ++List of invoked processes " << G4endl;
318
319 for(std::size_t np=0; np<MAXofPostStepLoops; ++np)
320 {
321 std::size_t npGPIL = MAXofPostStepLoops-np-1;
323 {
324 ++npt;
325 ptProcManager = (*fPostStepDoItVector)[np];
326 G4cout << " " << npt << ") "
327 << ptProcManager->GetProcessName()
328 << " (Forced)" << G4endl;
329 }
331 {
332 ++npt;
333 ptProcManager = (*fPostStepDoItVector)[np];
334 G4cout << " " << npt << ") " << ptProcManager->GetProcessName()
335 << G4endl;
336 }
337 }
338
339 ShowStep();
340 G4cout << G4endl;
341 G4cout << " ++List of secondaries generated "
342 << "(x,y,z,kE,t,PID):"
343 << " No. of secondaries = "
344 << (*fSecondary).size() << G4endl;
345 G4cout << " [Note]Secondaries from AlongStepDoIt included."
346 << G4endl;
347
348 if((*fSecondary).size()>0)
349 {
350 for(std::size_t lp1=0; lp1<(*fSecondary).size(); ++lp1)
351 {
352 G4cout << " "
353 << std::setw( 9)
354 << G4BestUnit((*fSecondary)[lp1]->GetPosition().x(), "Length")
355 << " " << std::setw( 9)
356 << G4BestUnit((*fSecondary)[lp1]->GetPosition().y(), "Length")
357 << " " << std::setw( 9)
358 << G4BestUnit((*fSecondary)[lp1]->GetPosition().z(), "Length")
359 << " " << std::setw( 9)
360 << G4BestUnit((*fSecondary)[lp1]->GetKineticEnergy(), "Energy")
361 << " " << std::setw( 9)
362 << G4BestUnit((*fSecondary)[lp1]->GetGlobalTime(), "Time")
363 << " " << std::setw(18)
364 << (*fSecondary)[lp1]->GetDefinition()->GetParticleName()
365 << G4endl;
366 }
367 }
368 }
369 }
370}
371
372//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
373
375{
376 CopyState();
377
378 if( verboseLevel > 5 )
379 {
380 G4cout << G4endl
381 << " >>DefinePhysicalStepLength (List of proposed StepLengths): "
382 << G4endl;
383 }
384}
385
386//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
387
389{
390 CopyState();
391
392 if( verboseLevel > 5 )
393 {
394 G4cout << G4endl << G4endl;
395 G4cout << "=== Defined Physical Step Length (DPSL)" << G4endl;
396 G4cout << " ++ProposedStep(UserLimit) = "
397 << std::setw( 9) << G4BestUnit(physIntLength , "Length")
398 << " : ProcName = User defined maximum allowed Step" << G4endl;
399 }
400}
401
402//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
403
405{
406 CopyState();
407
408 if( verboseLevel > 5 )
409 {
410 G4cout << " ++ProposedStep(PostStep ) = "
411 << std::setw( 9) << G4BestUnit(physIntLength , "Length")
412 << " : ProcName = " << fCurrentProcess->GetProcessName() << " (";
414 {
415 G4cout << "ExclusivelyForced)" << G4endl;
416 }
417 else if(fCondition==StronglyForced)
418 {
419 G4cout << "StronglyForced)" << G4endl;
420 }
421 else if(fCondition==Conditionally)
422 {
423 G4cout << "Conditionally)" << G4endl;
424 }
425 else if(fCondition==Forced)
426 {
427 G4cout << "Forced)" << G4endl;
428 }
429 else
430 {
431 G4cout << "No ForceCondition)" << G4endl;
432 }
433 }
434}
435
436//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
437
439{
440 CopyState();
441
442 if( verboseLevel > 5 )
443 {
444 G4cout << " ++ProposedStep(AlongStep) = "
445 << std::setw( 9) << G4BestUnit(physIntLength , "Length")
446 << " : ProcName = "
448 << " (";
450 {
451 G4cout << "CandidateForSelection)" << G4endl;
452 }
454 {
455 G4cout << "NotCandidateForSelection)" << G4endl;
456 }
457 else
458 {
459 G4cout << "?!?)" << G4endl;
460 }
461 }
462}
463
464//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
465
467{
468 CopyState();
469
470 if(verboseLevel >= 4)
471 {
472 G4cout << G4endl;
473 G4cout << " >>AlongStepDoIt (process by process): "
474 << " Process Name = "
476
477 ShowStep();
478 G4cout << " "
479 << "!Note! Safety of PostStep is only valid "
480 << "after all DoIt invocations."
481 << G4endl;
482
484 G4cout << G4endl;
485
486 G4cout << " ++List of secondaries generated "
487 << "(x,y,z,kE,t,PID):"
488 << " No. of secondaries = "
490
492 {
493 for(std::size_t lp1=(*fSecondary).size()-fN2ndariesAlongStepDoIt;
494 lp1<(*fSecondary).size(); ++lp1)
495 {
496 G4cout << " "
497 << std::setw( 9)
498 << G4BestUnit((*fSecondary)[lp1]->GetPosition().x(), "Length")
499 << " " << std::setw( 9)
500 << G4BestUnit((*fSecondary)[lp1]->GetPosition().y(), "Length")
501 << " " << std::setw( 9)
502 << G4BestUnit((*fSecondary)[lp1]->GetPosition().z(), "Length")
503 << " " << std::setw( 9)
504 << G4BestUnit((*fSecondary)[lp1]->GetKineticEnergy(), "Energy")
505 << " " << std::setw( 9)
506 << G4BestUnit((*fSecondary)[lp1]->GetGlobalTime(), "Time")
507 << " " << std::setw(18)
508 << (*fSecondary)[lp1]->GetDefinition()->GetParticleName()
509 << G4endl;
510 }
511 }
512 }
513}
514
515//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
516
518{
519 CopyState();
520
521 if(verboseLevel >= 4)
522 {
523 G4cout << G4endl;
524 G4cout << " >>PostStepDoIt (process by process): "
525 << " Process Name = "
527
528 ShowStep();
529 G4cout << G4endl;
531 G4cout << G4endl;
532
533 G4cout << " ++List of secondaries generated "
534 << "(x,y,z,kE,t,PID):"
535 << " No. of secondaries = "
537
539 {
540 for(std::size_t lp1=(*fSecondary).size()-fN2ndariesPostStepDoIt;
541 lp1<(*fSecondary).size(); ++lp1)
542 {
543 G4cout << " "
544 << std::setw( 9)
545 << G4BestUnit((*fSecondary)[lp1]->GetPosition().x(), "Length")
546 << " " << std::setw( 9)
547 << G4BestUnit((*fSecondary)[lp1]->GetPosition().y(), "Length")
548 << " " << std::setw( 9)
549 << G4BestUnit((*fSecondary)[lp1]->GetPosition().z(), "Length")
550 << " " << std::setw( 9)
551 << G4BestUnit((*fSecondary)[lp1]->GetKineticEnergy(), "Energy")
552 << " " << std::setw( 9)
553 << G4BestUnit((*fSecondary)[lp1]->GetGlobalTime(), "Time")
554 << " " << std::setw(18)
555 << (*fSecondary)[lp1]->GetDefinition()->GetParticleName()
556 << G4endl;
557 }
558 }
559 }
560}
561
562//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
563
565{
566 CopyState();
567
568 G4cout << G4endl;
569 G4cout << " ++G4Track Information " << G4endl;
570 G4int oldprec = G4cout.precision(fprec);
571
572
573 G4cout << " -----------------------------------------------" << G4endl;
574 G4cout << " G4Track Information " << std::setw(20) << G4endl;
575 G4cout << " -----------------------------------------------" << G4endl;
576
577 G4cout << " Step number : "
578 << std::setw(20) << fTrack->GetCurrentStepNumber() << G4endl;
579 G4cout << " Position - x : "
580 << std::setw(20) << G4BestUnit(fTrack->GetPosition().x(), "Length")
581 << G4endl;
582 G4cout << " Position - y : "
583 << std::setw(20) << G4BestUnit(fTrack->GetPosition().y(), "Length")
584 << G4endl;
585 G4cout << " Position - z : "
586 << std::setw(20) << G4BestUnit(fTrack->GetPosition().z(), "Length")
587 << G4endl;
588 G4cout << " Global Time : "
589 << std::setw(20) << G4BestUnit(fTrack->GetGlobalTime(), "Time")
590 << G4endl;
591 G4cout << " Local Time : "
592 << std::setw(20) << G4BestUnit(fTrack->GetLocalTime(), "Time")
593 << G4endl;
594 G4cout << " Momentum Direct - x : "
595 << std::setw(20) << fTrack->GetMomentumDirection().x()
596 << G4endl;
597 G4cout << " Momentum Direct - y : "
598 << std::setw(20) << fTrack->GetMomentumDirection().y()
599 << G4endl;
600 G4cout << " Momentum Direct - z : "
601 << std::setw(20) << fTrack->GetMomentumDirection().z()
602 << G4endl;
603 G4cout << " Kinetic Energy : "
604 << std::setw(20) << G4BestUnit(fTrack->GetKineticEnergy(), "Energy")
605 << G4endl;
606 G4cout << " Polarization - x : "
607 << std::setw(20) << fTrack->GetPolarization().x()
608 << G4endl;
609 G4cout << " Polarization - y : "
610 << std::setw(20) << fTrack->GetPolarization().y()
611 << G4endl;
612 G4cout << " Polarization - z : "
613 << std::setw(20) << fTrack->GetPolarization().z()
614 << G4endl;
615 G4cout << " Track Length : "
616 << std::setw(20) << G4BestUnit(fTrack->GetTrackLength(), "Length")
617 << G4endl;
618 G4cout << " Track ID # : "
619 << std::setw(20) << fTrack->GetTrackID()
620 << G4endl;
621 G4cout << " Parent Track ID # : "
622 << std::setw(20) << fTrack->GetParentID()
623 << G4endl;
624 G4cout << " Next Volume : "
625 << std::setw(20);
626 if (fTrack->GetNextVolume() != 0)
627 G4cout << fTrack->GetNextVolume()->GetName() << " ";
628 else G4cout << "OutOfWorld" << " ";
629 G4cout << G4endl;
630 G4cout << " Track Status : "
631 << std::setw(20);
632 if( fTrack->GetTrackStatus() == fAlive )
633 G4cout << " Alive";
634 else if( fTrack->GetTrackStatus() == fStopButAlive )
635 G4cout << " StopButAlive";
636 else if( fTrack->GetTrackStatus() == fStopAndKill )
637 G4cout << " StopAndKill";
639 G4cout << " KillTrackAndSecondaries";
640 else if( fTrack->GetTrackStatus() == fSuspend )
641 G4cout << " Suspend";
643 G4cout << " PostponeToNextEvent";
644 G4cout << G4endl;
645 G4cout << " Vertex - x : "
646 << std::setw(20)
647 << G4BestUnit(fTrack->GetVertexPosition().x(),"Length")
648 << G4endl;
649 G4cout << " Vertex - y : "
650 << std::setw(20)
651 << G4BestUnit(fTrack->GetVertexPosition().y(),"Length")
652 << G4endl;
653 G4cout << " Vertex - z : "
654 << std::setw(20)
655 << G4BestUnit(fTrack->GetVertexPosition().z(),"Length")
656 << G4endl;
657 G4cout << " Vertex - Px (MomDir): "
658 << std::setw(20) << fTrack->GetVertexMomentumDirection().x()
659 << G4endl;
660 G4cout << " Vertex - Py (MomDir): "
661 << std::setw(20) << fTrack->GetVertexMomentumDirection().y()
662 << G4endl;
663 G4cout << " Vertex - Pz (MomDir): "
664 << std::setw(20) << fTrack->GetVertexMomentumDirection().z()
665 << G4endl;
666 G4cout << " Vertex - KineE : "
667 << std::setw(20)
669 << G4endl;
670
671 G4cout << " Creator Process : "
672 << std::setw(20);
673 if (fTrack->GetCreatorProcess() == 0)
674 G4cout << " Event Generator" << G4endl;
675 else
677
678 G4cout << " -----------------------------------------------" << G4endl;
679 G4cout.precision(oldprec);
680}
681
682//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
683
685{
686 G4cout << G4endl;
687 G4cout << " ++G4ParticleChange Information " << G4endl;
689}
690
691//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
692
694{
695 // Show header
696 G4cout << G4endl;
697 G4cout << " ++G4Step Information " << G4endl;
698 G4int oldprc = G4cout.precision(fprec);
699
700 // Show G4Step specific information
701 G4cout << " Address of G4Track : "
702 << fStep->GetTrack() << G4endl;
703 G4cout << " Step Length : "
704 << G4BestUnit(fStep->GetTrack()->GetStepLength(), "Length") << G4endl;
705 G4cout << " Energy Deposit : "
706 << G4BestUnit(fStep->GetTotalEnergyDeposit(), "Energy") << G4endl;
707
708 // Show G4StepPoint specific information
709 G4cout << " -------------------------------------------------------"
710 << "----------------" << G4endl;
711 G4cout << " StepPoint Information "
712 << std::setw(20) << "PreStep" << std::setw(20) << "PostStep" << G4endl;
713 G4cout << " -------------------------------------------------------"
714 << "----------------" << G4endl;
715 G4cout << " Position - x : "
716 << std::setw(17)
717 << G4BestUnit(fStep->GetPreStepPoint()->GetPosition().x(), "Length")
718 << std::setw(17)
719 << G4BestUnit(fStep->GetPostStepPoint()->GetPosition().x(), "Length")
720 << G4endl;
721 G4cout << " Position - y : "
722 << std::setw(17)
723 << G4BestUnit(fStep->GetPreStepPoint()->GetPosition().y(), "Length")
724 << std::setw(17)
725 << G4BestUnit(fStep->GetPostStepPoint()->GetPosition().y(), "Length")
726 << G4endl;
727 G4cout << " Position - z : "
728 << std::setw(17)
729 << G4BestUnit(fStep->GetPreStepPoint()->GetPosition().z(), "Length")
730 << std::setw(17)
731 << G4BestUnit(fStep->GetPostStepPoint()->GetPosition().z(), "Length")
732 << G4endl;
733 G4cout << " Global Time : "
734 << std::setw(17)
736 << std::setw(17)
738 << G4endl;
739 G4cout << " Local Time : "
740 << std::setw(17)
742 << std::setw(17)
744 << G4endl;
745 G4cout << " Proper Time : "
746 << std::setw(17)
748 << std::setw(17)
750 << G4endl;
751 G4cout << " Momentum Direct - x : "
752 << std::setw(20) << fStep->GetPreStepPoint()->GetMomentumDirection().x()
753 << std::setw(20) << fStep->GetPostStepPoint()->GetMomentumDirection().x()
754 << G4endl;
755 G4cout << " Momentum Direct - y : "
756 << std::setw(20) << fStep->GetPreStepPoint()->GetMomentumDirection().y()
757 << std::setw(20) << fStep->GetPostStepPoint()->GetMomentumDirection().y()
758 << G4endl;
759 G4cout << " Momentum Direct - z : "
760 << std::setw(20) << fStep->GetPreStepPoint()->GetMomentumDirection().z()
761 << std::setw(20) << fStep->GetPostStepPoint()->GetMomentumDirection().z()
762 << G4endl;
763 G4cout << " Momentum - x : "
764 << std::setw(14)
765 << G4BestUnit(fStep->GetPreStepPoint()->GetMomentum().x(),"Momentum")
766 << std::setw(14)
767 << G4BestUnit(fStep->GetPostStepPoint()->GetMomentum().x(),"Momentum")
768 << G4endl;
769 G4cout << " Momentum - y : "
770 << std::setw(14)
771 << G4BestUnit(fStep->GetPreStepPoint()->GetMomentum().y(),"Momentum")
772 << std::setw(14)
773 << G4BestUnit(fStep->GetPostStepPoint()->GetMomentum().y(),"Momentum")
774 << G4endl;
775 G4cout << " Momentum - z : "
776 << std::setw(14)
777 << G4BestUnit(fStep->GetPreStepPoint()->GetMomentum().z(),"Momentum")
778 << std::setw(14)
779 << G4BestUnit(fStep->GetPostStepPoint()->GetMomentum().z(),"Momentum")
780 << G4endl;
781 G4cout << " Total Energy : "
782 << std::setw(16)
784 << std::setw(16)
786 << G4endl;
787 G4cout << " Kinetic Energy : "
788 << std::setw(16)
790 << std::setw(16)
792 << G4endl;
793 G4cout << " Velocity : "
794 << std::setw(14)
795 << G4BestUnit(fStep->GetPreStepPoint()->GetVelocity(),"Velocity")
796 << std::setw(14)
797 << G4BestUnit(fStep->GetPostStepPoint()->GetVelocity(),"Velocity")
798 << G4endl;
799 G4cout << " Volume Name : "
800 << std::setw(20)
802 G4String volName = "OutOfWorld";
805 G4cout << std::setw(20) << volName
806 << G4endl;
807 G4cout << " Safety : "
808 << std::setw(17)
809 << G4BestUnit(fStep->GetPreStepPoint()->GetSafety(),"Length")
810 << std::setw(17)
811 << G4BestUnit(fStep->GetPostStepPoint()->GetSafety(),"Length")
812 << G4endl;
813 G4cout << " Polarization - x : "
814 << std::setw(20) << fStep->GetPreStepPoint()->GetPolarization().x()
815 << std::setw(20) << fStep->GetPostStepPoint()->GetPolarization().x()
816 << G4endl;
817 G4cout << " Polarization - y : "
818 << std::setw(20) << fStep->GetPreStepPoint()->GetPolarization().y()
819 << std::setw(20) << fStep->GetPostStepPoint()->GetPolarization().y()
820 << G4endl;
821 G4cout << " Polarization - Z : "
822 << std::setw(20) << fStep->GetPreStepPoint()->GetPolarization().z()
823 << std::setw(20) << fStep->GetPostStepPoint()->GetPolarization().z()
824 << G4endl;
825 G4cout << " Weight : "
826 << std::setw(20) << fStep->GetPreStepPoint()->GetWeight()
827 << std::setw(20) << fStep->GetPostStepPoint()->GetWeight()
828 << G4endl;
829 G4cout << " Step Status : " ;
831 if( tStepStatus == fGeomBoundary )
832 {
833 G4cout << std::setw(20) << "Geom Limit";
834 }
835 else if ( tStepStatus == fAlongStepDoItProc )
836 {
837 G4cout << std::setw(20) << "AlongStep Proc.";
838 }
839 else if ( tStepStatus == fPostStepDoItProc )
840 {
841 G4cout << std::setw(20) << "PostStep Proc";
842 }
843 else if ( tStepStatus == fAtRestDoItProc )
844 {
845 G4cout << std::setw(20) << "AtRest Proc";
846 }
847 else if ( tStepStatus == fUndefined )
848 {
849 G4cout << std::setw(20) << "Undefined";
850 }
851
852 tStepStatus = fStep->GetPostStepPoint()->GetStepStatus();
853 if( tStepStatus == fGeomBoundary )
854 {
855 G4cout << std::setw(20) << "Geom Limit";
856 }
857 else if ( tStepStatus == fAlongStepDoItProc )
858 {
859 G4cout << std::setw(20) << "AlongStep Proc.";
860 }
861 else if ( tStepStatus == fPostStepDoItProc )
862 {
863 G4cout << std::setw(20) << "PostStep Proc";
864 }
865 else if ( tStepStatus == fAtRestDoItProc )
866 {
867 G4cout << std::setw(20) << "AtRest Proc";
868 }
869 else if ( tStepStatus == fUndefined )
870 {
871 G4cout << std::setw(20) << "Undefined";
872 }
873
874 G4cout << G4endl;
875 G4cout << " Process defined Step: " ;
877 {
878 G4cout << std::setw(20) << "Undefined";
879 }
880 else
881 {
882 G4cout << std::setw(20)
885 }
887 {
888 G4cout << std::setw(20) << "Undefined";
889 }
890 else
891 {
892 G4cout << std::setw(20)
895 }
896 G4cout.precision(oldprc);
897
898 G4cout << G4endl;
899 G4cout << " -------------------------------------------------------"
900 << "----------------" << G4endl;
901}
902
903//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@ G4State_Idle
@ G4State_PreInit
@ StronglyForced
@ NotForced
@ Conditionally
@ ExclusivelyForced
@ Forced
@ CandidateForSelection
@ NotCandidateForSelection
G4StepStatus
Definition: G4StepStatus.hh:40
@ fGeomBoundary
Definition: G4StepStatus.hh:43
@ fWorldBoundary
Definition: G4StepStatus.hh:41
@ fUndefined
Definition: G4StepStatus.hh:55
@ fPostStepDoItProc
Definition: G4StepStatus.hh:49
@ fAtRestDoItProc
Definition: G4StepStatus.hh:45
@ fAlongStepDoItProc
Definition: G4StepStatus.hh:47
Definition of the G4SteppingVerboseWithUnits class.
#define G4BestUnit(a, b)
@ fKillTrackAndSecondaries
@ fSuspend
@ fAlive
@ fStopAndKill
@ fStopButAlive
@ fPostponeToNextEvent
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
Command & DeclareProperty(const G4String &name, const G4AnyType &variable, const G4String &doc="")
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
const std::vector< const G4Track * > * GetSecondaryInCurrentStep() const
Definition: G4Step.cc:209
G4StepPoint * GetPreStepPoint() const
G4double GetStepLength() const
G4double GetTotalEnergyDeposit() const
G4StepPoint * GetPostStepPoint() const
void SetManager(G4SteppingManager *const) override
G4TrackStatus GetTrackStatus() const
G4double GetVertexKineticEnergy() const
G4int GetTrackID() const
G4VPhysicalVolume * GetVolume() 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:382
std::size_t MAXofAlongStepLoops
G4ForceCondition fCondition
G4GPILSelection fGPILSelection
G4VParticleChange * fParticleChange
G4SelectedPostStepDoItVector * fSelectedPostStepDoItVector
G4SelectedAtRestDoItVector * fSelectedAtRestDoItVector
G4VProcess * fCurrentProcess
G4SteppingManager * fManager
std::size_t MAXofPostStepLoops
G4TrackVector * fSecondary
static const double prec
Definition: RanecuEngine.cc:61
Command & SetStates(G4ApplicationState s0)