ATLAS Offline Software
Loading...
Searching...
No Matches
Simulation
G4Sim
MCTruth
src
TrackInformation.cxx
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
3
*/
4
5
#include "
MCTruth/TrackInformation.h
"
6
#include "
AtlasHepMC/GenEvent.h
"
7
#include "
AtlasHepMC/GenParticle.h
"
8
9
TrackInformation::TrackInformation
()
10
:
m_regenerationNr
(0)
11
,
m_currentGenParticle
(nullptr)
12
,
m_generationZeroGenParticle
(nullptr)
13
,
m_theBaseISFParticle
(nullptr)
14
,
m_returnedToISF
(false)
15
{
16
}
17
18
TrackInformation::TrackInformation
(
HepMC::GenParticlePtr
p,
ISF::ISFParticle
* baseIsp)
19
:
m_regenerationNr
(0)
20
,
m_currentGenParticle
(p)
21
,
m_generationZeroGenParticle
(
std
::move(p))
22
,
m_theBaseISFParticle
(baseIsp)
23
,
m_returnedToISF
(false)
24
{
25
}
26
27
int
TrackInformation::GetParticleBarcode
()
const
28
{
29
if
(m_barcode !=
HepMC::INVALID_PARTICLE_BARCODE
)
return
m_barcode;
30
if
(
m_currentGenParticle
) {
31
m_barcode =
HepMC::barcode
(
m_currentGenParticle
);
32
return
m_barcode;
33
}
34
return
HepMC::UNDEFINED_ID
;
35
}
36
37
int
TrackInformation::GetParticleUniqueID
()
const
38
{
39
if
(m_uniqueID !=
HepMC::INVALID_PARTICLE_BARCODE
)
return
m_uniqueID;
40
if
(
m_currentGenParticle
) {
41
HepMC::ConstGenParticlePtr
particle =
m_currentGenParticle
;
42
m_uniqueID =
HepMC::uniqueID
(particle);
43
return
m_uniqueID;
44
}
45
return
HepMC::UNDEFINED_ID
;
46
}
47
48
int
TrackInformation::GetParticleStatus
()
const
49
{
50
if
(
m_currentGenParticle
) {
51
return
m_currentGenParticle
->status();
52
}
53
return
0;
54
}
55
56
void
TrackInformation::SetCurrentGenParticle
(
HepMC::GenParticlePtr
p)
57
{
58
m_currentGenParticle
= std::move(p);
59
m_barcode =
HepMC::INVALID_PARTICLE_BARCODE
;
60
m_uniqueID =
HepMC::INVALID_PARTICLE_BARCODE
;
61
}
62
63
void
TrackInformation::SetGenerationZeroGenParticle
(
HepMC::GenParticlePtr
p)
64
{
65
m_generationZeroGenParticle
= std::move(p);
66
}
67
68
void
TrackInformation::SetBaseISFParticle
(
ISF::ISFParticle
* p)
69
{
70
m_theBaseISFParticle
= p;
71
}
GenEvent.h
GenParticle.h
TrackInformation.h
ISF::ISFParticle
The generic ISF particle definition,.
Definition
ISFParticle.h:42
TrackInformation::SetBaseISFParticle
virtual void SetBaseISFParticle(ISF::ISFParticle *) override
set the pointer to the ISFParticle corresponding to the current G4Track.
Definition
TrackInformation.cxx:68
TrackInformation::m_generationZeroGenParticle
HepMC::GenParticlePtr m_generationZeroGenParticle
Definition
TrackInformation.h:119
TrackInformation::SetGenerationZeroGenParticle
virtual void SetGenerationZeroGenParticle(HepMC::GenParticlePtr) override
set m_generationZeroGenParticle, the pointer to the simulation truth particle before any regeneration...
Definition
TrackInformation.cxx:63
TrackInformation::TrackInformation
TrackInformation()
Definition
TrackInformation.cxx:9
TrackInformation::m_regenerationNr
int m_regenerationNr
Definition
TrackInformation.h:117
TrackInformation::GetParticleStatus
virtual int GetParticleStatus() const override
Definition
TrackInformation.cxx:48
TrackInformation::GetParticleUniqueID
virtual int GetParticleUniqueID() const override
Definition
TrackInformation.cxx:37
TrackInformation::m_theBaseISFParticle
ISF::ISFParticle * m_theBaseISFParticle
Definition
TrackInformation.h:122
TrackInformation::m_currentGenParticle
HepMC::GenParticlePtr m_currentGenParticle
Definition
TrackInformation.h:118
TrackInformation::GetParticleBarcode
virtual int GetParticleBarcode() const override
Definition
TrackInformation.cxx:27
TrackInformation::SetCurrentGenParticle
virtual void SetCurrentGenParticle(HepMC::GenParticlePtr) override
set m_currentGenParticle, the pointer to the GenParticle corresponding to the current G4Track.
Definition
TrackInformation.cxx:56
TrackInformation::m_returnedToISF
bool m_returnedToISF
Definition
TrackInformation.h:123
HepMC::barcode
int barcode(const T *p)
Definition
Barcode.h:15
HepMC::uniqueID
int uniqueID(const T &p)
Definition
MagicNumbers.h:89
HepMC::UNDEFINED_ID
constexpr int UNDEFINED_ID
Definition
MagicNumbers.h:57
HepMC::INVALID_PARTICLE_BARCODE
constexpr int INVALID_PARTICLE_BARCODE
Definition
MagicNumbers.h:55
HepMC::GenParticlePtr
HepMC3::GenParticlePtr GenParticlePtr
Definition
GenParticle.h:19
HepMC::ConstGenParticlePtr
HepMC3::ConstGenParticlePtr ConstGenParticlePtr
Definition
GenParticle.h:20
std
STL namespace.
Generated on
for ATLAS Offline Software by
1.16.1