Geant4.10
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions
MCTruthTrackingAction Class Reference

#include <MCTruthTrackingAction.hh>

Inheritance diagram for MCTruthTrackingAction:
G4UserTrackingAction

Public Member Functions

 MCTruthTrackingAction ()
 
virtual ~MCTruthTrackingAction ()
 
void PreUserTrackingAction (const G4Track *)
 
void PostUserTrackingAction (const G4Track *)
 
- Public Member Functions inherited from G4UserTrackingAction
 G4UserTrackingAction ()
 
virtual ~G4UserTrackingAction ()
 
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 49 of file MCTruthTrackingAction.cc.

50 {}
MCTruthTrackingAction::~MCTruthTrackingAction ( )
virtual

Definition at line 52 of file MCTruthTrackingAction.cc.

53 {}

Member Function Documentation

void MCTruthTrackingAction::PostUserTrackingAction ( const G4Track track)
virtual

Reimplemented from G4UserTrackingAction.

Definition at line 66 of file MCTruthTrackingAction.cc.

References G4UserTrackingAction::fpTrackingManager, G4Track::GetDefinition(), MCTruthTrackInformation::GetDirectParent(), G4Track::GetGlobalTime(), MCTruthManager::GetInstance(), G4Track::GetLocalTime(), G4Track::GetParentID(), G4ParticleDefinition::GetPDGEncoding(), G4Track::GetPosition(), G4Track::GetTrackID(), G4Track::GetUserInformation(), G4Track::GetVertexPosition(), G4TrackingManager::GimmeSecondaries(), MCTruthTrackInformation::SetDirectParent(), G4Track::SetParentID(), and G4Track::SetUserInformation().

67 {
68 
69  G4LorentzVector prodpos(track->GetGlobalTime() - track->GetLocalTime(),
70  track->GetVertexPosition());
71  G4LorentzVector endpos(track->GetGlobalTime(), track->GetPosition());
72 
73  // here (?) make all different checks to decide whether to store the particle
74  //
75  if (trackToBeStored(track))
76  {
79 
81  AddParticle(fmom, prodpos, endpos,
82  track->GetDefinition()->GetPDGEncoding(),
83  track->GetTrackID(),
84  track->GetParentID(), mcinf->GetDirectParent());
85  }
86  else
87  {
88  // If track is not to be stored, propagate it's parent ID (stored)
89  // to its secondaries
90  //
92 
93  for( unsigned int index = 0 ; index < childrens->size() ; ++index )
94  {
95  G4Track* tr = (*childrens)[index] ;
96  tr->SetParentID( track->GetParentID() );
97 
98  // set the flag saying that the direct mother is not stored
99  //
100  MCTruthTrackInformation* mcinf =
102  if(!mcinf)
104 
105  mcinf->SetDirectParent(false);
106  }
107  }
108 }
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
std::vector< G4Track * > G4TrackVector
void SetParentID(const G4int aValue)
void SetUserInformation(G4VUserTrackInformation *aValue)
void MCTruthTrackingAction::PreUserTrackingAction ( const G4Track track)
virtual

Reimplemented from G4UserTrackingAction.

Definition at line 55 of file MCTruthTrackingAction.cc.

References G4UserTrackingAction::fpTrackingManager, G4Track::GetMomentum(), G4Track::GetTotalEnergy(), G4Track::GetUserInformation(), and G4TrackingManager::SetUserTrackInformation().

56 {
57  fmom = G4LorentzVector(track->GetMomentum(), track->GetTotalEnergy());
58 
59  if(!track->GetUserInformation())
60  {
63  }
64 }
G4TrackingManager * fpTrackingManager
void SetUserTrackInformation(G4VUserTrackInformation *aValue)
G4VUserTrackInformation * GetUserInformation() const
G4ThreeVector GetMomentum() const
G4double GetTotalEnergy() const
CLHEP::HepLorentzVector G4LorentzVector

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