Geant4  10.02.p03
CexmcTrackingAction Class Reference

#include <CexmcTrackingAction.hh>

Inheritance diagram for CexmcTrackingAction:
Collaboration diagram for CexmcTrackingAction:

Public Member Functions

 CexmcTrackingAction (CexmcPhysicsManager *physicsManager)
 
void PreUserTrackingAction (const G4Track *track)
 
void BeginOfEventAction (void)
 
- Public Member Functions inherited from G4UserTrackingAction
 G4UserTrackingAction ()
 
virtual ~G4UserTrackingAction ()
 
void SetTrackingManagerPointer (G4TrackingManager *pValue)
 
virtual void PostUserTrackingAction (const G4Track *)
 

Private Member Functions

void ResetOutputParticleTrackId (void)
 
void ResetOutputParticleDecayProductCopyNumber (void)
 
void SetupIncidentParticleTrackInfo (const G4Track *track)
 

Private Attributes

CexmcPhysicsManagerphysicsManager
 
const G4LogicalVolumetargetVolume
 
G4int outputParticleTrackId
 
G4int outputParticleDecayProductCopyNumber
 
G4ParticleDefinitionincidentParticle
 
G4ParticleDefinitionoutputParticle
 
G4ParticleDefinitionnucleusOutputParticle
 

Additional Inherited Members

- Protected Attributes inherited from G4UserTrackingAction
G4TrackingManagerfpTrackingManager
 

Detailed Description

Definition at line 56 of file CexmcTrackingAction.hh.

Constructor & Destructor Documentation

◆ CexmcTrackingAction()

CexmcTrackingAction::CexmcTrackingAction ( CexmcPhysicsManager physicsManager)
explicit

Definition at line 58 of file CexmcTrackingAction.cc.

59  :
60  physicsManager( physicsManager ), targetVolume( NULL ),
63  outputParticle( NULL ), nucleusOutputParticle( NULL )
64 {
65  CexmcProductionModel * productionModel(
66  physicsManager->GetProductionModel() );
67  if ( ! productionModel )
69 
70  incidentParticle = productionModel->GetIncidentParticle();
71  outputParticle = productionModel->GetOutputParticle();
72  nucleusOutputParticle = productionModel->GetNucleusOutputParticle();
73 
76 
77  G4RunManager * runManager( G4RunManager::GetRunManager() );
78  const CexmcSetup * setup( static_cast< const CexmcSetup * >(
79  runManager->GetUserDetectorConstruction() ) );
80  targetVolume = setup->GetVolume( CexmcSetup::Target );
81 }
G4ParticleDefinition * nucleusOutputParticle
G4ParticleDefinition * incidentParticle
const G4int CexmcInvalidTrackId(-1)
const G4LogicalVolume * targetVolume
G4ParticleDefinition * outputParticle
static G4RunManager * GetRunManager()
Definition: G4RunManager.cc:79
CexmcPhysicsManager * physicsManager
virtual CexmcProductionModel * GetProductionModel(void)=0
Here is the call graph for this function:

Member Function Documentation

◆ BeginOfEventAction()

void CexmcTrackingAction::BeginOfEventAction ( void  )
inline

Definition at line 104 of file CexmcTrackingAction.hh.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ PreUserTrackingAction()

void CexmcTrackingAction::PreUserTrackingAction ( const G4Track *  track)
virtual

Reimplemented from G4UserTrackingAction.

Definition at line 84 of file CexmcTrackingAction.cc.

85 {
86  CexmcTrackInfo * trackInfo( static_cast< CexmcTrackInfo * >(
87  track->GetUserInformation() ) );
88 
89  if ( trackInfo )
90  return;
91 
92  G4Track * theTrack( const_cast< G4Track * >( track ) );
93 
94  do
95  {
96  if ( track->GetParentID() == 0 )
97  {
98  if ( *track->GetDefinition() == *incidentParticle )
99  {
100  trackInfo = new CexmcIncidentParticleTrackInfo(
102  theTrack->SetUserInformation( trackInfo );
104  }
105  else
106  {
107  trackInfo = new CexmcTrackInfo( CexmcBeamParticleTrack );
108  }
109  break;
110  }
111 
112  if ( track->GetCreatorProcess()->GetProcessName() ==
114  {
115  do
116  {
117  if ( *track->GetDefinition() == *outputParticle )
118  {
119  outputParticleTrackId = track->GetTrackID();
120  trackInfo = new CexmcTrackInfo( CexmcOutputParticleTrack );
121  break;
122  }
123  if ( *track->GetDefinition() == *nucleusOutputParticle )
124  {
125  trackInfo = new CexmcTrackInfo( CexmcNucleusParticleTrack );
126  break;
127  }
128  } while ( false );
129  break;
130  }
131 
132  if ( track->GetParentID() == outputParticleTrackId )
133  {
134  trackInfo = new CexmcTrackInfo(
137  break;
138  }
139 
140  if ( *track->GetDefinition() == *incidentParticle )
141  {
143  break;
145  theTrack->SetUserInformation( trackInfo );
147  break;
148  }
149  } while ( false );
150 
151  if ( ! trackInfo )
152  return;
153 
154  if ( ! track->GetUserInformation() )
155  theTrack->SetUserInformation( trackInfo );
156 }
G4ParticleDefinition * nucleusOutputParticle
G4ParticleDefinition * incidentParticle
void SetupIncidentParticleTrackInfo(const G4Track *track)
G4ParticleDefinition * outputParticle
CexmcPhysicsManager * physicsManager
G4bool OnlyBeamParticleCanTriggerStudiedProcess(void) const
const G4String CexmcStudiedProcessFullName(CexmcStudiedProcessFirstName+CexmcStudiedProcessLastName)
Here is the call graph for this function:

◆ ResetOutputParticleDecayProductCopyNumber()

void CexmcTrackingAction::ResetOutputParticleDecayProductCopyNumber ( void  )
inlineprivate

Definition at line 97 of file CexmcTrackingAction.hh.

99 {
101 }
Here is the caller graph for this function:

◆ ResetOutputParticleTrackId()

void CexmcTrackingAction::ResetOutputParticleTrackId ( void  )
inlineprivate

Definition at line 91 of file CexmcTrackingAction.hh.

92 {
94 }
const G4int CexmcInvalidTrackId(-1)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ SetupIncidentParticleTrackInfo()

void CexmcTrackingAction::SetupIncidentParticleTrackInfo ( const G4Track *  track)
private

Definition at line 159 of file CexmcTrackingAction.cc.

161 {
162  CexmcIncidentParticleTrackInfo * trackInfo(
163  static_cast< CexmcIncidentParticleTrackInfo * >(
164  track->GetUserInformation() ) );
165 
166  if ( ! trackInfo )
167  return;
168 
169  G4VPhysicalVolume * volume( track->GetVolume() );
170 
171  if ( volume && volume->GetLogicalVolume() == targetVolume )
172  {
174  trackInfo->ActivateStudiedProcess();
175  }
176 }
const G4LogicalVolume * targetVolume
virtual void ResampleTrackLengthInTarget(const G4Track *track, const G4StepPoint *stepPoint=NULL)=0
CexmcPhysicsManager * physicsManager
Here is the call graph for this function:
Here is the caller graph for this function:

Member Data Documentation

◆ incidentParticle

G4ParticleDefinition* CexmcTrackingAction::incidentParticle
private

Definition at line 83 of file CexmcTrackingAction.hh.

◆ nucleusOutputParticle

G4ParticleDefinition* CexmcTrackingAction::nucleusOutputParticle
private

Definition at line 87 of file CexmcTrackingAction.hh.

◆ outputParticle

G4ParticleDefinition* CexmcTrackingAction::outputParticle
private

Definition at line 85 of file CexmcTrackingAction.hh.

◆ outputParticleDecayProductCopyNumber

G4int CexmcTrackingAction::outputParticleDecayProductCopyNumber
private

Definition at line 80 of file CexmcTrackingAction.hh.

◆ outputParticleTrackId

G4int CexmcTrackingAction::outputParticleTrackId
private

Definition at line 78 of file CexmcTrackingAction.hh.

◆ physicsManager

CexmcPhysicsManager* CexmcTrackingAction::physicsManager
private

Definition at line 74 of file CexmcTrackingAction.hh.

◆ targetVolume

const G4LogicalVolume* CexmcTrackingAction::targetVolume
private

Definition at line 76 of file CexmcTrackingAction.hh.


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