Geant4.10
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions
F04SteppingAction Class Reference

#include <F04SteppingAction.hh>

Inheritance diagram for F04SteppingAction:
G4UserSteppingAction

Public Member Functions

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

Additional Inherited Members

- Protected Attributes inherited from G4UserSteppingAction
G4SteppingManagerfpSteppingManager
 

Detailed Description

Definition at line 43 of file F04SteppingAction.hh.

Constructor & Destructor Documentation

F04SteppingAction::F04SteppingAction ( )

Definition at line 45 of file F04SteppingAction.cc.

47  fSteppingMessenger(0),
48  fTargetVolume(0),
49  fTestPlaneVolume(0)
50 {
51  fSteppingMessenger = new F04SteppingActionMessenger();
52 }
F04SteppingAction::~F04SteppingAction ( )
virtual

Definition at line 56 of file F04SteppingAction.cc.

57 {
58  delete fSteppingMessenger ;
59 }

Member Function Documentation

void F04SteppingAction::UserSteppingAction ( const G4Step theStep)
virtual

Reimplemented from G4UserSteppingAction.

Definition at line 63 of file F04SteppingAction.cc.

References fAlive, fStopAndKill, G4LogicalVolumeStore::GetInstance(), G4VPhysicalVolume::GetLogicalVolume(), G4Track::GetMomentumDirection(), G4Track::GetParentID(), G4StepPoint::GetPhysicalVolume(), G4Step::GetPostStepPoint(), G4Step::GetPreStepPoint(), G4StepPoint::GetProcessDefinedStep(), G4VProcess::GetProcessName(), G4Step::GetTrack(), G4Track::GetTrackStatus(), F04UserTrackInformation::GetTrackStatusFlag(), G4Track::GetUserInformation(), G4Track::GetVertexMomentumDirection(), G4LogicalVolumeStore::GetVolume(), reverse, G4Track::SetTrackStatus(), F04UserTrackInformation::SetTrackStatusFlag(), and CLHEP::Hep3Vector::z().

64 {
65  G4Track* theTrack = theStep->GetTrack();
66 
67  // Get pointers to test volumes (only once)
68  if ( ! fTargetVolume ) {
69  fTargetVolume
71  fTestPlaneVolume
73  }
74 
75  if (theTrack->GetParentID()==0) {
76  //This is a primary track
77  G4LogicalVolume* theVolume
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 =
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 }
void SetTrackStatus(const G4TrackStatus aTrackStatus)
G4int GetParentID() const
G4TrackStatus GetTrackStatus() const
G4LogicalVolume * GetVolume(const G4String &name, G4bool verbose=true) const
double z() const
G4VUserTrackInformation * GetUserInformation() const
G4StepPoint * GetPreStepPoint() const
G4VPhysicalVolume * GetPhysicalVolume() const
static G4LogicalVolumeStore * GetInstance()
const G4String & GetProcessName() const
Definition: G4VProcess.hh:408
const G4VProcess * GetProcessDefinedStep() const
const G4ThreeVector & GetMomentumDirection() const
G4LogicalVolume * GetLogicalVolume() const
void SetTrackStatusFlag(TrackStatus s)
G4StepPoint * GetPostStepPoint() const
TrackStatus GetTrackStatusFlag() const
G4Track * GetTrack() const
const G4ThreeVector & GetVertexMomentumDirection() const

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