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/field02/src/F02SteppingVerbose 26 /// \file field/field02/src/F02SteppingVerbose.cc 27 /// \brief Implementation of the F02SteppingVe 27 /// \brief Implementation of the F02SteppingVerbose 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 "F02SteppingVerbose.hh" 35 #include "F02SteppingVerbose.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 F02SteppingVerbose::StepInfo() 42 void F02SteppingVerbose::StepInfo() 43 { 43 { 44 CopyState(); 44 CopyState(); 45 45 46 G4int prec = G4cout.precision(3); 46 G4int prec = G4cout.precision(3); 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(6) << "X" << 53 << std::setw( 6) << "X" << " " 54 << " " << std::setw(6) << "Y" << 54 << std::setw( 6) << "Y" << " " 55 << " " << std::setw(6) << "Z" << 55 << std::setw( 6) << "Z" << " " 56 << " " << std::setw(9) << "Kin << 56 << std::setw( 9) << "KineE" << " " 57 << " " << std::setw(9) << "dEStep << 57 << std::setw( 9) << "dEStep" << " " 58 << " " << std::setw(10) << "StepL << 58 << std::setw(10) << "StepLeng" 59 << "NextVolu" << std::setw(10) << << 59 << std::setw(10) << "TrakLeng" 60 } << 60 << std::setw(10) << "NextVolu" 61 << 61 << std::setw(10) << "Process" << G4endl; 62 G4cout << std::setw(5) << fTrack->GetCurre << 62 } 63 << G4BestUnit(fTrack->GetPosition() << 63 64 << G4BestUnit(fTrack->GetPosition() << 64 G4cout << std::setw( 5)<<fTrack->GetCurrentStepNumber() << " " 65 << G4BestUnit(fTrack->GetPosition() << 65 << std::setw( 6)<<G4BestUnit(fTrack->GetPosition().x(),"Length") 66 << G4BestUnit(fTrack->GetKineticEne << 66 << std::setw( 6)<<G4BestUnit(fTrack->GetPosition().y(),"Length") 67 << G4BestUnit(fStep->GetTotalEnergy << 67 << std::setw( 6)<<G4BestUnit(fTrack->GetPosition().z(),"Length") 68 << G4BestUnit(fStep->GetStepLength( << 68 << std::setw( 6)<<G4BestUnit(fTrack->GetKineticEnergy(),"Energy") 69 << G4BestUnit(fTrack->GetTrackLengt << 69 << std::setw( 6)<<G4BestUnit(fStep->GetTotalEnergyDeposit(),"Energy") >> 70 << std::setw( 6)<<G4BestUnit(fStep->GetStepLength(),"Length") >> 71 << std::setw( 6) << G4BestUnit(fTrack->GetTrackLength(),"Length"); 70 72 71 if (fTrack->GetNextVolume() != nullptr) { << 73 if( fTrack->GetNextVolume() != nullptr ) { 72 G4cout << std::setw(10) << fTrack->GetNe 74 G4cout << std::setw(10) << fTrack->GetNextVolume()->GetName(); 73 } << 75 } else { 74 else { << 75 G4cout << std::setw(10) << "OutOfWorld"; 76 G4cout << std::setw(10) << "OutOfWorld"; 76 } 77 } 77 78 78 if (fStep->GetPostStepPoint()->GetProcessD << 79 if(fStep->GetPostStepPoint()->GetProcessDefinedStep() != nullptr){ 79 G4cout << std::setw(10) 80 G4cout << std::setw(10) 80 << fStep->GetPostStepPoint()->Get << 81 << fStep->GetPostStepPoint()->GetProcessDefinedStep() 81 } << 82 ->GetProcessName(); 82 else { << 83 } else { 83 G4cout << " UserLimit"; 84 G4cout << " UserLimit"; 84 } 85 } 85 86 86 G4cout << G4endl; 87 G4cout << G4endl; 87 88 88 if (verboseLevel == 2) { << 89 if( verboseLevel == 2 ){ 89 G4int tN2ndariesTot = fN2ndariesAtRestDo << 90 G4int tN2ndariesTot = fN2ndariesAtRestDoIt + 90 if (tN2ndariesTot > 0) { << 91 fN2ndariesAlongStepDoIt + >> 92 fN2ndariesPostStepDoIt; >> 93 if(tN2ndariesTot>0){ 91 G4cout << " :----- List of 2ndaries 94 G4cout << " :----- List of 2ndaries - " 92 << "#SpawnInStep=" << std::setw << 95 << "#SpawnInStep=" << std::setw(3) << tN2ndariesTot 93 << fN2ndariesAtRestDoIt << ",Al << 96 << "(Rest=" << std::setw(2) << fN2ndariesAtRestDoIt 94 << ",Post=" << std::setw(2) << << 97 << ",Along=" << std::setw(2) << fN2ndariesAlongStepDoIt 95 << " ---------------" << G4endl << 98 << ",Post=" << std::setw(2) << fN2ndariesPostStepDoIt >> 99 << "), " >> 100 << " ---------------" >> 101 << G4endl; 96 G4cout << " :---------------------- 102 G4cout << " :-----------------------------" 97 << "--------------------------- 103 << "----------------------------------" 98 << "-- EndOf2ndaries Info ----- << 104 << "-- EndOf2ndaries Info ---------------" >> 105 << G4endl; 99 } 106 } 100 } 107 } >> 108 101 } 109 } 102 G4cout.precision(prec); 110 G4cout.precision(prec); 103 } 111 } 104 112 105 //....oooOO0OOooo........oooOO0OOooo........oo 113 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 106 114 107 void F02SteppingVerbose::TrackingStarted() 115 void F02SteppingVerbose::TrackingStarted() 108 { 116 { 109 CopyState(); 117 CopyState(); 110 G4int prec = G4cout.precision(3); 118 G4int prec = G4cout.precision(3); 111 if (verboseLevel > 0) { << 119 if( verboseLevel > 0 ){ 112 G4cout << std::setw(5) << "Step#" << 120 113 << " " << std::setw(6) << "X" << 121 G4cout << std::setw( 5) << "Step#" << " " 114 << " " << std::setw(6) << "Y" << 122 << std::setw( 6) << "X" << " " 115 << " " << std::setw(6) << "Z" << 123 << std::setw( 6) << "Y" << " " 116 << " " << std::setw(9) << "KineE << 124 << std::setw( 6) << "Z" << " " 117 << " " << std::setw(9) << "dEStep" << 125 << std::setw( 9) << "KineE" << " " 118 << " " << std::setw(10) << "StepLen << 126 << std::setw( 9) << "dEStep" << " " 119 << "NextVolu" << std::setw(10) << " << 127 << std::setw(10) << "StepLeng" 120 << 128 << std::setw(10) << "TrakLeng" 121 G4cout << std::setw(5) << fTrack->GetCurre << 129 << std::setw(10) << "NextVolu" 122 << G4BestUnit(fTrack->GetPosition() << 130 << std::setw(10) << "Process" << G4endl; 123 << G4BestUnit(fTrack->GetPosition() << 131 124 << G4BestUnit(fTrack->GetPosition() << 132 G4cout << std::setw( 5)<<fTrack->GetCurrentStepNumber() << " " 125 << G4BestUnit(fTrack->GetKineticEne << 133 << std::setw( 6)<<G4BestUnit(fTrack->GetPosition().x(),"Length") 126 << G4BestUnit(fStep->GetTotalEnergy << 134 << std::setw( 6)<<G4BestUnit(fTrack->GetPosition().y(),"Length") 127 << G4BestUnit(fStep->GetStepLength( << 135 << std::setw( 6)<<G4BestUnit(fTrack->GetPosition().z(),"Length") 128 << G4BestUnit(fTrack->GetTrackLengt << 136 << std::setw( 6)<<G4BestUnit(fTrack->GetKineticEnergy(),"Energy") >> 137 << std::setw( 6)<<G4BestUnit(fStep->GetTotalEnergyDeposit(),"Energy") >> 138 << std::setw( 6)<<G4BestUnit(fStep->GetStepLength(),"Length") >> 139 << std::setw( 6) << G4BestUnit(fTrack->GetTrackLength(),"Length"); 129 140 130 if (fTrack->GetNextVolume()) { << 141 if(fTrack->GetNextVolume()){ 131 G4cout << std::setw(10) << fTrack->GetNe 142 G4cout << std::setw(10) << fTrack->GetNextVolume()->GetName() << " "; 132 } << 143 } else { 133 else { << 144 G4cout << std::setw(10) << "OutOfWorld" << " "; 134 G4cout << std::setw(10) << "OutOfWorld" << 135 << " "; << 136 } 145 } 137 G4cout << std::setw(10) << "initStep" << G 146 G4cout << std::setw(10) << "initStep" << G4endl; 138 } 147 } 139 G4cout.precision(prec); 148 G4cout.precision(prec); 140 } 149 } 141 150 142 //....oooOO0OOooo........oooOO0OOooo........oo 151 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 143 152