ATLAS Offline Software
RecordingEnvelope.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 #ifndef MCTruthBase_RECORDINGENVELOPE_H
6 #define MCTruthBase_RECORDINGENVELOPE_H
7 
8 // Athena headers
10 #include "StoreGate/WriteHandle.h"
11 
12 // STL headers
13 #include <string>
14 
15 class G4LogicalVolume;
16 class G4Step;
17 class G4VPhysicalVolume;
18 
23 
25 {
26 public:
27 
29  RecordingEnvelope(const std::string& envelopeVolumeName, const std::string& trackRecordCollectionName);
30 
33 
37  bool Initialize();
38 
41  void BeginOfEvent();
42 
45  inline int GetLevel() const;
46 
48  inline const std::string& GetVolumeName() const;
49 
52  inline const G4LogicalVolume* GetLogicalVolume() const;
53 
56  inline std::string GetTrackRecordCollectionName() const;
57 
60  void AddTrackRecord(const G4Step* aStep);
61 private:
65  bool checkDaughters(const G4LogicalVolume *possibleParent, const G4VPhysicalVolume *thePhysicalVolume, int& level) const;
66 
69  int m_level;
70 
73 
74  G4LogicalVolume *m_logicalVolume;
75 
77  const std::string m_envelopeVolumeName;
78 
81 };
82 
83 const std::string& RecordingEnvelope::GetVolumeName() const
84 {
85  return m_envelopeVolumeName;
86 }
87 
88 const G4LogicalVolume* RecordingEnvelope::GetLogicalVolume() const
89 {
90  return m_logicalVolume;
91 }
92 
94 {
95  return m_trackRecordCollection.name();
96 }
97 
99 {
100  return m_level;
101 }
102 
103 #endif //MCTruthBase_RECORDINGENVELOPE_H
RecordingEnvelope::GetLogicalVolume
const G4LogicalVolume * GetLogicalVolume() const
Returns the pointer to the G4LogicalVolume used by this recording envelope.
Definition: RecordingEnvelope.h:88
RecordingEnvelope::m_level
int m_level
The number of levels beneath the world that the G4LogicalVolume called m_envelopeVolumeName lies.
Definition: RecordingEnvelope.h:69
RecordingEnvelope::BeginOfEvent
void BeginOfEvent()
Called at the start of each G4 event.
Definition: RecordingEnvelope.cxx:63
RecordingEnvelope::m_trackRecordCollection
SG::WriteHandle< TrackRecordCollection > m_trackRecordCollection
WriteHandle to the TrackRecordCollection used by this envelope.
Definition: RecordingEnvelope.h:80
python.iconfTool.models.loaders.level
level
Definition: loaders.py:20
WriteHandle.h
Handle class for recording to StoreGate.
RecordingEnvelope::checkDaughters
bool checkDaughters(const G4LogicalVolume *possibleParent, const G4VPhysicalVolume *thePhysicalVolume, int &level) const
Recursively called method used to hunt for the G4LogicalVolume associated with this recording envelop...
Definition: RecordingEnvelope.cxx:33
RecordingEnvelope::~RecordingEnvelope
~RecordingEnvelope()
Destructor.
Definition: RecordingEnvelope.cxx:28
RecordingEnvelope::m_logicalVolume
G4LogicalVolume * m_logicalVolume
Pointer to the G4LogicalVolume used by this recording envelope.
Definition: RecordingEnvelope.h:74
RecordingEnvelope::RecordingEnvelope
RecordingEnvelope(const std::string &envelopeVolumeName, const std::string &trackRecordCollectionName)
Constructor.
Definition: RecordingEnvelope.cxx:19
TrackRecordCollection.h
SG::WriteHandle
Definition: StoreGate/StoreGate/WriteHandle.h:76
RecordingEnvelope::m_envelopeVolumeName
const std::string m_envelopeVolumeName
Name of the G4LogicalVolume used by this recording envelope.
Definition: RecordingEnvelope.h:77
RecordingEnvelope::Initialize
bool Initialize()
Finds the pointer to the G4LogicalVolume called m_envelopeVolumeName and the number of levels beneath...
Definition: RecordingEnvelope.cxx:54
RecordingEnvelope::GetTrackRecordCollectionName
std::string GetTrackRecordCollectionName() const
Returns the name of the TrackRecordCollection to which tracks crossing this recording envelope should...
Definition: RecordingEnvelope.h:93
RecordingEnvelope
Responsible for finding the G4LogicalVolume pointer for each recording envelope and for creating and ...
Definition: RecordingEnvelope.h:25
RecordingEnvelope::GetVolumeName
const std::string & GetVolumeName() const
Returns the name of the recording envelope volume.
Definition: RecordingEnvelope.h:83
RecordingEnvelope::AddTrackRecord
void AddTrackRecord(const G4Step *aStep)
Add a TrackRecord to the TrackRecordCollection owned by this recording envelope based on the informat...
Definition: RecordingEnvelope.cxx:68
RecordingEnvelope::GetLevel
int GetLevel() const
Returns the number of levels beneath the world volume that the G4LogicalVolume associated with this r...
Definition: RecordingEnvelope.h:98