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