| 1 |
cafagna |
1.1 |
|
| 2 |
|
|
#include "SteppingVerbose.hh"
|
| 3 |
|
|
#include "G4SteppingManager.hh"
|
| 4 |
|
|
|
| 5 |
|
|
#include "G4UnitsTable.hh"
|
| 6 |
|
|
|
| 7 |
|
|
|
| 8 |
|
|
SteppingVerbose::SteppingVerbose()
|
| 9 |
|
|
|
| 10 |
|
|
{
|
| 11 |
|
|
}
|
| 12 |
|
|
|
| 13 |
|
|
|
| 14 |
|
|
SteppingVerbose::~SteppingVerbose()
|
| 15 |
|
|
|
| 16 |
|
|
{
|
| 17 |
|
|
}
|
| 18 |
|
|
|
| 19 |
|
|
|
| 20 |
|
|
void SteppingVerbose::StepInfo()
|
| 21 |
|
|
|
| 22 |
|
|
{
|
| 23 |
|
|
CopyState();
|
| 24 |
|
|
|
| 25 |
|
|
G4int prec = G4cout.precision(3);
|
| 26 |
|
|
|
| 27 |
|
|
if( verboseLevel >= 1 ){
|
| 28 |
|
|
if( verboseLevel >= 4 ) VerboseTrack();
|
| 29 |
|
|
if( verboseLevel >= 3 ){
|
| 30 |
|
|
G4cout << G4endl;
|
| 31 |
|
|
G4cout << std::setw( 5) << "#Step#" << " "
|
| 32 |
|
|
<< std::setw( 6) << "X" << " "
|
| 33 |
|
|
<< std::setw( 6) << "Y" << " "
|
| 34 |
|
|
<< std::setw( 6) << "Z" << " "
|
| 35 |
|
|
<< std::setw( 9) << "KineE" << " "
|
| 36 |
|
|
<< std::setw( 9) << "dEStep" << " "
|
| 37 |
|
|
<< std::setw(10) << "StepLeng"
|
| 38 |
|
|
<< std::setw(10) << "TrakLeng"
|
| 39 |
|
|
<< std::setw(10) << "NextVolu"
|
| 40 |
|
|
<< std::setw(10) << "Process" << G4endl;
|
| 41 |
|
|
}
|
| 42 |
|
|
|
| 43 |
|
|
G4cout << std::setw( 5) << fTrack->GetCurrentStepNumber() << " "
|
| 44 |
|
|
<< std::setw( 6) << G4BestUnit(fTrack->GetPosition().x(),"Length")
|
| 45 |
|
|
<< std::setw( 6) << G4BestUnit(fTrack->GetPosition().y(),"Length")
|
| 46 |
|
|
<< std::setw( 6) << G4BestUnit(fTrack->GetPosition().z(),"Length")
|
| 47 |
|
|
<< std::setw( 6) << G4BestUnit(fTrack->GetKineticEnergy(),"Energy")
|
| 48 |
|
|
<< std::setw( 6) << G4BestUnit(fStep->GetTotalEnergyDeposit(),"Energy")
|
| 49 |
|
|
<< std::setw( 6) << G4BestUnit(fStep->GetStepLength(),"Length")
|
| 50 |
|
|
<< std::setw( 6) << G4BestUnit(fTrack->GetTrackLength(),"Length");
|
| 51 |
|
|
|
| 52 |
|
|
// if( fStepStatus != fWorldBoundary){
|
| 53 |
|
|
if( fTrack->GetNextVolume() != 0 ) {
|
| 54 |
|
|
G4cout << std::setw(10) << fTrack->GetNextVolume()->GetName();
|
| 55 |
|
|
} else {
|
| 56 |
|
|
G4cout << std::setw(10) << "OutOfWorld";
|
| 57 |
|
|
}
|
| 58 |
|
|
|
| 59 |
|
|
if(fStep->GetPostStepPoint()->GetProcessDefinedStep() != NULL){
|
| 60 |
|
|
G4cout << std::setw(10) << fStep->GetPostStepPoint()->GetProcessDefinedStep()
|
| 61 |
|
|
->GetProcessName();
|
| 62 |
|
|
} else {
|
| 63 |
|
|
G4cout << "User Limit";
|
| 64 |
|
|
}
|
| 65 |
|
|
|
| 66 |
|
|
G4cout << G4endl;
|
| 67 |
|
|
|
| 68 |
|
|
if( verboseLevel == 2 ){
|
| 69 |
|
|
G4int tN2ndariesTot = fN2ndariesAtRestDoIt +
|
| 70 |
|
|
fN2ndariesAlongStepDoIt +
|
| 71 |
|
|
fN2ndariesPostStepDoIt;
|
| 72 |
|
|
if(tN2ndariesTot>0){
|
| 73 |
|
|
G4cout << " :----- List of 2ndaries - "
|
| 74 |
|
|
<< "#SpawnInStep=" << std::setw(3) << tN2ndariesTot
|
| 75 |
|
|
<< "(Rest=" << std::setw(2) << fN2ndariesAtRestDoIt
|
| 76 |
|
|
<< ",Along=" << std::setw(2) << fN2ndariesAlongStepDoIt
|
| 77 |
|
|
<< ",Post=" << std::setw(2) << fN2ndariesPostStepDoIt
|
| 78 |
|
|
<< "), "
|
| 79 |
|
|
<< "#SpawnTotal=" << std::setw(3) << (*fSecondary).size()
|
| 80 |
|
|
<< " ---------------"
|
| 81 |
|
|
<< G4endl;
|
| 82 |
|
|
for(G4int lp1=(*fSecondary).size()-tN2ndariesTot;
|
| 83 |
|
|
lp1<(*fSecondary).size(); lp1++){
|
| 84 |
|
|
G4cout << " : "
|
| 85 |
|
|
<< std::setw(6)
|
| 86 |
|
|
<< G4BestUnit((*fSecondary)[lp1]->GetPosition().x(),"Length")
|
| 87 |
|
|
<< std::setw(6)
|
| 88 |
|
|
<< G4BestUnit((*fSecondary)[lp1]->GetPosition().y(),"Length")
|
| 89 |
|
|
<< std::setw(6)
|
| 90 |
|
|
<< G4BestUnit((*fSecondary)[lp1]->GetPosition().z(),"Length")
|
| 91 |
|
|
<< std::setw(6)
|
| 92 |
|
|
<< G4BestUnit((*fSecondary)[lp1]->GetKineticEnergy(),"Energy")
|
| 93 |
|
|
<< std::setw(10)
|
| 94 |
|
|
<< (*fSecondary)[lp1]->GetDefinition()->GetParticleName();
|
| 95 |
|
|
G4cout << G4endl;
|
| 96 |
|
|
}
|
| 97 |
|
|
|
| 98 |
|
|
G4cout << " :-----------------------------"
|
| 99 |
|
|
<< "----------------------------------"
|
| 100 |
|
|
<< "-- EndOf2ndaries Info ---------------"
|
| 101 |
|
|
<< G4endl;
|
| 102 |
|
|
}
|
| 103 |
|
|
}
|
| 104 |
|
|
|
| 105 |
|
|
}
|
| 106 |
|
|
G4cout.precision(prec);
|
| 107 |
|
|
}
|
| 108 |
|
|
|
| 109 |
|
|
|
| 110 |
|
|
void SteppingVerbose::TrackingStarted()
|
| 111 |
|
|
|
| 112 |
|
|
{
|
| 113 |
|
|
|
| 114 |
|
|
CopyState();
|
| 115 |
|
|
G4int prec = G4cout.precision(3);
|
| 116 |
|
|
if( verboseLevel > 0 ){
|
| 117 |
|
|
|
| 118 |
|
|
G4cout << std::setw( 5) << "Step#" << " "
|
| 119 |
|
|
<< std::setw( 6) << "X" << " "
|
| 120 |
|
|
<< std::setw( 6) << "Y" << " "
|
| 121 |
|
|
<< std::setw( 6) << "Z" << " "
|
| 122 |
|
|
<< std::setw( 9) << "KineE" << " "
|
| 123 |
|
|
<< std::setw( 9) << "dEStep" << " "
|
| 124 |
|
|
<< std::setw(10) << "StepLeng"
|
| 125 |
|
|
<< std::setw(10) << "TrakLeng"
|
| 126 |
|
|
<< std::setw(10) << "NextVolu"
|
| 127 |
|
|
<< std::setw(10) << "Process" << G4endl;
|
| 128 |
|
|
|
| 129 |
|
|
G4cout << std::setw( 5) << fTrack->GetCurrentStepNumber() << " "
|
| 130 |
|
|
<< std::setw( 6) << G4BestUnit(fTrack->GetPosition().x(),"Length")
|
| 131 |
|
|
<< std::setw( 6) << G4BestUnit(fTrack->GetPosition().y(),"Length")
|
| 132 |
|
|
<< std::setw( 6) << G4BestUnit(fTrack->GetPosition().z(),"Length")
|
| 133 |
|
|
<< std::setw( 6) << G4BestUnit(fTrack->GetKineticEnergy(),"Energy")
|
| 134 |
|
|
<< std::setw( 6) << G4BestUnit(fStep->GetTotalEnergyDeposit(),"Energy")
|
| 135 |
|
|
<< std::setw( 6) << G4BestUnit(fStep->GetStepLength(),"Length")
|
| 136 |
|
|
<< std::setw( 6) << G4BestUnit(fTrack->GetTrackLength(),"Length");
|
| 137 |
|
|
|
| 138 |
|
|
if(fTrack->GetNextVolume()){
|
| 139 |
|
|
G4cout << std::setw(10) << fTrack->GetNextVolume()->GetName() << " ";
|
| 140 |
|
|
} else {
|
| 141 |
|
|
G4cout << std::setw(10) << "OutOfWorld" << " ";
|
| 142 |
|
|
}
|
| 143 |
|
|
G4cout << std::setw(10) << "initStep" << G4endl;
|
| 144 |
|
|
}
|
| 145 |
|
|
G4cout.precision(prec);
|
| 146 |
|
|
}
|