Skip to content

Commit d886b77

Browse files
committed
Add getR method to TrackPar
1 parent 202d71b commit d886b77

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

DataFormats/Reconstruction/include/ReconstructionDataFormats/TrackParametrization.h

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,8 @@ class TrackParametrization
165165
GPUd() value_t getTgl() const;
166166
GPUhd() value_t getQ2Pt() const;
167167
GPUd() value_t getCharge2Pt() const;
168+
GPUd() value_t getR2() const;
169+
GPUd() value_t getR() const;
168170
GPUd() int getAbsCharge() const;
169171
GPUd() PID getPID() const;
170172
GPUd() void setPID(const PID pid, bool passCharge = false);
@@ -378,6 +380,20 @@ GPUdi() auto TrackParametrization<value_T>::getCharge2Pt() const -> value_t
378380
return mAbsCharge ? mP[kQ2Pt] : 0.f;
379381
}
380382

383+
//____________________________________________________________
384+
template <typename value_T>
385+
GPUdi() auto TrackParametrization<value_T>::getR2() const -> value_t
386+
{
387+
return mX * mX + mP[kY] * mP[kY];
388+
}
389+
390+
//____________________________________________________________
391+
template <typename value_T>
392+
GPUdi() auto TrackParametrization<value_T>::getR() const -> value_t
393+
{
394+
return gpu::CAMath::Sqrt(getR2());
395+
}
396+
381397
//____________________________________________________________
382398
template <typename value_T>
383399
GPUdi() int TrackParametrization<value_T>::getAbsCharge() const

0 commit comments

Comments
 (0)