Geant4  10.02.p03
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 ()
 
void SetSteppingManagerPointer (G4SteppingManager *pValue)
 

Private Attributes

CexmcPhysicsManagerphysicsManager
 
const G4LogicalVolumetargetVolume
 

Additional Inherited Members

- Protected Attributes inherited from G4UserSteppingAction
G4SteppingManagerfpSteppingManager
 

Detailed Description

Definition at line 54 of file CexmcSteppingAction.hh.

Constructor & Destructor Documentation

◆ CexmcSteppingAction()

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
CexmcPhysicsManager * physicsManager
const G4LogicalVolume * targetVolume
Here is the call graph for this function:

Member Function Documentation

◆ UserSteppingAction()

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  {
93  theTrackInfo->ActivateStudiedProcess();
94  }
95 
96  if ( stepStatus != fGeomBoundary )
97  {
98  if ( theTrackInfo->NeedsTrackLengthResampling() )
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 }
virtual void ResampleTrackLengthInTarget(const G4Track *track, const G4StepPoint *stepPoint=NULL)=0
CexmcPhysicsManager * physicsManager
const G4LogicalVolume * targetVolume
Here is the call graph for this function:

Member Data Documentation

◆ physicsManager

CexmcPhysicsManager* CexmcSteppingAction::physicsManager
private

Definition at line 63 of file CexmcSteppingAction.hh.

◆ targetVolume

const G4LogicalVolume* CexmcSteppingAction::targetVolume
private

Definition at line 65 of file CexmcSteppingAction.hh.


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