File indexing completed on 2026-03-28 07:50:09
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022
0023
0024
0025
0026
0027
0028
0029 #include "ExN04SteppingVerbose.hh"
0030
0031 #include "G4SteppingManager.hh"
0032 #include "G4UnitsTable.hh"
0033
0034
0035 ExN04SteppingVerbose::ExN04SteppingVerbose() : G4SteppingVerbose() {}
0036
0037
0038 ExN04SteppingVerbose::~ExN04SteppingVerbose() {}
0039
0040
0041 void ExN04SteppingVerbose::StepInfo()
0042 {
0043 CopyState();
0044
0045 G4int prec = G4cout.precision(3);
0046
0047 if (verboseLevel >= 1) {
0048 if (verboseLevel >= 4) VerboseTrack();
0049 if (verboseLevel >= 3) {
0050 G4cout << G4endl;
0051 G4cout << std::setw(5) << "#Step#"
0052 << " " << std::setw(6) << "X"
0053 << " " << std::setw(6) << "Y"
0054 << " " << std::setw(6) << "Z"
0055 << " " << std::setw(9) << "KineE"
0056 << " " << std::setw(9) << "dEStep"
0057 << " " << std::setw(10) << "StepLeng" << std::setw(10) << "TrakLeng" << std::setw(10)
0058 << "Volume"
0059 << " " << std::setw(10) << "Process" << G4endl;
0060 }
0061
0062 G4cout << std::setw(5) << fTrack->GetCurrentStepNumber() << " " << std::setw(6)
0063 << G4BestUnit(fTrack->GetPosition().x(), "Length") << std::setw(6)
0064 << G4BestUnit(fTrack->GetPosition().y(), "Length") << std::setw(6)
0065 << G4BestUnit(fTrack->GetPosition().z(), "Length") << std::setw(6)
0066 << G4BestUnit(fTrack->GetKineticEnergy(), "Energy") << std::setw(6)
0067 << G4BestUnit(fStep->GetTotalEnergyDeposit(), "Energy") << std::setw(6)
0068 << G4BestUnit(fStep->GetStepLength(), "Length") << std::setw(6)
0069 << G4BestUnit(fTrack->GetTrackLength(), "Length") << " ";
0070
0071
0072 if (fTrack->GetNextVolume() != 0) {
0073 G4cout << std::setw(10) << fTrack->GetVolume()->GetName();
0074 }
0075 else {
0076 G4cout << std::setw(10) << "OutOfWorld";
0077 }
0078
0079 if (fStep->GetPostStepPoint()->GetProcessDefinedStep() != NULL) {
0080 G4cout << " " << std::setw(10)
0081 << fStep->GetPostStepPoint()->GetProcessDefinedStep()->GetProcessName();
0082 }
0083 else {
0084 G4cout << " UserLimit";
0085 }
0086
0087 G4cout << G4endl;
0088
0089 if (verboseLevel == 2) {
0090 G4int tN2ndariesTot = fN2ndariesAtRestDoIt + fN2ndariesAlongStepDoIt + fN2ndariesPostStepDoIt;
0091 if (tN2ndariesTot > 0) {
0092 G4cout << " :----- List of 2ndaries - "
0093 << "#SpawnInStep=" << std::setw(3) << tN2ndariesTot << "(Rest=" << std::setw(2)
0094 << fN2ndariesAtRestDoIt << ",Along=" << std::setw(2) << fN2ndariesAlongStepDoIt
0095 << ",Post=" << std::setw(2) << fN2ndariesPostStepDoIt << "), "
0096 << "#SpawnTotal=" << std::setw(3) << (*fSecondary).size() << " ---------------"
0097 << G4endl;
0098
0099 for (size_t lp1 = (*fSecondary).size() - tN2ndariesTot; lp1 < (*fSecondary).size(); lp1++) {
0100 G4cout << " : " << std::setw(6)
0101 << G4BestUnit((*fSecondary)[lp1]->GetPosition().x(), "Length") << std::setw(6)
0102 << G4BestUnit((*fSecondary)[lp1]->GetPosition().y(), "Length") << std::setw(6)
0103 << G4BestUnit((*fSecondary)[lp1]->GetPosition().z(), "Length") << std::setw(6)
0104 << G4BestUnit((*fSecondary)[lp1]->GetKineticEnergy(), "Energy") << std::setw(10)
0105 << (*fSecondary)[lp1]->GetDefinition()->GetParticleName();
0106 G4cout << G4endl;
0107 }
0108
0109 G4cout << " :-----------------------------"
0110 << "----------------------------------"
0111 << "-- EndOf2ndaries Info ---------------" << G4endl;
0112 }
0113 }
0114 }
0115 G4cout.precision(prec);
0116 }
0117
0118
0119 void ExN04SteppingVerbose::TrackingStarted()
0120 {
0121 CopyState();
0122 G4int prec = G4cout.precision(3);
0123 if (verboseLevel > 0) {
0124 G4cout << std::setw(5) << "Step#"
0125 << " " << std::setw(6) << "X"
0126 << " " << std::setw(6) << "Y"
0127 << " " << std::setw(6) << "Z"
0128 << " " << std::setw(9) << "KineE"
0129 << " " << std::setw(9) << "dEStep"
0130 << " " << std::setw(10) << "StepLeng" << std::setw(10) << "TrakLeng" << std::setw(10)
0131 << "Volume"
0132 << " " << std::setw(10) << "Process" << G4endl;
0133
0134 G4cout << std::setw(5) << fTrack->GetCurrentStepNumber() << " " << std::setw(6)
0135 << G4BestUnit(fTrack->GetPosition().x(), "Length") << std::setw(6)
0136 << G4BestUnit(fTrack->GetPosition().y(), "Length") << std::setw(6)
0137 << G4BestUnit(fTrack->GetPosition().z(), "Length") << std::setw(6)
0138 << G4BestUnit(fTrack->GetKineticEnergy(), "Energy") << std::setw(6)
0139 << G4BestUnit(fStep->GetTotalEnergyDeposit(), "Energy") << std::setw(6)
0140 << G4BestUnit(fStep->GetStepLength(), "Length") << std::setw(6)
0141 << G4BestUnit(fTrack->GetTrackLength(), "Length") << " ";
0142
0143 if (fTrack->GetNextVolume()) {
0144 G4cout << std::setw(10) << fTrack->GetVolume()->GetName();
0145 }
0146 else {
0147 G4cout << std::setw(10) << "OutOfWorld";
0148 }
0149 G4cout << " initStep" << G4endl;
0150 }
0151 G4cout.precision(prec);
0152 }