Geant4 Cross Reference |
1 // 1 // 2 // ******************************************* 2 // ******************************************************************** 3 // * License and Disclaimer << 3 // * DISCLAIMER * 4 // * 4 // * * 5 // * The Geant4 software is copyright of th << 5 // * The following disclaimer summarizes all the specific disclaimers * 6 // * the Geant4 Collaboration. It is provided << 6 // * of contributors to this software. The specific disclaimers,which * 7 // * conditions of the Geant4 Software License << 7 // * govern, are listed with their locations in: * 8 // * LICENSE and available at http://cern.ch/ << 8 // * http://cern.ch/geant4/license * 9 // * include a list of copyright holders. << 10 // * 9 // * * 11 // * Neither the authors of this software syst 10 // * Neither the authors of this software system, nor their employing * 12 // * institutes,nor the agencies providing fin 11 // * institutes,nor the agencies providing financial support for this * 13 // * work make any representation or warran 12 // * work make any representation or warranty, express or implied, * 14 // * regarding this software system or assum 13 // * regarding this software system or assume any liability for its * 15 // * use. Please see the license in the file << 14 // * use. * 16 // * for the full disclaimer and the limitatio << 17 // * 15 // * * 18 // * This code implementation is the result << 16 // * This code implementation is the intellectual property of the * 19 // * technical work of the GEANT4 collaboratio << 17 // * GEANT4 collaboration. * 20 // * By using, copying, modifying or distri << 18 // * By copying, distributing or modifying the Program (or any work * 21 // * any work based on the software) you ag << 19 // * based on the Program) you indicate your acceptance of this * 22 // * use in resulting scientific publicati << 20 // * statement, and all its terms. * 23 // * acceptance of all terms of the Geant4 Sof << 24 // ******************************************* 21 // ******************************************************************** 25 // 22 // 26 // Code developed by: 23 // Code developed by: 27 // S.Larsson 24 // S.Larsson 28 // 25 // 29 // ************************************ 26 // ************************************ 30 // * * 27 // * * 31 // * PurgMagSteppingVerbose.cc * 28 // * PurgMagSteppingVerbose.cc * 32 // * * 29 // * * 33 // ************************************ 30 // ************************************ 34 // 31 // >> 32 // $Id: PurgMagSteppingVerbose.cc,v 1.2 2004/06/18 09:18:02 gunter Exp $ >> 33 // GEANT4 tag $Name: geant4-07-01 $ 35 // 34 // 36 35 37 #include "PurgMagSteppingVerbose.hh" 36 #include "PurgMagSteppingVerbose.hh" 38 #include "G4SteppingManager.hh" 37 #include "G4SteppingManager.hh" 39 38 40 #include "G4UnitsTable.hh" 39 #include "G4UnitsTable.hh" 41 40 42 //....oooOO0OOooo........oooOO0OOooo........oo 41 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 43 42 44 PurgMagSteppingVerbose::PurgMagSteppingVerbose 43 PurgMagSteppingVerbose::PurgMagSteppingVerbose() 45 {} 44 {} 46 45 47 //....oooOO0OOooo........oooOO0OOooo........oo 46 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 48 47 49 PurgMagSteppingVerbose::~PurgMagSteppingVerbos 48 PurgMagSteppingVerbose::~PurgMagSteppingVerbose() 50 {} 49 {} 51 50 52 //....oooOO0OOooo........oooOO0OOooo........oo 51 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 53 52 54 void PurgMagSteppingVerbose::StepInfo() 53 void PurgMagSteppingVerbose::StepInfo() 55 { 54 { 56 CopyState(); 55 CopyState(); 57 56 58 G4int prec = G4cout.precision(3); 57 G4int prec = G4cout.precision(3); 59 58 60 if( verboseLevel >= 1 ){ 59 if( verboseLevel >= 1 ){ 61 if( verboseLevel >= 4 ) VerboseTrack(); 60 if( verboseLevel >= 4 ) VerboseTrack(); 62 if( verboseLevel >= 3 ){ 61 if( verboseLevel >= 3 ){ 63 G4cout << G4endl; 62 G4cout << G4endl; 64 G4cout << std::setw( 5) << "#Step#" 63 G4cout << std::setw( 5) << "#Step#" << " " 65 << std::setw( 6) << "X" << " 64 << std::setw( 6) << "X" << " " 66 << std::setw( 6) << "Y" << " 65 << std::setw( 6) << "Y" << " " 67 << std::setw( 6) << "Z" << " 66 << std::setw( 6) << "Z" << " " 68 << std::setw( 9) << "KineE" << " " 67 << std::setw( 9) << "KineE" << " " 69 << std::setw( 9) << "dEStep" << " " 68 << std::setw( 9) << "dEStep" << " " 70 << std::setw(10) << "StepLeng" 69 << std::setw(10) << "StepLeng" 71 << std::setw(10) << "TrakLeng" 70 << std::setw(10) << "TrakLeng" 72 << std::setw(10) << "NextVolu" 71 << std::setw(10) << "NextVolu" 73 << std::setw(10) << "Process" << G4en 72 << std::setw(10) << "Process" << G4endl; 74 } 73 } 75 74 76 G4cout << std::setw( 5) << fTrack->GetCurr 75 G4cout << std::setw( 5) << fTrack->GetCurrentStepNumber() << " " 77 << std::setw( 6) << G4BestUnit(fTrack->Ge 76 << std::setw( 6) << G4BestUnit(fTrack->GetPosition().x(),"Length") 78 << std::setw( 6) << G4BestUnit(fTrack->Ge 77 << std::setw( 6) << G4BestUnit(fTrack->GetPosition().y(),"Length") 79 << std::setw( 6) << G4BestUnit(fTrack->Ge 78 << std::setw( 6) << G4BestUnit(fTrack->GetPosition().z(),"Length") 80 << std::setw( 6) << G4BestUnit(fTrack->Ge 79 << std::setw( 6) << G4BestUnit(fTrack->GetKineticEnergy(),"Energy") 81 << std::setw( 6) << G4BestUnit(fStep->Get 80 << std::setw( 6) << G4BestUnit(fStep->GetTotalEnergyDeposit(),"Energy") 82 << std::setw( 6) << G4BestUnit(fStep->Get 81 << std::setw( 6) << G4BestUnit(fStep->GetStepLength(),"Length") 83 << std::setw( 6) << G4BestUnit(fTrack->Ge 82 << std::setw( 6) << G4BestUnit(fTrack->GetTrackLength(),"Length"); 84 83 85 // if( fStepStatus != fWorldBoundary){ 84 // if( fStepStatus != fWorldBoundary){ 86 if( fTrack->GetNextVolume() != 0 ) { 85 if( fTrack->GetNextVolume() != 0 ) { 87 G4cout << std::setw(10) << fTrack->GetNe 86 G4cout << std::setw(10) << fTrack->GetNextVolume()->GetName(); 88 } else { 87 } else { 89 G4cout << std::setw(10) << "OutOfWorld"; 88 G4cout << std::setw(10) << "OutOfWorld"; 90 } 89 } 91 90 92 if(fStep->GetPostStepPoint()->GetProcessDe 91 if(fStep->GetPostStepPoint()->GetProcessDefinedStep() != NULL){ 93 G4cout << std::setw(10) << fStep->GetPos 92 G4cout << std::setw(10) << fStep->GetPostStepPoint()->GetProcessDefinedStep() 94 ->GetProcessName(); 93 ->GetProcessName(); 95 } else { 94 } else { 96 G4cout << "User Limit"; 95 G4cout << "User Limit"; 97 } 96 } 98 97 99 G4cout << G4endl; 98 G4cout << G4endl; 100 99 101 if( verboseLevel == 2 ){ 100 if( verboseLevel == 2 ){ 102 G4int tN2ndariesTot = fN2ndariesAtRestDo 101 G4int tN2ndariesTot = fN2ndariesAtRestDoIt + 103 fN2ndariesAlongStepDoIt 102 fN2ndariesAlongStepDoIt + 104 fN2ndariesPostStepDoIt; 103 fN2ndariesPostStepDoIt; 105 if(tN2ndariesTot>0){ 104 if(tN2ndariesTot>0){ 106 G4cout << " :----- List of 2ndaries - " 105 G4cout << " :----- List of 2ndaries - " 107 << "#SpawnInStep=" << std::setw(3) << 106 << "#SpawnInStep=" << std::setw(3) << tN2ndariesTot 108 << "(Rest=" << std::setw(2) << fN2nd 107 << "(Rest=" << std::setw(2) << fN2ndariesAtRestDoIt 109 << ",Along=" << std::setw(2) << fN2nd 108 << ",Along=" << std::setw(2) << fN2ndariesAlongStepDoIt 110 << ",Post=" << std::setw(2) << fN2nd 109 << ",Post=" << std::setw(2) << fN2ndariesPostStepDoIt 111 << "), " 110 << "), " 112 << "#SpawnTotal=" << std::setw(3) << 111 << "#SpawnTotal=" << std::setw(3) << (*fSecondary).size() 113 << " ---------------" 112 << " ---------------" 114 << G4endl; 113 << G4endl; 115 114 116 for(size_t lp1=(*fSecondary).size()-tN2ndari 115 for(size_t lp1=(*fSecondary).size()-tN2ndariesTot; 117 lp1<(*fSecondary).size(); lp1++){ 116 lp1<(*fSecondary).size(); lp1++){ 118 G4cout << " : " 117 G4cout << " : " 119 << std::setw(6) 118 << std::setw(6) 120 << G4BestUnit((*fSecondary)[lp1]->GetPosi 119 << G4BestUnit((*fSecondary)[lp1]->GetPosition().x(),"Length") 121 << std::setw(6) 120 << std::setw(6) 122 << G4BestUnit((*fSecondary)[lp1]->GetPosi 121 << G4BestUnit((*fSecondary)[lp1]->GetPosition().y(),"Length") 123 << std::setw(6) 122 << std::setw(6) 124 << G4BestUnit((*fSecondary)[lp1]->GetPosi 123 << G4BestUnit((*fSecondary)[lp1]->GetPosition().z(),"Length") 125 << std::setw(6) 124 << std::setw(6) 126 << G4BestUnit((*fSecondary)[lp1]->GetKine 125 << G4BestUnit((*fSecondary)[lp1]->GetKineticEnergy(),"Energy") 127 << std::setw(10) 126 << std::setw(10) 128 << (*fSecondary)[lp1]->GetDefinition()->G 127 << (*fSecondary)[lp1]->GetDefinition()->GetParticleName(); 129 G4cout << G4endl; 128 G4cout << G4endl; 130 } 129 } 131 130 132 G4cout << " :---------------------------- 131 G4cout << " :-----------------------------" 133 << "--------------------------------- 132 << "----------------------------------" 134 << "-- EndOf2ndaries Info ----------- 133 << "-- EndOf2ndaries Info ---------------" 135 << G4endl; 134 << G4endl; 136 } 135 } 137 } 136 } 138 137 139 } 138 } 140 G4cout.precision(prec); 139 G4cout.precision(prec); 141 G4cout<< "exit PurgMagSteppingVerbose::StepI 140 G4cout<< "exit PurgMagSteppingVerbose::StepInfo " <<G4endl; 142 } 141 } 143 142 144 //....oooOO0OOooo........oooOO0OOooo........oo 143 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 145 144 146 void PurgMagSteppingVerbose::TrackingStarted() 145 void PurgMagSteppingVerbose::TrackingStarted() 147 { 146 { 148 CopyState(); 147 CopyState(); 149 G4int prec = G4cout.precision(3); 148 G4int prec = G4cout.precision(3); 150 if( verboseLevel > 0 ){ 149 if( verboseLevel > 0 ){ 151 150 152 G4cout << std::setw( 5) << "Step#" << 151 G4cout << std::setw( 5) << "Step#" << " " 153 << std::setw( 6) << "X" << 152 << std::setw( 6) << "X" << " " 154 << std::setw( 6) << "Y" << " 153 << std::setw( 6) << "Y" << " " 155 << std::setw( 6) << "Z" << " 154 << std::setw( 6) << "Z" << " " 156 << std::setw( 9) << "KineE" << " " 155 << std::setw( 9) << "KineE" << " " 157 << std::setw( 9) << "dEStep" << " " 156 << std::setw( 9) << "dEStep" << " " 158 << std::setw(10) << "StepLeng" 157 << std::setw(10) << "StepLeng" 159 << std::setw(10) << "TrakLeng" 158 << std::setw(10) << "TrakLeng" 160 << std::setw(10) << "NextVolu" 159 << std::setw(10) << "NextVolu" 161 << std::setw(10) << "Process" << G4end 160 << std::setw(10) << "Process" << G4endl; 162 161 163 G4cout << std::setw( 5) << fTrack->GetCurr 162 G4cout << std::setw( 5) << fTrack->GetCurrentStepNumber() << " " 164 << std::setw( 6) << G4BestUnit(fTrack->Ge 163 << std::setw( 6) << G4BestUnit(fTrack->GetPosition().x(),"Length") 165 << std::setw( 6) << G4BestUnit(fTrack->Ge 164 << std::setw( 6) << G4BestUnit(fTrack->GetPosition().y(),"Length") 166 << std::setw( 6) << G4BestUnit(fTrack->Ge 165 << std::setw( 6) << G4BestUnit(fTrack->GetPosition().z(),"Length") 167 << std::setw( 6) << G4BestUnit(fTrack->Ge 166 << std::setw( 6) << G4BestUnit(fTrack->GetKineticEnergy(),"Energy") 168 << std::setw( 6) << G4BestUnit(fStep->Get 167 << std::setw( 6) << G4BestUnit(fStep->GetTotalEnergyDeposit(),"Energy") 169 << std::setw( 6) << G4BestUnit(fStep->Get 168 << std::setw( 6) << G4BestUnit(fStep->GetStepLength(),"Length") 170 << std::setw( 6) << G4BestUnit(fTrack->Ge 169 << std::setw( 6) << G4BestUnit(fTrack->GetTrackLength(),"Length"); 171 170 172 if(fTrack->GetNextVolume()){ 171 if(fTrack->GetNextVolume()){ 173 G4cout << std::setw(10) << fTrack->GetNe 172 G4cout << std::setw(10) << fTrack->GetNextVolume()->GetName() << " "; 174 } else { 173 } else { 175 G4cout << std::setw(10) << "OutOfWorld" 174 G4cout << std::setw(10) << "OutOfWorld" << " "; 176 } 175 } 177 G4cout << std::setw(10) << "initStep" << G 176 G4cout << std::setw(10) << "initStep" << G4endl; 178 } 177 } 179 G4cout.precision(prec); 178 G4cout.precision(prec); 180 G4cout<< "exit PurgMagSteppingVerbose::Track 179 G4cout<< "exit PurgMagSteppingVerbose::TrackingStarted() " <<G4endl; 181 } 180 } 182 181