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