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