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