ATLAS Offline Software
Loading...
Searching...
No Matches
TrackHelper Class Reference

#include <TrackHelper.h>

Collaboration diagram for TrackHelper:

Public Member Functions

 TrackHelper (const G4Track *t)
bool IsPrimary () const
bool IsRegeneratedPrimary () const
bool IsRegisteredSecondary () const
bool IsSecondary () const
int GetBarcode () const
int GetUniqueID () const
int GetStatus () const
TrackInformationGetTrackInformation ()
HepMcParticleLink GenerateParticleLink ()
 Generates a creates new HepMcParticleLink object on the stack based on GetUniqueID(), assuming that the link should point at the first GenEvent in the McEventCollection.
HepMcParticleLink GenerateParticleLink (IProxyDict *)

Private Member Functions

std::tuple< int, HepMcParticleLink::UniqueIDFlagparticleIdentifierAndFlag () const

Private Attributes

TrackInformationm_trackInfo

Detailed Description

Definition at line 18 of file TrackHelper.h.

Constructor & Destructor Documentation

◆ TrackHelper()

TrackHelper::TrackHelper ( const G4Track * t)

Definition at line 11 of file TrackHelper.cxx.

12{
13 m_trackInfo=static_cast<TrackInformation *>(t->GetUserInformation());
14}
TrackInformation * m_trackInfo
Definition TrackHelper.h:39

Member Function Documentation

◆ GenerateParticleLink() [1/2]

HepMcParticleLink TrackHelper::GenerateParticleLink ( )
inline

Generates a creates new HepMcParticleLink object on the stack based on GetUniqueID(), assuming that the link should point at the first GenEvent in the McEventCollection.

Definition at line 52 of file TrackHelper.h.

53{
55 return HepMcParticleLink(identifier,
56 0,
58 flag);
59}
std::tuple< int, HepMcParticleLink::UniqueIDFlag > particleIdentifierAndFlag() const
Definition TrackHelper.h:43
bool flag
Definition master.py:29

◆ GenerateParticleLink() [2/2]

HepMcParticleLink TrackHelper::GenerateParticleLink ( IProxyDict * proxy)
inline

Definition at line 61 of file TrackHelper.h.

62{
64 if(!proxy) {
65 return GenerateParticleLink();
66 }
67 return HepMcParticleLink(identifier,
68 0,
70 flag,
71 proxy);
72}
HepMcParticleLink GenerateParticleLink()
Generates a creates new HepMcParticleLink object on the stack based on GetUniqueID(),...
Definition TrackHelper.h:52

◆ GetBarcode()

int TrackHelper::GetBarcode ( ) const

Definition at line 35 of file TrackHelper.cxx.

36{
37 if (m_trackInfo==0 || std::as_const(m_trackInfo)->GetCurrentGenParticle()==0) return 0;
38 return m_trackInfo->GetParticleBarcode();
39}

◆ GetStatus()

int TrackHelper::GetStatus ( ) const

Definition at line 47 of file TrackHelper.cxx.

48{
49 if (m_trackInfo==0 || std::as_const(m_trackInfo)->GetCurrentGenParticle()==0) return 0;
50 return m_trackInfo->GetParticleStatus();
51}

◆ GetTrackInformation()

TrackInformation * TrackHelper::GetTrackInformation ( )
inline

Definition at line 28 of file TrackHelper.h.

28{return m_trackInfo;}

◆ GetUniqueID()

int TrackHelper::GetUniqueID ( ) const

Definition at line 41 of file TrackHelper.cxx.

42{
43 if (m_trackInfo==0 || std::as_const(m_trackInfo)->GetCurrentGenParticle()==0) return 0;
44 return m_trackInfo->GetParticleUniqueID();
45}

◆ IsPrimary()

bool TrackHelper::IsPrimary ( ) const

Definition at line 15 of file TrackHelper.cxx.

16{
17 if (m_trackInfo==0) return false;
18 return m_trackInfo->GetClassification()==VTrackInformation::Primary;
19}

◆ IsRegeneratedPrimary()

bool TrackHelper::IsRegeneratedPrimary ( ) const

Definition at line 20 of file TrackHelper.cxx.

21{
22 if (m_trackInfo==0) return false;
23 return m_trackInfo->GetClassification()==VTrackInformation::RegeneratedPrimary;
24}

◆ IsRegisteredSecondary()

bool TrackHelper::IsRegisteredSecondary ( ) const

Definition at line 25 of file TrackHelper.cxx.

26{
27 if (m_trackInfo==0) return false;
28 return m_trackInfo->GetClassification()==VTrackInformation::RegisteredSecondary;
29}

◆ IsSecondary()

bool TrackHelper::IsSecondary ( ) const

Definition at line 30 of file TrackHelper.cxx.

31{
32 if (m_trackInfo==0) return true;
33 return m_trackInfo->GetClassification()==VTrackInformation::Secondary;
34}

◆ particleIdentifierAndFlag()

std::tuple< int, HepMcParticleLink::UniqueIDFlag > TrackHelper::particleIdentifierAndFlag ( ) const
inlineprivate

Definition at line 43 of file TrackHelper.h.

44{
45#if defined(HEPMC3)
47#else
49#endif
50}
int GetBarcode() const
int GetUniqueID() const

Member Data Documentation

◆ m_trackInfo

TrackInformation* TrackHelper::m_trackInfo
private

Definition at line 39 of file TrackHelper.h.


The documentation for this class was generated from the following files: