ATLAS Offline Software
TrackProcessorUserActionBase.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 ISF_GEANT4TOOLS_TRACKPROCESSORUSERACTIONBASE_H
6 #define ISF_GEANT4TOOLS_TRACKPROCESSORUSERACTIONBASE_H
7 
8 #include "G4UserTrackingAction.hh"
9 #include "G4UserSteppingAction.hh"
10 #include "G4UserEventAction.hh"
11 
13 
15 
16 // forward declarations
18 
20 
21 namespace ISF {
22  class ISFParticle;
23 }
24 
25 
26 namespace G4UA{
27 
28 namespace iGeant4 {
29 
30 class TrackProcessorUserActionBase: public G4UserTrackingAction,
31  public G4UserSteppingAction,
32  public G4UserEventAction
33 {
34 
35 public:
37  virtual void BeginOfEventAction(const G4Event*) override final;
38  virtual void EndOfEventAction(const G4Event*) override final;
39 
40  virtual void PreUserTrackingAction(const G4Track*) override;
41  virtual void PostUserTrackingAction(const G4Track*) override final;
42 
43  virtual void UserSteppingAction(const G4Step*) override final;
44 
46 
47 protected:
49 
51 
54  virtual void ISFSteppingAction(const G4Step*, ISF::ISFParticle*) = 0;
55 
56 private:
58  void setupPrimary(G4Track&);
59 
61  void setupSecondary(const G4Track&);
62 
64  void updateCachedParticleInfo(ISF::ISFParticle* baseISFParticle,
65  HepMC::ConstGenParticlePtr primaryGenParticle,
66  HepMC::GenParticlePtr currentGenParticle);
67 
70  HepMC::ConstGenParticlePtr generationZeroGenParticle,
71  HepMC::ConstGenParticlePtr currentGenParticle,
72  int regenerationNumber) const;
73 
76 
77 }; // class TrackProcessorUserActionBase
78 
79 }// iGeant4
80 
81 }// G4UA
82 
83 #endif // ISF_GEANT4TOOLS_TRACKPROCESSORUSERACTIONBASE_H
ISF::ISFParticleContainer
std::list< ISF::ISFParticle * > ISFParticleContainer
generic ISFParticle container (not necessarily a std::list!)
Definition: ISFParticleContainer.h:23
AtlasG4EventUserInfo
This class is attached to G4Event objects as UserInformation. It holds a pointer to the HepMC::GenEve...
Definition: AtlasG4EventUserInfo.h:21
G4UA::iGeant4::TrackProcessorUserActionBase
Definition: TrackProcessorUserActionBase.h:33
G4UA
for nSW
Definition: CalibrationDefaultProcessing.h:19
G4UA::iGeant4::TrackProcessorUserActionBase::TrackProcessorUserActionBase
TrackProcessorUserActionBase()=default
G4UA::iGeant4::TrackProcessorUserActionBase::classify
VTrackInformation::TrackClassification classify(HepMC::ConstGenParticlePtr primaryGenParticle, HepMC::ConstGenParticlePtr generationZeroGenParticle, HepMC::ConstGenParticlePtr currentGenParticle, int regenerationNumber) const
Classify the particle represented by the given set of truth links.
Definition: TrackProcessorUserActionBase.cxx:208
HepMC::GenParticlePtr
GenParticle * GenParticlePtr
Definition: GenParticle.h:37
ISF::ISFParticle
Definition: ISFParticle.h:42
GenParticle_fwd.h
G4UA::iGeant4::TrackProcessorUserActionBase::EndOfEventAction
virtual void EndOfEventAction(const G4Event *) override final
Definition: TrackProcessorUserActionBase.cxx:55
G4UA::iGeant4::TrackProcessorUserActionBase::ISFSteppingAction
virtual void ISFSteppingAction(const G4Step *, ISF::ISFParticle *)=0
This method is called by TrackProcessorUserActionBase after the G4Track->ISFParticle association has ...
ISFParticleContainer.h
G4UA::iGeant4::TrackProcessorUserActionBase::BeginOfEventAction
virtual void BeginOfEventAction(const G4Event *) override final
Definition: TrackProcessorUserActionBase.cxx:48
G4UA::iGeant4::TrackProcessorUserActionBase::m_storedSecondaries
ISF::ISFParticleContainer m_storedSecondaries
Definition: TrackProcessorUserActionBase.h:50
G4UA::iGeant4::TrackProcessorUserActionBase::ReturnSecondaries
ISF::ISFParticleContainer ReturnSecondaries(ISF::ISFParticle const *parent)
Definition: TrackProcessorUserActionBase.cxx:238
test_pyathena.parent
parent
Definition: test_pyathena.py:15
G4UA::iGeant4::TrackProcessorUserActionBase::setupSecondary
void setupSecondary(const G4Track &)
Setup the given G4Track as the current secondary particle which we'll process.
Definition: TrackProcessorUserActionBase.cxx:183
G4UA::iGeant4::TrackProcessorUserActionBase::m_atlasG4EvtUserInfo
AtlasG4EventUserInfo * m_atlasG4EvtUserInfo
event-global G4 UserInformation
Definition: TrackProcessorUserActionBase.h:48
HepMC::ConstGenParticlePtr
const GenParticle * ConstGenParticlePtr
Definition: GenParticle.h:38
VTrackInformation.h
G4UA::iGeant4::TrackProcessorUserActionBase::updateCachedParticleInfo
void updateCachedParticleInfo(ISF::ISFParticle *baseISFParticle, HepMC::ConstGenParticlePtr primaryGenParticle, HepMC::GenParticlePtr currentGenParticle)
Set the following information as the currently traced particle.
Definition: TrackProcessorUserActionBase.cxx:196
G4UA::iGeant4::TrackProcessorUserActionBase::setupPrimary
void setupPrimary(G4Track &)
Setup the given G4Track as the current primary particle which we'll process.
Definition: TrackProcessorUserActionBase.cxx:111
G4UA::iGeant4::TrackProcessorUserActionBase::PostUserTrackingAction
virtual void PostUserTrackingAction(const G4Track *) override final
Definition: TrackProcessorUserActionBase.cxx:232
ISF
ISFParticleOrderedQueue.
Definition: PrimaryParticleInformation.h:13
VTrackInformation::TrackClassification
TrackClassification
Definition: VTrackInformation.h:32
G4UA::iGeant4::TrackProcessorUserActionBase::PreUserTrackingAction
virtual void PreUserTrackingAction(const G4Track *) override
Definition: TrackProcessorUserActionBase.cxx:98
G4UA::iGeant4::TrackProcessorUserActionBase::m_curBaseISP
ISF::ISFParticle * m_curBaseISP
The most recent ISFParticle ancestor that triggers the currently processed G4Track.
Definition: TrackProcessorUserActionBase.h:75
G4UA::iGeant4::TrackProcessorUserActionBase::UserSteppingAction
virtual void UserSteppingAction(const G4Step *) override final
Definition: TrackProcessorUserActionBase.cxx:62
iGeant4
Definition: Geant4TruthIncident.h:35