Geant4  10.02.p03
F04SteppingAction Class Reference

#include <F04SteppingAction.hh>

Inheritance diagram for F04SteppingAction:
Collaboration diagram for F04SteppingAction:

Public Member Functions

 F04SteppingAction ()
 
virtual ~F04SteppingAction ()
 
virtual void UserSteppingAction (const G4Step *)
 
- Public Member Functions inherited from G4UserSteppingAction
 G4UserSteppingAction ()
 
virtual ~G4UserSteppingAction ()
 
void SetSteppingManagerPointer (G4SteppingManager *pValue)
 

Private Attributes

F04SteppingActionMessengerfSteppingMessenger
 
G4LogicalVolumefTargetVolume
 
G4LogicalVolumefTestPlaneVolume
 

Additional Inherited Members

- Protected Attributes inherited from G4UserSteppingAction
G4SteppingManagerfpSteppingManager
 

Detailed Description

Definition at line 43 of file F04SteppingAction.hh.

Constructor & Destructor Documentation

◆ F04SteppingAction()

F04SteppingAction::F04SteppingAction ( )

Definition at line 45 of file F04SteppingAction.cc.

◆ ~F04SteppingAction()

F04SteppingAction::~F04SteppingAction ( )
virtual

Definition at line 56 of file F04SteppingAction.cc.

57 {
58  delete fSteppingMessenger ;
59 }
F04SteppingActionMessenger * fSteppingMessenger

Member Function Documentation

◆ UserSteppingAction()

void F04SteppingAction::UserSteppingAction ( const G4Step *  theStep)
virtual

Reimplemented from G4UserSteppingAction.

Definition at line 63 of file F04SteppingAction.cc.

64 {
65  G4Track* theTrack = theStep->GetTrack();
66 
67  // Get pointers to test volumes (only once)
68  if ( ! fTargetVolume ) {
73  }
74 
75  if (theTrack->GetParentID()==0) {
76  //This is a primary track
77  G4LogicalVolume* theVolume
78  = theStep->GetPreStepPoint()->GetPhysicalVolume()->GetLogicalVolume();
79  if (theVolume != fTargetVolume) {
80  theTrack->SetTrackStatus(fStopAndKill);
81  return;
82  }
83  }
84 
85 // G4ParticleDefinition* particleType = theTrack->GetDefinition();
86 
87  // check if it is entering the test volume
88  G4StepPoint* thePrePoint = theStep->GetPreStepPoint();
89  G4VPhysicalVolume* thePrePV = thePrePoint->GetPhysicalVolume();
90  G4LogicalVolume* thePreLV = thePrePV->GetLogicalVolume();
91 
92  G4LogicalVolume* thePostLV = 0;
93  G4StepPoint* thePostPoint = theStep->GetPostStepPoint();
94 
95  if (thePostPoint) {
96  G4VPhysicalVolume* thePostPV = thePostPoint->GetPhysicalVolume();
97  if (thePostPV) thePostLV = thePostPV->GetLogicalVolume();
98  }
99 
100  if (thePostLV == fTestPlaneVolume &&
101  thePreLV != fTestPlaneVolume) {
102 
103 // G4double x = theTrack->GetPosition().x();
104 // G4double y = theTrack->GetPosition().y();
105 
106  G4ThreeVector theMomentumDirection = theTrack->
107  GetDynamicParticle()->GetMomentumDirection();
108 // G4double theTotalMomentum = theTrack->GetDynamicParticle()->
109 // GetTotalMomentum();
110 
111  // then kill the track
112  theTrack->SetTrackStatus(fStopAndKill);
113  return;
114 
115  }
116 
117 // G4double z = theTrack->GetPosition().z();
118 
119  F04UserTrackInformation* trackInformation =
120  (F04UserTrackInformation*)theTrack->GetUserInformation();
121 
122  if (trackInformation->GetTrackStatusFlag() != reverse) {
123  if (thePreLV != fTargetVolume ) {
124  if ( theTrack-> GetMomentumDirection().z()>0.0 &&
125  theTrack->GetVertexMomentumDirection().z()<0.0 )
126  {
127  trackInformation->SetTrackStatusFlag(reverse);
128  }
129  }
130  }
131 
132  // check if it is alive
133  if (theTrack->GetTrackStatus() == fAlive) { return; }
134 
135  if (thePostPoint->GetProcessDefinedStep() != 0) {
136  if (thePostPoint->GetProcessDefinedStep()->GetProcessName() != "Decay")
137  return;
138  }
139 
140 }
G4LogicalVolume * fTestPlaneVolume
G4LogicalVolume * fTargetVolume
G4LogicalVolume * GetVolume(const G4String &name, G4bool verbose=true) const
static G4LogicalVolumeStore * GetInstance()
TrackStatus GetTrackStatusFlag() const
void SetTrackStatusFlag(TrackStatus s)
G4LogicalVolume * GetLogicalVolume() const
Here is the call graph for this function:

Member Data Documentation

◆ fSteppingMessenger

F04SteppingActionMessenger* F04SteppingAction::fSteppingMessenger
private

Definition at line 54 of file F04SteppingAction.hh.

◆ fTargetVolume

G4LogicalVolume* F04SteppingAction::fTargetVolume
private

Definition at line 55 of file F04SteppingAction.hh.

◆ fTestPlaneVolume

G4LogicalVolume* F04SteppingAction::fTestPlaneVolume
private

Definition at line 56 of file F04SteppingAction.hh.


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