3 #include <fwk/CentralConfig.h>
4 #include <utl/ErrorLogger.h>
5 #include <utl/Reader.h>
6 #include <utl/MathConstants.h>
9 #include <G4SteppingManager.hh>
12 #include <G4StepPoint.hh>
13 #include <G4TrackStatus.hh>
14 #include <G4VPhysicalVolume.hh>
15 #include <G4ParticleDefinition.hh>
16 #include <G4ParticleTypes.hh>
23 using namespace GroundPropagatorAG;
25 SteppingAction::SteppingAction (
double depth ){
29 SteppingAction::~SteppingAction ( ){;}
31 void SteppingAction::UserSteppingAction (
const G4Step * theStep )
34 G4Track * theTrack = theStep->GetTrack ( );
36 G4StepPoint * thePostPoint = theStep->GetPostStepPoint ( );
37 G4VPhysicalVolume * thePostPV = thePostPoint->GetPhysicalVolume ( );
38 G4ParticleDefinition * particleType = theTrack->GetDefinition ( );
40 G4String process =
"Undefined";
41 if ( thePostPoint->GetProcessDefinedStep() != NULL)
42 process = thePostPoint->GetProcessDefinedStep()->GetProcessName();
46 G4double x = theStep->GetPostStepPoint()->GetPosition().x();
47 G4double y = theStep->GetPostStepPoint()->GetPosition().y();
48 G4double z = theStep->GetPostStepPoint()->GetPosition().z();
49 G4VPhysicalVolume *thePrePV = theStep->GetPreStepPoint ( )->GetPhysicalVolume ( );
50 string prePVName = string (thePrePV->GetName());
51 string postPVName =
"OutOfWorld";
54 if( prePVName ==
"SoilPhys"&& fabs(fDepth+z)< 1e-5 ) {
55 G4int trackid = theTrack->GetTrackID();
69 fPData.Pname = particleType->GetParticleName();
70 fPData.PDGCode = particleType->GetPDGEncoding();
71 fPData.TrackID = trackid;
75 fPData.px = theStep->GetPreStepPoint()->GetMomentumDirection().x();
76 fPData.py = theStep->GetPreStepPoint()->GetMomentumDirection().y();
77 fPData.pz = theStep->GetPreStepPoint()->GetMomentumDirection().z();
78 fPData.KinE = theStep->GetPreStepPoint()->GetKineticEnergy();
79 fPData.Time = theStep->GetPreStepPoint()->GetGlobalTime();
81 fPartColl.push_back( fPData );