45#define G4_USE_G4BESTUNIT_FOR_VERBOSE 1
47#ifdef G4_USE_G4BESTUNIT_FOR_VERBOSE
50#define G4BestUnit(a,b) a
89 ptProcManager = (*fAtRestDoItVector)[(
G4int)np];
96 ptProcManager = (*fAtRestDoItVector)[(
G4int)np];
106 G4cout <<
" -- List of secondaries generated : "
107 <<
"(x,y,z,kE,t,PID) --" <<
G4endl;
109 lp1<(*fSecondary).size(); ++lp1)
123 << (*fSecondary)[lp1]->GetDefinition()->GetParticleName() <<
G4endl;
150 G4cout <<
" >>AlongStepDoIt (after all invocations):" <<
G4endl;
155 ptProcManager = (*fAlongStepDoItVector)((
G4int)ci);
156 G4cout <<
" " << ci+1 <<
") ";
157 if(ptProcManager !=
nullptr)
165 G4cout <<
" ++List of secondaries generated "
166 <<
"(x,y,z,kE,t,PID):"
167 <<
" No. of secodaries = "
168 << (*fSecondary).size() <<
G4endl;
170 if(!(*fSecondary).empty())
176 <<
G4BestUnit(lp1->GetPosition().x(),
"Length") <<
" "
178 <<
G4BestUnit(lp1->GetPosition().y(),
"Length") <<
" "
180 <<
G4BestUnit(lp1->GetPosition().z(),
"Length") <<
" "
182 <<
G4BestUnit(lp1->GetKineticEnergy(),
"Energy") <<
" "
184 <<
G4BestUnit(lp1->GetGlobalTime(),
"Time") <<
" "
186 << lp1->GetDefinition()->GetParticleName() <<
G4endl;
214 G4cout <<
" **PostStepDoIt (after all invocations):" <<
G4endl;
223 ptProcManager = (*fPostStepDoItVector)[(
G4int)np];
230 ptProcManager = (*fPostStepDoItVector)[(
G4int)np];
231 G4cout <<
" " << npt <<
") "
238 G4cout <<
" ++List of secondaries generated " <<
"(x,y,z,kE,t,PID):"
239 <<
" No. of secodaries = " << (*fSecondary).size() <<
G4endl;
240 G4cout <<
" [Note]Secondaries from AlongStepDoIt included." <<
G4endl;
242 if(!(*fSecondary).empty())
246 G4cout <<
" " << std::setw(9)
247 <<
G4BestUnit(lp1->GetPosition().x(),
"Length")
248 <<
" " << std::setw(9)
249 <<
G4BestUnit(lp1->GetPosition().y(),
"Length")
250 <<
" " << std::setw(9)
251 <<
G4BestUnit(lp1->GetPosition().z(),
"Length")
252 <<
" " << std::setw(9)
253 <<
G4BestUnit(lp1->GetKineticEnergy(),
"Energy")
254 <<
" " << std::setw(9)
256 <<
" " << std::setw(18)
257 << lp1->GetDefinition()->GetParticleName()
285#ifdef G4_USE_G4BESTUNIT_FOR_VERBOSE
286 G4cout << std::setw( 5) <<
"#TrackID" <<
" "
287 << std::setw( 5) <<
"#Step#" <<
" "
288 << std::setw( 8) <<
"X" <<
" " << std::setw( 8) <<
"Y" <<
" "
289 << std::setw( 8) <<
"Z" <<
" "
290 << std::setw( 9) <<
"KineE" <<
" " << std::setw( 8) <<
"dE" <<
" "
291 << std::setw(12) <<
"StepLeng" <<
" " << std::setw(12) <<
"TrackLeng" <<
" "
292 << std::setw(12) <<
"NextVolume" <<
" " << std::setw( 8) <<
"ProcName" <<
G4endl;
294 G4cout << std::setw( 5) <<
"#TrackID" <<
" "
295 << std::setw( 5) <<
"#Step#" <<
" "
296 << std::setw( 8) <<
"X(mm)" <<
" " << std::setw( 8) <<
"Y(mm)" <<
" "
297 << std::setw( 8) <<
"Z(mm)" <<
" "
298 << std::setw( 9) <<
"KinE(MeV)" <<
" " << std::setw( 8) <<
"dE(MeV)" <<
" "
299 << std::setw( 8) <<
"StepLeng" <<
" " << std::setw( 9) <<
"TrackLeng" <<
" "
300 << std::setw(11) <<
"NextVolume" <<
" " << std::setw( 8) <<
"ProcName" <<
G4endl;
307 <<
" " << std::setw(8)
310 <<
" " << std::setw(8)
313 <<
" " << std::setw(9)
323 G4cout << std::setw(11) <<
"OutOfWorld" <<
" ";
340 if(tN2ndariesTot > 0)
342 G4cout <<
" :----- List of 2ndaries - " <<
"#SpawnInStep="
343 << std::setw(3) << tN2ndariesTot <<
"(Rest=" << std::setw(2)
347 << std::setw(3) << (*fSecondary).size() <<
" ---------------"
350 for(std::size_t lp1=(*fSecondary).size()-tN2ndariesTot;
351 lp1<(*fSecondary).size(); ++lp1)
363 << (*fSecondary)[lp1]->GetDefinition()->GetParticleName() <<
G4endl;
365 G4cout <<
" :-----------------------------" <<
"----------------------------------"
366 <<
"-- EndOf2ndaries Info ---------------" <<
G4endl;
390#ifdef G4_USE_G4BESTUNIT_FOR_VERBOSE
391 G4cout << std::setw( 5) <<
"#TrackID" <<
" "
392 << std::setw( 5) <<
"#Step#" <<
" "
393 << std::setw( 8) <<
"X" <<
" " << std::setw( 8) <<
"Y" <<
" "
394 << std::setw( 8) <<
"Z" <<
" "
395 << std::setw( 9) <<
"KineE" <<
" " << std::setw( 8) <<
"dE" <<
" "
396 << std::setw(12) <<
"StepLeng" <<
" " << std::setw(12) <<
"TrackLeng" <<
" "
397 << std::setw(12) <<
"NextVolume" <<
" " << std::setw( 8) <<
"ProcName" <<
G4endl;
399 G4cout << std::setw( 5) <<
"#TrackID" <<
" "
400 << std::setw( 5) <<
"#Step#" <<
" "
401 << std::setw( 8) <<
"X(mm)" <<
" " << std::setw( 8) <<
"Y(mm)" <<
" "
402 << std::setw( 8) <<
"Z(mm)" <<
" "
403 << std::setw( 9) <<
"KinE(MeV)" <<
" " << std::setw( 8) <<
"dE(MeV)" <<
" "
404 << std::setw( 8) <<
"StepLeng" <<
" " << std::setw( 9) <<
"TrackLeng" <<
" "
405 << std::setw(11) <<
"NextVolume" <<
" " << std::setw( 8) <<
"ProcName" <<
G4endl;
412 <<
" " << std::setw(8)
415 <<
" " << std::setw(8)
428 G4cout << std::setw(11) <<
"OutOfWorld" <<
" ";
444 if(tN2ndariesTot > 0)
446 G4cout <<
" :----- List of 2ndaries - " <<
"#SpawnInStep="
447 << std::setw(3) << tN2ndariesTot <<
"(Rest=" << std::setw(2)
451 << std::setw(3) << (*fSecondary).size() <<
" ---------------"
454 for(std::size_t lp1=(*fSecondary).size()-tN2ndariesTot;
455 lp1<(*fSecondary).size(); ++lp1)
467 << (*fSecondary)[lp1]->GetDefinition()->GetParticleName() <<
G4endl;
469 G4cout <<
" :-----------------------------" <<
"----------------------------------"
470 <<
"-- EndOf2ndaries Info ---------------" <<
G4endl;
489 G4cout <<
G4endl<<
" >>DefinePhysicalStepLength (List of proposed StepLengths): " <<
G4endl;
505 G4cout <<
"=== Defined Physical Step Length (DPSL)" <<
G4endl;
507 <<
" : ProcName = User defined maximum allowed Step" <<
G4endl;
523 G4cout <<
" ++ProposedStep(PostStep ) = " << std::setw(9)
561 G4cout <<
" ++ProposedStep(AlongStep) = " << std::setw(9)
612 G4cout <<
"Start tracking : "
641 G4cout << std::setw(11) <<
"OutOfWorld" <<
" ";
654 G4cout <<
" * End tracking : " <<
" Particle : "
678 G4cout <<
" >>AlongStepDoIt (process by process): " <<
" Process Name = "
682 G4cout <<
" " <<
"!Note! Safety of PostStep is only valid "
683 <<
"after all DoIt invocations." <<
G4endl;
688 G4cout <<
" ++List of secondaries generated " <<
"(x,y,z,kE,t,PID):"
694 lp1 < (*fSecondary).size(); ++lp1)
696 G4cout <<
" " << std::setw(9)
698 <<
" " << std::setw(9)
700 <<
" " << std::setw(9)
702 <<
" " << std::setw(9)
704 <<
" " << std::setw(9)
707 << (*fSecondary)[lp1]->GetDefinition()->GetParticleName() <<
G4endl;
722 G4cout <<
" >>PostStepDoIt (process by process): " <<
" Process Name = "
730 G4cout <<
" ++List of secondaries generated " <<
"(x,y,z,kE,t,PID):"
736 lp1 < (*fSecondary).size(); ++lp1)
738 G4cout <<
" " << std::setw(9)
740 <<
" " << std::setw(9)
742 <<
" " << std::setw(9)
744 <<
" " << std::setw(9)
746 <<
" " << std::setw(9)
749 << (*fSecondary)[lp1]->GetDefinition()->GetParticleName() <<
G4endl;
769 G4cout <<
" -----------------------------------------------" <<
G4endl;
770 G4cout <<
" G4Track Information " << std::setw(20) <<
G4endl;
771 G4cout <<
" -----------------------------------------------" <<
G4endl;
773 G4cout <<
" Step number : " << std::setw(20)
775#ifdef G4_USE_G4BESTUNIT_FOR_VERBOSE
776 G4cout <<
" Position - x : " << std::setw(20)
778 G4cout <<
" Position - y : " << std::setw(20)
780 G4cout <<
" Position - z : " << std::setw(20)
782 G4cout <<
" Global Time : " << std::setw(20)
784 G4cout <<
" Local Time : " << std::setw(20)
787 G4cout <<
" Position - x (mm) : " << std::setw(20)
789 G4cout <<
" Position - y (mm) : " << std::setw(20)
791 G4cout <<
" Position - z (mm) : " << std::setw(20)
793 G4cout <<
" Global Time (ns) : " << std::setw(20)
795 G4cout <<
" Local Time (ns) : " << std::setw(20)
798 G4cout <<
" Momentum Direct - x : " << std::setw(20)
800 G4cout <<
" Momentum Direct - y : " << std::setw(20)
802 G4cout <<
" Momentum Direct - z : " << std::setw(20)
804#ifdef G4_USE_G4BESTUNIT_FOR_VERBOSE
805 G4cout <<
" Kinetic Energy : "
807 G4cout <<
" Kinetic Energy (MeV): "
811 G4cout <<
" Polarization - x : " << std::setw(20)
813 G4cout <<
" Polarization - y : " << std::setw(20)
815 G4cout <<
" Polarization - z : " << std::setw(20)
817 G4cout <<
" Track Length : " << std::setw(20)
819 G4cout <<
" Track ID # : " << std::setw(20)
821 G4cout <<
" Parent Track ID # : " << std::setw(20)
823 G4cout <<
" Next Volume : " << std::setw(20);
830 G4cout <<
"OutOfWorld" <<
" ";
833 G4cout <<
" Track Status : " << std::setw(20);
840 G4cout <<
" StopButAlive";
848 G4cout <<
" KillTrackAndSecondaries";
856 G4cout <<
" PostponeToNextEvent";
859#ifdef G4_USE_G4BESTUNIT_FOR_VERBOSE
860 G4cout <<
" Vertex - x : " << std::setw(20)
862 G4cout <<
" Vertex - y : " << std::setw(20)
864 G4cout <<
" Vertex - z : " << std::setw(20)
867 G4cout <<
" Vertex - x (mm) : " << std::setw(20)
869 G4cout <<
" Vertex - y (mm) : " << std::setw(20)
871 G4cout <<
" Vertex - z (mm) : " << std::setw(20)
874 G4cout <<
" Vertex - Px (MomDir): " << std::setw(20)
876 G4cout <<
" Vertex - Py (MomDir): " << std::setw(20)
878 G4cout <<
" Vertex - Pz (MomDir): " << std::setw(20)
880#ifdef G4_USE_G4BESTUNIT_FOR_VERBOSE
881 G4cout <<
" Vertex - KineE : "
883 G4cout <<
" Vertex - KineE (MeV): "
888 G4cout <<
" Creator Process : " << std::setw(20);
898 G4cout <<
" -----------------------------------------------" <<
G4endl;
931 oldprc =
G4cout.precision(16);
935 G4cout <<
" Step Length (mm) : "
941 G4cout <<
" -------------------------------------------------------"
942 <<
"----------------" <<
G4endl;
943 G4cout <<
" StepPoint Information " << std::setw(20) <<
"PreStep"
944 << std::setw(20) <<
"PostStep" <<
G4endl;
945 G4cout <<
" -------------------------------------------------------"
946 <<
"----------------" <<
G4endl;
947 G4cout <<
" Position - x (mm) : " << std::setw(20)
950 G4cout <<
" Position - y (mm) : " << std::setw(20)
953 G4cout <<
" Position - z (mm) : " << std::setw(20)
956 G4cout <<
" Global Time (ns) : " << std::setw(20)
959 G4cout <<
" Local Time (ns) : " << std::setw(20)
962 G4cout <<
" Proper Time (ns) : " << std::setw(20)
965 G4cout <<
" Momentum Direct - x : " << std::setw(20)
969 G4cout <<
" Momentum Direct - y : " << std::setw(20)
973 G4cout <<
" Momentum Direct - z : " << std::setw(20)
977 G4cout <<
" Momentum - x (MeV/c): " << std::setw(20)
980 G4cout <<
" Momentum - y (MeV/c): " << std::setw(20)
983 G4cout <<
" Momentum - z (MeV/c): " << std::setw(20)
986 G4cout <<
" Total Energy (MeV) : " << std::setw(20)
989 G4cout <<
" Kinetic Energy (MeV): " << std::setw(20)
992 G4cout <<
" Velocity (mm/ns) : " << std::setw(20)
995 G4cout <<
" Volume Name : " << std::setw(20)
1003 volName =
"OutOfWorld";
1006 G4cout <<
" Safety (mm) : " << std::setw(20)
1009 G4cout <<
" Polarization - x : " << std::setw(20)
1012 G4cout <<
" Polarization - y : " << std::setw(20)
1015 G4cout <<
" Polarization - Z : " << std::setw(20)
1018 G4cout <<
" Weight : " << std::setw(20)
1021 G4cout <<
" Step Status : ";
1025 G4cout << std::setw(20) <<
"Geom Limit";
1029 G4cout << std::setw(20) <<
"AlongStep Proc.";
1033 G4cout << std::setw(20) <<
"PostStep Proc";
1037 G4cout << std::setw(20) <<
"AtRest Proc";
1041 G4cout << std::setw(20) <<
"Undefined";
1047 G4cout << std::setw(20) <<
"Geom Limit";
1051 G4cout << std::setw(20) <<
"AlongStep Proc.";
1055 G4cout << std::setw(20) <<
"PostStep Proc";
1059 G4cout << std::setw(20) <<
"AtRest Proc";
1063 G4cout << std::setw(20) <<
"Undefined";
1067 G4cout <<
" Process defined Step: ";
1070 G4cout << std::setw(20) <<
"Undefined";
1080 G4cout << std::setw(20) <<
"Undefined";
1088 G4cout.precision(oldprc);
1091 G4cout <<
" -------------------------------------------------------"
1092 <<
"----------------" <<
G4endl;
1104 G4cout << std::setw(18) << left <<
"#Name" << std::setw(15) <<
"trackID"
1105 << std::setw(35) <<
"Position" << std::setw(25) <<
"Pre step volume"
1106 << std::setw(25) <<
"Post step volume" << std::setw(22) <<
"Process"
1140 if(nextTouchable && ((volume = nextTouchable->
GetVolume()) !=
nullptr))
1142 volumeName = volume->
GetName();
1152 volumeName =
"OutOfWorld";
1156 << track->
GetTrackID() << std::setprecision(3) << setw(35)
1158 << volumeName << setw(25) <<
"---" <<
G4endl;
1172 << track->
GetTrackID() << std::setprecision(3) << setw(35)
1179 if(nextTouchable && ((volume = nextTouchable->
GetVolume()) !=
nullptr))
1189 G4cout << setw(25) << volumeName;
1193 G4cout << setw(25) <<
"OutOfWorld";
1213 if(!secondaries->empty())
1216 for(
const auto secondarie : *secondaries)
1219 << secondarie->GetTrackID() <<
")" <<
" ";
1233 G4cout <<
" Invoke at rest process : "
@ NotCandidateForSelection
G4IT * GetIT(const G4Track *track)
@ fKillTrackAndSecondaries
std::vector< G4Track * > G4TrackVector
G4GLOB_DLL std::ostream G4cout
void TrackingStarted(G4Track *) override
void PostStepVerbose(G4Track *track) override
void VerboseParticleChange() override
void PreStepVerbose(G4Track *track) override
void DPSLAlongStep() override
void AtRestDoItOneByOne() override
~G4ITSteppingVerbose() override
void TrackingEnded(G4Track *) override
void AlongStepDoItOneByOne() override
void StepInfoForLeadingTrack() override
void PostStepDoItAllDone() override
void AlongStepDoItAllDone() override
void VerboseTrack() override
void AtRestDoItInvoked() override
void DPSLUserLimit() override
void DPSLPostStep() override
void DoItStarted() override
void DPSLStarted() override
void PostStepDoItOneByOne() override
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
virtual G4VPhysicalVolume * GetVolume(G4int depth=0) const
virtual G4int GetReplicaNumber(G4int depth=0) const
G4TrackStatus GetTrackStatus() const
G4double GetVertexKineticEnergy() 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
size_t MAXofPostStepLoops
G4int fN2ndariesAtRestDoIt
G4SelectedPostStepDoItVector * fSelectedPostStepDoItVector
const G4VITProcess * fCurrentProcess
G4SelectedAtRestDoItVector * fSelectedAtRestDoItVector
const G4VParticleChange * fParticleChange
const G4TrackVector * fSecondary
G4ForceCondition fCondition
G4GPILSelection fGPILSelection
G4int fN2ndariesPostStepDoIt
G4int fN2ndariesAlongStepDoIt
size_t MAXofAlongStepLoops
virtual void DumpInfo() const
virtual G4bool IsReplicated() const =0
const G4String & GetName() const
virtual G4bool IsParameterised() const =0
const G4String & GetProcessName() const