ATLAS Offline Software
Loading...
Searching...
No Matches
TrackHelpers.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
3*/
4
6
7
8#ifndef COLUMNAR_TRACKING_TRACK_HELPERS_H
9#define COLUMNAR_TRACKING_TRACK_HELPERS_H
10
16
17namespace columnar
18{
19 namespace TrackHelpers
20 {
27
28
29 template<ContainerIdConcept CI = ContainerId::track,typename CM=ColumnarModeDefault>
30 class ChargeAccessor final
31 {
33
34 public:
35
37 : m_qOverPAcc (columnarTool, "qOverP")
38 {}
39
40 [[nodiscard]] float operator () (ObjectId<CI,CM> object) const
41 {
43 }
44 };
45
46
47
61
62 template<ContainerIdConcept CI = ContainerId::track,typename CM=ColumnarModeDefault>
64 {
68
69 public:
70
72 : m_qOverPAcc (columnarTool, "qOverP"),
73 m_thetaAcc (columnarTool, "theta"),
74 m_phiAcc (columnarTool, "phi")
75 {}
76
78 [[nodiscard]] GenVecFourMom_t genvecP4 (ObjectId<CI,CM> trk, double m) const {
80 }
81
82 [[nodiscard]] double pt (ObjectId<CI,CM> object, double m) const {
83 return genvecP4 (object, m).pt(); }
84 [[nodiscard]] double eta (ObjectId<CI,CM> object, double m) const {
85 return genvecP4 (object, m).eta(); }
86 [[nodiscard]] double phi (ObjectId<CI,CM> object, double m) const {
87 return genvecP4 (object, m).phi(); }
88 };
89
90
91
92 template<ContainerIdConcept CI = ContainerId::track,typename CM=ColumnarModeDefault>
94 {
100
101 public:
102
104 : m_d0Acc (columnarTool, "d0"),
105 m_z0Acc (columnarTool, "z0"),
106 m_phi0Acc (columnarTool, "phi"),
107 m_thetaAcc (columnarTool, "theta"),
108 m_qOverPAcc (columnarTool, "qOverP")
109 {}
110
111 [[nodiscard]] xAOD::DefiningParameters_t operator () (ObjectId<CI,CM> trk) const {
112 xAOD::DefiningParameters_t tmp;
113 tmp << m_d0Acc(trk) , m_z0Acc(trk) , m_phi0Acc(trk) , m_thetaAcc(trk) , m_qOverPAcc(trk);
114 return tmp;
115 }
116 };
117
118
119
120 template<ContainerIdConcept CI = ContainerId::track,typename CM=ColumnarModeDefault>
122 {
125
126 public:
127
129 : m_accCovMatrixDiag (columnarTool, "definingParametersCovMatrixDiag"),
130 m_accCovMatrixOffDiag (columnarTool, "definingParametersCovMatrixOffDiag")
131 {}
132
133 [[nodiscard]] const xAOD::ParametersCovMatrix_t operator () (ObjectId<CI,CM> trk) const {
134 bool valid = true;
136 if( !valid ) throw std::runtime_error("DefiningParametersCovAccessor: track covariance matrix not available or improperly formatted");
137 return result;
138 }
139 };
140 }
141}
142
143#endif
A number of constexpr particle constants to avoid hardcoding them directly in various places.
Helper functions for TrackingDetails accessors.
the base class for all columnar components
a class representing a single object (electron, muons, etc.)
ColumnAccessor< CI, float, CM > m_qOverPAcc
ChargeAccessor(ColumnarTool< CM > &columnarTool)
float operator()(ObjectId< CI, CM > object) const
DefiningParametersAccessor(ColumnarTool< CM > &columnarTool)
ColumnAccessor< CI, float, CM > m_qOverPAcc
ColumnAccessor< CI, float, CM > m_thetaAcc
xAOD::DefiningParameters_t operator()(ObjectId< CI, CM > trk) const
ColumnAccessor< CI, float, CM > m_phi0Acc
const xAOD::ParametersCovMatrix_t operator()(ObjectId< CI, CM > trk) const
DefiningParametersCovAccessor(ColumnarTool< CM > &columnarTool)
ColumnAccessor< CI, std::vector< float >, CM > m_accCovMatrixDiag
ColumnAccessor< CI, std::vector< float >, CM > m_accCovMatrixOffDiag
ColumnAccessor< CI, float, CM > m_qOverPAcc
ColumnAccessor< CI, RetypeColumn< double, float >, CM > m_phiAcc
double eta(ObjectId< CI, CM > object, double m) const
double phi(ObjectId< CI, CM > object, double m) const
GenVecFourMom_t genvecP4(ObjectId< CI, CM > trk, double m) const
double pt(ObjectId< CI, CM > object, double m) const
xAOD::TrackParticle::GenVecFourMom_t GenVecFourMom_t
ColumnAccessor< CI, float, CM > m_thetaAcc
TrackMomentumAccessors(ColumnarTool< CM > &columnarTool)
ROOT::Math::LorentzVector< ROOT::Math::PxPyPzM4D< double > > GenVecFourMom_t
Base 4 Momentum type for TrackParticle.
AccessorTemplate< CI, CT, ColumnAccessMode::input, CM > ColumnAccessor
GenVecFourMom_t genvecP4(float qOverP, float thetaT, float phiT, double m)
xAOD::ParametersCovMatrix_t definingParametersCovMatrix(std::span< const float > covMatrixDiag, std::span< const float > covMatrixOffDiag, bool &valid)
float charge(float qOverP)