46 #include "G4StepStatus.hh" 50 #ifdef G4_USE_G4BESTUNIT_FOR_VERBOSE 53 #define G4BestUnit(a,b) a 60 #ifdef G4_TRACKING_DEBUG 61 G4cout <<
"G4SteppingVerbose has instantiated" <<
G4endl;
90 size_t npGPIL = MAXofAtRestLoops-np-1;
93 ptProcManager = (*fAtRestDoItVector)[np];
94 G4cout <<
" # " << npt <<
" : " 99 ptProcManager = (*fAtRestDoItVector)[np];
107 G4cout <<
" -- List of secondaries generated : " <<
"(x,y,z,kE,t,PID) --" <<
G4endl;
109 lp1<(*fSecondary).size(); lp1++) {
122 << (*fSecondary)[lp1]->GetDefinition()->GetParticleName() <<
G4endl;
144 G4cout <<
" >>AlongStepDoIt (after all invocations):" <<
G4endl;
148 ptProcManager = (*fAlongStepDoItVector)(ci);
149 G4cout <<
" " << ci+1 <<
") ";
150 if(ptProcManager != 0){
157 G4cout <<
" ++List of secondaries generated " 158 <<
"(x,y,z,kE,t,PID):" 159 <<
" No. of secodaries = " 160 << (*fSecondary).size() <<
G4endl;
162 if((*fSecondary).size()>0){
163 for(
size_t lp1=0; lp1<(*fSecondary).size(); lp1++){
176 << (*fSecondary)[lp1]->GetDefinition()->GetParticleName() <<
G4endl;
200 G4cout <<
" **PostStepDoIt (after all invocations):" <<
G4endl;
204 size_t npGPIL = MAXofPostStepLoops-np-1;
207 ptProcManager = (*fPostStepDoItVector)[np];
208 G4cout <<
" " << npt <<
") " 213 ptProcManager = (*fPostStepDoItVector)[np];
220 G4cout <<
" ++List of secondaries generated " 221 <<
"(x,y,z,kE,t,PID):" 222 <<
" No. of secodaries = " 223 << (*fSecondary).size() <<
G4endl;
224 G4cout <<
" [Note]Secondaries from AlongStepDoIt included." <<
G4endl;
226 if((*fSecondary).size()>0){
227 for(
size_t lp1=0; lp1<(*fSecondary).size(); lp1++){
240 << (*fSecondary)[lp1]->GetDefinition()->GetParticleName() <<
G4endl;
262 #ifdef G4_USE_G4BESTUNIT_FOR_VERBOSE 263 G4cout << std::setw( 5) <<
"#Step#" <<
" " 264 << std::setw( 8) <<
"X" <<
" " << std::setw( 8) <<
"Y" <<
" " 265 << std::setw( 8) <<
"Z" <<
" " 266 << std::setw( 9) <<
"KineE" <<
" " << std::setw( 8) <<
"dE" <<
" " 267 << std::setw(12) <<
"StepLeng" <<
" " << std::setw(12) <<
"TrackLeng" <<
" " 268 << std::setw(12) <<
"NextVolume" <<
" " << std::setw( 8) <<
"ProcName" <<
G4endl;
270 G4cout << std::setw( 5) <<
"#Step#" <<
" " 271 << std::setw( 8) <<
"X(mm)" <<
" " << std::setw( 8) <<
"Y(mm)" <<
" " 272 << std::setw( 8) <<
"Z(mm)" <<
" " 273 << std::setw( 9) <<
"KinE(MeV)" <<
" " << std::setw( 8) <<
"dE(MeV)" <<
" " 274 << std::setw( 8) <<
"StepLeng" <<
" " << std::setw( 9) <<
"TrackLeng" <<
" " 275 << std::setw(11) <<
"NextVolume" <<
" " << std::setw( 8) <<
"ProcName" <<
G4endl;
278 G4cout << std::setw( 5) <<
fTrack->GetCurrentStepNumber() <<
" " 282 << std::setw( 9) <<
G4BestUnit(
fTrack->GetKineticEnergy() ,
"Energy") <<
" " 283 << std::setw( 8) <<
G4BestUnit(
fStep->GetTotalEnergyDeposit(),
"Energy") <<
" " 284 << std::setw( 8) <<
G4BestUnit(
fStep->GetStepLength() ,
"Length") <<
" " 288 if(
fTrack->GetNextVolume() != 0 ) {
289 G4cout << std::setw(11) <<
fTrack->GetNextVolume()->GetName() <<
" ";
291 G4cout << std::setw(11) <<
"OutOfWorld" <<
" ";
293 if(
fStep->GetPostStepPoint()->GetProcessDefinedStep() != 0){
294 G4cout <<
fStep->GetPostStepPoint()->GetProcessDefinedStep()->GetProcessName();
303 G4cout <<
" :----- List of 2ndaries - " 304 <<
"#SpawnInStep=" << std::setw(3) << tN2ndariesTot
307 <<
",Post=" << std::setw(2) << fN2ndariesPostStepDoIt
309 <<
"#SpawnTotal=" << std::setw(3) << (*fSecondary).size()
310 <<
" ---------------" 313 for(
size_t lp1=(*fSecondary).size()-tN2ndariesTot; lp1<(*fSecondary).size(); lp1++){
324 << (*fSecondary)[lp1]->GetDefinition()->GetParticleName() <<
G4endl;
326 G4cout <<
" :-----------------------------" <<
"----------------------------------" 327 <<
"-- EndOf2ndaries Info ---------------" <<
G4endl;
343 G4cout <<
G4endl <<
" >>DefinePhysicalStepLength (List of proposed StepLengths): " <<
G4endl;
355 G4cout <<
"=== Defined Physical Step Length (DPSL)" <<
G4endl;
357 <<
" : ProcName = User defined maximum allowed Step" <<
G4endl;
395 G4cout <<
" ++ProposedStep(AlongStep) = " 424 #ifdef G4_USE_G4BESTUNIT_FOR_VERBOSE 425 G4cout << std::setw( 5) <<
"Step#" <<
" " 426 << std::setw( 8) <<
"X" <<
" " 427 << std::setw( 8) <<
"Y" <<
" " 428 << std::setw( 8) <<
"Z" <<
" " 429 << std::setw( 9) <<
"KineE" <<
" " 430 << std::setw( 8) <<
"dE" <<
" " 431 << std::setw(12) <<
"StepLeng" <<
" " 432 << std::setw(12) <<
"TrackLeng" <<
" " 433 << std::setw(12) <<
"NextVolume" <<
" " 434 << std::setw( 8) <<
"ProcName" <<
G4endl;
436 G4cout << std::setw( 5) <<
"Step#" <<
" " 437 << std::setw( 8) <<
"X(mm)" <<
" " 438 << std::setw( 8) <<
"Y(mm)" <<
" " 439 << std::setw( 8) <<
"Z(mm)" <<
" " 440 << std::setw( 9) <<
"KinE(MeV)" <<
" " 441 << std::setw( 8) <<
"dE(MeV)" <<
" " 442 << std::setw( 8) <<
"StepLeng" <<
" " 443 << std::setw( 9) <<
"TrackLeng" <<
" " 444 << std::setw(11) <<
"NextVolume" <<
" " 445 << std::setw( 8) <<
"ProcName" <<
G4endl;
448 G4cout << std::setw( 5) <<
fTrack->GetCurrentStepNumber() <<
" " 453 << std::setw( 8) <<
G4BestUnit(
fStep->GetTotalEnergyDeposit(),
"Energy") <<
" " 457 if(
fTrack->GetNextVolume()){
458 G4cout << std::setw(11) <<
fTrack->GetNextVolume()->GetName() <<
" ";
460 G4cout << std::setw(11) <<
"OutOfWorld" <<
" ";
476 G4cout <<
" >>AlongStepDoIt (process by process): " 477 <<
" Process Name = " 482 <<
"!Note! Safety of PostStep is only valid " 483 <<
"after all DoIt invocations." 489 G4cout <<
" ++List of secondaries generated " 490 <<
"(x,y,z,kE,t,PID):" 491 <<
" No. of secodaries = " 508 << (*fSecondary)[lp1]->GetDefinition()->GetParticleName() <<
G4endl;
523 G4cout <<
" >>PostStepDoIt (process by process): " 524 <<
" Process Name = " 532 G4cout <<
" ++List of secondaries generated " 533 <<
"(x,y,z,kE,t,PID):" 534 <<
" No. of secodaries = " 551 << (*fSecondary)[lp1]->GetDefinition()->GetParticleName() <<
G4endl;
571 G4cout <<
" -----------------------------------------------" 573 G4cout <<
" G4Track Information " << std::setw(20) <<
G4endl;
574 G4cout <<
" -----------------------------------------------" 577 G4cout <<
" Step number : " 578 << std::setw(20) <<
fTrack->GetCurrentStepNumber()
580 #ifdef G4_USE_G4BESTUNIT_FOR_VERBOSE 581 G4cout <<
" Position - x : " 584 G4cout <<
" Position - y : " 587 G4cout <<
" Position - z : " 590 G4cout <<
" Global Time : " 593 G4cout <<
" Local Time : " 597 G4cout <<
" Position - x (mm) : " 598 << std::setw(20) <<
fTrack->GetPosition().x() /
mm 600 G4cout <<
" Position - y (mm) : " 601 << std::setw(20) <<
fTrack->GetPosition().y() /
mm 603 G4cout <<
" Position - z (mm) : " 604 << std::setw(20) <<
fTrack->GetPosition().z() /
mm 606 G4cout <<
" Global Time (ns) : " 607 << std::setw(20) <<
fTrack->GetGlobalTime() /
ns 609 G4cout <<
" Local Time (ns) : " 610 << std::setw(20) <<
fTrack->GetLocalTime() /
ns 613 G4cout <<
" Momentum Direct - x : " 614 << std::setw(20) <<
fTrack->GetMomentumDirection().x()
616 G4cout <<
" Momentum Direct - y : " 617 << std::setw(20) <<
fTrack->GetMomentumDirection().y()
619 G4cout <<
" Momentum Direct - z : " 620 << std::setw(20) <<
fTrack->GetMomentumDirection().z()
622 #ifdef G4_USE_G4BESTUNIT_FOR_VERBOSE 623 G4cout <<
" Kinetic Energy : " 625 G4cout <<
" Kinetic Energy (MeV): " 629 G4cout <<
" Polarization - x : " 630 << std::setw(20) <<
fTrack->GetPolarization().x()
632 G4cout <<
" Polarization - y : " 633 << std::setw(20) <<
fTrack->GetPolarization().y()
635 G4cout <<
" Polarization - z : " 636 << std::setw(20) <<
fTrack->GetPolarization().z()
638 G4cout <<
" Track Length : " 641 G4cout <<
" Track ID # : " 642 << std::setw(20) <<
fTrack->GetTrackID()
644 G4cout <<
" Parent Track ID # : " 645 << std::setw(20) <<
fTrack->GetParentID()
647 G4cout <<
" Next Volume : " 649 if(
fTrack->GetNextVolume() != 0 ) {
652 G4cout <<
"OutOfWorld" <<
" ";
655 G4cout <<
" Track Status : " 657 if(
fTrack->GetTrackStatus() == fAlive ){
659 }
else if(
fTrack->GetTrackStatus() == fStopButAlive ){
660 G4cout <<
" StopButAlive";
661 }
else if(
fTrack->GetTrackStatus() == fStopAndKill ){
663 }
else if(
fTrack->GetTrackStatus() == fKillTrackAndSecondaries ){
664 G4cout <<
" KillTrackAndSecondaries";
665 }
else if(
fTrack->GetTrackStatus() == fSuspend ){
667 }
else if(
fTrack->GetTrackStatus() == fPostponeToNextEvent ){
668 G4cout <<
" PostponeToNextEvent";
671 #ifdef G4_USE_G4BESTUNIT_FOR_VERBOSE 672 G4cout <<
" Vertex - x : " 675 G4cout <<
" Vertex - y : " 678 G4cout <<
" Vertex - z : " 682 G4cout <<
" Vertex - x (mm) : " 683 << std::setw(20) <<
fTrack->GetVertexPosition().x()/
mm 685 G4cout <<
" Vertex - y (mm) : " 686 << std::setw(20) <<
fTrack->GetVertexPosition().y()/
mm 688 G4cout <<
" Vertex - z (mm) : " 689 << std::setw(20) <<
fTrack->GetVertexPosition().z()/
mm 692 G4cout <<
" Vertex - Px (MomDir): " 693 << std::setw(20) <<
fTrack->GetVertexMomentumDirection().x()
695 G4cout <<
" Vertex - Py (MomDir): " 696 << std::setw(20) <<
fTrack->GetVertexMomentumDirection().y()
698 G4cout <<
" Vertex - Pz (MomDir): " 699 << std::setw(20) <<
fTrack->GetVertexMomentumDirection().z()
701 #ifdef G4_USE_G4BESTUNIT_FOR_VERBOSE 702 G4cout <<
" Vertex - KineE : " 704 G4cout <<
" Vertex - KineE (MeV): " 709 G4cout <<
" Creator Process : " 711 if(
fTrack->GetCreatorProcess() == 0){
717 G4cout <<
" -----------------------------------------------" 745 oldprc =
G4cout.precision(16);
749 G4cout <<
" Step Length (mm) : " <<
fStep->GetTrack()->GetStepLength() <<
G4endl;
750 G4cout <<
" Energy Deposit (MeV) : " <<
fStep->GetTotalEnergyDeposit() <<
G4endl;
753 G4cout <<
" -------------------------------------------------------" 754 <<
"----------------" <<
G4endl;
755 G4cout <<
" StepPoint Information " << std::setw(20) <<
"PreStep" 756 << std::setw(20) <<
"PostStep" <<
G4endl;
757 G4cout <<
" -------------------------------------------------------" 758 <<
"----------------" <<
G4endl;
759 G4cout <<
" Position - x (mm) : " 760 << std::setw(20) <<
fStep->GetPreStepPoint()->GetPosition().x()
761 << std::setw(20) <<
fStep->GetPostStepPoint()->GetPosition().x() <<
G4endl;
762 G4cout <<
" Position - y (mm) : " 763 << std::setw(20) <<
fStep->GetPreStepPoint()->GetPosition().y()
764 << std::setw(20) <<
fStep->GetPostStepPoint()->GetPosition().y() <<
G4endl;
765 G4cout <<
" Position - z (mm) : " 766 << std::setw(20) <<
fStep->GetPreStepPoint()->GetPosition().z()
767 << std::setw(20) <<
fStep->GetPostStepPoint()->GetPosition().z() <<
G4endl;
768 G4cout <<
" Global Time (ns) : " 769 << std::setw(20) <<
fStep->GetPreStepPoint()->GetGlobalTime()
770 << std::setw(20) <<
fStep->GetPostStepPoint()->GetGlobalTime() <<
G4endl;
771 G4cout <<
" Local Time (ns) : " 772 << std::setw(20) <<
fStep->GetPreStepPoint()->GetLocalTime()
773 << std::setw(20) <<
fStep->GetPostStepPoint()->GetLocalTime() <<
G4endl;
774 G4cout <<
" Proper Time (ns) : " 775 << std::setw(20) <<
fStep->GetPreStepPoint()->GetProperTime()
776 << std::setw(20) <<
fStep->GetPostStepPoint()->GetProperTime() <<
G4endl;
777 G4cout <<
" Momentum Direct - x : " 778 << std::setw(20) <<
fStep->GetPreStepPoint()->GetMomentumDirection().x()
779 << std::setw(20) <<
fStep->GetPostStepPoint()->GetMomentumDirection().x() <<
G4endl;
780 G4cout <<
" Momentum Direct - y : " 781 << std::setw(20) <<
fStep->GetPreStepPoint()->GetMomentumDirection().y()
782 << std::setw(20) <<
fStep->GetPostStepPoint()->GetMomentumDirection().y() <<
G4endl;
783 G4cout <<
" Momentum Direct - z : " 784 << std::setw(20) <<
fStep->GetPreStepPoint()->GetMomentumDirection().z()
785 << std::setw(20) <<
fStep->GetPostStepPoint()->GetMomentumDirection().z() <<
G4endl;
786 G4cout <<
" Momentum - x (MeV/c): " 787 << std::setw(20) <<
fStep->GetPreStepPoint()->GetMomentum().x()
788 << std::setw(20) <<
fStep->GetPostStepPoint()->GetMomentum().x() <<
G4endl;
789 G4cout <<
" Momentum - y (MeV/c): " 790 << std::setw(20) <<
fStep->GetPreStepPoint()->GetMomentum().y()
791 << std::setw(20) <<
fStep->GetPostStepPoint()->GetMomentum().y() <<
G4endl;
792 G4cout <<
" Momentum - z (MeV/c): " 793 << std::setw(20) <<
fStep->GetPreStepPoint()->GetMomentum().z()
794 << std::setw(20) <<
fStep->GetPostStepPoint()->GetMomentum().z() <<
G4endl;
795 G4cout <<
" Total Energy (MeV) : " 796 << std::setw(20) <<
fStep->GetPreStepPoint()->GetTotalEnergy()
797 << std::setw(20) <<
fStep->GetPostStepPoint()->GetTotalEnergy() <<
G4endl;
798 G4cout <<
" Kinetic Energy (MeV): " 799 << std::setw(20) <<
fStep->GetPreStepPoint()->GetKineticEnergy()
800 << std::setw(20) <<
fStep->GetPostStepPoint()->GetKineticEnergy() <<
G4endl;
801 G4cout <<
" Velocity (mm/ns) : " 802 << std::setw(20) <<
fStep->GetPreStepPoint()->GetVelocity()
803 << std::setw(20) <<
fStep->GetPostStepPoint()->GetVelocity() <<
G4endl;
804 G4cout <<
" Volume Name : " 805 << std::setw(20) <<
fStep->GetPreStepPoint()->GetPhysicalVolume()->GetName();
806 if (
fStep->GetPostStepPoint()->GetPhysicalVolume())
808 volName =
fStep->GetPostStepPoint()->GetPhysicalVolume()->GetName();
812 volName =
"OutOfWorld";
815 G4cout <<
" Safety (mm) : " 816 << std::setw(20) <<
fStep->GetPreStepPoint()->GetSafety()
817 << std::setw(20) <<
fStep->GetPostStepPoint()->GetSafety() <<
G4endl;
818 G4cout <<
" Polarization - x : " 819 << std::setw(20) <<
fStep->GetPreStepPoint()->GetPolarization().x()
820 << std::setw(20) <<
fStep->GetPostStepPoint()->GetPolarization().x() <<
G4endl;
821 G4cout <<
" Polarization - y : " 822 << std::setw(20) <<
fStep->GetPreStepPoint()->GetPolarization().y()
823 << std::setw(20) <<
fStep->GetPostStepPoint()->GetPolarization().y() <<
G4endl;
824 G4cout <<
" Polarization - Z : " 825 << std::setw(20) <<
fStep->GetPreStepPoint()->GetPolarization().z()
826 << std::setw(20) <<
fStep->GetPostStepPoint()->GetPolarization().z() <<
G4endl;
828 << std::setw(20) <<
fStep->GetPreStepPoint()->GetWeight()
829 << std::setw(20) <<
fStep->GetPostStepPoint()->GetWeight() <<
G4endl;
830 G4cout <<
" Step Status : " ;
831 G4StepStatus tStepStatus =
fStep->GetPreStepPoint()->GetStepStatus();
832 if( tStepStatus == fGeomBoundary ){
833 G4cout << std::setw(20) <<
"Geom Limit";
834 }
else if ( tStepStatus == fAlongStepDoItProc ){
835 G4cout << std::setw(20) <<
"AlongStep Proc.";
836 }
else if ( tStepStatus == fPostStepDoItProc ){
837 G4cout << std::setw(20) <<
"PostStep Proc";
838 }
else if ( tStepStatus == fAtRestDoItProc ){
839 G4cout << std::setw(20) <<
"AtRest Proc";
840 }
else if ( tStepStatus == fUndefined ){
841 G4cout << std::setw(20) <<
"Undefined";
844 tStepStatus =
fStep->GetPostStepPoint()->GetStepStatus();
845 if( tStepStatus == fGeomBoundary ){
846 G4cout << std::setw(20) <<
"Geom Limit";
847 }
else if ( tStepStatus == fAlongStepDoItProc ){
848 G4cout << std::setw(20) <<
"AlongStep Proc.";
849 }
else if ( tStepStatus == fPostStepDoItProc ){
850 G4cout << std::setw(20) <<
"PostStep Proc";
851 }
else if ( tStepStatus == fAtRestDoItProc ){
852 G4cout << std::setw(20) <<
"AtRest Proc";
853 }
else if ( tStepStatus == fUndefined ){
854 G4cout << std::setw(20) <<
"Undefined";
858 G4cout <<
" Process defined Step: " ;
859 if(
fStep->GetPreStepPoint()->GetProcessDefinedStep() == 0 ){
860 G4cout << std::setw(20) <<
"Undefined";
862 G4cout << std::setw(20) <<
fStep->GetPreStepPoint()->GetProcessDefinedStep()->GetProcessName();
864 if(
fStep->GetPostStepPoint()->GetProcessDefinedStep() == 0){
865 G4cout << std::setw(20) <<
"Undefined";
867 G4cout << std::setw(20) <<
fStep->GetPostStepPoint()->GetProcessDefinedStep()->GetProcessName();
872 G4cout <<
" -------------------------------------------------------" 873 <<
"----------------" <<
G4endl;
void AlongStepDoItOneByOne()
G4SelectedPostStepDoItVector * fSelectedPostStepDoItVector
G4int fN2ndariesPostStepDoIt
G4VParticleChange * fParticleChange
G4VProcess * fCurrentProcess
#define G4BestUnit(a, b)
#define G4_USE_G4BESTUNIT_FOR_VERBOSE 1
G4int fN2ndariesAlongStepDoIt
void VerboseParticleChange()
void PostStepDoItOneByOne()
static G4ThreadLocal G4int Silent
size_t MAXofAlongStepLoops
static G4ThreadLocal G4int SilentStepInfo
const G4String & GetProcessName() const
G4GLOB_DLL std::ostream G4cout
G4int fN2ndariesAtRestDoIt
G4TrackVector * fSecondary
size_t MAXofPostStepLoops
G4SelectedAtRestDoItVector * fSelectedAtRestDoItVector
G4ForceCondition fCondition
G4GPILSelection fGPILSelection
void AlongStepDoItAllDone()
void PostStepDoItAllDone()