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