Geant4  10.03.p03
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
CexmcSteppingAction Class Reference

#include <CexmcSteppingAction.hh>

Inheritance diagram for CexmcSteppingAction:
Collaboration diagram for CexmcSteppingAction:

Public Member Functions

 CexmcSteppingAction (CexmcPhysicsManager *physicsManager)
 
void UserSteppingAction (const G4Step *step)
 
- Public Member Functions inherited from G4UserSteppingAction
 G4UserSteppingAction ()
 
virtual ~G4UserSteppingAction ()
 
virtual void SetSteppingManagerPointer (G4SteppingManager *pValue)
 

Additional Inherited Members

- Protected Attributes inherited from G4UserSteppingAction
G4SteppingManagerfpSteppingManager
 

Detailed Description

Definition at line 54 of file CexmcSteppingAction.hh.

Constructor & Destructor Documentation

CexmcSteppingAction::CexmcSteppingAction ( CexmcPhysicsManager physicsManager)
explicit

Definition at line 59 of file CexmcSteppingAction.cc.

60  :
61  physicsManager( physicsManager ), targetVolume( NULL )
62 {
63  G4RunManager * runManager( G4RunManager::GetRunManager() );
64  const CexmcSetup * setup( static_cast< const CexmcSetup * >(
65  runManager->GetUserDetectorConstruction() ) );
66  targetVolume = setup->GetVolume( CexmcSetup::Target );
67 }
static G4RunManager * GetRunManager()
Definition: G4RunManager.cc:79

Here is the call graph for this function:

Member Function Documentation

void CexmcSteppingAction::UserSteppingAction ( const G4Step step)
virtual

Reimplemented from G4UserSteppingAction.

Definition at line 70 of file CexmcSteppingAction.cc.

71 {
72  G4Track * track( step->GetTrack() );
73  CexmcTrackInfo * trackInfo( static_cast< CexmcTrackInfo * >(
74  track->GetUserInformation() ) );
75 
76  if ( ! trackInfo ||
77  trackInfo->GetTypeInfo() != CexmcIncidentParticleTrackType )
78  return;
79 
80  CexmcIncidentParticleTrackInfo * theTrackInfo(
81  static_cast< CexmcIncidentParticleTrackInfo * >( trackInfo ) );
82 
83  G4StepPoint * postStepPoint( step->GetPostStepPoint() );
84  G4StepStatus stepStatus( postStepPoint->GetStepStatus() );
85  const G4VTouchable * touchable( postStepPoint->GetTouchable() );
86  G4VPhysicalVolume * volume( touchable->GetVolume() );
87 
88  if ( volume && volume->GetLogicalVolume() == targetVolume )
89  {
90  if ( ! theTrackInfo->IsStudiedProcessActivated() )
91  {
92  physicsManager->ResampleTrackLengthInTarget( track, postStepPoint );
93  theTrackInfo->ActivateStudiedProcess();
94  }
95 
96  if ( stepStatus != fGeomBoundary )
97  {
98  if ( theTrackInfo->NeedsTrackLengthResampling() )
99  physicsManager->ResampleTrackLengthInTarget(
100  track, postStepPoint );
101  else
102  theTrackInfo->AddTrackLengthInTarget( step->GetStepLength() );
103  }
104  }
105 
106  G4StepPoint * preStepPoint( step->GetPreStepPoint() );
107  touchable = preStepPoint->GetTouchable();
108  volume = touchable->GetVolume();
109 
110  if ( volume && volume->GetLogicalVolume() == targetVolume )
111  {
112  if ( stepStatus == fGeomBoundary )
113  theTrackInfo->ActivateStudiedProcess( false );
114  }
115 }
G4double GetStepLength() const
const G4VTouchable * GetTouchable() const
G4StepStatus
Definition: G4StepStatus.hh:49
G4StepPoint * GetPreStepPoint() const
virtual G4VPhysicalVolume * GetVolume(G4int depth=0) const
Definition: G4VTouchable.cc:44
G4StepPoint * GetPostStepPoint() const
virtual void ResampleTrackLengthInTarget(const G4Track *track, const G4StepPoint *stepPoint=NULL)=0
G4Track * GetTrack() const

Here is the call graph for this function:


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