00001
00002
00003
00004
00005
00006
00007
00008 #include "SteppingVerbose.hh"
00009
00010 #include "G4SteppingManager.hh"
00011 #include "G4UnitsTable.hh"
00012
00013
00014
00015 SteppingVerbose::SteppingVerbose()
00016 {}
00017
00018
00019
00020 SteppingVerbose::~SteppingVerbose()
00021 {}
00022
00023
00024
00025 void SteppingVerbose::StepInfo()
00026 {
00027 CopyState();
00028
00029 G4int prec = G4cout.precision(3);
00030
00031 if( verboseLevel >= 1 ){
00032 if( verboseLevel >= 4 ) VerboseTrack();
00033 if( verboseLevel >= 3 ){
00034 G4cout << G4endl;
00035 G4cout << std::setw( 5) << "#Step#" << " "
00036 << std::setw( 6) << "X" << " "
00037 << std::setw( 6) << "Y" << " "
00038 << std::setw( 6) << "Z" << " "
00039 << std::setw( 9) << "KineE" << " "
00040 << std::setw( 9) << "dEStep" << " "
00041 << std::setw(10) << "StepLeng"
00042 << std::setw(10) << "TrakLeng"
00043 << std::setw(10) << "Volume" << " "
00044 << std::setw(10) << "Process" << G4endl;
00045 }
00046
00047 G4cout << std::setw(5) << fTrack->GetCurrentStepNumber() << " "
00048 << std::setw(6) << G4BestUnit(fTrack->GetPosition().x(),"Length")
00049 << std::setw(6) << G4BestUnit(fTrack->GetPosition().y(),"Length")
00050 << std::setw(6) << G4BestUnit(fTrack->GetPosition().z(),"Length")
00051 << std::setw(6) << G4BestUnit(fTrack->GetKineticEnergy(),"Energy")
00052 << std::setw(6) << G4BestUnit(fStep->GetTotalEnergyDeposit(),"Energy")
00053 << std::setw(6) << G4BestUnit(fStep->GetStepLength(),"Length")
00054 << std::setw(6) << G4BestUnit(fTrack->GetTrackLength(),"Length")
00055 << " ";
00056
00057
00058 if( fTrack->GetNextVolume() != 0 ) {
00059 G4cout << std::setw(10) << fTrack->GetVolume()->GetName();
00060 } else {
00061 G4cout << std::setw(10) << "OutOfWorld";
00062 }
00063
00064 if(fStep->GetPostStepPoint()->GetProcessDefinedStep() != NULL){
00065 G4cout << " "
00066 << std::setw(10) << fStep->GetPostStepPoint()
00067 ->GetProcessDefinedStep()->GetProcessName();
00068 } else {
00069 G4cout << " UserLimit";
00070 }
00071
00072 G4cout << G4endl;
00073
00074 if( verboseLevel == 2 ){
00075 G4int tN2ndariesTot = fN2ndariesAtRestDoIt +
00076 fN2ndariesAlongStepDoIt +
00077 fN2ndariesPostStepDoIt;
00078 if(tN2ndariesTot>0){
00079 G4cout << " :----- List of 2ndaries - "
00080 << "#SpawnInStep=" << std::setw(3) << tN2ndariesTot
00081 << "(Rest=" << std::setw(2) << fN2ndariesAtRestDoIt
00082 << ",Along=" << std::setw(2) << fN2ndariesAlongStepDoIt
00083 << ",Post=" << std::setw(2) << fN2ndariesPostStepDoIt
00084 << "), "
00085 << "#SpawnTotal=" << std::setw(3) << (*fSecondary).size()
00086 << " ---------------"
00087 << G4endl;
00088
00089 for(size_t lp1=(*fSecondary).size()-tN2ndariesTot;
00090 lp1<(*fSecondary).size(); lp1++){
00091 G4cout << " : "
00092 << std::setw(6)
00093 << G4BestUnit((*fSecondary)[lp1]->GetPosition().x(),"Length")
00094 << std::setw(6)
00095 << G4BestUnit((*fSecondary)[lp1]->GetPosition().y(),"Length")
00096 << std::setw(6)
00097 << G4BestUnit((*fSecondary)[lp1]->GetPosition().z(),"Length")
00098 << std::setw(6)
00099 << G4BestUnit((*fSecondary)[lp1]->GetKineticEnergy(),"Energy")
00100 << std::setw(10)
00101 << (*fSecondary)[lp1]->GetDefinition()->GetParticleName();
00102 G4cout << G4endl;
00103 }
00104
00105 G4cout << " :-----------------------------"
00106 << "----------------------------------"
00107 << "-- EndOf2ndaries Info ---------------"
00108 << G4endl;
00109 }
00110 }
00111
00112 }
00113 G4cout.precision(prec);
00114 }
00115
00116
00117
00118 void SteppingVerbose::TrackingStarted()
00119 {
00120
00121 CopyState();
00122 G4int prec = G4cout.precision(3);
00123 if( verboseLevel > 0 ){
00124
00125 G4cout << std::setw( 5) << "Step#" << " "
00126 << std::setw( 6) << "X" << " "
00127 << std::setw( 6) << "Y" << " "
00128 << std::setw( 6) << "Z" << " "
00129 << std::setw( 9) << "KineE" << " "
00130 << std::setw( 9) << "dEStep" << " "
00131 << std::setw(10) << "StepLeng"
00132 << std::setw(10) << "TrakLeng"
00133 << std::setw(10) << "Volume" << " "
00134 << std::setw(10) << "Process" << G4endl;
00135
00136 G4cout << std::setw(5) << fTrack->GetCurrentStepNumber() << " "
00137 << std::setw(6) << G4BestUnit(fTrack->GetPosition().x(),"Length")
00138 << std::setw(6) << G4BestUnit(fTrack->GetPosition().y(),"Length")
00139 << std::setw(6) << G4BestUnit(fTrack->GetPosition().z(),"Length")
00140 << std::setw(6) << G4BestUnit(fTrack->GetKineticEnergy(),"Energy")
00141 << std::setw(6) << G4BestUnit(fStep->GetTotalEnergyDeposit(),"Energy")
00142 << std::setw(6) << G4BestUnit(fStep->GetStepLength(),"Length")
00143 << std::setw(6) << G4BestUnit(fTrack->GetTrackLength(),"Length")
00144 << " ";
00145
00146 if(fTrack->GetNextVolume()){
00147 G4cout << std::setw(10) << fTrack->GetVolume()->GetName();
00148 } else {
00149 G4cout << std::setw(10) << "OutOfWorld";
00150 }
00151 G4cout << " initStep" << G4endl;
00152 }
00153 G4cout.precision(prec);
00154 }
00155
00156