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