ATLAS Offline Software
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"
9 
10 
11 TrackHelper::TrackHelper(const G4Track* t)
12 {
13  m_trackInfo=static_cast<TrackInformation *>(t->GetUserInformation());
14 }
16 {
17  if (m_trackInfo==0) return false;
19 }
21 {
22  if (m_trackInfo==0) return false;
24 }
26 {
27  if (m_trackInfo==0) return false;
29 }
31 {
32  if (m_trackInfo==0) return true;
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;
39 }
40 
42 {
43  if (m_trackInfo==0 || std::as_const(m_trackInfo)->GetCurrentGenParticle()==0) return 0;
45 }
46 
48 {
49  if (m_trackInfo==0 || std::as_const(m_trackInfo)->GetCurrentGenParticle()==0) return 0;
51 }
TrackHelper::IsRegeneratedPrimary
bool IsRegeneratedPrimary() const
Definition: TrackHelper.cxx:20
TrackHelper::GetBarcode
int GetBarcode() const
Definition: TrackHelper.cxx:35
TrackHelper.h
read_hist_ntuple.t
t
Definition: read_hist_ntuple.py:5
const
bool const RAWDATA *ch2 const
Definition: LArRodBlockPhysicsV0.cxx:562
TrackInformation::GetParticleUniqueID
virtual int GetParticleUniqueID() const override
Definition: TrackInformation.cxx:36
ISFParticle.h
TrackHelper::TrackHelper
TrackHelper(const G4Track *t)
Definition: TrackHelper.cxx:11
VTrackInformation::Primary
@ Primary
Definition: VTrackInformation.h:32
TrackInformation
Implementation of VTrackInformation. Instances of this class are attached as UserInformation to G4Tra...
Definition: TrackInformation.h:41
TrackHelper::IsSecondary
bool IsSecondary() const
Definition: TrackHelper.cxx:30
TrackInformation.h
TrackHelper::GetStatus
int GetStatus() const
Definition: TrackHelper.cxx:47
TrackHelper::IsRegisteredSecondary
bool IsRegisteredSecondary() const
Definition: TrackHelper.cxx:25
TrackInformation::GetParticleBarcode
virtual int GetParticleBarcode() const override
Definition: TrackInformation.cxx:26
TrackHelper::IsPrimary
bool IsPrimary() const
Definition: TrackHelper.cxx:15
TrackInformation::GetParticleStatus
virtual int GetParticleStatus() const override
Definition: TrackInformation.cxx:47
TrackHelper::m_trackInfo
TrackInformation * m_trackInfo
Definition: TrackHelper.h:32
VTrackInformation::Secondary
@ Secondary
Definition: VTrackInformation.h:32
TrackHelper::GetUniqueID
int GetUniqueID() const
Definition: TrackHelper.cxx:41
VTrackInformation::RegisteredSecondary
@ RegisteredSecondary
Definition: VTrackInformation.h:32
VTrackInformation::GetClassification
TrackClassification GetClassification() const
return the classification of the current G4Ttrack (Primary, Regenerated Primary, Registered Secondary...
Definition: VTrackInformation.h:39
VTrackInformation::RegeneratedPrimary
@ RegeneratedPrimary
Definition: VTrackInformation.h:32