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