ATLAS Offline Software
Loading...
Searching...
No Matches
Simulation
G4Sim
MCTruth
src
TrackHelper.cxx
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3
*/
4
5
#include "
MCTruth/TrackHelper.h
"
6
#include "G4Track.hh"
7
#include "
ISF_Event/ISFParticle.h
"
8
#include "
MCTruth/TrackInformation.h
"
9
10
11
TrackHelper::TrackHelper
(
const
G4Track* t)
12
{
13
m_trackInfo
=
static_cast<
TrackInformation
*
>
(t->GetUserInformation());
14
}
15
bool
TrackHelper::IsPrimary
()
const
16
{
17
if
(
m_trackInfo
==0)
return
false
;
18
return
m_trackInfo
->GetClassification()==
VTrackInformation::Primary
;
19
}
20
bool
TrackHelper::IsRegeneratedPrimary
()
const
21
{
22
if
(
m_trackInfo
==0)
return
false
;
23
return
m_trackInfo
->GetClassification()==
VTrackInformation::RegeneratedPrimary
;
24
}
25
bool
TrackHelper::IsRegisteredSecondary
()
const
26
{
27
if
(
m_trackInfo
==0)
return
false
;
28
return
m_trackInfo
->GetClassification()==
VTrackInformation::RegisteredSecondary
;
29
}
30
bool
TrackHelper::IsSecondary
()
const
31
{
32
if
(
m_trackInfo
==0)
return
true
;
33
return
m_trackInfo
->GetClassification()==
VTrackInformation::Secondary
;
34
}
35
int
TrackHelper::GetBarcode
()
const
// TODO Drop this once UniqueID and Status are used instead
36
{
37
if
(
m_trackInfo
==0 || std::as_const(
m_trackInfo
)->GetCurrentGenParticle()==0)
return
0;
38
return
m_trackInfo
->GetParticleBarcode();
39
}
40
41
int
TrackHelper::GetUniqueID
()
const
42
{
43
if
(
m_trackInfo
==0 || std::as_const(
m_trackInfo
)->GetCurrentGenParticle()==0)
return
0;
44
return
m_trackInfo
->GetParticleUniqueID();
45
}
46
47
int
TrackHelper::GetStatus
()
const
48
{
49
if
(
m_trackInfo
==0 || std::as_const(
m_trackInfo
)->GetCurrentGenParticle()==0)
return
0;
50
return
m_trackInfo
->GetParticleStatus();
51
}
ISFParticle.h
TrackHelper.h
TrackInformation.h
TrackHelper::m_trackInfo
TrackInformation * m_trackInfo
Definition
TrackHelper.h:39
TrackHelper::TrackHelper
TrackHelper(const G4Track *t)
Definition
TrackHelper.cxx:11
TrackHelper::IsPrimary
bool IsPrimary() const
Definition
TrackHelper.cxx:15
TrackHelper::IsSecondary
bool IsSecondary() const
Definition
TrackHelper.cxx:30
TrackHelper::GetBarcode
int GetBarcode() const
Definition
TrackHelper.cxx:35
TrackHelper::IsRegisteredSecondary
bool IsRegisteredSecondary() const
Definition
TrackHelper.cxx:25
TrackHelper::IsRegeneratedPrimary
bool IsRegeneratedPrimary() const
Definition
TrackHelper.cxx:20
TrackHelper::GetUniqueID
int GetUniqueID() const
Definition
TrackHelper.cxx:41
TrackHelper::GetStatus
int GetStatus() const
Definition
TrackHelper.cxx:47
TrackInformation
Implementation of VTrackInformation.
Definition
TrackInformation.h:41
VTrackInformation::RegeneratedPrimary
@ RegeneratedPrimary
Definition
VTrackInformation.h:32
VTrackInformation::Primary
@ Primary
Definition
VTrackInformation.h:32
VTrackInformation::RegisteredSecondary
@ RegisteredSecondary
Definition
VTrackInformation.h:32
VTrackInformation::Secondary
@ Secondary
Definition
VTrackInformation.h:32
const
Generated on
for ATLAS Offline Software by
1.14.0