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