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