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