Geant4 Cross Reference |
1 // 2 // ******************************************************************** 3 // * License and Disclaimer * 4 // * * 5 // * The Geant4 software is copyright of the Copyright Holders of * 6 // * the Geant4 Collaboration. It is provided under the terms and * 7 // * conditions of the Geant4 Software License, included in the file * 8 // * LICENSE and available at http://cern.ch/geant4/license . These * 9 // * include a list of copyright holders. * 10 // * * 11 // * Neither the authors of this software system, nor their employing * 12 // * institutes,nor the agencies providing financial support for this * 13 // * work make any representation or warranty, express or implied, * 14 // * regarding this software system or assume any liability for its * 15 // * use. Please see the license in the file LICENSE and URL above * 16 // * for the full disclaimer and the limitation of liability. * 17 // * * 18 // * This code implementation is the result of the scientific and * 19 // * technical work of the GEANT4 collaboration. * 20 // * By using, copying, modifying or distributing the software (or * 21 // * any work based on the software) you agree to acknowledge its * 22 // * use in resulting scientific publications, and indicate your * 23 // * acceptance of all terms of the Geant4 Software license. * 24 // ******************************************************************** 25 // 26 // 27 /// \file RE05/src/RE05SteppingVerbose.cc 28 /// \brief Implementation of the RE05SteppingVerbose class 29 // 30 31 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 32 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 33 34 #include "RE05SteppingVerbose.hh" 35 36 #include "G4SteppingManager.hh" 37 #include "G4UnitsTable.hh" 38 39 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 40 41 RE05SteppingVerbose::RE05SteppingVerbose() : G4SteppingVerbose() {} 42 43 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 44 45 RE05SteppingVerbose::~RE05SteppingVerbose() {} 46 47 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 48 49 void RE05SteppingVerbose::StepInfo() 50 { 51 CopyState(); 52 53 G4int prec = G4cout.precision(3); 54 55 if (verboseLevel >= 1) { 56 if (verboseLevel >= 4) VerboseTrack(); 57 if (verboseLevel >= 3) { 58 G4cout << G4endl; 59 G4cout << std::setw(5) << "#Step#" 60 << " " << std::setw(6) << "X" 61 << " " << std::setw(6) << "Y" 62 << " " << std::setw(6) << "Z" 63 << " " << std::setw(9) << "KineE" 64 << " " << std::setw(9) << "dEStep" 65 << " " << std::setw(10) << "StepLeng" << std::setw(10) << "TrakLeng" << std::setw(10) 66 << "Volume" 67 << " " << std::setw(10) << "Process" << G4endl; 68 } 69 70 G4cout << std::setw(5) << fTrack->GetCurrentStepNumber() << " " << std::setw(6) 71 << G4BestUnit(fTrack->GetPosition().x(), "Length") << std::setw(6) 72 << G4BestUnit(fTrack->GetPosition().y(), "Length") << std::setw(6) 73 << G4BestUnit(fTrack->GetPosition().z(), "Length") << std::setw(6) 74 << G4BestUnit(fTrack->GetKineticEnergy(), "Energy") << std::setw(6) 75 << G4BestUnit(fStep->GetTotalEnergyDeposit(), "Energy") << std::setw(6) 76 << G4BestUnit(fStep->GetStepLength(), "Length") << std::setw(6) 77 << G4BestUnit(fTrack->GetTrackLength(), "Length") << " "; 78 79 // if( fStepStatus != fWorldBoundary){ 80 if (fTrack->GetNextVolume() != 0) { 81 G4cout << std::setw(10) << fTrack->GetVolume()->GetName(); 82 } 83 else { 84 G4cout << std::setw(10) << "OutOfWorld"; 85 } 86 87 if (fStep->GetPostStepPoint()->GetProcessDefinedStep() != NULL) { 88 G4cout << " " << std::setw(10) 89 << fStep->GetPostStepPoint()->GetProcessDefinedStep()->GetProcessName(); 90 } 91 else { 92 G4cout << " UserLimit"; 93 } 94 95 G4cout << G4endl; 96 97 if (verboseLevel == 2) { 98 G4int tN2ndariesTot = fN2ndariesAtRestDoIt + fN2ndariesAlongStepDoIt + fN2ndariesPostStepDoIt; 99 if (tN2ndariesTot > 0) { 100 G4cout << " :----- List of 2ndaries - " 101 << "#SpawnInStep=" << std::setw(3) << tN2ndariesTot << "(Rest=" << std::setw(2) 102 << fN2ndariesAtRestDoIt << ",Along=" << std::setw(2) << fN2ndariesAlongStepDoIt 103 << ",Post=" << std::setw(2) << fN2ndariesPostStepDoIt << "), " 104 << "#SpawnTotal=" << std::setw(3) << (*fSecondary).size() << " ---------------" 105 << G4endl; 106 107 for (size_t lp1 = (*fSecondary).size() - tN2ndariesTot; lp1 < (*fSecondary).size(); lp1++) { 108 G4cout << " : " << std::setw(6) 109 << G4BestUnit((*fSecondary)[lp1]->GetPosition().x(), "Length") << std::setw(6) 110 << G4BestUnit((*fSecondary)[lp1]->GetPosition().y(), "Length") << std::setw(6) 111 << G4BestUnit((*fSecondary)[lp1]->GetPosition().z(), "Length") << std::setw(6) 112 << G4BestUnit((*fSecondary)[lp1]->GetKineticEnergy(), "Energy") << std::setw(10) 113 << (*fSecondary)[lp1]->GetDefinition()->GetParticleName(); 114 G4cout << G4endl; 115 } 116 117 G4cout << " :-----------------------------" 118 << "----------------------------------" 119 << "-- EndOf2ndaries Info ---------------" << G4endl; 120 } 121 } 122 } 123 G4cout.precision(prec); 124 } 125 126 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 127 128 void RE05SteppingVerbose::TrackingStarted() 129 { 130 CopyState(); 131 G4int prec = G4cout.precision(3); 132 if (verboseLevel > 0) { 133 G4cout << std::setw(5) << "Step#" 134 << " " << std::setw(6) << "X" 135 << " " << std::setw(6) << "Y" 136 << " " << std::setw(6) << "Z" 137 << " " << std::setw(9) << "KineE" 138 << " " << std::setw(9) << "dEStep" 139 << " " << std::setw(10) << "StepLeng" << std::setw(10) << "TrakLeng" << std::setw(10) 140 << "Volume" 141 << " " << std::setw(10) << "Process" << G4endl; 142 143 G4cout << std::setw(5) << fTrack->GetCurrentStepNumber() << " " << std::setw(6) 144 << G4BestUnit(fTrack->GetPosition().x(), "Length") << std::setw(6) 145 << G4BestUnit(fTrack->GetPosition().y(), "Length") << std::setw(6) 146 << G4BestUnit(fTrack->GetPosition().z(), "Length") << std::setw(6) 147 << G4BestUnit(fTrack->GetKineticEnergy(), "Energy") << std::setw(6) 148 << G4BestUnit(fStep->GetTotalEnergyDeposit(), "Energy") << std::setw(6) 149 << G4BestUnit(fStep->GetStepLength(), "Length") << std::setw(6) 150 << G4BestUnit(fTrack->GetTrackLength(), "Length") << " "; 151 152 if (fTrack->GetNextVolume()) { 153 G4cout << std::setw(10) << fTrack->GetVolume()->GetName(); 154 } 155 else { 156 G4cout << std::setw(10) << "OutOfWorld"; 157 } 158 G4cout << " initStep" << G4endl; 159 } 160 G4cout.precision(prec); 161 } 162 163 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 164