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 /// \file eventgenerator/HepMC/HepMCEx01/src/E << 27 /// \brief Implementation of the ExN04Stepping << 28 // 26 // >> 27 // $Id: ExN04SteppingVerbose.cc,v 1.4 2006/06/29 17:06:23 gunter Exp $ >> 28 // GEANT4 tag $Name: geant4-08-01-patch-01 $ 29 // 29 // 30 //....oooOO0OOooo........oooOO0OOooo........oo 30 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 31 //....oooOO0OOooo........oooOO0OOooo........oo 31 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 32 32 33 #include "ExN04SteppingVerbose.hh" 33 #include "ExN04SteppingVerbose.hh" 34 34 35 #include "G4SteppingManager.hh" 35 #include "G4SteppingManager.hh" 36 #include "G4UnitsTable.hh" 36 #include "G4UnitsTable.hh" 37 37 38 //....oooOO0OOooo........oooOO0OOooo........oo 38 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 39 ExN04SteppingVerbose::ExN04SteppingVerbose() : << 39 >> 40 ExN04SteppingVerbose::ExN04SteppingVerbose() >> 41 {} 40 42 41 //....oooOO0OOooo........oooOO0OOooo........oo 43 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 42 ExN04SteppingVerbose::~ExN04SteppingVerbose() << 43 44 >> 45 ExN04SteppingVerbose::~ExN04SteppingVerbose() >> 46 {} >> 47 44 //....oooOO0OOooo........oooOO0OOooo........oo 48 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... >> 49 45 void ExN04SteppingVerbose::StepInfo() 50 void ExN04SteppingVerbose::StepInfo() 46 { 51 { 47 CopyState(); 52 CopyState(); 48 << 53 49 G4int prec = G4cout.precision(3); 54 G4int prec = G4cout.precision(3); 50 55 51 if (verboseLevel >= 1) { << 56 if( verboseLevel >= 1 ){ 52 if (verboseLevel >= 4) VerboseTrack(); << 57 if( verboseLevel >= 4 ) VerboseTrack(); 53 if (verboseLevel >= 3) { << 58 if( verboseLevel >= 3 ){ 54 G4cout << G4endl; << 59 G4cout << G4endl; 55 G4cout << std::setw(5) << "#Step#" << 60 G4cout << std::setw( 5) << "#Step#" << " " 56 << " " << std::setw(6) << "X" << 61 << std::setw( 6) << "X" << " " 57 << " " << std::setw(6) << "Y" << 62 << std::setw( 6) << "Y" << " " 58 << " " << std::setw(6) << "Z" << 63 << std::setw( 6) << "Z" << " " 59 << " " << std::setw(9) << "Kin << 64 << std::setw( 9) << "KineE" << " " 60 << " " << std::setw(9) << "dEStep << 65 << std::setw( 9) << "dEStep" << " " 61 << " " << std::setw(10) << "StepL << 66 << std::setw(10) << "StepLeng" 62 << "Volume" << 67 << std::setw(10) << "TrakLeng" 63 << " " << std::setw(10) << "Proc << 68 << std::setw(10) << "Volume" << " " 64 } << 69 << std::setw(10) << "Process" << G4endl; >> 70 } >> 71 >> 72 G4cout << std::setw(5) << fTrack->GetCurrentStepNumber() << " " >> 73 << std::setw(6) << G4BestUnit(fTrack->GetPosition().x(),"Length") >> 74 << std::setw(6) << G4BestUnit(fTrack->GetPosition().y(),"Length") >> 75 << std::setw(6) << G4BestUnit(fTrack->GetPosition().z(),"Length") >> 76 << std::setw(6) << G4BestUnit(fTrack->GetKineticEnergy(),"Energy") >> 77 << std::setw(6) << G4BestUnit(fStep->GetTotalEnergyDeposit(),"Energy") >> 78 << std::setw(6) << G4BestUnit(fStep->GetStepLength(),"Length") >> 79 << std::setw(6) << G4BestUnit(fTrack->GetTrackLength(),"Length") >> 80 << " "; 65 81 66 G4cout << std::setw(5) << fTrack->GetCurre << 82 // if( fStepStatus != fWorldBoundary){ 67 << G4BestUnit(fTrack->GetPosition() << 83 if( fTrack->GetNextVolume() != 0 ) { 68 << G4BestUnit(fTrack->GetPosition() << 69 << G4BestUnit(fTrack->GetPosition() << 70 << G4BestUnit(fTrack->GetKineticEne << 71 << G4BestUnit(fStep->GetTotalEnergy << 72 << G4BestUnit(fStep->GetStepLength( << 73 << G4BestUnit(fTrack->GetTrackLengt << 74 << 75 // if( fStepStatus != fWorldBoundary){ << 76 if (fTrack->GetNextVolume() != 0) { << 77 G4cout << std::setw(10) << fTrack->GetVo 84 G4cout << std::setw(10) << fTrack->GetVolume()->GetName(); 78 } << 85 } else { 79 else { << 80 G4cout << std::setw(10) << "OutOfWorld"; 86 G4cout << std::setw(10) << "OutOfWorld"; 81 } 87 } 82 88 83 if (fStep->GetPostStepPoint()->GetProcessD << 89 if(fStep->GetPostStepPoint()->GetProcessDefinedStep() != NULL){ 84 G4cout << " " << std::setw(10) << 90 G4cout << " " 85 << fStep->GetPostStepPoint()->Get << 91 << std::setw(10) << fStep->GetPostStepPoint()->GetProcessDefinedStep() 86 } << 92 ->GetProcessName(); 87 else { << 93 } else { 88 G4cout << " UserLimit"; 94 G4cout << " UserLimit"; 89 } 95 } 90 96 91 G4cout << G4endl; 97 G4cout << G4endl; 92 98 93 if (verboseLevel == 2) { << 99 if( verboseLevel == 2 ){ 94 G4int tN2ndariesTot = fN2ndariesAtRestDo << 100 G4int tN2ndariesTot = fN2ndariesAtRestDoIt + 95 if (tN2ndariesTot > 0) { << 101 fN2ndariesAlongStepDoIt + 96 G4cout << " :----- List of 2ndaries << 102 fN2ndariesPostStepDoIt; 97 << "#SpawnInStep=" << std::setw << 103 if(tN2ndariesTot>0){ 98 << fN2ndariesAtRestDoIt << ",Al << 104 G4cout << " :----- List of 2ndaries - " 99 << ",Post=" << std::setw(2) << << 105 << "#SpawnInStep=" << std::setw(3) << tN2ndariesTot 100 << "#SpawnTotal=" << std::setw( << 106 << "(Rest=" << std::setw(2) << fN2ndariesAtRestDoIt 101 << G4endl; << 107 << ",Along=" << std::setw(2) << fN2ndariesAlongStepDoIt 102 << 108 << ",Post=" << std::setw(2) << fN2ndariesPostStepDoIt 103 for (size_t lp1 = (*fSecondary).size() << 109 << "), " 104 G4cout << " : " << std::setw(6) << 110 << "#SpawnTotal=" << std::setw(3) << (*fSecondary).size() 105 << G4BestUnit((*fSecondary)[l << 111 << " ---------------" 106 << G4BestUnit((*fSecondary)[l << 112 << G4endl; 107 << G4BestUnit((*fSecondary)[l << 113 108 << G4BestUnit((*fSecondary)[l << 114 for(size_t lp1=(*fSecondary).size()-tN2ndariesTot; 109 << (*fSecondary)[lp1]->GetDef << 115 lp1<(*fSecondary).size(); lp1++){ 110 G4cout << G4endl; << 116 G4cout << " : " 111 } << 117 << std::setw(6) 112 << 118 << G4BestUnit((*fSecondary)[lp1]->GetPosition().x(),"Length") 113 G4cout << " :---------------------- << 119 << std::setw(6) 114 << "--------------------------- << 120 << G4BestUnit((*fSecondary)[lp1]->GetPosition().y(),"Length") 115 << "-- EndOf2ndaries Info ----- << 121 << std::setw(6) >> 122 << G4BestUnit((*fSecondary)[lp1]->GetPosition().z(),"Length") >> 123 << std::setw(6) >> 124 << G4BestUnit((*fSecondary)[lp1]->GetKineticEnergy(),"Energy") >> 125 << std::setw(10) >> 126 << (*fSecondary)[lp1]->GetDefinition()->GetParticleName(); >> 127 G4cout << G4endl; >> 128 } >> 129 >> 130 G4cout << " :-----------------------------" >> 131 << "----------------------------------" >> 132 << "-- EndOf2ndaries Info ---------------" >> 133 << G4endl; 116 } 134 } 117 } 135 } >> 136 118 } 137 } 119 G4cout.precision(prec); 138 G4cout.precision(prec); 120 } 139 } 121 140 122 //....oooOO0OOooo........oooOO0OOooo........oo 141 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... >> 142 123 void ExN04SteppingVerbose::TrackingStarted() 143 void ExN04SteppingVerbose::TrackingStarted() 124 { 144 { >> 145 125 CopyState(); 146 CopyState(); 126 G4int prec = G4cout.precision(3); << 147 G4int prec = G4cout.precision(3); 127 if (verboseLevel > 0) { << 148 if( verboseLevel > 0 ){ 128 G4cout << std::setw(5) << "Step#" << 149 129 << " " << std::setw(6) << "X" << 150 G4cout << std::setw( 5) << "Step#" << " " 130 << " " << std::setw(6) << "Y" << 151 << std::setw( 6) << "X" << " " 131 << " " << std::setw(6) << "Z" << 152 << std::setw( 6) << "Y" << " " 132 << " " << std::setw(9) << "KineE << 153 << std::setw( 6) << "Z" << " " 133 << " " << std::setw(9) << "dEStep" << 154 << std::setw( 9) << "KineE" << " " 134 << " " << std::setw(10) << "StepLen << 155 << std::setw( 9) << "dEStep" << " " 135 << "Volume" << 156 << std::setw(10) << "StepLeng" 136 << " " << std::setw(10) << "Proces << 157 << std::setw(10) << "TrakLeng" 137 << 158 << std::setw(10) << "Volume" << " " 138 G4cout << std::setw(5) << fTrack->GetCurre << 159 << std::setw(10) << "Process" << G4endl; 139 << G4BestUnit(fTrack->GetPosition() << 160 140 << G4BestUnit(fTrack->GetPosition() << 161 G4cout << std::setw(5) << fTrack->GetCurrentStepNumber() << " " 141 << G4BestUnit(fTrack->GetPosition() << 162 << std::setw(6) << G4BestUnit(fTrack->GetPosition().x(),"Length") 142 << G4BestUnit(fTrack->GetKineticEne << 163 << std::setw(6) << G4BestUnit(fTrack->GetPosition().y(),"Length") 143 << G4BestUnit(fStep->GetTotalEnergy << 164 << std::setw(6) << G4BestUnit(fTrack->GetPosition().z(),"Length") 144 << G4BestUnit(fStep->GetStepLength( << 165 << std::setw(6) << G4BestUnit(fTrack->GetKineticEnergy(),"Energy") 145 << G4BestUnit(fTrack->GetTrackLengt << 166 << std::setw(6) << G4BestUnit(fStep->GetTotalEnergyDeposit(),"Energy") >> 167 << std::setw(6) << G4BestUnit(fStep->GetStepLength(),"Length") >> 168 << std::setw(6) << G4BestUnit(fTrack->GetTrackLength(),"Length") >> 169 << " "; 146 170 147 if (fTrack->GetNextVolume()) { << 171 if(fTrack->GetNextVolume()){ 148 G4cout << std::setw(10) << fTrack->GetVo 172 G4cout << std::setw(10) << fTrack->GetVolume()->GetName(); 149 } << 173 } else { 150 else { << 151 G4cout << std::setw(10) << "OutOfWorld"; 174 G4cout << std::setw(10) << "OutOfWorld"; 152 } 175 } 153 G4cout << " initStep" << G4endl; << 176 G4cout << " initStep" << G4endl; 154 } 177 } 155 G4cout.precision(prec); 178 G4cout.precision(prec); 156 } 179 } >> 180 >> 181 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 157 182