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