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