ATLAS Offline Software
Loading...
Searching...
No Matches
G4UA::iGeant4::MCTruthUserAction Class Reference

#include <MCTruthUserAction.h>

Inheritance diagram for G4UA::iGeant4::MCTruthUserAction:
Collaboration diagram for G4UA::iGeant4::MCTruthUserAction:

Classes

struct  Config

Public Member Functions

 MCTruthUserAction (const Config &config)
virtual void PreUserTrackingAction (const G4Track *) override
virtual void PostUserTrackingAction (const G4Track *) override

Private Attributes

Config m_config
ISF::ITruthSvcm_truthRecordSvcQuick
 used for faster access

Detailed Description

Definition at line 36 of file MCTruthUserAction.h.

Constructor & Destructor Documentation

◆ MCTruthUserAction()

G4UA::iGeant4::MCTruthUserAction::MCTruthUserAction ( const Config & config)

Definition at line 38 of file MCTruthUserAction.cxx.

39 : m_config(config)
40 , m_truthRecordSvcQuick(nullptr)
41 {
42
43 if(4<m_config.verboseLevel)
44 {
45 G4cout << "create MCTruthUserAction" << G4endl;
46 }
47
48 if (m_config.truthRecordSvc.retrieve().isFailure()){
49 G4ExceptionDescription description;
50 description << G4String("MCTruthUserAction: ") + "Could not retrieve " << m_config.truthRecordSvc;
51 G4Exception("G4UA::iGeant4::MCTruthUserAction", "NoTruthSvc", FatalException, description);
52 return; //The G4Exception call above should abort the job, but Coverity does not seem to pick this up.
53 }
54
55 // store a pointer directly to the truth service class
56 // by doing so, the Gaudi overhead can be minimized
57 m_truthRecordSvcQuick = &(*(m_config.truthRecordSvc));
58 }
ISF::ITruthSvc * m_truthRecordSvcQuick
used for faster access
std::string description
glabal timer - how long have I taken so far?
Definition hcg.cxx:91

Member Function Documentation

◆ PostUserTrackingAction()

void G4UA::iGeant4::MCTruthUserAction::PostUserTrackingAction ( const G4Track * )
overridevirtual

Definition at line 79 of file MCTruthUserAction.cxx.

79 {
80 G4EventManager::GetEventManager()->GetTrackingManager()->SetStoreTrajectory(false);
81 }

◆ PreUserTrackingAction()

void G4UA::iGeant4::MCTruthUserAction::PreUserTrackingAction ( const G4Track * inTrack)
overridevirtual

Definition at line 60 of file MCTruthUserAction.cxx.

60 {
61
62 TrackHelper trackHelper(inTrack);
63
64 if (trackHelper.IsPrimary() ||
65 (trackHelper.IsRegisteredSecondary()&&m_config.ilevel>1) ||
66 (trackHelper.IsSecondary()&&m_config.ilevel>2)) {
67
68 auto trkMgr = G4EventManager::GetEventManager()->GetTrackingManager();
69 G4Trajectory *temp=new ::iGeant4::ISFTrajectory(inTrack, m_truthRecordSvcQuick);
70 trkMgr->SetStoreTrajectory(true);
71 trkMgr->SetTrajectory(temp);
72
73 // TODO: check that the 'temp' object is actually deleted by the G4TrackingManager
74 // after FADS::FadsTrackingAction::GetTrackingAction()->ResetTraj() is executed
75 }
76
77 }

Member Data Documentation

◆ m_config

Config G4UA::iGeant4::MCTruthUserAction::m_config
private

Definition at line 54 of file MCTruthUserAction.h.

◆ m_truthRecordSvcQuick

ISF::ITruthSvc* G4UA::iGeant4::MCTruthUserAction::m_truthRecordSvcQuick
private

used for faster access

Definition at line 55 of file MCTruthUserAction.h.


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