ATLAS Offline Software
Loading...
Searching...
No Matches
MCTruthSteppingAction.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
3*/
4
5#ifndef MCTruthBase_MCTruthSteppingAction_H
6#define MCTruthBase_MCTruthSteppingAction_H
7
8// System includes
9#include <map>
10#include <string>
11#include <vector>
12
13// Framework includes
15
16// Geant4 includes
17#include "G4UserEventAction.hh"
18#include "G4UserSteppingAction.hh"
19
20// Local includes
21#include "RecordingEnvelope.h"
22
23namespace ISF
24{
25 class IGeoIDSvc;
26 class ITruthSvc;
27}
28
29namespace G4UA
30{
31
38 class MCTruthSteppingAction : public G4UserEventAction,
39 public G4UserSteppingAction,
40 public AthMessaging
41 {
42
43 public:
44
46 using VolumeCollectionMap_t = std::map<std::string, std::string>;
47
52 int secondarySavingLevel,
53 int subDetVolLevel,
54 ISF::ITruthSvc& truthRecordSvc,
55 ISF::IGeoIDSvc& geoIDSvc,
56 IMessageSvc* msgSvc, MSG::Level level);
57
60 virtual void BeginOfEventAction(const G4Event*) override final;
61
65 virtual void UserSteppingAction(const G4Step*) override final;
66
67 private:
68
70 void setupRecEnvelopes();
71
73 void propagatePrimaryInfoToSecondaries(const G4Step*) const;
74
76 void createTruthIncident(const G4Step*) const;
77
80
83
86
89
92
95
97 std::vector<RecordingEnvelope> m_recordingEnvelopes;
98
99 }; // class MCTruthSteppingAction
100
101} // namespace G4UA
102
103#endif
AthMessaging(IMessageSvc *msgSvc, const std::string &name)
Constructor.
std::map< std::string, std::string > VolumeCollectionMap_t
Map of volume name to output TrackRecordCollection name.
bool m_isInitialized
Used to delay initialization until the event loop, after geo is ready.
int m_subDetVolLevel
The level in the G4 volume hierarchy at which we find the sub-detector.
int m_secondarySavingLevel
The saving level for secondaries.
void setupRecEnvelopes()
Setup the list of RecordingEnvelope helpers.
std::vector< RecordingEnvelope > m_recordingEnvelopes
List of RecordingEnvelope helpers to invoke.
ISF::IGeoIDSvc & m_geoIDSvc
ISF GeoID Service used to identify the next detector region.
VolumeCollectionMap_t m_volumeCollectionMap
Map of volume name to output collection name.
void propagatePrimaryInfoToSecondaries(const G4Step *) const
Propagate parent primary truth attribution to ordinary secondaries.
virtual void BeginOfEventAction(const G4Event *) override final
Called at the start of each G4 event.
ISF::ITruthSvc & m_truthRecordSvc
ISF Truth Service used to register truth incidents.
void createTruthIncident(const G4Step *) const
Create and register a truth incident for the current step.
virtual void UserSteppingAction(const G4Step *) override final
Process one particle step.
MCTruthSteppingAction(const VolumeCollectionMap_t &collMap, int secondarySavingLevel, int subDetVolLevel, ISF::ITruthSvc &truthRecordSvc, ISF::IGeoIDSvc &geoIDSvc, IMessageSvc *msgSvc, MSG::Level level)
Construct the action with specified volumes and output collections.
The interface to chose between the sub geometry services, realized as an AlgTool since it does not ha...
Definition IGeoIDSvc.h:41
@ class ITruthSvc
Definition ITruthSvc.h:29
ISFParticleOrderedQueue.