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_theBaseISFParticle
(nullptr)
13
,
m_returnedToISF
(false)
14
{
15
}
16
17
TrackInformation::TrackInformation
(
HepMC::GenParticlePtr
p,
ISF::ISFParticle
* baseIsp)
18
:
m_regenerationNr
(0)
19
,
m_currentGenParticle
(
std
::move(p))
20
,
m_theBaseISFParticle
(baseIsp)
21
,
m_returnedToISF
(false)
22
{
23
}
24
25
int
TrackInformation::GetParticleBarcode
()
const
26
{
27
if
(m_barcode !=
HepMC::INVALID_PARTICLE_BARCODE
)
return
m_barcode;
28
if
(
m_currentGenParticle
) {
29
m_barcode =
HepMC::barcode
(
m_currentGenParticle
);
30
return
m_barcode;
31
}
32
return
HepMC::UNDEFINED_ID
;
33
}
34
35
int
TrackInformation::GetParticleUniqueID
()
const
36
{
37
if
(m_uniqueID !=
HepMC::INVALID_PARTICLE_BARCODE
)
return
m_uniqueID;
38
if
(
m_currentGenParticle
) {
39
HepMC::ConstGenParticlePtr
particle =
m_currentGenParticle
;
40
m_uniqueID =
HepMC::uniqueID
(particle);
41
return
m_uniqueID;
42
}
43
return
HepMC::UNDEFINED_ID
;
44
}
45
46
int
TrackInformation::GetParticleStatus
()
const
47
{
48
if
(
m_currentGenParticle
) {
49
return
m_currentGenParticle
->status();
50
}
51
return
0;
52
}
53
54
void
TrackInformation::SetCurrentGenParticle
(
HepMC::GenParticlePtr
p)
55
{
56
m_currentGenParticle
= std::move(p);
57
m_barcode =
HepMC::INVALID_PARTICLE_BARCODE
;
58
m_uniqueID =
HepMC::INVALID_PARTICLE_BARCODE
;
59
}
60
61
void
TrackInformation::SetBaseISFParticle
(
ISF::ISFParticle
* p)
62
{
63
m_theBaseISFParticle
= p;
64
}
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:61
TrackInformation::TrackInformation
TrackInformation()
Definition
TrackInformation.cxx:9
TrackInformation::m_regenerationNr
int m_regenerationNr
Definition
TrackInformation.h:102
TrackInformation::GetParticleStatus
virtual int GetParticleStatus() const override
Definition
TrackInformation.cxx:46
TrackInformation::GetParticleUniqueID
virtual int GetParticleUniqueID() const override
Definition
TrackInformation.cxx:35
TrackInformation::m_theBaseISFParticle
ISF::ISFParticle * m_theBaseISFParticle
Definition
TrackInformation.h:106
TrackInformation::m_currentGenParticle
HepMC::GenParticlePtr m_currentGenParticle
Definition
TrackInformation.h:103
TrackInformation::GetParticleBarcode
virtual int GetParticleBarcode() const override
Definition
TrackInformation.cxx:25
TrackInformation::SetCurrentGenParticle
virtual void SetCurrentGenParticle(HepMC::GenParticlePtr) override
set m_currentGenParticle, the pointer to the GenParticle corresponding to the current G4Track.
Definition
TrackInformation.cxx:54
TrackInformation::m_returnedToISF
bool m_returnedToISF
Definition
TrackInformation.h:107
HepMC::barcode
int barcode(const T *p)
Definition
Barcode.h:16
HepMC::uniqueID
int uniqueID(const T &p)
Definition
MagicNumbers.h:117
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
GenParticle * GenParticlePtr
Definition
GenParticle.h:37
HepMC::ConstGenParticlePtr
const GenParticle * ConstGenParticlePtr
Definition
GenParticle.h:38
std
STL namespace.
Generated on
for ATLAS Offline Software by
1.14.0