ATLAS Offline Software
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
}
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:560
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
Generated on Thu Nov 7 2024 21:28:58 for ATLAS Offline Software by
1.8.18