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 int secondarySavingLevel,
49 int subDetVolLevel,
50 IMessageSvc* msgSvc, MSG::Level level);
51
54 virtual void BeginOfEventAction(const G4Event*) override final;
55
59 virtual void UserSteppingAction(const G4Step*) override final;
60
61 private:
62
64 void setupRecEnvelopes();
65
67 void propagatePrimaryInfoToSecondaries(const G4Step*) const;
68
71
74
77
80
82 std::vector<RecordingEnvelope> m_recordingEnvelopes;
83
84 }; // class MCTruthSteppingAction
85
86} // namespace G4UA
87
88#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.
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.
MCTruthSteppingAction(const VolumeCollectionMap_t &collMap, int secondarySavingLevel, int subDetVolLevel, IMessageSvc *msgSvc, MSG::Level level)
Construct the action with specified volumes and output collections.
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.