Geant4 10.7.0
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
G4ITSteppingVerbose.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//
27//
28//---------------------------------------------------------------
29//
30// G4ITSteppingVerbose.cc
31//
32// Description:
33// Implementation of the G4ITSteppingVerbose class
34//
35//---------------------------------------------------------------
36
38#include "G4ITStepProcessor.hh"
39#include "G4SystemOfUnits.hh"
40//#include "G4VSensitiveDetector.hh" // Include from 'hits/digi'
41#include "G4StepStatus.hh" // Include from 'tracking'
42
43#include "G4IT.hh"
44#include "G4IosFlagsSaver.hh"
45
46#define G4_USE_G4BESTUNIT_FOR_VERBOSE 1
47
48#ifdef G4_USE_G4BESTUNIT_FOR_VERBOSE
49#include "G4UnitsTable.hh"
50#else
51#define G4BestUnit(a,b) a
52#endif
53
54using namespace std;
55
56//////////////////////////////////////////////////
58//////////////////////////////////////////////////
59{
60#ifdef G4_TRACKING_DEBUG
61 G4cout << "G4ITSteppingVerbose has instantiated" << G4endl;
62#endif
63}
64
65//////////////////////////////////////////////////
67//////////////////////////////////////////////////
68{
69}
70
71//////////////////////////////////////////////////
73//////////////////////////////////////////////////
74{
75}
76
77//////////////////////////////////////////////////
79//////////////////////////////////////////////////
80{
81 if(fVerboseLevel == 0)
82 {
83 return;
84 }
85
86 G4VProcess* ptProcManager;
87 CopyState();
88
89 if(fVerboseLevel >= 3)
90 {
91 G4int npt = 0;
92 G4cout << " **List of AtRestDoIt invoked:" << G4endl;
93 for(size_t np = 0; np < MAXofAtRestLoops; np++)
94 {
95 size_t npGPIL = MAXofAtRestLoops - np - 1;
96 if((*fSelectedAtRestDoItVector)[npGPIL] == 2)
97 {
98 npt++;
99 ptProcManager = (*fAtRestDoItVector)[np];
100 G4cout << " # " << npt << " : " << ptProcManager->GetProcessName()
101 << " (Forced)" << G4endl;
102 }
103 else if ( (*fSelectedAtRestDoItVector)[npGPIL] == 1 )
104 {
105 npt++;
106 ptProcManager = (*fAtRestDoItVector)[np];
107 G4cout << " # " << npt << " : " << ptProcManager->GetProcessName()
108 << G4endl;
109 }
110 }
111
112 G4cout << " Generated secondries # : " << fN2ndariesAtRestDoIt << G4endl;
113
115 {
116 G4cout << " -- List of secondaries generated : "
117 << "(x,y,z,kE,t,PID) --" << G4endl;
118 for( size_t lp1=(*fSecondary).size()-fN2ndariesAtRestDoIt;
119 lp1<(*fSecondary).size(); lp1++)
120 {
121 G4cout << " "
122 << std::setw( 9)
123 << G4BestUnit((*fSecondary)[lp1]->GetPosition().x(),"Length") << " "
124 << std::setw( 9)
125 << G4BestUnit((*fSecondary)[lp1]->GetPosition().y(),"Length") << " "
126 << std::setw( 9)
127 << G4BestUnit((*fSecondary)[lp1]->GetPosition().z(),"Length") << " "
128 << std::setw( 9)
129 << G4BestUnit((*fSecondary)[lp1]->GetKineticEnergy(),"Energy") << " "
130 << std::setw( 9)
131 << G4BestUnit((*fSecondary)[lp1]->GetGlobalTime(),"Time") << " "
132 << std::setw(18)
133 << (*fSecondary)[lp1]->GetDefinition()->GetParticleName() << G4endl;
134 }
135 }
136 }
137
138 if(fVerboseLevel >= 4)
139 {
140 ShowStep();
141 G4cout << G4endl;
142 }
143}
144/////////////////////////////////////////////////////
146/////////////////////////////////////////////////////
147{
148 if(fVerboseLevel == 0)
149 {
150 return;
151 }
152
153 G4VProcess* ptProcManager;
154
155 CopyState();
156
157 if(fVerboseLevel >= 3)
158 {
159 G4cout << G4endl;
160 G4cout << " >>AlongStepDoIt (after all invocations):" << G4endl;
161 G4cout << " ++List of invoked processes " << G4endl;
162
163 for(size_t ci=0; ci<MAXofAlongStepLoops; ci++)
164 {
165 ptProcManager = (*fAlongStepDoItVector)(ci);
166 G4cout << " " << ci+1 << ") ";
167 if(ptProcManager != 0)
168 {
169 G4cout << ptProcManager->GetProcessName() << G4endl;
170 }
171 }
172
173 ShowStep();
174 G4cout << G4endl;
175 G4cout << " ++List of secondaries generated "
176 << "(x,y,z,kE,t,PID):"
177 << " No. of secodaries = "
178 << (*fSecondary).size() << G4endl;
179
180 if((*fSecondary).size()>0)
181 {
182 for(size_t lp1=0; lp1<(*fSecondary).size(); lp1++)
183 {
184 G4cout << " "
185 << std::setw( 9)
186 << G4BestUnit((*fSecondary)[lp1]->GetPosition().x(),"Length") << " "
187 << std::setw( 9)
188 << G4BestUnit((*fSecondary)[lp1]->GetPosition().y(),"Length") << " "
189 << std::setw( 9)
190 << G4BestUnit((*fSecondary)[lp1]->GetPosition().z(),"Length") << " "
191 << std::setw( 9)
192 << G4BestUnit((*fSecondary)[lp1]->GetKineticEnergy(),"Energy") << " "
193 << std::setw( 9)
194 << G4BestUnit((*fSecondary)[lp1]->GetGlobalTime(),"Time") << " "
195 << std::setw(18)
196 << (*fSecondary)[lp1]->GetDefinition()->GetParticleName() << G4endl;
197 }
198 }
199 }
200}
201////////////////////////////////////////////////////
203////////////////////////////////////////////////////
204{
205 if(fVerboseLevel == 0)
206 {
207 return;
208 }
209
210 G4VProcess* ptProcManager;
211
212 CopyState();
213
214 if(fVerboseLevel >= 3)
215 {
216
220 {
221
222 G4int npt = 0;
223 G4cout << G4endl;
224 G4cout << " **PostStepDoIt (after all invocations):" << G4endl;
225 G4cout << " ++List of invoked processes " << G4endl;
226
227 for(size_t np = 0; np < MAXofPostStepLoops; np++)
228 {
229 size_t npGPIL = MAXofPostStepLoops - np - 1;
230 if((*fSelectedPostStepDoItVector)[npGPIL] == 2)
231 {
232 npt++;
233 ptProcManager = (*fPostStepDoItVector)[np];
234 G4cout << " " << npt << ") " << ptProcManager->GetProcessName()
235 << " (Forced)" << G4endl;
236 }
237 else if ( (*fSelectedPostStepDoItVector)[npGPIL] == 1)
238 {
239 npt++;
240 ptProcManager = (*fPostStepDoItVector)[np];
241 G4cout << " " << npt << ") "
242 << ptProcManager->GetProcessName() << G4endl;
243 }
244 }
245
246 ShowStep();
247 G4cout << G4endl;
248 G4cout << " ++List of secondaries generated " << "(x,y,z,kE,t,PID):"
249 << " No. of secodaries = " << (*fSecondary).size() << G4endl;
250 G4cout << " [Note]Secondaries from AlongStepDoIt included." << G4endl;
251
252 if((*fSecondary).size() > 0)
253 {
254 for(size_t lp1 = 0; lp1 < (*fSecondary).size(); lp1++)
255 {
256 G4cout << " " << std::setw(9)
257 << G4BestUnit((*fSecondary)[lp1]->GetPosition().x(), "Length")
258 << " " << std::setw(9)
259 << G4BestUnit((*fSecondary)[lp1]->GetPosition().y(), "Length")
260 << " " << std::setw(9)
261 << G4BestUnit((*fSecondary)[lp1]->GetPosition().z(), "Length")
262 << " " << std::setw(9)
263 << G4BestUnit((*fSecondary)[lp1]->GetKineticEnergy(), "Energy")
264 << " " << std::setw(9)
265 << G4BestUnit((*fSecondary)[lp1]->GetGlobalTime(), "Time")
266 << " " << std::setw(18)
267 << (*fSecondary)[lp1]->GetDefinition()->GetParticleName()
268 << G4endl;
269 }
270 }
271 }
272 }
273}
274
275/////////////////////////////////////////
277/////////////////////////////////////////
278{
279 if(fVerboseLevel == 0)
280 {
281 return;
282 }
283
284 if(fVerboseLevel < 2)
285 {
286 CopyState();
287 G4int prec = G4cout.precision(3);
288 // G4cout.precision(16);
289
290 if(fVerboseLevel >= 4) VerboseTrack();
291 if(fVerboseLevel >= 3)
292 {
293 G4cout << G4endl;
294 G4cout << "StepInfo" << G4endl;
295#ifdef G4_USE_G4BESTUNIT_FOR_VERBOSE
296 G4cout << std::setw( 5) << "#TrackID" << " "
297 << std::setw( 5) << "#Step#" << " "
298 << std::setw( 8) << "X" << " " << std::setw( 8) << "Y" << " "
299 << std::setw( 8) << "Z" << " "
300 << std::setw( 9) << "KineE" << " " << std::setw( 8) << "dE" << " "
301 << std::setw(12) << "StepLeng" << " " << std::setw(12) << "TrackLeng" << " "
302 << std::setw(12) << "NextVolume" << " " << std::setw( 8) << "ProcName" << G4endl;
303#else
304 G4cout << std::setw( 5) << "#TrackID" << " "
305 << std::setw( 5) << "#Step#" << " "
306 << std::setw( 8) << "X(mm)" << " " << std::setw( 8) << "Y(mm)" << " "
307 << std::setw( 8) << "Z(mm)" << " "
308 << std::setw( 9) << "KinE(MeV)" << " " << std::setw( 8) << "dE(MeV)" << " "
309 << std::setw( 8) << "StepLeng" << " " << std::setw( 9) << "TrackLeng" << " "
310 << std::setw(11) << "NextVolume" << " " << std::setw( 8) << "ProcName" << G4endl;
311#endif
312 }
313 G4cout << std::setw(5) << fTrack->GetTrackID() << " " << std::setw(5)
314 << fTrack->GetCurrentStepNumber() << " " << std::setw(8)
315 << G4BestUnit(fTrack->GetPosition().x(), "Length") << " "
316 << std::setw(8) << G4BestUnit(fTrack->GetPosition().y(), "Length")
317 << " " << std::setw(8)
318 << G4BestUnit(fTrack->GetPosition().z(), "Length") << " "
319 << std::setw(9) << G4BestUnit(fTrack->GetKineticEnergy(), "Energy")
320 << " " << std::setw(8)
321 << G4BestUnit(fStep->GetTotalEnergyDeposit(), "Energy") << " "
322 << std::setw(8) << G4BestUnit(fStep->GetStepLength(), "Length")
323 << " " << std::setw(9)
324 << G4BestUnit(fTrack->GetTrackLength(), "Length") << " ";
325
326 // Put cut comment here
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 {
337 G4cout
339 }
340 else
341 {
342 G4cout << "User Limit";
343 }
344
345 G4cout << G4endl;
346 if(fVerboseLevel == 2)
347 {
350 if(tN2ndariesTot > 0)
351 {
352 G4cout << " :----- List of 2ndaries - " << "#SpawnInStep="
353 << std::setw(3) << tN2ndariesTot << "(Rest=" << std::setw(2)
354 << fN2ndariesAtRestDoIt << ",Along=" << std::setw(2)
355 << fN2ndariesAlongStepDoIt << ",Post=" << std::setw(2)
356 << fN2ndariesPostStepDoIt << "), " << "#SpawnTotal="
357 << std::setw(3) << (*fSecondary).size() << " ---------------"
358 << G4endl;
359
360 for(size_t lp1=(*fSecondary).size()-tN2ndariesTot; lp1<(*fSecondary).size(); lp1++)
361 {
362 G4cout << " : "
363 << std::setw( 9)
364 << G4BestUnit((*fSecondary)[lp1]->GetPosition().x() , "Length")<< " "
365 << std::setw( 9)
366 << G4BestUnit((*fSecondary)[lp1]->GetPosition().y() , "Length")<< " "
367 << std::setw( 9)
368 << G4BestUnit((*fSecondary)[lp1]->GetPosition().z() , "Length") << " "
369 << std::setw( 9)
370 << G4BestUnit((*fSecondary)[lp1]->GetKineticEnergy() , "Energy")<< " "
371 << std::setw(18)
372 << (*fSecondary)[lp1]->GetDefinition()->GetParticleName() << G4endl;
373 }
374 G4cout << " :-----------------------------" << "----------------------------------"
375 << "-- EndOf2ndaries Info ---------------" << G4endl;
376 }
377 }
378 G4cout.precision(prec);
379 }
380}
381/////////////////////////////////////////
383/////////////////////////////////////////
384{
385 if(fVerboseLevel < 2)
386 {
387 return;
388 }
389
390 CopyState();
391 G4int prec = G4cout.precision(3);
392// G4cout.precision(16);
393
394 if(fVerboseLevel >= 4) VerboseTrack();
395 if(fVerboseLevel >= 3)
396 {
397 G4cout << G4endl;
398 G4cout << "StepInfo" << G4endl;
399#ifdef G4_USE_G4BESTUNIT_FOR_VERBOSE
400 G4cout << std::setw( 5) << "#TrackID" << " "
401 << std::setw( 5) << "#Step#" << " "
402 << std::setw( 8) << "X" << " " << std::setw( 8) << "Y" << " "
403 << std::setw( 8) << "Z" << " "
404 << std::setw( 9) << "KineE" << " " << std::setw( 8) << "dE" << " "
405 << std::setw(12) << "StepLeng" << " " << std::setw(12) << "TrackLeng" << " "
406 << std::setw(12) << "NextVolume" << " " << std::setw( 8) << "ProcName" << G4endl;
407#else
408 G4cout << std::setw( 5) << "#TrackID" << " "
409 << std::setw( 5) << "#Step#" << " "
410 << std::setw( 8) << "X(mm)" << " " << std::setw( 8) << "Y(mm)" << " "
411 << std::setw( 8) << "Z(mm)" << " "
412 << std::setw( 9) << "KinE(MeV)" << " " << std::setw( 8) << "dE(MeV)" << " "
413 << std::setw( 8) << "StepLeng" << " " << std::setw( 9) << "TrackLeng" << " "
414 << std::setw(11) << "NextVolume" << " " << std::setw( 8) << "ProcName" << G4endl;
415#endif
416 }
417 G4cout << std::setw(5) << fTrack->GetTrackID() << " " << std::setw(5)
418 << fTrack->GetCurrentStepNumber() << " " << std::setw(8)
419 << G4BestUnit(fTrack->GetPosition().x(), "Length") << " "
420 << std::setw(8) << G4BestUnit(fTrack->GetPosition().y(), "Length")
421 << " " << std::setw(8)
422 << G4BestUnit(fTrack->GetPosition().z(), "Length") << " "
423 << std::setw(9) << G4BestUnit(fTrack->GetKineticEnergy(), "Energy")
424 << " " << std::setw(8)
425 << G4BestUnit(fStep->GetTotalEnergyDeposit(), "Energy") << " "
426 << std::setw(8) << G4BestUnit(fStep->GetStepLength(), "Length") << " "
427 << std::setw(9) << G4BestUnit(fTrack->GetTrackLength(), "Length")
428 << " ";
429
430 // Put cut comment here
431 if(fTrack->GetNextVolume() != 0)
432 {
433 G4cout << std::setw(11) << fTrack->GetNextVolume()->GetName() << " ";
434 }
435 else
436 {
437 G4cout << std::setw(11) << "OutOfWorld" << " ";
438 }
440 {
441 G4cout
443 }
444 else
445 {
446 G4cout << "User Limit";
447 }
448 G4cout << G4endl;
449 if(fVerboseLevel == 2)
450 {
453 if(tN2ndariesTot > 0)
454 {
455 G4cout << " :----- List of 2ndaries - " << "#SpawnInStep="
456 << std::setw(3) << tN2ndariesTot << "(Rest=" << std::setw(2)
457 << fN2ndariesAtRestDoIt << ",Along=" << std::setw(2)
458 << fN2ndariesAlongStepDoIt << ",Post=" << std::setw(2)
459 << fN2ndariesPostStepDoIt << "), " << "#SpawnTotal="
460 << std::setw(3) << (*fSecondary).size() << " ---------------"
461 << G4endl;
462
463 for(size_t lp1=(*fSecondary).size()-tN2ndariesTot; lp1<(*fSecondary).size(); lp1++)
464 {
465 G4cout << " : "
466 << std::setw( 9)
467 << G4BestUnit((*fSecondary)[lp1]->GetPosition().x() , "Length")<< " "
468 << std::setw( 9)
469 << G4BestUnit((*fSecondary)[lp1]->GetPosition().y() , "Length")<< " "
470 << std::setw( 9)
471 << G4BestUnit((*fSecondary)[lp1]->GetPosition().z() , "Length") << " "
472 << std::setw( 9)
473 << G4BestUnit((*fSecondary)[lp1]->GetKineticEnergy() , "Energy")<< " "
474 << std::setw(18)
475 << (*fSecondary)[lp1]->GetDefinition()->GetParticleName() << G4endl;
476 }
477 G4cout << " :-----------------------------" << "----------------------------------"
478 << "-- EndOf2ndaries Info ---------------" << G4endl;
479 }
480 }
481 G4cout.precision(prec);
482}
483// Put cut comment here if( fStepStatus != fWorldBoundary){
484
485////////////////////////////////////////////
487////////////////////////////////////////////
488{
489 if(fVerboseLevel == 0)
490 {
491 return;
492 }
493 CopyState();
494
495 if(fVerboseLevel > 5)
496 {
497 G4cout << G4endl<< " >>DefinePhysicalStepLength (List of proposed StepLengths): " << G4endl;
498 }
499}
500//////////////////////////////////////////////
502//////////////////////////////////////////////
503{
504 if(fVerboseLevel == 0)
505 {
506 return;
507 }
508 CopyState();
509
510 if(fVerboseLevel > 5)
511 {
512 G4cout << G4endl<< G4endl;
513 G4cout << "=== Defined Physical Step Length (DPSL)" << G4endl;
514 G4cout << " ++ProposedStep(UserLimit) = " << std::setw( 9) << physIntLength
515 << " : ProcName = User defined maximum allowed Step" << G4endl;
516 }
517}
518/////////////////////////////////////////////
520/////////////////////////////////////////////
521{
522 if(fVerboseLevel == 0)
523 {
524 return;
525 }
526
527 if(fVerboseLevel > 5)
528 {
529 CopyState();
530
531 G4cout << " ++ProposedStep(PostStep ) = " << std::setw(9)
532 << physIntLength << " : ProcName = "
533 << fCurrentProcess->GetProcessName() << " (";
535 {
536 G4cout << "ExclusivelyForced)" << G4endl;
537 }
538 else if(fCondition==StronglyForced)
539 {
540 G4cout << "StronglyForced)" << G4endl;
541 }
542 else if(fCondition==Conditionally)
543 {
544 G4cout << "Conditionally)" << G4endl;
545 }
546 else if(fCondition==Forced)
547 {
548 G4cout << "Forced)" << G4endl;
549 }
550 else
551 {
552 G4cout << "No ForceCondition)" << G4endl;
553 }
554 }
555}
556/////////////////////////////////////////////
558/////////////////////////////////////////////
559{
560 if(fVerboseLevel == 0)
561 {
562 return;
563 }
564
565 if(fVerboseLevel > 5)
566 {
567 CopyState();
568
569 G4cout << " ++ProposedStep(AlongStep) = " << std::setw(9)
570 << G4BestUnit(physIntLength, "Length") << " : ProcName = "
571 << fCurrentProcess->GetProcessName() << " (";
573 {
574 G4cout << "CandidateForSelection)" << G4endl;
575 }
577 {
578 G4cout << "NotCandidateForSelection)" << G4endl;
579 }
580 else
581 {
582 G4cout << "?!?)" << G4endl;
583 }
584 }
585}
586
587////////////////////////////////////////////////
589////////////////////////////////////////////////
590{
591 if(fVerboseLevel <= 1)
592 {
593 return;
594 }
595
596 G4int prec = G4cout.precision(3);
597 if(fVerboseLevel > 0)
598 {
599 fTrack = track;
600 fStep = track->GetStep();
601
602//#ifdef G4_USE_G4BESTUNIT_FOR_VERBOSE
603// G4cout << std::setw(5) << "TrackID" << " " << std::setw(5) << "Step#" << " "
604// << std::setw(8) << "X" << " " << std::setw(8) << "Y" << " "
605// << std::setw(8) << "Z" << " " << std::setw(9) << "KineE"
606// << " " << std::setw(8) << "dE" << " " << std::setw(12)
607// << "StepLeng" << " " << std::setw(12) << "TrackLeng" << " "
608// << std::setw(12) << "NextVolume" << " " << std::setw(8) << "ProcName"
609// << G4endl;
610//#else
611// G4cout << std::setw(5) << "TrackID" << std::setw(5) << "Step#" << " "
612// << std::setw(8) << "X(mm)" << " " << std::setw(8) << "Y(mm)" << " "
613// << std::setw(8) << "Z(mm)" << " " << std::setw(9) << "KinE(MeV)"
614// << " " << std::setw(8) << "dE(MeV)" << " " << std::setw(8)
615// << "StepLeng" << " " << std::setw(9) << "TrackLeng" << " "
616// << std::setw(11) << "NextVolume" << " " << std::setw(8) << "ProcName"
617// << G4endl;
618//#endif
619
620 G4cout << "Start tracking : "
621 << GetIT(fTrack)->GetName()
622 << " (" << fTrack->GetTrackID() << ") from position "
623 << std::setw(8)
624 << G4BestUnit(fTrack->GetPosition().x(), "Length") << " "
625 << std::setw(8)
626 << G4BestUnit(fTrack->GetPosition().y(), "Length") << " "
627 << std::setw(8)
628 << G4BestUnit(fTrack->GetPosition().z(), "Length") << " ";
629
630// G4cout << std::setw(5) << fTrack->GetTrackID() << std::setw(5)
631// << fTrack->GetCurrentStepNumber() << " " << std::setw(8)
632// << G4BestUnit(fTrack->GetPosition().x(), "Length") << " "
633// << std::setw(8) << G4BestUnit(fTrack->GetPosition().y(), "Length")
634// << " " << std::setw(8)
635// << G4BestUnit(fTrack->GetPosition().z(), "Length") << " "
636// << std::setw(9) << G4BestUnit(fTrack->GetKineticEnergy(), "Energy")
637// << " " << std::setw(8)
638// << G4BestUnit(fStep->GetTotalEnergyDeposit(), "Energy") << " "
639// << std::setw(8) << G4BestUnit(fStep->GetStepLength(), "Length")
640// << " " << std::setw(9)
641// << G4BestUnit(fTrack->GetTrackLength(), "Length") << " ";
642
643 if(fTrack->GetNextVolume())
644 {
645 G4cout << std::setw(11) << fTrack->GetNextVolume()->GetName() << " ";
646 }
647 else
648 {
649 G4cout << std::setw(11) << "OutOfWorld" << " ";
650 }
651 G4cout << "initStep" << G4endl;
652 }
653 G4cout.precision(prec);
654}
655
656////////////////////////////////////////////////
658////////////////////////////////////////////////
659{
660 if(fVerboseLevel <= 1) return;
661
662 G4cout << " * End tracking : " << " Particle : "
663 << track->GetDefinition()->GetParticleName() << "," << " Track ID : "
664 << track->GetTrackID();
665
666 if(track->GetNextVolume())
667 {
668 G4cout << std::setw(11) << track->GetNextVolume()->GetName() << " ";
669 }
670
671 G4cout << G4endl;
672}
673
674//////////////////////////////////////////////////////
676//////////////////////////////////////////////////////
677{
678 if(fVerboseLevel < 4)
679 {
680 return;
681 }
682
683 CopyState();
684
685 G4cout << G4endl;
686 G4cout << " >>AlongStepDoIt (process by process): " << " Process Name = "
688
689 ShowStep();
690 G4cout << " " << "!Note! Safety of PostStep is only valid "
691 << "after all DoIt invocations." << G4endl;
692
694 G4cout << G4endl;
695
696 G4cout << " ++List of secondaries generated " << "(x,y,z,kE,t,PID):"
697 << " No. of secodaries = " << fN2ndariesAlongStepDoIt << G4endl;
698
700 {
701 for(size_t lp1 = (*fSecondary).size() - fN2ndariesAlongStepDoIt;
702 lp1 < (*fSecondary).size(); lp1++)
703 {
704 G4cout << " " << std::setw(9)
705 << G4BestUnit((*fSecondary)[lp1]->GetPosition().x(), "Length")
706 << " " << std::setw(9)
707 << G4BestUnit((*fSecondary)[lp1]->GetPosition().y(), "Length")
708 << " " << std::setw(9)
709 << G4BestUnit((*fSecondary)[lp1]->GetPosition().z(), "Length")
710 << " " << std::setw(9)
711 << G4BestUnit((*fSecondary)[lp1]->GetKineticEnergy(), "Energy")
712 << " " << std::setw(9)
713 << G4BestUnit((*fSecondary)[lp1]->GetGlobalTime(), "Time") << " "
714 << std::setw(18)
715 << (*fSecondary)[lp1]->GetDefinition()->GetParticleName() << G4endl;
716 }
717 }
718}
719//////////////////////////////////////////////////////
721//////////////////////////////////////////////////////
722{
723 if(fVerboseLevel < 4)
724 {
725 return;
726 }
727
728 CopyState();
729 G4cout << G4endl;
730 G4cout << " >>PostStepDoIt (process by process): " << " Process Name = "
732
733 ShowStep();
734 G4cout << G4endl;
736 G4cout << G4endl;
737
738 G4cout << " ++List of secondaries generated " << "(x,y,z,kE,t,PID):"
739 << " No. of secodaries = " << fN2ndariesPostStepDoIt << G4endl;
740
742 {
743 for(size_t lp1 = (*fSecondary).size() - fN2ndariesPostStepDoIt;
744 lp1 < (*fSecondary).size(); lp1++)
745 {
746 G4cout << " " << std::setw(9)
747 << G4BestUnit((*fSecondary)[lp1]->GetPosition().x(), "Length")
748 << " " << std::setw(9)
749 << G4BestUnit((*fSecondary)[lp1]->GetPosition().y(), "Length")
750 << " " << std::setw(9)
751 << G4BestUnit((*fSecondary)[lp1]->GetPosition().z(), "Length")
752 << " " << std::setw(9)
753 << G4BestUnit((*fSecondary)[lp1]->GetKineticEnergy(), "Energy")
754 << " " << std::setw(9)
755 << G4BestUnit((*fSecondary)[lp1]->GetGlobalTime(), "Time") << " "
756 << std::setw(18)
757 << (*fSecondary)[lp1]->GetDefinition()->GetParticleName() << G4endl;
758 }
759 }
760}
761
762//////////////////////////////////////
764//////////////////////////////////////
765{
766 if(fVerboseLevel == 0)
767 {
768 return;
769 }
770
771 CopyState();
772// Show header
773 G4cout << G4endl;
774 G4cout << " ++G4Track Information " << G4endl;
775 G4int prec = G4cout.precision(3);
776
777 G4cout << " -----------------------------------------------" << G4endl;
778 G4cout << " G4Track Information " << std::setw(20) << G4endl;
779 G4cout << " -----------------------------------------------" << G4endl;
780
781 G4cout << " Step number : " << std::setw(20)
783#ifdef G4_USE_G4BESTUNIT_FOR_VERBOSE
784 G4cout << " Position - x : " << std::setw(20)
785 << G4BestUnit(fTrack->GetPosition().x(), "Length") << G4endl;
786 G4cout << " Position - y : " << std::setw(20)
787 << G4BestUnit(fTrack->GetPosition().y(), "Length") << G4endl;
788 G4cout << " Position - z : " << std::setw(20)
789 << G4BestUnit(fTrack->GetPosition().z(), "Length") << G4endl;
790 G4cout << " Global Time : " << std::setw(20)
791 << G4BestUnit(fTrack->GetGlobalTime(), "Time") << G4endl;
792 G4cout << " Local Time : " << std::setw(20)
793 << G4BestUnit(fTrack->GetLocalTime(), "Time") << G4endl;
794#else
795 G4cout << " Position - x (mm) : " << std::setw(20)
796 << fTrack->GetPosition().x() / mm << G4endl;
797 G4cout << " Position - y (mm) : " << std::setw(20)
798 << fTrack->GetPosition().y() / mm << G4endl;
799 G4cout << " Position - z (mm) : " << std::setw(20)
800 << fTrack->GetPosition().z() / mm << G4endl;
801 G4cout << " Global Time (ns) : " << std::setw(20)
802 << fTrack->GetGlobalTime() / ns << G4endl;
803 G4cout << " Local Time (ns) : " << std::setw(20)
804 << fTrack->GetLocalTime() / ns << G4endl;
805#endif
806 G4cout << " Momentum Direct - x : " << std::setw(20)
808 G4cout << " Momentum Direct - y : " << std::setw(20)
810 G4cout << " Momentum Direct - z : " << std::setw(20)
812#ifdef G4_USE_G4BESTUNIT_FOR_VERBOSE
813 G4cout << " Kinetic Energy : "
814#else
815 G4cout << " Kinetic Energy (MeV): "
816#endif
817 << std::setw(20)
818 << G4BestUnit(fTrack->GetKineticEnergy(), "Energy") << G4endl;
819 G4cout << " Polarization - x : " << std::setw(20)
820 << fTrack->GetPolarization().x() << G4endl;
821 G4cout << " Polarization - y : " << std::setw(20)
822 << fTrack->GetPolarization().y() << G4endl;
823 G4cout << " Polarization - z : " << std::setw(20)
824 << fTrack->GetPolarization().z() << G4endl;
825 G4cout << " Track Length : " << std::setw(20)
826 << G4BestUnit(fTrack->GetTrackLength(), "Length") << G4endl;
827 G4cout << " Track ID # : " << std::setw(20)
828 << fTrack->GetTrackID() << G4endl;
829 G4cout << " Parent Track ID # : " << std::setw(20)
830 << fTrack->GetParentID() << G4endl;
831 G4cout << " Next Volume : " << std::setw(20);
832 if(fTrack->GetNextVolume() != 0)
833 {
834 G4cout << fTrack->GetNextVolume()->GetName() << " ";
835 }
836 else
837 {
838 G4cout << "OutOfWorld" << " ";
839 }
840 G4cout << G4endl;
841 G4cout << " Track Status : " << std::setw(20);
843 {
844 G4cout << " Alive";
845 }
846 else if(fTrack->GetTrackStatus() == fStopButAlive)
847 {
848 G4cout << " StopButAlive";
849 }
850 else if(fTrack->GetTrackStatus() == fStopAndKill)
851 {
852 G4cout << " StopAndKill";
853 }
855 {
856 G4cout << " KillTrackAndSecondaries";
857 }
858 else if(fTrack->GetTrackStatus() == fSuspend)
859 {
860 G4cout << " Suspend";
861 }
863 {
864 G4cout << " PostponeToNextEvent";
865 }
866 G4cout << G4endl;
867#ifdef G4_USE_G4BESTUNIT_FOR_VERBOSE
868 G4cout << " Vertex - x : " << std::setw(20)
869 << G4BestUnit(fTrack->GetVertexPosition().x(), "Length") << G4endl;
870 G4cout << " Vertex - y : " << std::setw(20)
871 << G4BestUnit(fTrack->GetVertexPosition().y(), "Length") << G4endl;
872 G4cout << " Vertex - z : " << std::setw(20)
873 << G4BestUnit(fTrack->GetVertexPosition().z(), "Length") << G4endl;
874#else
875 G4cout << " Vertex - x (mm) : " << std::setw(20)
876 << fTrack->GetVertexPosition().x() / mm << G4endl;
877 G4cout << " Vertex - y (mm) : " << std::setw(20)
878 << fTrack->GetVertexPosition().y() / mm << G4endl;
879 G4cout << " Vertex - z (mm) : " << std::setw(20)
880 << fTrack->GetVertexPosition().z() / mm << G4endl;
881#endif
882 G4cout << " Vertex - Px (MomDir): " << std::setw(20)
884 G4cout << " Vertex - Py (MomDir): " << std::setw(20)
886 G4cout << " Vertex - Pz (MomDir): " << std::setw(20)
888#ifdef G4_USE_G4BESTUNIT_FOR_VERBOSE
889 G4cout << " Vertex - KineE : "
890#else
891 G4cout << " Vertex - KineE (MeV): "
892#endif
893 << std::setw(20)
895
896 G4cout << " Creator Process : " << std::setw(20);
897 if(fTrack->GetCreatorProcess() == 0)
898 {
899 G4cout << " Event Generator" << G4endl;
900 }
901 else
902 {
904 }
905
906 G4cout << " -----------------------------------------------" << G4endl;
907
908 G4cout.precision(prec);
909}
910
911///////////////////////////////////////////////
913///////////////////////////////////////////////
914{
915 if(fVerboseLevel == 0)
916 {
917 return;
918 }
919// Show header
920 G4cout << G4endl;
921 G4cout << " ++G4ParticleChange Information " << G4endl;
923}
924/////////////////////////////////////////
926////////////////////////////////////////
927{
928 if(fVerboseLevel == 0)
929 {
930 return;
931 }
932
933 G4String volName;
934 G4int oldprc;
935
936// Show header
937 G4cout << G4endl;
938 G4cout << " ++G4Step Information " << G4endl;
939 oldprc = G4cout.precision(16);
940
941// Show G4Step specific information
942 G4cout << " Address of G4Track : " << fStep->GetTrack() << G4endl;
943 G4cout << " Step Length (mm) : "
945 G4cout << " Energy Deposit (MeV) : " << fStep->GetTotalEnergyDeposit()
946 << G4endl;
947
948// Show G4StepPoint specific information
949 G4cout << " -------------------------------------------------------"
950 << "----------------" << G4endl;
951 G4cout << " StepPoint Information " << std::setw(20) << "PreStep"
952 << std::setw(20) << "PostStep" << G4endl;
953 G4cout << " -------------------------------------------------------"
954 << "----------------" << G4endl;
955 G4cout << " Position - x (mm) : " << std::setw(20)
956 << fStep->GetPreStepPoint()->GetPosition().x() << std::setw(20)
958 G4cout << " Position - y (mm) : " << std::setw(20)
959 << fStep->GetPreStepPoint()->GetPosition().y() << std::setw(20)
961 G4cout << " Position - z (mm) : " << std::setw(20)
962 << fStep->GetPreStepPoint()->GetPosition().z() << std::setw(20)
964 G4cout << " Global Time (ns) : " << std::setw(20)
965 << fStep->GetPreStepPoint()->GetGlobalTime() << std::setw(20)
967 G4cout << " Local Time (ns) : " << std::setw(20)
968 << fStep->GetPreStepPoint()->GetLocalTime() << std::setw(20)
970 G4cout << " Proper Time (ns) : " << std::setw(20)
971 << fStep->GetPreStepPoint()->GetProperTime() << std::setw(20)
973 G4cout << " Momentum Direct - x : " << std::setw(20)
975 << std::setw(20)
977 G4cout << " Momentum Direct - y : " << std::setw(20)
979 << std::setw(20)
981 G4cout << " Momentum Direct - z : " << std::setw(20)
983 << std::setw(20)
985 G4cout << " Momentum - x (MeV/c): " << std::setw(20)
986 << fStep->GetPreStepPoint()->GetMomentum().x() << std::setw(20)
988 G4cout << " Momentum - y (MeV/c): " << std::setw(20)
989 << fStep->GetPreStepPoint()->GetMomentum().y() << std::setw(20)
991 G4cout << " Momentum - z (MeV/c): " << std::setw(20)
992 << fStep->GetPreStepPoint()->GetMomentum().z() << std::setw(20)
994 G4cout << " Total Energy (MeV) : " << std::setw(20)
995 << fStep->GetPreStepPoint()->GetTotalEnergy() << std::setw(20)
997 G4cout << " Kinetic Energy (MeV): " << std::setw(20)
998 << fStep->GetPreStepPoint()->GetKineticEnergy() << std::setw(20)
1000 G4cout << " Velocity (mm/ns) : " << std::setw(20)
1001 << fStep->GetPreStepPoint()->GetVelocity() << std::setw(20)
1003 G4cout << " Volume Name : " << std::setw(20)
1006 {
1008 }
1009 else
1010 {
1011 volName = "OutOfWorld";
1012 }
1013 G4cout << std::setw(20) << volName << G4endl;
1014 G4cout << " Safety (mm) : " << std::setw(20)
1015 << fStep->GetPreStepPoint()->GetSafety() << std::setw(20)
1017 G4cout << " Polarization - x : " << std::setw(20)
1018 << fStep->GetPreStepPoint()->GetPolarization().x() << std::setw(20)
1020 G4cout << " Polarization - y : " << std::setw(20)
1021 << fStep->GetPreStepPoint()->GetPolarization().y() << std::setw(20)
1023 G4cout << " Polarization - Z : " << std::setw(20)
1024 << fStep->GetPreStepPoint()->GetPolarization().z() << std::setw(20)
1026 G4cout << " Weight : " << std::setw(20)
1027 << fStep->GetPreStepPoint()->GetWeight() << std::setw(20)
1029 G4cout << " Step Status : ";
1030 G4StepStatus tStepStatus = fStep->GetPreStepPoint()->GetStepStatus();
1031 if(tStepStatus == fGeomBoundary)
1032 {
1033 G4cout << std::setw(20) << "Geom Limit";
1034 }
1035 else if(tStepStatus == fAlongStepDoItProc)
1036 {
1037 G4cout << std::setw(20) << "AlongStep Proc.";
1038 }
1039 else if(tStepStatus == fPostStepDoItProc)
1040 {
1041 G4cout << std::setw(20) << "PostStep Proc";
1042 }
1043 else if(tStepStatus == fAtRestDoItProc)
1044 {
1045 G4cout << std::setw(20) << "AtRest Proc";
1046 }
1047 else if(tStepStatus == fUndefined)
1048 {
1049 G4cout << std::setw(20) << "Undefined";
1050 }
1051
1052 tStepStatus = fStep->GetPostStepPoint()->GetStepStatus();
1053 if(tStepStatus == fGeomBoundary)
1054 {
1055 G4cout << std::setw(20) << "Geom Limit";
1056 }
1057 else if(tStepStatus == fAlongStepDoItProc)
1058 {
1059 G4cout << std::setw(20) << "AlongStep Proc.";
1060 }
1061 else if(tStepStatus == fPostStepDoItProc)
1062 {
1063 G4cout << std::setw(20) << "PostStep Proc";
1064 }
1065 else if(tStepStatus == fAtRestDoItProc)
1066 {
1067 G4cout << std::setw(20) << "AtRest Proc";
1068 }
1069 else if(tStepStatus == fUndefined)
1070 {
1071 G4cout << std::setw(20) << "Undefined";
1072 }
1073
1074 G4cout << G4endl;
1075 G4cout << " Process defined Step: ";
1077 {
1078 G4cout << std::setw(20) << "Undefined";
1079 }
1080 else
1081 {
1082 G4cout
1083 << std::setw(20)
1085 }
1087 {
1088 G4cout << std::setw(20) << "Undefined";
1089 }
1090 else
1091 {
1092 G4cout
1093 << std::setw(20)
1095 }
1096 G4cout.precision(oldprc);
1097
1098 G4cout << G4endl;
1099 G4cout << " -------------------------------------------------------"
1100 << "----------------" << G4endl;
1101}
1102
1104{
1105 if(fVerboseLevel <= 0) return;
1106
1107 G4IosFlagsSaver ios_saver(G4cout);
1108#ifdef USE_COLOR
1109 G4cout << LIGHT_RED;
1110#endif
1111 G4cout << "*** G4ITStepProcessor::DoIt ***" << G4endl;
1112 G4cout << std::setw(18) << left << "#Name" << std::setw(15) << "trackID"
1113 << std::setw(35) << "Position" << std::setw(25) << "Pre step volume"
1114 << std::setw(25) << "Post step volume" << std::setw(22) << "Process"
1115 << G4endl;
1116#ifdef USE_COLOR
1118#endif
1119}
1120
1122{
1123 if(fVerboseLevel <= 0) return;
1124
1125 G4IosFlagsSaver ios_saver(G4cout);
1126
1127/////
1128// PRE STEP VERBOSE
1129
1130#ifdef DEBUG
1131#ifdef USE_COLOR
1132 G4cout << LIGHT_RED;
1133#endif
1134 G4cout << "*DoIt* " << GetIT(track)->GetName()
1135 << " ID: " << track->GetTrackID()
1136 << " at time : " << track->GetGlobalTime()
1137 << G4endl;
1138#ifdef USE_COLOR
1140#endif
1141#endif
1142
1143 G4String volumeName;
1144
1145 G4TouchableHandle nextTouchable = track->GetNextTouchableHandle();
1146 G4VPhysicalVolume* volume(0);
1147
1148 if(nextTouchable && (volume = nextTouchable->GetVolume()))
1149 {
1150 volumeName = volume->GetName();
1151
1152 if(volume->IsParameterised() || volume->IsReplicated())
1153 {
1154 volumeName += " ";
1155 volumeName += nextTouchable->GetReplicaNumber();
1156 }
1157 }
1158 else
1159 {
1160 volumeName = "OutOfWorld";
1161 }
1162
1163 G4cout << setw(18) << left << GetIT(track)->GetName() << setw(15)
1164 << track->GetTrackID() << std::setprecision(3) << setw(35)
1165 << G4String(G4BestUnit(track->GetPosition(), "Length")) << setw(25)
1166 << volumeName << setw(25) << "---" << G4endl;
1167
1168}
1169
1171{
1172 if(fVerboseLevel <= 0) return;
1173
1174 G4IosFlagsSaver ios_saver(G4cout);
1175
1176 /////
1177 // POST STEP VERBOSE
1178
1179 G4cout << setw(18) << left << GetIT(track)->GetName() << setw(15)
1180 << track->GetTrackID() << std::setprecision(3) << setw(35)
1181 << G4String(G4BestUnit(track->GetPosition(), "Length")) << setw(25)
1182 << "---";
1183
1184 G4TouchableHandle nextTouchable = track->GetNextTouchableHandle();
1185 G4VPhysicalVolume* volume(0);
1186
1187 if(nextTouchable && (volume = nextTouchable->GetVolume()))
1188 {
1189 G4String volumeName = volume->GetName();
1190
1191 if(volume->IsParameterised() || volume->IsReplicated())
1192 {
1193 volumeName += " ";
1194 volumeName += nextTouchable->GetReplicaNumber();
1195 }
1196
1197 G4cout << setw(25) << volumeName;
1198 }
1199 else
1200 {
1201 G4cout << setw(25) << "OutOfWorld";
1202 }
1204 {
1205 G4cout
1206 << setw(22)
1208 ->GetProcessName();
1209 }
1210 else
1211 {
1212 G4cout << "---";
1213 }
1214 G4cout << G4endl;
1215
1216 if(fVerboseLevel > 2)
1217 {
1218 const G4TrackVector* secondaries = 0;
1219 if((secondaries = track->GetStep()->GetSecondary()))
1220 {
1221 if(secondaries->empty() == false)
1222 {
1223 G4cout << "\t\t ---->";
1224 for(size_t j = 0; j < secondaries->size(); ++j)
1225 {
1226 G4cout << GetIT((*secondaries)[j])->GetName() << "("
1227 << (*secondaries)[j]->GetTrackID() << ")" << " ";
1228 }
1229 G4cout << G4endl;
1230 }
1231 }
1232 }
1233
1234 G4cout << G4endl;
1235}
1236
1238{
1239 CopyState();
1240
1241 G4cout << " Invoke at rest process : "
1243 << G4endl;
1244}
@ StronglyForced
@ Conditionally
@ ExclusivelyForced
@ Forced
@ CandidateForSelection
@ NotCandidateForSelection
G4IT * GetIT(const G4Track *track)
Definition: G4IT.cc:48
#define LIGHT_RED
Definition: G4Scheduler.cc:83
#define RESET_COLOR
Definition: G4Scheduler.cc:86
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
@ fKillTrackAndSecondaries
@ fSuspend
@ fAlive
@ fStopAndKill
@ fStopButAlive
@ fPostponeToNextEvent
std::vector< G4Track * > G4TrackVector
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
void TrackingStarted(G4Track *)
void TrackingEnded(G4Track *)
void PostStepVerbose(G4Track *track)
void PreStepVerbose(G4Track *track)
virtual const G4String & GetName() const =0
const G4String & GetParticleName() 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
const G4TrackVector * GetSecondary() const
G4StepPoint * GetPreStepPoint() const
G4double GetStepLength() const
G4double GetTotalEnergyDeposit() const
G4StepPoint * GetPostStepPoint() const
G4TrackStatus GetTrackStatus() const
G4double GetVertexKineticEnergy() const
G4int GetTrackID() const
const G4TouchableHandle & GetNextTouchableHandle() 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
G4ParticleDefinition * GetDefinition() const
const G4ThreeVector & GetMomentumDirection() const
G4double GetKineticEnergy() const
const G4ThreeVector & GetPolarization() const
G4double GetStepLength() const
G4int GetParentID() const
const G4Step * GetStep() const
G4SelectedPostStepDoItVector * fSelectedPostStepDoItVector
const G4VITProcess * fCurrentProcess
G4SelectedAtRestDoItVector * fSelectedAtRestDoItVector
const G4VParticleChange * fParticleChange
const G4TrackVector * fSecondary
G4GPILSelection fGPILSelection
virtual void DumpInfo() const
virtual G4bool IsReplicated() const =0
const G4String & GetName() const
virtual G4bool IsParameterised() const =0
const G4String & GetProcessName() const
Definition: G4VProcess.hh:382
virtual G4VPhysicalVolume * GetVolume(G4int depth=0) const
Definition: G4VTouchable.cc:41
virtual G4int GetReplicaNumber(G4int depth=0) const
Definition: G4VTouchable.cc:55
#define ns
Definition: xmlparse.cc:614