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