File indexing completed on 2025-02-23 09:22:13
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
0035
0036
0037
0038
0039 #include "SteppingVerbose.hh"
0040
0041 #include "G4UnitsTable.hh"
0042
0043
0044
0045 SteppingVerbose::SteppingVerbose() : G4SteppingVerbose() {}
0046
0047
0048
0049 SteppingVerbose::~SteppingVerbose() {}
0050
0051
0052
0053 void SteppingVerbose::TrackingStarted()
0054 {
0055 CopyState();
0056
0057 G4int prec = G4cout.precision(3);
0058
0059
0060
0061 if (verboseLevel > 0) {
0062 G4cout << std::setw(5) << "Step#"
0063 << " " << std::setw(6) << "X"
0064 << " " << std::setw(6) << "Y"
0065 << " " << std::setw(6) << "Z"
0066 << " " << std::setw(9) << "KineE"
0067 << " " << std::setw(9) << "dEStep"
0068 << " " << std::setw(10) << "StepLeng" << std::setw(10) << "TrakLeng" << std::setw(10)
0069 << "Volume"
0070 << " " << std::setw(10) << "Process" << G4endl;
0071
0072 G4cout << std::setw(5) << fTrack->GetCurrentStepNumber() << " " << std::setw(6)
0073 << G4BestUnit(fTrack->GetPosition().x(), "Length") << std::setw(6)
0074 << G4BestUnit(fTrack->GetPosition().y(), "Length") << std::setw(6)
0075 << G4BestUnit(fTrack->GetPosition().z(), "Length") << std::setw(6)
0076 << G4BestUnit(fTrack->GetKineticEnergy(), "Energy") << std::setw(6)
0077 << G4BestUnit(fStep->GetTotalEnergyDeposit(), "Energy") << std::setw(6)
0078 << G4BestUnit(fStep->GetStepLength(), "Length") << std::setw(6)
0079 << G4BestUnit(fTrack->GetTrackLength(), "Length") << std::setw(10)
0080 << fTrack->GetVolume()->GetName() << " initStep" << G4endl;
0081 }
0082 G4cout.precision(prec);
0083 }
0084
0085
0086
0087 void SteppingVerbose::StepInfo()
0088 {
0089 CopyState();
0090
0091 G4int prec = G4cout.precision(3);
0092
0093 if (verboseLevel >= 1) {
0094 if (verboseLevel >= 4) VerboseTrack();
0095 if (verboseLevel >= 3) {
0096 G4cout << G4endl;
0097 G4cout << std::setw(5) << "#Step#"
0098 << " " << std::setw(6) << "X"
0099 << " " << std::setw(6) << "Y"
0100 << " " << std::setw(6) << "Z"
0101 << " " << std::setw(9) << "KineE"
0102 << " " << std::setw(9) << "dEStep"
0103 << " " << std::setw(10) << "StepLeng" << std::setw(10) << "TrakLeng" << std::setw(10)
0104 << "Volume"
0105 << " " << std::setw(10) << "Process" << G4endl;
0106 }
0107
0108 G4cout << std::setw(5) << fTrack->GetCurrentStepNumber() << " " << std::setw(6)
0109 << G4BestUnit(fTrack->GetPosition().x(), "Length") << std::setw(6)
0110 << G4BestUnit(fTrack->GetPosition().y(), "Length") << std::setw(6)
0111 << G4BestUnit(fTrack->GetPosition().z(), "Length") << std::setw(6)
0112 << G4BestUnit(fTrack->GetKineticEnergy(), "Energy") << std::setw(6)
0113 << G4BestUnit(fStep->GetTotalEnergyDeposit(), "Energy") << std::setw(6)
0114 << G4BestUnit(fStep->GetStepLength(), "Length") << std::setw(6)
0115 << G4BestUnit(fTrack->GetTrackLength(), "Length") << std::setw(10)
0116 << fTrack->GetVolume()->GetName();
0117
0118 const G4VProcess* process = fStep->GetPostStepPoint()->GetProcessDefinedStep();
0119 G4String procName = " UserLimit";
0120 if (process) procName = process->GetProcessName();
0121 if (fStepStatus == fWorldBoundary) procName = "OutOfWorld";
0122 G4cout << " " << std::setw(10) << procName;
0123 G4cout << G4endl;
0124
0125 if (verboseLevel == 2) {
0126 const std::vector<const G4Track*>* secondary = fStep->GetSecondaryInCurrentStep();
0127 size_t nbtrk = (*secondary).size();
0128 if (nbtrk) {
0129 G4cout << "\n :----- List of secondaries ----------------" << G4endl;
0130 G4cout.precision(4);
0131 for (size_t lp = 0; lp < (*secondary).size(); lp++) {
0132 G4cout << " " << std::setw(13) << (*secondary)[lp]->GetDefinition()->GetParticleName()
0133 << ": energy =" << std::setw(6)
0134 << G4BestUnit((*secondary)[lp]->GetKineticEnergy(), "Energy")
0135 << " time =" << std::setw(6)
0136 << G4BestUnit((*secondary)[lp]->GetGlobalTime(), "Time");
0137 G4cout << G4endl;
0138 }
0139
0140 G4cout << " :------------------------------------------\n" << G4endl;
0141 }
0142 }
0143 }
0144 G4cout.precision(prec);
0145 }