ATLAS Offline Software
Classes | Public Member Functions | Private Attributes | List of all members
G4UA::GeantFollower Class Reference

#include <GeantFollower.h>

Inheritance diagram for G4UA::GeantFollower:
Collaboration diagram for G4UA::GeantFollower:

Classes

struct  Config
 

Public Member Functions

 GeantFollower (const Config &config)
 
virtual void BeginOfEventAction (const G4Event *) override
 
virtual void EndOfEventAction (const G4Event *) override
 
virtual void BeginOfRunAction (const G4Run *) override
 
virtual void UserSteppingAction (const G4Step *) override
 

Private Attributes

Config m_config
 
Trk::IGeantFollowerHelperm_helperPointer
 

Detailed Description

Definition at line 33 of file GeantFollower.h.

Constructor & Destructor Documentation

◆ GeantFollower()

GeantFollower::GeantFollower ( const Config config)

Definition at line 25 of file GeantFollower.cxx.

26  : m_config(config)
27  , m_helperPointer(nullptr)
28  {}

Member Function Documentation

◆ BeginOfEventAction()

void GeantFollower::BeginOfEventAction ( const G4Event *  )
overridevirtual

Definition at line 30 of file GeantFollower.cxx.

31  {
33  }

◆ BeginOfRunAction()

void GeantFollower::BeginOfRunAction ( const G4Run *  )
overridevirtual

Definition at line 40 of file GeantFollower.cxx.

41  {
42  if(m_config.helper.retrieve()!=StatusCode::SUCCESS)
43  {
44  G4ExceptionDescription description;
45  description << "Cannot retrieve GeantFollower helper";
46  G4Exception("GeantFollower", "GeantFollower1", FatalException, description);
47  return;
48  }
49 
51  }

◆ EndOfEventAction()

void GeantFollower::EndOfEventAction ( const G4Event *  )
overridevirtual

Definition at line 35 of file GeantFollower.cxx.

36  {
38  }

◆ UserSteppingAction()

void GeantFollower::UserSteppingAction ( const G4Step *  aStep)
overridevirtual

Definition at line 53 of file GeantFollower.cxx.

54  {
55  // kill secondaries
56  if (aStep->GetTrack()->GetParentID())
57  {
58  aStep->GetTrack()->SetTrackStatus(fStopAndKill);
59  return;
60  }
61 
62  // get the prestep point and follow this guy
63  G4StepPoint * g4PreStep = aStep->GetPreStepPoint();
64  G4ThreeVector g4Momentum = g4PreStep->GetMomentum();
65  const G4ThreeVector& g4Position = g4PreStep->GetPosition();
66 
67  G4Track* g4Track = aStep->GetTrack();
68  const G4DynamicParticle* g4DynParticle = g4Track->GetDynamicParticle();
69 
70  // the material information
71  const G4TouchableHistory* touchHist = static_cast<const G4TouchableHistory*>(aStep->GetPreStepPoint()->GetTouchable());
72  if(ATH_LIKELY(touchHist))
73  {
74  // G4LogicalVolume
75  const G4LogicalVolume *lv= touchHist->GetVolume()->GetLogicalVolume();
76  if(ATH_LIKELY(lv))
77  {
78  const G4Material *mat = lv->GetMaterial();
79  // the step information
80  double steplength = aStep->GetStepLength();
81  // the position information
82  double X0 = mat->GetRadlen();
83  // update the track follower
84  m_helperPointer->trackParticle(g4Position,g4Momentum,g4DynParticle->GetPDGcode(),g4DynParticle->GetCharge(),steplength,X0);
85  }
86  else
87  {
88  G4ExceptionDescription description;
89  description << "GeantFollower::SteppingAction NULL G4LogicalVolume pointer.";
90  G4Exception("GeantFollower", "GeantFollower2", FatalException, description);
91  }
92  }
93  else
94  {
95  G4ExceptionDescription description;
96  description << "GeantFollower::SteppingAction NULL G4TouchableHistory pointer.";
97  G4Exception("GeantFollower", "GeantFollower3", FatalException, description);
98  }
99  }

Member Data Documentation

◆ m_config

Config G4UA::GeantFollower::m_config
private

Definition at line 53 of file GeantFollower.h.

◆ m_helperPointer

Trk::IGeantFollowerHelper* G4UA::GeantFollower::m_helperPointer
private

Definition at line 55 of file GeantFollower.h.


The documentation for this class was generated from the following files:
G4UA::GeantFollower::Config::helper
ToolHandle< Trk::IGeantFollowerHelper > helper
FIXME: Public tool handle. See ATLASSIM-3561.
Definition: GeantFollower.h:41
Trk::IGeantFollowerHelper::trackParticle
virtual void trackParticle(const G4ThreeVector &pos, const G4ThreeVector &mom, int pdg, double charge, float t, float X0)=0
mat
GeoMaterial * mat
Definition: LArDetectorConstructionTBEC.cxx:53
G4UA::GeantFollower::m_config
Config m_config
Definition: GeantFollower.h:53
Trk::IGeantFollowerHelper::beginEvent
virtual void beginEvent()=0
config
Definition: PhysicsAnalysis/AnalysisCommon/AssociationUtils/python/config.py:1
pdg_comparison.X0
X0
Definition: pdg_comparison.py:314
ATH_LIKELY
#define ATH_LIKELY(x)
Definition: AthUnlikelyMacros.h:16
G4UA::GeantFollower::m_helperPointer
Trk::IGeantFollowerHelper * m_helperPointer
Definition: GeantFollower.h:55
Trk::IGeantFollowerHelper::endEvent
virtual void endEvent()=0
description
std::string description
glabal timer - how long have I taken so far?
Definition: hcg.cxx:88