#include <BesSteppingAction.hh>
Public Member Functions | |
BesSteppingAction () | |
~BesSteppingAction () | |
void | UserSteppingAction (const G4Step *) |
Definition at line 7 of file BesSteppingAction.hh.
BesSteppingAction::BesSteppingAction | ( | ) |
BesSteppingAction::~BesSteppingAction | ( | ) |
void BesSteppingAction::UserSteppingAction | ( | const G4Step * | ) |
Definition at line 17 of file BesSteppingAction.cc.
References abs.
00018 { 00019 00020 G4StepPoint* postStep = currentStep->GetPostStepPoint(); 00021 G4ThreeVector currentPosition = postStep->GetPosition(); 00022 G4Track* currentTrack = currentStep->GetTrack(); 00023 if(std::abs(currentPosition.x()) > 263.5*cm|| 00024 std::abs(currentPosition.y()) > 263.5*cm|| 00025 std::abs(currentPosition.z()) > 287.5*cm){ 00026 G4cout<<"Out of World!!!"<<G4endl; 00027 currentTrack->SetTrackStatus(fKillTrackAndSecondaries); 00028 }else if(currentTrack->GetCurrentStepNumber()>=20000){ 00029 G4cout<<"StepNumber>=20000 !!!"<<G4endl; 00030 currentTrack->SetTrackStatus(fKillTrackAndSecondaries); 00031 } 00032 /* G4cout.precision(15); 00033 G4cout<<"#Step# "<<currentTrack->GetCurrentStepNumber()<<" pName "<<currentTrack->GetDefinition()->GetParticleName()<<" prex prey prez "<<currentStep->GetPreStepPoint()->GetPosition().x()/mm<<" "<<currentStep->GetPreStepPoint()->GetPosition().y()/mm<<" "<<currentStep->GetPreStepPoint()->GetPosition().z()/mm<<G4endl; 00034 G4cout<<"prepx prepy prepz "<<currentStep->GetPreStepPoint()->GetMomentum().x()/GeV<<" "<<currentStep->GetPreStepPoint()->GetMomentum().y()/GeV<<" "<<currentStep->GetPreStepPoint()->GetMomentum().z()/GeV<<G4endl; 00035 G4cout<<"post step postx posty postz "<<postStep->GetPosition().x()/mm<<" "<<postStep->GetPosition().y()/mm<<" "<<postStep->GetPosition().z()/mm<<G4endl; 00036 G4cout<<"postpx postpy postpz "<<postStep->GetMomentum().x()/GeV<<" "<<postStep->GetMomentum().y()/GeV<<" "<<postStep->GetMomentum().z()/GeV<<G4endl; 00037 G4cout << G4endl; 00038 G4cout << std::setw( 5) << "#Step#" << " " 00039 << std::setw( 9) << "pName" << " " 00040 << std::setw( 6) << "X" << " " 00041 << std::setw( 6) << "Y" << " " 00042 << std::setw( 6) << "Z" << " " 00043 << std::setw( 9) << "KineE" << " " 00044 << std::setw( 9) << "dEStep" << " " 00045 << std::setw(10) << "StepLeng" 00046 << std::setw(10) << "Volume" << " " 00047 << std::setw(10) << "Process" 00048 << G4endl; 00049 00050 00051 G4cout << std::setw(5) << currentTrack->GetCurrentStepNumber() << " " 00052 << std::setw(9) << currentTrack->GetDefinition()->GetParticleName() 00053 << std::setw(6) << G4BestUnit(currentTrack->GetPosition().x(),"Length") 00054 << std::setw(6) << G4BestUnit(currentTrack->GetPosition().y(),"Length") 00055 << std::setw(6) << G4BestUnit(currentTrack->GetPosition().z(),"Length") 00056 << std::setw(6) << G4BestUnit(currentTrack->GetKineticEnergy(),"Energy") 00057 << std::setw(6) << G4BestUnit(currentStep->GetTotalEnergyDeposit(),"Energy") 00058 << std::setw(6) << G4BestUnit(currentStep->GetStepLength(),"Length"); 00059 if( currentTrack->GetNextVolume() != 0 ) { 00060 G4cout << std::setw(10) << currentTrack->GetVolume()->GetName(); 00061 } else { 00062 G4cout << std::setw(10) << "OutOfWorld"; 00063 } 00064 00065 if(currentStep->GetPostStepPoint()->GetProcessDefinedStep() != NULL){ 00066 G4cout << " " 00067 << std::setw(10) << currentStep->GetPostStepPoint()->GetProcessDefinedStep() 00068 ->GetProcessName(); 00069 } else { 00070 G4cout << " UserLimit"; 00071 } 00072 00073 G4cout << G4endl; 00074 HepRandom::showEngineStatus(); 00075 */ 00076 }