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