ATLAS Offline Software
Geant4TruthIncident.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_Geant4TruthIncident_H
6 #define ISF_GEANT4TOOLS_Geant4TruthIncident_H
7 
8 // ISF includes
9 #include "ISF_Event/ITruthIncident.h" //inheritance
10 
11 //G4 includes
12 #include "G4ThreeVector.hh" //typedef
13 
14 // HepMC includes
15 #include "AtlasHepMC/SimpleVector.h" //typedef FourVector
16 #include "AtlasHepMC/GenParticle_fwd.h" //typedef GenParticlePtr
17 
18 #include "AtlasDetDescr/AtlasRegion.h" //enum
19 
20 #include "CxxUtils/checker_macros.h" //ATLAS_THREAD_SAFE
21 // std
22 #include <vector>
23 
24 
25 // forward declarations
26 class G4Step;
27 class G4Track;
29 
30 namespace ISF {
31  class ISFParticle;
32 }
33 
34 
35 namespace iGeant4 {
36 
45  public:
46  Geant4TruthIncident( const G4Step*,
47  const ISF::ISFParticle& baseISP,
49  AtlasG4EventUserInfo* atlasG4EvtUserInfo);
50  virtual ~Geant4TruthIncident() {};
51 
53  const HepMC::FourVector& position() const override final;
54 
56  int physicsProcessCategory() const override final;
58  int physicsProcessCode() const override final;
59 
61  double parentP2() const override final;
63  double parentPt2() const override final;
65  double parentEkin() const override final;
67  int parentPdgCode() const override final;
69  int parentBarcode() override final; // TODO Remove this method
71  int parentUniqueID() override final;
73  int parentStatus() override final;
75  bool parentSurvivesIncident() const override final;
78  HepMC::GenParticlePtr parentParticleAfterIncident(int newBC) override final;
79 
81  const G4ThreeVector childP(unsigned short index) const;
83  double childP2(unsigned short index) const override final;
85  double childPt2(unsigned short index) const override final;
87  double childEkin(unsigned short index) const override final;
89  int childPdgCode(unsigned short index) const override final;
91  int childBarcode(unsigned short index) const override final; // TODO Remove - only used in one place in TruthSvc
92 
101 
102  // only called once accepted
103 
105  HepMC::GenParticlePtr parentParticle() override final;
108  HepMC::GenParticlePtr childParticle(unsigned short index,
109  int bc) override final;
110  private:
113  inline void prepareChildren();
114 
116  inline bool particleAlive(const G4Track *track) const;
117 
118  HepMC::GenParticlePtr convert(const G4Track *particle, const int barcode, const bool secondary) const;
119 
121  HepMC::FourVector m_position;
122  const G4Step* m_step{};
124 
125  AtlasG4EventUserInfo* m_atlasG4EvtUserInfo ATLAS_THREAD_SAFE{};
126  std::vector<const G4Track*> m_children;
127 
129  };
130 
131 }
132 
133 #endif // ISF_GEANT4TOOLS_Geant4TruthIncident_H
iGeant4::Geant4TruthIncident::parentP2
double parentP2() const override final
Return p^2 of the parent particle.
Definition: Geant4TruthIncident.cxx:98
iGeant4::Geant4TruthIncident::parentBarcode
int parentBarcode() override final
Return the barcode of the parent particle.
Definition: Geant4TruthIncident.cxx:116
iGeant4::Geant4TruthIncident::parentParticleAfterIncident
HepMC::GenParticlePtr parentParticleAfterIncident(int newBC) override final
Return the parent particle after the TruthIncident vertex (and give it a new barcode)
Definition: Geant4TruthIncident.cxx:149
iGeant4::Geant4TruthIncident::parentParticle
HepMC::GenParticlePtr parentParticle() override final
Return the parent particle as a HepMC particle type.
Definition: Geant4TruthIncident.cxx:134
iGeant4::Geant4TruthIncident::m_baseISP
const ISF::ISFParticle & m_baseISP
Definition: Geant4TruthIncident.h:123
AtlasG4EventUserInfo
This class is attached to G4Event objects as UserInformation. It holds a pointer to the HepMC::GenEve...
Definition: AtlasG4EventUserInfo.h:21
Trk::ParticleSwitcher::particle
constexpr ParticleHypothesis particle[PARTICLEHYPOTHESES]
the array of masses
Definition: ParticleHypothesis.h:76
iGeant4::Geant4TruthIncident::parentStatus
int parentStatus() override final
Return the status of the parent particle.
Definition: Geant4TruthIncident.cxx:128
iGeant4::Geant4TruthIncident::parentUniqueID
int parentUniqueID() override final
Return the unique ID of the parent particle.
Definition: Geant4TruthIncident.cxx:122
iGeant4::Geant4TruthIncident::~Geant4TruthIncident
virtual ~Geant4TruthIncident()
Definition: Geant4TruthIncident.h:50
AtlasRegion.h
index
Definition: index.py:1
AtlasDetDescr::AtlasRegion
AtlasRegion
Definition: AtlasRegion.h:27
HepMC::GenParticlePtr
GenParticle * GenParticlePtr
Definition: GenParticle.h:37
ISF::ISFParticle
Definition: ISFParticle.h:42
iGeant4::Geant4TruthIncident
Definition: Geant4TruthIncident.h:44
GenParticle_fwd.h
iGeant4::Geant4TruthIncident::parentEkin
double parentEkin() const override final
Return Ekin of the parent particle.
Definition: Geant4TruthIncident.cxx:108
const
bool const RAWDATA *ch2 const
Definition: LArRodBlockPhysicsV0.cxx:560
iGeant4::Geant4TruthIncident::convert
HepMC::GenParticlePtr convert(const G4Track *particle, const int barcode, const bool secondary) const
Definition: Geant4TruthIncident.cxx:276
iGeant4::Geant4TruthIncident::m_step
const G4Step * m_step
Definition: Geant4TruthIncident.h:122
iGeant4::Geant4TruthIncident::m_position
HepMC::FourVector m_position
Definition: Geant4TruthIncident.h:121
iGeant4::Geant4TruthIncident::childPt2
double childPt2(unsigned short index) const override final
Return pT^2 of the i-th child particle.
Definition: Geant4TruthIncident.cxx:198
iGeant4::Geant4TruthIncident::m_children
std::vector< const G4Track * > m_children
Definition: Geant4TruthIncident.h:126
iGeant4::Geant4TruthIncident::physicsProcessCode
int physicsProcessCode() const override final
Return specific physics process code of the truth incident (eg ionisation, bremsstrahlung,...
Definition: Geant4TruthIncident.cxx:92
SimpleVector.h
iGeant4::Geant4TruthIncident::position
const HepMC::FourVector & position() const override final
Return HepMC position of the truth vertex.
Definition: Geant4TruthIncident.cxx:82
ITruthIncident.h
iGeant4::Geant4TruthIncident::physicsProcessCategory
int physicsProcessCategory() const override final
Return category of the physics process represented by the truth incident (eg hadronic,...
Definition: Geant4TruthIncident.cxx:86
iGeant4::Geant4TruthIncident::childEkin
double childEkin(unsigned short index) const override final
Return Ekin of the i-th child particle.
Definition: Geant4TruthIncident.cxx:203
HepMC::barcode
int barcode(const T *p)
Definition: Barcode.h:16
ISF::ITruthIncident
Definition: ITruthIncident.h:45
iGeant4::Geant4TruthIncident::childP2
double childP2(unsigned short index) const override final
Return p^2 of the i-th child particle.
Definition: Geant4TruthIncident.cxx:188
iGeant4::Geant4TruthIncident::childP
const G4ThreeVector childP(unsigned short index) const
Return p of the i-th child particle.
Definition: Geant4TruthIncident.cxx:193
iGeant4::Geant4TruthIncident::prepareChildren
void prepareChildren()
prepare the child particles
Definition: Geant4TruthIncident.cxx:327
private
#define private
Definition: DetDescrConditionsDict_dict_fixes.cxx:13
ISF::InteractionClass_t
InteractionClass_t
The interaction classifications are described as follows: STD_VTX: interaction of a particle without ...
Definition: ITruthIncident.h:27
iGeant4::Geant4TruthIncident::m_parentParticleAfterIncident
HepMC::GenParticlePtr m_parentParticleAfterIncident
Definition: Geant4TruthIncident.h:128
iGeant4::Geant4TruthIncident::parentSurvivesIncident
bool parentSurvivesIncident() const override final
Return a boolean whether or not the parent particle survives the incident.
Definition: Geant4TruthIncident.cxx:138
iGeant4::Geant4TruthIncident::ATLAS_THREAD_SAFE
AtlasG4EventUserInfo *m_atlasG4EvtUserInfo ATLAS_THREAD_SAFE
Definition: Geant4TruthIncident.h:125
iGeant4::Geant4TruthIncident::particleAlive
bool particleAlive(const G4Track *track) const
check if the given G4Track represents a particle that is alive in ISF or ISF-G4
Definition: Geant4TruthIncident.cxx:255
iGeant4::Geant4TruthIncident::childParticle
HepMC::GenParticlePtr childParticle(unsigned short index, int bc) override final
Return the i-th child as a HepMC particle type and assign the given Barcode to the simulator particle...
Definition: Geant4TruthIncident.cxx:228
ISF
ISFParticleOrderedQueue.
Definition: PrimaryParticleInformation.h:13
HepMC
Definition: Barcode.h:14
iGeant4::Geant4TruthIncident::childPdgCode
int childPdgCode(unsigned short index) const override final
Return the PDG Code of the i-th child particle.
Definition: Geant4TruthIncident.cxx:207
iGeant4::Geant4TruthIncident::parentPdgCode
int parentPdgCode() const override final
Return the PDG Code of the parent particle.
Definition: Geant4TruthIncident.cxx:112
xAOD::track
@ track
Definition: TrackingPrimitives.h:512
iGeant4::Geant4TruthIncident::m_positionSet
bool m_positionSet
Definition: Geant4TruthIncident.h:120
iGeant4::Geant4TruthIncident::interactionClassification
ISF::InteractionClass_t interactionClassification() const override final
The interaction classifications are described as follows: STD_VTX: interaction of a particle without ...
Definition: Geant4TruthIncident.cxx:344
checker_macros.h
Define macros for attributes used to control the static checker.
iGeant4::Geant4TruthIncident::childBarcode
int childBarcode(unsigned short index) const override final
Return the barcode of the i-th child particle (if defined as part of the TruthIncident) otherwise ret...
Definition: Geant4TruthIncident.cxx:211
ISF::ITruthIncident::geoID
AtlasDetDescr::AtlasRegion geoID()
Return the SimGeoID corresponding to the vertex of the truth incident.
Definition: ITruthIncident.h:53
iGeant4::Geant4TruthIncident::Geant4TruthIncident
Geant4TruthIncident()
iGeant4::Geant4TruthIncident::parentPt2
double parentPt2() const override final
Return pT^2 of the parent particle.
Definition: Geant4TruthIncident.cxx:103
iGeant4
Definition: Geant4TruthIncident.h:35