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