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
14#include "GaudiKernel/ToolHandle.h"
16
17// Geant4 includes
18#include "G4UserEventAction.hh"
19#include "G4UserSteppingAction.hh"
20
21// Local includes
22#include "RecordingEnvelope.h"
23
24
25namespace G4UA
26{
27
34 class MCTruthSteppingAction : public G4UserEventAction,
35 public G4UserSteppingAction,
36 public AthMessaging
37 {
38
39 public:
40
42 using VolumeCollectionMap_t = std::map<std::string, std::string>;
43
48 IMessageSvc* msgSvc, MSG::Level level);
49
52 virtual void BeginOfEventAction(const G4Event*) override final;
53
57 virtual void UserSteppingAction(const G4Step*) override final;
58
59 private:
60
62 void setupRecEnvelopes();
63
66
69
71 std::vector<RecordingEnvelope> m_recordingEnvelopes;
72
73 }; // class MCTruthSteppingAction
74
75} // namespace G4UA
76
77#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.
void setupRecEnvelopes()
Setup the list of RecordingEnvelope helpers.
std::vector< RecordingEnvelope > m_recordingEnvelopes
List of RecordingEnvelope helpers to invoke.
MCTruthSteppingAction(const VolumeCollectionMap_t &collMap, IMessageSvc *msgSvc, MSG::Level level)
Construct the action with specified volumes and output collections.
VolumeCollectionMap_t m_volumeCollectionMap
Map of volume name to output collection name.
virtual void BeginOfEventAction(const G4Event *) override final
Called at the start of each G4 event.
virtual void UserSteppingAction(const G4Step *) override final
Process one particle step.