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

#include <MCTruthTrackingAction.hh>

Inheritance diagram for MCTruthTrackingAction:
Collaboration diagram for MCTruthTrackingAction:

Public Member Functions

 MCTruthTrackingAction ()
 
virtual ~MCTruthTrackingAction ()
 
void PreUserTrackingAction (const G4Track *)
 
void PostUserTrackingAction (const G4Track *)
 
- Public Member Functions inherited from G4UserTrackingAction
 G4UserTrackingAction ()
 
virtual ~G4UserTrackingAction ()
 
virtual void SetTrackingManagerPointer (G4TrackingManager *pValue)
 

Additional Inherited Members

- Protected Attributes inherited from G4UserTrackingAction
G4TrackingManagerfpTrackingManager
 

Detailed Description

Definition at line 47 of file MCTruthTrackingAction.hh.

Constructor & Destructor Documentation

MCTruthTrackingAction::MCTruthTrackingAction ( )

Definition at line 53 of file MCTruthTrackingAction.cc.

54 {}
MCTruthTrackingAction::~MCTruthTrackingAction ( )
virtual

Definition at line 58 of file MCTruthTrackingAction.cc.

59 {}

Member Function Documentation

void MCTruthTrackingAction::PostUserTrackingAction ( const G4Track track)
virtual

Reimplemented from G4UserTrackingAction.

Definition at line 76 of file MCTruthTrackingAction.cc.

77 {
78 
79  G4LorentzVector prodpos(track->GetGlobalTime() - track->GetLocalTime(),
80  track->GetVertexPosition());
81  G4LorentzVector endpos(track->GetGlobalTime(), track->GetPosition());
82 
83  // here (?) make all different checks to decide whether to store the particle
84  //
85  if (TrackToBeStored(track))
86  {
89 
91  AddParticle(fmom, prodpos, endpos,
92  track->GetDefinition()->GetPDGEncoding(),
93  track->GetTrackID(),
94  track->GetParentID(), mcinf->GetDirectParent());
95  }
96  else
97  {
98  // If track is not to be stored, propagate it's parent ID (stored)
99  // to its secondaries
100  //
102 
103  for( unsigned int index = 0 ; index < childrens->size() ; ++index )
104  {
105  G4Track* tr = (*childrens)[index] ;
106  tr->SetParentID( track->GetParentID() );
107 
108  // set the flag saying that the direct mother is not stored
109  //
110  MCTruthTrackInformation* mcinf =
112  if(!mcinf)
114 
115  mcinf->SetDirectParent(false);
116  }
117  }
118 }
G4ParticleDefinition * GetDefinition() const
G4TrackingManager * fpTrackingManager
G4int GetParentID() const
static MCTruthManager * GetInstance()
G4double GetLocalTime() const
const G4ThreeVector & GetPosition() const
G4VUserTrackInformation * GetUserInformation() const
void SetDirectParent(G4bool value)
G4TrackVector * GimmeSecondaries() const
G4int GetTrackID() const
G4double GetGlobalTime() const
const G4ThreeVector & GetVertexPosition() const
void SetUserInformation(G4VUserTrackInformation *aValue) const
std::vector< G4Track * > G4TrackVector
void SetParentID(const G4int aValue)

Here is the call graph for this function:

void MCTruthTrackingAction::PreUserTrackingAction ( const G4Track track)
virtual

Reimplemented from G4UserTrackingAction.

Definition at line 63 of file MCTruthTrackingAction.cc.

64 {
65  fmom = G4LorentzVector(track->GetMomentum(), track->GetTotalEnergy());
66 
67  if(!track->GetUserInformation())
68  {
71  }
72 }
G4TrackingManager * fpTrackingManager
void SetUserTrackInformation(G4VUserTrackInformation *aValue)
G4VUserTrackInformation * GetUserInformation() const
G4ThreeVector GetMomentum() const
G4double GetTotalEnergy() const
CLHEP::HepLorentzVector G4LorentzVector

Here is the call graph for this function:


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