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 TrackSoA< TrackerTraits >::hindex_type
 
using TrackSoAConstView = typename TrackSoA< TrackerTraits >::template TrackSoALayout<>::ConstView
 
using TrackSoAView = typename TrackSoA< TrackerTraits >::template TrackSoALayout<>::View
 

Static Public Member Functions

static __host__ __device__ float charge (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 >
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 >
static constexpr __host__ __device__ void copyFromDense (TrackSoAView &tracks, V5 const &v, M5 const &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)
 
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

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

Definition at line 54 of file PixelTrackUtilities.h.

◆ TrackSoAConstView

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

Definition at line 53 of file PixelTrackUtilities.h.

◆ TrackSoAView

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 pwdgSkimBPark_cfi::tracks.

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

◆ computeNumberOfLayers()

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 pwdgSkimBPark_cfi::tracks.

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()

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, dqmMemoryStats::float, mps_fire::i, and pwdgSkimBPark_cfi::tracks.

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:118

◆ copyFromDense()

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, dqmdumpme::k, pwdgSkimBPark_cfi::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()

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, dqmdumpme::k, pwdgSkimBPark_cfi::tracks, and findQualityFiles::v.

Referenced by 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 pwdgSkimBPark_cfi::tracks.

Referenced by gpuVertexFinder::for().

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

◆ nHits()

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

Definition at line 62 of file PixelTrackUtilities.h.

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

Referenced by Particle.Particle::__str__(), and ntupleDataFormat.Track::phiPull().

63  {
64  return tracks[i].state()(0);

◆ 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 pwdgSkimBPark_cfi::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 pwdgSkimBPark_cfi::tracks.

Referenced by gpuVertexFinder::for().

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