CMS 3D CMS Logo

List of all members | Public Types | Static Public Member Functions
TracksUtilities< TrackerTraits > Struct Template Reference

#include <PixelTrackUtilities.h>

Public Types

using hindex_type = typename reco::TrackSoA< TrackerTraits >::hindex_type
 
using hindex_type = typename TrackSoA< TrackerTraits >::hindex_type
 
using TrackSoAConstView = typename reco::TrackSoA< TrackerTraits >::template Layout<>::ConstView
 
using TrackSoAConstView = typename TrackSoA< TrackerTraits >::template TrackSoALayout<>::ConstView
 
using TrackSoAView = typename reco::TrackSoA< TrackerTraits >::template Layout<>::View
 
using TrackSoAView = typename TrackSoA< TrackerTraits >::template TrackSoALayout<>::View
 

Static Public Member Functions

static __host__ __device__ float charge (const TrackSoAConstView &tracks, int32_t i)
 
ALPAKA_FN_HOST_ACC static ALPAKA_FN_INLINE constexpr int computeNumberOfLayers (const TrackSoAConstView &tracks, int32_t i)
 
static constexpr __host__ __device__ int computeNumberOfLayers (const TrackSoAConstView &tracks, int32_t i)
 
template<typename V3 , typename M3 , typename V2 , typename M2 >
ALPAKA_FN_HOST_ACC static ALPAKA_FN_INLINE constexpr void copyFromCircle (TrackSoAView &tracks, V3 const &cp, M3 const &ccov, V2 const &lp, M2 const &lcov, float b, int32_t i)
 
template<typename V3 , typename M3 , typename V2 , typename M2 >
static constexpr __host__ __device__ void copyFromCircle (TrackSoAView &tracks, V3 const &cp, M3 const &ccov, V2 const &lp, M2 const &lcov, float b, int32_t i)
 
template<typename V5 , typename M5 >
ALPAKA_FN_HOST_ACC static ALPAKA_FN_INLINE constexpr void copyFromDense (TrackSoAView &tracks, V5 const &v, M5 const &cov, int32_t i)
 
template<typename V5 , typename M5 >
static constexpr __host__ __device__ void copyFromDense (TrackSoAView &tracks, V5 const &v, M5 const &cov, int32_t i)
 
template<typename V5 , typename M5 >
ALPAKA_FN_HOST_ACC static ALPAKA_FN_INLINE constexpr void copyToDense (const TrackSoAConstView &tracks, V5 &v, M5 &cov, int32_t i)
 
template<typename V5 , typename M5 >
static constexpr __host__ __device__ void copyToDense (const TrackSoAConstView &tracks, V5 &v, M5 &cov, int32_t i)
 
static constexpr __host__ __device__ bool isTriplet (const TrackSoAConstView &tracks, int i)
 
ALPAKA_FN_HOST_ACC static ALPAKA_FN_INLINE constexpr int nHits (const TrackSoAConstView &tracks, int i)
 
static constexpr __host__ __device__ int nHits (const TrackSoAConstView &tracks, int i)
 
static constexpr __host__ __device__ float phi (const TrackSoAConstView &tracks, int32_t i)
 
static constexpr __host__ __device__ float tip (const TrackSoAConstView &tracks, int32_t i)
 
static constexpr __host__ __device__ float zip (const TrackSoAConstView &tracks, int32_t i)
 

Detailed Description

template<typename TrackerTraits>
struct TracksUtilities< TrackerTraits >

Definition at line 51 of file PixelTrackUtilities.h.

Member Typedef Documentation

◆ hindex_type [1/2]

template<typename TrackerTraits>
using TracksUtilities< TrackerTraits >::hindex_type = typename reco::TrackSoA<TrackerTraits>::hindex_type

Definition at line 18 of file TrackUtilities.h.

◆ hindex_type [2/2]

template<typename TrackerTraits>
using TracksUtilities< TrackerTraits >::hindex_type = typename TrackSoA<TrackerTraits>::hindex_type

Definition at line 54 of file PixelTrackUtilities.h.

◆ TrackSoAConstView [1/2]

template<typename TrackerTraits>
using TracksUtilities< TrackerTraits >::TrackSoAConstView = typename reco::TrackSoA<TrackerTraits>::template Layout<>::ConstView

Definition at line 17 of file TrackUtilities.h.

◆ TrackSoAConstView [2/2]

template<typename TrackerTraits>
using TracksUtilities< TrackerTraits >::TrackSoAConstView = typename TrackSoA<TrackerTraits>::template TrackSoALayout<>::ConstView

Definition at line 53 of file PixelTrackUtilities.h.

◆ TrackSoAView [1/2]

template<typename TrackerTraits>
using TracksUtilities< TrackerTraits >::TrackSoAView = typename reco::TrackSoA<TrackerTraits>::template Layout<>::View

Definition at line 16 of file TrackUtilities.h.

◆ TrackSoAView [2/2]

template<typename TrackerTraits>
using TracksUtilities< TrackerTraits >::TrackSoAView = typename TrackSoA<TrackerTraits>::template TrackSoALayout<>::View

Definition at line 52 of file PixelTrackUtilities.h.

Member Function Documentation

◆ charge()

template<typename TrackerTraits>
static __host__ __device__ float TracksUtilities< TrackerTraits >::charge ( const TrackSoAConstView tracks,
int32_t  i 
)
inlinestatic

Definition at line 58 of file PixelTrackUtilities.h.

References f, mps_fire::i, and DiMuonV_cfg::tracks.

59  {
60  return std::copysign(1.f, tracks[i].state()(2));
double f[11][100]

◆ computeNumberOfLayers() [1/2]

template<typename TrackerTraits>
ALPAKA_FN_HOST_ACC static ALPAKA_FN_INLINE constexpr int TracksUtilities< TrackerTraits >::computeNumberOfLayers ( const TrackSoAConstView tracks,
int32_t  i 
)
inlinestatic

Definition at line 67 of file TrackUtilities.h.

References mps_fire::i, and DiMuonV_cfg::tracks.

68  {
69  auto pdet = tracks.detIndices().begin(i);
70  int nl = 1;
71  auto ol = pixelTopology::getLayer<TrackerTraits>(*pdet);
72  for (; pdet < tracks.detIndices().end(i); ++pdet) {
73  auto il = pixelTopology::getLayer<TrackerTraits>(*pdet);
74  if (il != ol)
75  ++nl;
76  ol = il;
77  }
78  return nl;
79  }

◆ computeNumberOfLayers() [2/2]

template<typename TrackerTraits>
static constexpr __host__ __device__ int TracksUtilities< TrackerTraits >::computeNumberOfLayers ( const TrackSoAConstView tracks,
int32_t  i 
)
inlinestatic

Definition at line 123 of file PixelTrackUtilities.h.

References mps_fire::i, and DiMuonV_cfg::tracks.

Referenced by ALPAKA_ACCELERATOR_NAMESPACE::caHitNtupletGeneratorKernels::Kernel_fillNLayers< TrackerTraits >::operator()().

124  {
125  auto pdet = tracks.detIndices().begin(i);
126  int nl = 1;
127  auto ol = pixelTopology::getLayer<TrackerTraits>(*pdet);
128  for (; pdet < tracks.detIndices().end(i); ++pdet) {
129  auto il = pixelTopology::getLayer<TrackerTraits>(*pdet);
130  if (il != ol)
131  ++nl;
132  ol = il;
133  }
134  return nl;

◆ copyFromCircle() [1/2]

template<typename TrackerTraits>
template<typename V3 , typename M3 , typename V2 , typename M2 >
ALPAKA_FN_HOST_ACC static ALPAKA_FN_INLINE constexpr void TracksUtilities< TrackerTraits >::copyFromCircle ( TrackSoAView tracks,
V3 const &  cp,
M3 const &  ccov,
V2 const &  lp,
M2 const &  lcov,
float  b,
int32_t  i 
)
inlinestatic

Definition at line 23 of file TrackUtilities.h.

References b, ALCARECOEcalPhiSym_cff::float, mps_fire::i, and DiMuonV_cfg::tracks.

24  {
25  tracks[i].state() << cp.template cast<float>(), lp.template cast<float>();
26 
27  tracks[i].state()(2) = tracks[i].state()(2) * b;
28  auto cov = tracks[i].covariance();
29  cov(0) = ccov(0, 0);
30  cov(1) = ccov(0, 1);
31  cov(2) = b * float(ccov(0, 2));
32  cov(4) = cov(3) = 0;
33  cov(5) = ccov(1, 1);
34  cov(6) = b * float(ccov(1, 2));
35  cov(8) = cov(7) = 0;
36  cov(9) = b * b * float(ccov(2, 2));
37  cov(11) = cov(10) = 0;
38  cov(12) = lcov(0, 0);
39  cov(13) = lcov(0, 1);
40  cov(14) = lcov(1, 1);
41  }
double b
Definition: hdecay.h:120

◆ copyFromCircle() [2/2]

template<typename TrackerTraits>
template<typename V3 , typename M3 , typename V2 , typename M2 >
static constexpr __host__ __device__ void TracksUtilities< TrackerTraits >::copyFromCircle ( TrackSoAView tracks,
V3 const &  cp,
M3 const &  ccov,
V2 const &  lp,
M2 const &  lcov,
float  b,
int32_t  i 
)
inlinestatic

Definition at line 79 of file PixelTrackUtilities.h.

References b, ALCARECOEcalPhiSym_cff::float, mps_fire::i, and DiMuonV_cfg::tracks.

Referenced by ALPAKA_ACCELERATOR_NAMESPACE::Kernel_LineFit< N, TrackerTraits >::operator()(), and ALPAKA_ACCELERATOR_NAMESPACE::Kernel_BLFit< N, TrackerTraits >::operator()().

81  {
82  tracks[i].state() << cp.template cast<float>(), lp.template cast<float>();
83 
84  tracks[i].state()(2) = tracks[i].state()(2) * b;
85  auto cov = tracks[i].covariance();
86  cov(0) = ccov(0, 0);
87  cov(1) = ccov(0, 1);
88  cov(2) = b * float(ccov(0, 2));
89  cov(4) = cov(3) = 0;
90  cov(5) = ccov(1, 1);
91  cov(6) = b * float(ccov(1, 2));
92  cov(8) = cov(7) = 0;
93  cov(9) = b * b * float(ccov(2, 2));
94  cov(11) = cov(10) = 0;
95  cov(12) = lcov(0, 0);
96  cov(13) = lcov(0, 1);
97  cov(14) = lcov(1, 1);
double b
Definition: hdecay.h:120

◆ copyFromDense() [1/2]

template<typename TrackerTraits>
template<typename V5 , typename M5 >
ALPAKA_FN_HOST_ACC static ALPAKA_FN_INLINE constexpr void TracksUtilities< TrackerTraits >::copyFromDense ( TrackSoAView tracks,
V5 const &  v,
M5 const &  cov,
int32_t  i 
)
inlinestatic

Definition at line 44 of file TrackUtilities.h.

References mps_fire::i, dqmiolumiharvest::j, isotrackApplyRegressor::k, DiMuonV_cfg::tracks, and findQualityFiles::v.

47  {
48  tracks[i].state() = v.template cast<float>();
49  for (int j = 0, ind = 0; j < 5; ++j)
50  for (auto k = j; k < 5; ++k)
51  tracks[i].covariance()(ind++) = cov(j, k);
52  }

◆ copyFromDense() [2/2]

template<typename TrackerTraits>
template<typename V5 , typename M5 >
static constexpr __host__ __device__ void TracksUtilities< TrackerTraits >::copyFromDense ( TrackSoAView tracks,
V5 const &  v,
M5 const &  cov,
int32_t  i 
)
inlinestatic

Definition at line 100 of file PixelTrackUtilities.h.

References mps_fire::i, dqmiolumiharvest::j, isotrackApplyRegressor::k, DiMuonV_cfg::tracks, and findQualityFiles::v.

104  {
105  tracks[i].state() = v.template cast<float>();
106  for (int j = 0, ind = 0; j < 5; ++j)
107  for (auto k = j; k < 5; ++k)
108  tracks[i].covariance()(ind++) = cov(j, k);

◆ copyToDense() [1/2]

template<typename TrackerTraits>
template<typename V5 , typename M5 >
ALPAKA_FN_HOST_ACC static ALPAKA_FN_INLINE constexpr void TracksUtilities< TrackerTraits >::copyToDense ( const TrackSoAConstView tracks,
V5 &  v,
M5 &  cov,
int32_t  i 
)
inlinestatic

Definition at line 55 of file TrackUtilities.h.

References mps_fire::i, dqmiolumiharvest::j, isotrackApplyRegressor::k, DiMuonV_cfg::tracks, and findQualityFiles::v.

58  {
59  v = tracks[i].state().template cast<typename V5::Scalar>();
60  for (int j = 0, ind = 0; j < 5; ++j) {
61  cov(j, j) = tracks[i].covariance()(ind++);
62  for (auto k = j + 1; k < 5; ++k)
63  cov(k, j) = cov(j, k) = tracks[i].covariance()(ind++);
64  }
65  }

◆ copyToDense() [2/2]

template<typename TrackerTraits>
template<typename V5 , typename M5 >
static constexpr __host__ __device__ void TracksUtilities< TrackerTraits >::copyToDense ( const TrackSoAConstView tracks,
V5 &  v,
M5 &  cov,
int32_t  i 
)
inlinestatic

Definition at line 111 of file PixelTrackUtilities.h.

References mps_fire::i, dqmiolumiharvest::j, isotrackApplyRegressor::k, DiMuonV_cfg::tracks, and findQualityFiles::v.

Referenced by L2TauNNProducerAlpaka::impactParameter(), and L2TauNNProducer::impactParameter().

115  {
116  v = tracks[i].state().template cast<typename V5::Scalar>();
117  for (int j = 0, ind = 0; j < 5; ++j) {
118  cov(j, j) = tracks[i].covariance()(ind++);
119  for (auto k = j + 1; k < 5; ++k)
120  cov(k, j) = cov(j, k) = tracks[i].covariance()(ind++);
121  }

◆ isTriplet()

template<typename TrackerTraits>
static constexpr __host__ __device__ bool TracksUtilities< TrackerTraits >::isTriplet ( const TrackSoAConstView tracks,
int  i 
)
inlinestatic

Definition at line 74 of file PixelTrackUtilities.h.

References mps_fire::i, and DiMuonV_cfg::tracks.

Referenced by gpuVertexFinder::for().

75  {
76  return tracks[i].nLayers() == 3;

◆ nHits() [1/2]

template<typename TrackerTraits>
ALPAKA_FN_HOST_ACC static ALPAKA_FN_INLINE constexpr int TracksUtilities< TrackerTraits >::nHits ( const TrackSoAConstView tracks,
int  i 
)
inlinestatic

Definition at line 81 of file TrackUtilities.h.

References mps_fire::i, and DiMuonV_cfg::tracks.

81  {
82  return tracks.detIndices().size(i);
83  }

◆ nHits() [2/2]

template<typename TrackerTraits>
static constexpr __host__ __device__ int TracksUtilities< TrackerTraits >::nHits ( const TrackSoAConstView tracks,
int  i 
)
inlinestatic

◆ phi()

template<typename TrackerTraits>
static constexpr __host__ __device__ float TracksUtilities< TrackerTraits >::phi ( const TrackSoAConstView tracks,
int32_t  i 
)
inlinestatic

◆ tip()

template<typename TrackerTraits>
static constexpr __host__ __device__ float TracksUtilities< TrackerTraits >::tip ( const TrackSoAConstView tracks,
int32_t  i 
)
inlinestatic

Definition at line 66 of file PixelTrackUtilities.h.

References mps_fire::i, and DiMuonV_cfg::tracks.

67  {
68  return tracks[i].state()(1);

◆ zip()

template<typename TrackerTraits>
static constexpr __host__ __device__ float TracksUtilities< TrackerTraits >::zip ( const TrackSoAConstView tracks,
int32_t  i 
)
inlinestatic

Definition at line 70 of file PixelTrackUtilities.h.

References mps_fire::i, and DiMuonV_cfg::tracks.

Referenced by gpuVertexFinder::for().

71  {
72  return tracks[i].state()(4);