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 /// \file field/field01/src/F01SteppingVerbose << 27 /// \brief Implementation of the F01SteppingVe << 28 // 26 // >> 27 // $Id: F01SteppingVerbose.cc,v 1.7 2006/06/29 17:17:00 gunter Exp $ >> 28 // GEANT4 tag $Name: geant4-09-01-patch-01 $ 29 // 29 // 30 // << 30 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo..... 31 //....oooOO0OOooo........oooOO0OOooo........oo << 31 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo..... 32 //....oooOO0OOooo........oooOO0OOooo........oo << 33 32 34 #include "F01SteppingVerbose.hh" 33 #include "F01SteppingVerbose.hh" 35 34 36 #include "G4SteppingManager.hh" 35 #include "G4SteppingManager.hh" 37 #include "G4UnitsTable.hh" 36 #include "G4UnitsTable.hh" 38 37 39 //....oooOO0OOooo........oooOO0OOooo........oo << 38 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo..... >> 39 >> 40 F01SteppingVerbose::F01SteppingVerbose() >> 41 {} >> 42 >> 43 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo..... >> 44 >> 45 F01SteppingVerbose::~F01SteppingVerbose() >> 46 {} >> 47 >> 48 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo..... 40 49 41 void F01SteppingVerbose::StepInfo() 50 void F01SteppingVerbose::StepInfo() 42 { 51 { 43 CopyState(); 52 CopyState(); 44 << 53 45 G4int prec = G4cout.precision(6); 54 G4int prec = G4cout.precision(6); 46 55 47 if (verboseLevel >= 1) { << 56 if( verboseLevel >= 1 ){ 48 if (verboseLevel >= 4) VerboseTrack(); << 57 if( verboseLevel >= 4 ) VerboseTrack(); 49 if (verboseLevel >= 3) { << 58 if( verboseLevel >= 3 ){ 50 G4cout << G4endl; << 59 G4cout << G4endl; 51 G4cout << std::setw(5) << "#Step#" << 60 G4cout << std::setw( 5) << "#Step#" << " " 52 << " " << std::setw(10) << "X" << 61 << std::setw(10) << "X" << " " 53 << " " << std::setw(10) << "Y" << 62 << std::setw(10) << "Y" << " " 54 << " " << std::setw(10) << "Z" << 63 << std::setw(10) << "Z" << " " 55 << " " << std::setw(10) << "Di << 64 << std::setw(10) << "Direction x" << " " 56 << " " << std::setw(10) << "dir y << 65 << std::setw(10) << "dir y" << " " 57 << " " << std::setw(10) << "dir z << 66 << std::setw(10) << "dir z" << " " 58 << " " << std::setw(8) << "KineE" << 67 << std::setw( 8) << "KineE" << " " 59 << " " << std::setw(10) << "dESte << 68 << std::setw( 6) << "dEStep" << " " 60 << " " << std::setw(10) << "StepL << 69 << std::setw(10) << "StepLeng" 61 << " " << std::setw(10) << "TrakL << 70 << std::setw(10) << "TrakLeng" 62 << " " << std::setw(10) << "NextV << 71 << std::setw(10) << "NextVolu" 63 << " " << std::setw(10) << "Proce << 72 << std::setw(10) << "Process" << " " 64 << " " << G4endl; << 73 << G4endl; 65 } << 74 } 66 << 75 67 G4cout << std::setw(5) << fTrack->GetCurre << 76 G4cout << std::setw( 5) << fTrack->GetCurrentStepNumber() << " " 68 << G4BestUnit(fTrack->GetPosition() << 77 << std::setw(10) << G4BestUnit(fTrack->GetPosition().x(),"Length") 69 << G4BestUnit(fTrack->GetPosition() << 78 << std::setw(10) << G4BestUnit(fTrack->GetPosition().y(),"Length") 70 << G4BestUnit(fTrack->GetPosition() << 79 << std::setw(10) << G4BestUnit(fTrack->GetPosition().z(),"Length"); 71 G4cout << std::setw(10) << fTrack->GetMome << 80 G4cout << std::setw(10) << fTrack->GetMomentumDirection().x() << " " 72 << fTrack->GetMomentumDirection().y << 81 << std::setw(10) << fTrack->GetMomentumDirection().y() << " " 73 << fTrack->GetMomentumDirection().z << 82 << std::setw(10) << fTrack->GetMomentumDirection().z() << " "; 74 G4cout << std::setw(8) << G4BestUnit(fTrac << 83 G4cout << std::setw( 8) << G4BestUnit(fTrack->GetKineticEnergy(),"Energy") 75 << std::setw(10) << G4BestUnit(fSte << 84 << std::setw( 6) << G4BestUnit(fStep->GetTotalEnergyDeposit(),"Energy") 76 << std::setw(10) << G4BestUnit(fSte << 85 << std::setw(10) << G4BestUnit(fStep->GetStepLength(),"Length") 77 << G4BestUnit(fTrack->GetTrackLengt << 86 << std::setw(10) << G4BestUnit(fTrack->GetTrackLength(),"Length"); 78 87 79 if (fTrack->GetNextVolume() != nullptr) { << 88 if( fTrack->GetNextVolume() != 0 ) { 80 G4cout << std::setw(10) << fTrack->GetVo 89 G4cout << std::setw(10) << fTrack->GetVolume()->GetName(); 81 } << 90 } else { 82 else { << 83 G4cout << std::setw(10) << "OutOfWorld"; 91 G4cout << std::setw(10) << "OutOfWorld"; 84 } 92 } 85 93 86 if (fStep->GetPostStepPoint()->GetProcessD << 94 if(fStep->GetPostStepPoint()->GetProcessDefinedStep() != 0){ 87 G4cout << " " << std::setw(10) << 95 G4cout << " " 88 << fStep->GetPostStepPoint()->Get << 96 << std::setw(10) << fStep->GetPostStepPoint()->GetProcessDefinedStep() 89 } << 97 ->GetProcessName(); 90 else { << 98 } else { 91 G4cout << " UserLimit"; 99 G4cout << " UserLimit"; 92 } 100 } 93 G4cout << G4endl; 101 G4cout << G4endl; 94 102 95 if (verboseLevel == 2) { << 103 if( verboseLevel == 2 ){ 96 G4int tN2ndariesTot = fN2ndariesAtRestDo << 104 G4int tN2ndariesTot = fN2ndariesAtRestDoIt + 97 if (tN2ndariesTot > 0) { << 105 fN2ndariesAlongStepDoIt + 98 G4cout << " :----- List of 2ndaries << 106 fN2ndariesPostStepDoIt; 99 << "#SpawnInStep=" << std::setw << 107 if(tN2ndariesTot>0){ 100 << fN2ndariesAtRestDoIt << ",Al << 108 G4cout << " :----- List of 2ndaries - " 101 << ",Post=" << std::setw(2) << << 109 << "#SpawnInStep=" << std::setw(3) << tN2ndariesTot 102 << "#SpawnTotal=" << std::setw( << 110 << "(Rest=" << std::setw(2) << fN2ndariesAtRestDoIt 103 << G4endl; << 111 << ",Along=" << std::setw(2) << fN2ndariesAlongStepDoIt 104 << 112 << ",Post=" << std::setw(2) << fN2ndariesPostStepDoIt 105 for (size_t lp1 = (*fSecondary).size() << 113 << "), " 106 G4cout << " : " << std::setw(6) << 114 << "#SpawnTotal=" << std::setw(3) << (*fSecondary).size() 107 << G4BestUnit((*fSecondary)[l << 115 << " ---------------" 108 << G4BestUnit((*fSecondary)[l << 116 << G4endl; 109 << G4BestUnit((*fSecondary)[l << 117 110 << G4BestUnit((*fSecondary)[l << 118 for(size_t lp1=(*fSecondary).size()-tN2ndariesTot; 111 << (*fSecondary)[lp1]->GetDef << 119 lp1<(*fSecondary).size(); lp1++) 112 G4cout << G4endl; << 120 { 113 } << 121 G4cout << " : " 114 << 122 << std::setw(6) 115 G4cout << " :---------------------- << 123 << G4BestUnit((*fSecondary)[lp1]->GetPosition().x(),"Length") 116 << "--------------------------- << 124 << std::setw(6) 117 << "-- EndOf2ndaries Info ----- << 125 << G4BestUnit((*fSecondary)[lp1]->GetPosition().y(),"Length") >> 126 << std::setw(6) >> 127 << G4BestUnit((*fSecondary)[lp1]->GetPosition().z(),"Length") >> 128 << std::setw(6) >> 129 << G4BestUnit((*fSecondary)[lp1]->GetKineticEnergy(),"Energy") >> 130 << std::setw(10) >> 131 << (*fSecondary)[lp1]->GetDefinition()->GetParticleName(); >> 132 G4cout << G4endl; >> 133 } >> 134 >> 135 G4cout << " :-----------------------------" >> 136 << "----------------------------------" >> 137 << "-- EndOf2ndaries Info ---------------" >> 138 << G4endl; 118 } 139 } 119 } 140 } >> 141 120 } 142 } 121 G4cout.precision(prec); 143 G4cout.precision(prec); 122 } 144 } 123 145 124 //....oooOO0OOooo........oooOO0OOooo........oo << 146 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo..... 125 147 126 void F01SteppingVerbose::TrackingStarted() 148 void F01SteppingVerbose::TrackingStarted() 127 { 149 { >> 150 128 CopyState(); 151 CopyState(); 129 G4int prec = G4cout.precision(6); << 152 G4int prec = G4cout.precision(6); 130 if (verboseLevel > 0) { << 153 if( verboseLevel > 0 ){ 131 G4cout << std::setw(5) << "Step#" << 154 132 << " " << std::setw(10) << "X" << 155 G4cout << std::setw( 5) << "Step#" << " " 133 << " " << std::setw(10) << "Y" << 156 << std::setw(10) << "X" << " " 134 << " " << std::setw(10) << "Z" << 157 << std::setw(10) << "Y" << " " 135 << " " << std::setw(10) << "Dire << 158 << std::setw(10) << "Z" << " " 136 << " " << std::setw(10) << "dir y" << 159 << std::setw(10) << "Direction x" << " " 137 << " " << std::setw(10) << "dir z" << 160 << std::setw(10) << "dir y" << " " 138 << " " << std::setw(10) << "KineE" << 161 << std::setw(10) << "dir z" << " " 139 << " " << std::setw(10) << "dEStep" << 162 << std::setw(10) << "KineE" << " " 140 << " " << std::setw(10) << "StepLen << 163 << std::setw(10) << "dEStep" << " " 141 << "Volume" << 164 << std::setw(10) << "StepLeng" 142 << " " << std::setw(10) << "Proces << 165 << std::setw(10) << "TrakLeng" 143 << 166 << std::setw(10) << "Volume" << " " 144 G4cout << std::setw(5) << fTrack->GetCurre << 167 << std::setw(10) << "Process" 145 << G4BestUnit(fTrack->GetPosition() << 168 << G4endl; 146 << G4BestUnit(fTrack->GetPosition() << 169 147 << G4BestUnit(fTrack->GetPosition() << 170 G4cout << std::setw( 5) << fTrack->GetCurrentStepNumber() << " " 148 G4cout << std::setw(10) << fTrack->GetMome << 171 << std::setw(10) << G4BestUnit(fTrack->GetPosition().x(),"Length") 149 << fTrack->GetMomentumDirection().y << 172 << std::setw(10) << G4BestUnit(fTrack->GetPosition().y(),"Length") 150 << fTrack->GetMomentumDirection().z << 173 << std::setw(10) << G4BestUnit(fTrack->GetPosition().z(),"Length"); 151 G4cout << std::setw(8) << G4BestUnit(fTrac << 174 G4cout << std::setw(10) << fTrack->GetMomentumDirection().x() << " " 152 << G4BestUnit(fStep->GetTotalEnergy << 175 << std::setw(10) << fTrack->GetMomentumDirection().y() << " " 153 << G4BestUnit(fStep->GetStepLength( << 176 << std::setw(10) << fTrack->GetMomentumDirection().z() << " "; 154 << G4BestUnit(fTrack->GetTrackLengt << 177 G4cout << std::setw( 8) << G4BestUnit(fTrack->GetKineticEnergy(),"Energy") >> 178 << std::setw( 6) << G4BestUnit(fStep->GetTotalEnergyDeposit(),"Energy") >> 179 << std::setw(10) << G4BestUnit(fStep->GetStepLength(),"Length") >> 180 << std::setw(10) << G4BestUnit(fTrack->GetTrackLength(),"Length"); 155 181 156 if (fTrack->GetNextVolume()) { << 182 if(fTrack->GetNextVolume()){ 157 G4cout << std::setw(10) << fTrack->GetVo 183 G4cout << std::setw(10) << fTrack->GetVolume()->GetName(); 158 } << 184 } else { 159 else { << 160 G4cout << std::setw(10) << "OutOfWorld"; 185 G4cout << std::setw(10) << "OutOfWorld"; 161 } 186 } 162 G4cout << " initStep" << G4endl; << 187 G4cout << " initStep" << G4endl; 163 } 188 } 164 G4cout.precision(prec); 189 G4cout.precision(prec); 165 } 190 } 166 191 167 //....oooOO0OOooo........oooOO0OOooo........oo << 192 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo..... 168 193