Geant4  10.03.p03
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
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 ()
 
virtual void SetTrackingManagerPointer (G4TrackingManager *pValue)
 
virtual void PostUserTrackingAction (const G4Track *)
 

Additional Inherited Members

- Protected Attributes inherited from G4UserTrackingAction
G4TrackingManagerfpTrackingManager
 

Detailed Description

Definition at line 56 of file CexmcTrackingAction.hh.

Constructor & Destructor Documentation

CexmcTrackingAction::CexmcTrackingAction ( CexmcPhysicsManager physicsManager)
explicit

Definition at line 58 of file CexmcTrackingAction.cc.

59  :
60  physicsManager( physicsManager ), targetVolume( NULL ),
61  outputParticleTrackId( CexmcInvalidTrackId ),
62  outputParticleDecayProductCopyNumber( 0 ), incidentParticle( 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 
74  if ( ! incidentParticle || ! outputParticle || ! nucleusOutputParticle )
76 
77  G4RunManager * runManager( G4RunManager::GetRunManager() );
78  const CexmcSetup * setup( static_cast< const CexmcSetup * >(
79  runManager->GetUserDetectorConstruction() ) );
80  targetVolume = setup->GetVolume( CexmcSetup::Target );
81 }
const G4int CexmcInvalidTrackId(-1)
static G4RunManager * GetRunManager()
Definition: G4RunManager.cc:79
virtual CexmcProductionModel * GetProductionModel(void)=0

Here is the call graph for this function:

Member Function Documentation

void CexmcTrackingAction::BeginOfEventAction ( void  )
inline

Definition at line 104 of file CexmcTrackingAction.hh.

105 {
106  ResetOutputParticleTrackId();
107  ResetOutputParticleDecayProductCopyNumber();
108 }

Here is the caller graph for this function:

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 );
103  SetupIncidentParticleTrackInfo( track );
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(
136  outputParticleDecayProductCopyNumber++ );
137  break;
138  }
139 
140  if ( *track->GetDefinition() == *incidentParticle )
141  {
142  if ( physicsManager->OnlyBeamParticleCanTriggerStudiedProcess() )
143  break;
145  theTrack->SetUserInformation( trackInfo );
146  SetupIncidentParticleTrackInfo( track );
147  break;
148  }
149  } while ( false );
150 
151  if ( ! trackInfo )
152  return;
153 
154  if ( ! track->GetUserInformation() )
155  theTrack->SetUserInformation( trackInfo );
156 }
G4bool OnlyBeamParticleCanTriggerStudiedProcess(void) const
G4ParticleDefinition * GetDefinition() const
G4int GetParentID() const
G4VUserTrackInformation * GetUserInformation() const
const G4VProcess * GetCreatorProcess() const
G4int GetTrackID() const
const G4String & GetProcessName() const
Definition: G4VProcess.hh:408
const G4String CexmcStudiedProcessFullName(CexmcStudiedProcessFirstName+CexmcStudiedProcessLastName)

Here is the call graph for this function:


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