ATLAS Offline Software
Loading...
Searching...
No Matches
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
6#include "G4Track.hh"
9
10
11TrackHelper::TrackHelper(const G4Track* t)
12{
13 m_trackInfo=static_cast<TrackInformation *>(t->GetUserInformation());
14}
16{
17 if (m_trackInfo==0) return false;
18 return m_trackInfo->GetClassification()==VTrackInformation::Primary;
19}
21{
22 if (m_trackInfo==0) return false;
23 return m_trackInfo->GetClassification()==VTrackInformation::RegeneratedPrimary;
24}
26{
27 if (m_trackInfo==0) return false;
28 return m_trackInfo->GetClassification()==VTrackInformation::RegisteredSecondary;
29}
31{
32 if (m_trackInfo==0) return true;
33 return m_trackInfo->GetClassification()==VTrackInformation::Secondary;
34}
35int 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
42{
43 if (m_trackInfo==0 || std::as_const(m_trackInfo)->GetCurrentGenParticle()==0) return 0;
44 return m_trackInfo->GetParticleUniqueID();
45}
46
48{
49 if (m_trackInfo==0 || std::as_const(m_trackInfo)->GetCurrentGenParticle()==0) return 0;
50 return m_trackInfo->GetParticleStatus();
51}
TrackInformation * m_trackInfo
Definition TrackHelper.h:39
TrackHelper(const G4Track *t)
bool IsPrimary() const
bool IsSecondary() const
int GetBarcode() const
bool IsRegisteredSecondary() const
bool IsRegeneratedPrimary() const
int GetUniqueID() const
int GetStatus() const
Implementation of VTrackInformation.