File indexing completed on 2026-04-02 07:36:45
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 "F01SteppingVerbose.hh"
0030
0031 #include "G4SteppingManager.hh"
0032 #include "G4UnitsTable.hh"
0033
0034
0035
0036 void F01SteppingVerbose::StepInfo()
0037 {
0038 CopyState();
0039
0040 G4int prec = G4cout.precision(6);
0041
0042 if (verboseLevel >= 1) {
0043 if (verboseLevel >= 4) VerboseTrack();
0044 if (verboseLevel >= 3) {
0045 G4cout << G4endl;
0046 G4cout << std::setw(5) << "#Step#"
0047 << " " << std::setw(10) << "X"
0048 << " " << std::setw(10) << "Y"
0049 << " " << std::setw(10) << "Z"
0050 << " " << std::setw(10) << "Direction x"
0051 << " " << std::setw(10) << "dir y"
0052 << " " << std::setw(10) << "dir z"
0053 << " " << std::setw(8) << "KineE"
0054 << " " << std::setw(10) << "dEStep"
0055 << " " << std::setw(10) << "StepLeng"
0056 << " " << std::setw(10) << "TrakLeng"
0057 << " " << std::setw(10) << "NextVolu"
0058 << " " << std::setw(10) << "Process"
0059 << " " << G4endl;
0060 }
0061
0062 G4cout << std::setw(5) << fTrack->GetCurrentStepNumber() << " " << std::setw(10)
0063 << G4BestUnit(fTrack->GetPosition().x(), "Length") << std::setw(10)
0064 << G4BestUnit(fTrack->GetPosition().y(), "Length") << std::setw(10)
0065 << G4BestUnit(fTrack->GetPosition().z(), "Length");
0066 G4cout << std::setw(10) << fTrack->GetMomentumDirection().x() << " " << std::setw(10)
0067 << fTrack->GetMomentumDirection().y() << " " << std::setw(10)
0068 << fTrack->GetMomentumDirection().z() << " ";
0069 G4cout << std::setw(8) << G4BestUnit(fTrack->GetKineticEnergy(), "Energy") << " "
0070 << std::setw(10) << G4BestUnit(fStep->GetTotalEnergyDeposit(), "Energy") << " "
0071 << std::setw(10) << G4BestUnit(fStep->GetStepLength(), "Length") << " " << std::setw(10)
0072 << G4BestUnit(fTrack->GetTrackLength(), "Length") << " ";
0073
0074 if (fTrack->GetNextVolume() != nullptr) {
0075 G4cout << std::setw(10) << fTrack->GetVolume()->GetName();
0076 }
0077 else {
0078 G4cout << std::setw(10) << "OutOfWorld";
0079 }
0080
0081 if (fStep->GetPostStepPoint()->GetProcessDefinedStep() != nullptr) {
0082 G4cout << " " << std::setw(10)
0083 << fStep->GetPostStepPoint()->GetProcessDefinedStep()->GetProcessName();
0084 }
0085 else {
0086 G4cout << " UserLimit";
0087 }
0088 G4cout << G4endl;
0089
0090 if (verboseLevel == 2) {
0091 G4int tN2ndariesTot = fN2ndariesAtRestDoIt + fN2ndariesAlongStepDoIt + fN2ndariesPostStepDoIt;
0092 if (tN2ndariesTot > 0) {
0093 G4cout << " :----- List of 2ndaries - "
0094 << "#SpawnInStep=" << std::setw(3) << tN2ndariesTot << "(Rest=" << std::setw(2)
0095 << fN2ndariesAtRestDoIt << ",Along=" << std::setw(2) << fN2ndariesAlongStepDoIt
0096 << ",Post=" << std::setw(2) << fN2ndariesPostStepDoIt << "), "
0097 << "#SpawnTotal=" << std::setw(3) << (*fSecondary).size() << " ---------------"
0098 << G4endl;
0099
0100 for (size_t lp1 = (*fSecondary).size() - tN2ndariesTot; lp1 < (*fSecondary).size(); lp1++) {
0101 G4cout << " : " << std::setw(6)
0102 << G4BestUnit((*fSecondary)[lp1]->GetPosition().x(), "Length") << std::setw(6)
0103 << G4BestUnit((*fSecondary)[lp1]->GetPosition().y(), "Length") << std::setw(6)
0104 << G4BestUnit((*fSecondary)[lp1]->GetPosition().z(), "Length") << std::setw(6)
0105 << G4BestUnit((*fSecondary)[lp1]->GetKineticEnergy(), "Energy") << std::setw(10)
0106 << (*fSecondary)[lp1]->GetDefinition()->GetParticleName();
0107 G4cout << G4endl;
0108 }
0109
0110 G4cout << " :-----------------------------"
0111 << "----------------------------------"
0112 << "-- EndOf2ndaries Info ---------------" << G4endl;
0113 }
0114 }
0115 }
0116 G4cout.precision(prec);
0117 }
0118
0119
0120
0121 void F01SteppingVerbose::TrackingStarted()
0122 {
0123 CopyState();
0124 G4int prec = G4cout.precision(6);
0125 if (verboseLevel > 0) {
0126 G4cout << std::setw(5) << "Step#"
0127 << " " << std::setw(10) << "X"
0128 << " " << std::setw(10) << "Y"
0129 << " " << std::setw(10) << "Z"
0130 << " " << std::setw(10) << "Direction x"
0131 << " " << std::setw(10) << "dir y"
0132 << " " << std::setw(10) << "dir z"
0133 << " " << std::setw(10) << "KineE"
0134 << " " << std::setw(10) << "dEStep"
0135 << " " << std::setw(10) << "StepLeng" << std::setw(10) << "TrakLeng" << std::setw(10)
0136 << "Volume"
0137 << " " << std::setw(10) << "Process" << G4endl;
0138
0139 G4cout << std::setw(5) << fTrack->GetCurrentStepNumber() << " " << std::setw(10)
0140 << G4BestUnit(fTrack->GetPosition().x(), "Length") << std::setw(10)
0141 << G4BestUnit(fTrack->GetPosition().y(), "Length") << std::setw(10)
0142 << G4BestUnit(fTrack->GetPosition().z(), "Length");
0143 G4cout << std::setw(10) << fTrack->GetMomentumDirection().x() << " " << std::setw(10)
0144 << fTrack->GetMomentumDirection().y() << " " << std::setw(10)
0145 << fTrack->GetMomentumDirection().z() << " ";
0146 G4cout << std::setw(8) << G4BestUnit(fTrack->GetKineticEnergy(), "Energy") << std::setw(6)
0147 << G4BestUnit(fStep->GetTotalEnergyDeposit(), "Energy") << std::setw(10)
0148 << G4BestUnit(fStep->GetStepLength(), "Length") << std::setw(10)
0149 << G4BestUnit(fTrack->GetTrackLength(), "Length");
0150
0151 if (fTrack->GetNextVolume()) {
0152 G4cout << std::setw(10) << fTrack->GetVolume()->GetName();
0153 }
0154 else {
0155 G4cout << std::setw(10) << "OutOfWorld";
0156 }
0157 G4cout << " initStep" << G4endl;
0158 }
0159 G4cout.precision(prec);
0160 }
0161
0162