BOSS 7.1.2
BESIII Offline Software System
Loading...
Searching...
No Matches
BesSteppingAction Class Reference

#include <BesSteppingAction.hh>

+ Inheritance diagram for BesSteppingAction:

Public Member Functions

 BesSteppingAction ()
 
 ~BesSteppingAction ()
 
void UserSteppingAction (const G4Step *)
 

Detailed Description

Definition at line 7 of file BesSteppingAction.hh.

Constructor & Destructor Documentation

◆ BesSteppingAction()

BesSteppingAction::BesSteppingAction ( )

Definition at line 11 of file BesSteppingAction.cc.

12{ }

◆ ~BesSteppingAction()

BesSteppingAction::~BesSteppingAction ( )

Definition at line 14 of file BesSteppingAction.cc.

15{ }

Member Function Documentation

◆ UserSteppingAction()

void BesSteppingAction::UserSteppingAction ( const G4Step * currentStep)

Definition at line 18 of file BesSteppingAction.cc.

19{
20
21 G4StepPoint* postStep = currentStep->GetPostStepPoint();
22 G4ThreeVector currentPosition = postStep->GetPosition();
23 G4Track* currentTrack = currentStep->GetTrack();
24 if(std::abs(currentPosition.x()) > 263.5*cm||
25 std::abs(currentPosition.y()) > 263.5*cm||
26 std::abs(currentPosition.z()) > 287.5*cm){
27 G4cout<<"Out of World!!!"<<G4endl;
28 currentTrack->SetTrackStatus(fKillTrackAndSecondaries);
29 }else if(currentTrack->GetCurrentStepNumber()>=20000){
30 G4cout<<"StepNumber>=20000 !!!"<<G4endl;
31 currentTrack->SetTrackStatus(fKillTrackAndSecondaries);
32 }
33/* G4cout.precision(15);
34 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;
35 G4cout<<"prepx prepy prepz "<<currentStep->GetPreStepPoint()->GetMomentum().x()/GeV<<" "<<currentStep->GetPreStepPoint()->GetMomentum().y()/GeV<<" "<<currentStep->GetPreStepPoint()->GetMomentum().z()/GeV<<G4endl;
36 G4cout<<"post step postx posty postz "<<postStep->GetPosition().x()/mm<<" "<<postStep->GetPosition().y()/mm<<" "<<postStep->GetPosition().z()/mm<<G4endl;
37 G4cout<<"postpx postpy postpz "<<postStep->GetMomentum().x()/GeV<<" "<<postStep->GetMomentum().y()/GeV<<" "<<postStep->GetMomentum().z()/GeV<<G4endl;
38 G4cout << G4endl;
39 G4cout << std::setw( 5) << "#Step#" << " "
40 << std::setw( 9) << "pName" << " "
41 << std::setw( 6) << "X" << " "
42 << std::setw( 6) << "Y" << " "
43 << std::setw( 6) << "Z" << " "
44 << std::setw( 9) << "KineE" << " "
45 << std::setw( 9) << "dEStep" << " "
46 << std::setw(10) << "StepLeng"
47 << std::setw(10) << "Volume" << " "
48 << std::setw(10) << "Process"
49 << G4endl;
50
51
52 G4cout << std::setw(5) << currentTrack->GetCurrentStepNumber() << " "
53 << std::setw(9) << currentTrack->GetDefinition()->GetParticleName()
54 << std::setw(6) << G4BestUnit(currentTrack->GetPosition().x(),"Length")
55 << std::setw(6) << G4BestUnit(currentTrack->GetPosition().y(),"Length")
56 << std::setw(6) << G4BestUnit(currentTrack->GetPosition().z(),"Length")
57 << std::setw(6) << G4BestUnit(currentTrack->GetKineticEnergy(),"Energy")
58 << std::setw(6) << G4BestUnit(currentStep->GetTotalEnergyDeposit(),"Energy")
59 << std::setw(6) << G4BestUnit(currentStep->GetStepLength(),"Length");
60 if( currentTrack->GetNextVolume() != 0 ) {
61 G4cout << std::setw(10) << currentTrack->GetVolume()->GetName();
62 } else {
63 G4cout << std::setw(10) << "OutOfWorld";
64 }
65
66 if(currentStep->GetPostStepPoint()->GetProcessDefinedStep() != NULL){
67 G4cout << " "
68 << std::setw(10) << currentStep->GetPostStepPoint()->GetProcessDefinedStep()
69 ->GetProcessName();
70 } else {
71 G4cout << " UserLimit";
72 }
73
74 G4cout << G4endl;
75 HepRandom::showEngineStatus();
76*/
77}

The documentation for this class was generated from the following files: