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

#include <Par02TrackingAction.hh>

Inheritance diagram for Par02TrackingAction:
Collaboration diagram for Par02TrackingAction:

Public Member Functions

 Par02TrackingAction ()
 A default constructor. More...
 
virtual ~Par02TrackingAction ()
 
virtual void PreUserTrackingAction (const G4Track *track)
 
virtual void PostUserTrackingAction (const G4Track *track)
 
- 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

Tracking action (before/after track processing).

Defines the action at the start and at the end of processing of each track. The class needs to be set in G4RunManager::SetUserAction().

Author
Anna Zaborowska

Definition at line 43 of file Par02TrackingAction.hh.

Constructor & Destructor Documentation

Par02TrackingAction::Par02TrackingAction ( )

A default constructor.

Definition at line 48 of file Par02TrackingAction.cc.

Par02TrackingAction::~Par02TrackingAction ( )
virtual

Definition at line 52 of file Par02TrackingAction.cc.

52 {}

Member Function Documentation

void Par02TrackingAction::PostUserTrackingAction ( const G4Track track)
virtual

Defines the actions at the end of processing the track. It saves the information of MC data (PDG code, initial momentum), tracker (momentum), EMCal and HCal (energy deposit and its position) as well as resolution and efficiency for all the detectors.

Reimplemented from G4UserTrackingAction.

Definition at line 67 of file Par02TrackingAction.cc.

67  {
68  if ( aTrack->GetTrackStatus() == fStopAndKill && aTrack->GetParentID() == 0 ) {
70  aTrack->GetDynamicParticle()->GetPrimaryParticle()->GetUserInformation();
71  //info->Print();
73  info->GetPartID(),
74  info->GetPDG(),
75  info->GetMCMomentum()/MeV );
77  info->GetPartID(),
78  info->GetPDG(),
79  info->GetTrackerMomentum()/MeV,
80  info->GetTrackerResolution(),
81  info->GetTrackerEfficiency() );
83  info->GetPartID(),
84  info->GetPDG(),
85  info->GetEMCalPosition()/mm,
86  info->GetEMCalResolution(),
87  info->GetEMCalEfficiency(),
88  info->GetEMCalEnergy()/MeV );
90  info->GetPartID(),
91  info->GetPDG(),
92  info->GetHCalPosition()/mm,
93  info->GetHCalResolution(),
94  info->GetHCalEfficiency(),
95  info->GetHCalEnergy()/MeV );
96  }
97 }
G4double GetHCalEnergy()
Sets the energy deposit in the hadronic calorimeter.
const XML_Char XML_Encoding * info
Definition: expat.h:530
G4ThreeVector GetTrackerMomentum()
Gets the particle momentum at the entrance to the tracker detector.
static constexpr double mm
Definition: G4SIunits.hh:115
G4ThreeVector GetEMCalPosition()
Gets the position of the energy deposit in the electromagnetic calorimeter.
G4int GetPartID() const
Gets the particle unique ID (within event). Can be set only in the constructor.
G4ThreeVector GetHCalPosition()
Gets the position of the energy deposit in the hadronic calorimeter.
G4int GetPDG() const
Gets the standard PDG code. Can be set only in the constructor.
static Par02Output * Instance()
Definition: Par02Output.cc:60
void SaveTrack(SaveType aWhatToSave, G4int aPartID, G4int aPDG, G4ThreeVector aVector, G4double aResolution=0, G4double aEfficiency=1, G4double aEnergy=0)
Definition: Par02Output.cc:162
G4ThreeVector GetMCMomentum()
Gets the initial particle momentum (from particle generator).
G4double GetEMCalEnergy()
Sets the energy deposit in the electromagnetic calorimeter.
static constexpr double MeV
Definition: G4SIunits.hh:214

Here is the call graph for this function:

void Par02TrackingAction::PreUserTrackingAction ( const G4Track track)
virtual

Defines the actions at the start of processing the track. It checks the pseudorapidity range and if the particle is a primary.

Reimplemented from G4UserTrackingAction.

Definition at line 56 of file Par02TrackingAction.cc.

56  {
57  // Kill the tracks that have a small transverse momentum or that are not
58  // in the central region.
59  if ( aTrack->GetMomentum().perp() < 1.0*MeV ||
60  std::abs( aTrack->GetMomentum().pseudoRapidity() ) > 5.5 ) {
61  ( (G4Track*) aTrack )->SetTrackStatus( fStopAndKill );
62  }
63 }
static constexpr double MeV
Definition: G4SIunits.hh:214

Here is the call graph for this function:


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