ATLAS Offline Software
AtlasG4EventUserInfo.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 MCTRUTH_ATLASG4EVENTUSERINFO_H
6 #define MCTRUTH_ATLASG4EVENTUSERINFO_H
7 
8 #include <memory>
10 #include "AtlasHepMC/GenParticle.h"
11 #include "G4VUserEventInformation.hh"
13 
23 class AtlasG4EventUserInfo: public G4VUserEventInformation {
24 public:
26  : G4VUserEventInformation()
27  {}
28 
33  HepMC::GenEvent* GetHepMCEvent() ;
38  void SetHepMCEvent(HepMC::GenEvent*);
39 
56 
70 
85  void SetLastProcessedTrackID(int trackID) { m_lastProcessedTrackID = trackID; }
86 
95  int GetLastProcessedStep() const { return m_lastProcessedStep; }
102  void SetLastProcessedStep(int stepNumber) { m_lastProcessedStep = stepNumber; }
103 
108  std::shared_ptr<HitCollectionMap> GetHitCollectionMap() const { return m_hitCollectionMap; }
109 
113  void SetHitCollectionMap(std::shared_ptr<HitCollectionMap> hitCollections) { m_hitCollectionMap = hitCollections; }
114 
115  void Print() const {}
116 
117 private:
118  HepMC::GenEvent *m_theEvent{};
121 
122  std::shared_ptr<HitCollectionMap> m_hitCollectionMap{std::make_shared<HitCollectionMap>()};
123 
124  // These next two variables are used by the CaloCalibrationHit
125  // recording code as event-level flags They correspond to the Track
126  // ID and step number of the last G4Step processed by a
127  // CaloCalibrationHit SD Both are needed, because a particle might
128  // have only one step
131 };
132 
133 #endif // MCTRUTH_ATLASG4EVENTUSERINFO_H
AtlasG4EventUserInfo::m_lastProcessedTrackID
int m_lastProcessedTrackID
Definition: AtlasG4EventUserInfo.h:129
AtlasG4EventUserInfo::SetCurrentPrimaryGenParticle
void SetCurrentPrimaryGenParticle(HepMC::ConstGenParticlePtr p)
set m_currentPrimaryGenParticle, the pointer to the HepMC::GenParticle used to create the current G4P...
Definition: AtlasG4EventUserInfo.h:55
AtlasG4EventUserInfo::GetCurrentGenParticle
HepMC::ConstGenParticlePtr GetCurrentGenParticle() const
Definition: AtlasG4EventUserInfo.h:62
AtlasG4EventUserInfo::SetLastProcessedTrackID
void SetLastProcessedTrackID(int trackID)
record the value of G4Track::GetTrackID() for the current G4Step.
Definition: AtlasG4EventUserInfo.h:85
AtlasG4EventUserInfo
This class is attached to G4Event objects as UserInformation. It holds a pointer to the HepMC::GenEve...
Definition: AtlasG4EventUserInfo.h:23
AtlasG4EventUserInfo::m_currentGenParticle
HepMC::GenParticlePtr m_currentGenParticle
Definition: AtlasG4EventUserInfo.h:120
AtlasG4EventUserInfo::GetHepMCEvent
HepMC::GenEvent * GetHepMCEvent()
return a pointer to the HepMC::GenEvent used to create the G4Event.
Definition: AtlasG4EventUserInfo.cxx:8
HitCollectionMap.h
AtlasG4EventUserInfo::SetLastProcessedStep
void SetLastProcessedStep(int stepNumber)
record value of the G4Track::GetCurrentStepNumber() for the current G4Step.
Definition: AtlasG4EventUserInfo.h:102
AtlasG4EventUserInfo::SetHepMCEvent
void SetHepMCEvent(HepMC::GenEvent *)
set m_theEvent, the pointer to the HepMC::GenEvent used to create the G4Event.
Definition: AtlasG4EventUserInfo.cxx:13
HepMC::GenParticlePtr
GenParticle * GenParticlePtr
Definition: GenParticle.h:37
AtlasG4EventUserInfo::SetHitCollectionMap
void SetHitCollectionMap(std::shared_ptr< HitCollectionMap > hitCollections)
Set the HitCollectionMap object.
Definition: AtlasG4EventUserInfo.h:113
GenParticle.h
AtlasG4EventUserInfo::GetLastProcessedStep
int GetLastProcessedStep() const
return the value of the G4Track::GetCurrentStepNumber() for the last G4Step processed by a CaloCalibr...
Definition: AtlasG4EventUserInfo.h:95
AtlasG4EventUserInfo::GetLastProcessedTrackID
int GetLastProcessedTrackID() const
return the value of G4Track::GetTrackID() for the last G4Step processed by a CaloCalibrationHit Sensi...
Definition: AtlasG4EventUserInfo.h:78
AtlasG4EventUserInfo::AtlasG4EventUserInfo
AtlasG4EventUserInfo()
Definition: AtlasG4EventUserInfo.h:25
AtlasG4EventUserInfo::GetCurrentGenParticle
HepMC::GenParticlePtr GetCurrentGenParticle()
return a pointer to the GenParticle corresponding to the current G4Track (if there is one).
Definition: AtlasG4EventUserInfo.h:61
python.utils.AtlRunQueryDQUtils.p
p
Definition: AtlRunQueryDQUtils.py:209
AtlasG4EventUserInfo::Print
void Print() const
Definition: AtlasG4EventUserInfo.h:115
AtlasG4EventUserInfo::m_currentPrimaryGenParticle
HepMC::ConstGenParticlePtr m_currentPrimaryGenParticle
Definition: AtlasG4EventUserInfo.h:119
GenEvent_fwd.h
AtlasG4EventUserInfo::m_hitCollectionMap
std::shared_ptr< HitCollectionMap > m_hitCollectionMap
Definition: AtlasG4EventUserInfo.h:122
HepMC::ConstGenParticlePtr
const GenParticle * ConstGenParticlePtr
Definition: GenParticle.h:38
AtlasG4EventUserInfo::GetCurrentPrimaryGenParticle
HepMC::ConstGenParticlePtr GetCurrentPrimaryGenParticle() const
return a pointer to the HepMC::GenParticle used to create the current G4PrimaryParticle.
Definition: AtlasG4EventUserInfo.h:46
AtlasG4EventUserInfo::m_theEvent
HepMC::GenEvent * m_theEvent
Definition: AtlasG4EventUserInfo.h:118
AtlasG4EventUserInfo::SetCurrentGenParticle
void SetCurrentGenParticle(HepMC::GenParticlePtr p)
set m_currentGenParticle, the pointer to the GenParticle corresponding to the current G4Track.
Definition: AtlasG4EventUserInfo.h:69
AtlasG4EventUserInfo::m_lastProcessedStep
int m_lastProcessedStep
Definition: AtlasG4EventUserInfo.h:130
AtlasG4EventUserInfo::GetHitCollectionMap
std::shared_ptr< HitCollectionMap > GetHitCollectionMap() const
Get the HitCollectionMap object with shared ownership.
Definition: AtlasG4EventUserInfo.h:108