Project
Loading...
Searching...
No Matches
GPUTRDInterfaceO2Track.h
Go to the documentation of this file.
1// Copyright 2019-2020 CERN and copyright holders of ALICE O2.
2// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders.
3// All rights not expressly granted are reserved.
4//
5// This software is distributed under the terms of the GNU General Public
6// License v3 (GPL Version 3), copied verbatim in the file "COPYING".
7//
8// In applying this license CERN does not waive the privileges and immunities
9// granted to it by virtue of its status as an Intergovernmental Organization
10// or submit itself to any jurisdiction.
11
14
15#ifndef GPUTRDINTERFACEO2TRACK_H
16#define GPUTRDINTERFACEO2TRACK_H
17
18// This is the interface for the GPUTRDTrack based on the O2 track type
19#include "GPUCommonDef.h"
20namespace o2::gpu
21{
22template <typename T>
23class trackInterface;
24template <typename T>
25class GPUTRDTrack_t;
26class GPUTPCGMMergedTrack;
27namespace gputpcgmmergertypes
28{
29struct GPUTPCOuterParam;
30} // namespace gputpcgmmergertypes
31} // namespace o2::gpu
32namespace o2::tpc
33{
34class TrackTPC;
35}
36namespace o2::dataformats
37{
38class TrackTPCITS;
39}
40
44
45namespace o2::gpu
46{
47
48template <>
50{
51 public:
53 trackInterface(const o2::track::TrackParCov& param) = delete;
55 template <class T>
56 GPUd() trackInterface(const T& trkSrc) : o2::track::TrackParCov(trkSrc.getParamOut())
57 {
58 }
59
60 GPUd() void set(float x, float alpha, const float* param, const float* cov)
61 {
62 setX(x);
64 for (int32_t i = 0; i < 5; i++) {
65 setParam(param[i], i);
66 }
67 for (int32_t i = 0; i < 15; i++) {
68 setCov(cov[i], i);
69 }
70 }
72 GPUd() trackInterface(const gputpcgmmergertypes::GPUTPCOuterParam& param);
73 GPUd() void updateCovZ2(float addZerror) { updateCov(addZerror, o2::track::CovLabels::kSigZ2); }
74 GPUd() o2::track::TrackLTIntegral& getLTIntegralOut() { return mLTOut; }
75 GPUd() const o2::track::TrackLTIntegral& getLTIntegralOut() const { return mLTOut; }
76 GPUd() o2::track::TrackParCov& getOuterParam() { return mParamOut; }
77 GPUd() const o2::track::TrackParCov& getOuterParam() const { return mParamOut; }
78
79 GPUdi() const float* getPar() const { return getParams(); }
80
81 GPUdi() bool CheckNumericalQuality() const { return true; }
82
83 GPUdi() void setPileUpDistance(uint8_t bwd, uint8_t fwd) { setUserField((((uint16_t)bwd) << 8) | fwd); }
84 GPUdi() bool hasPileUpInfo() const { return getUserField() != 0; }
85 GPUdi() bool hasPileUpInfoBothSides() const { return getPileUpDistanceBwd() > 0 && getPileUpDistanceFwd() > 0; }
86 GPUdi() uint8_t getPileUpDistanceBwd() const { return getUserField() >> 8; }
87 GPUdi() uint8_t getPileUpDistanceFwd() const { return getUserField() & 255; }
88 GPUdi() uint16_t getPileUpSpan() const { return ((uint16_t)getPileUpDistanceBwd()) + getPileUpDistanceFwd(); }
89 GPUdi() float getPileUpMean() const { return hasPileUpInfoBothSides() ? 0.5f * (getPileUpDistanceFwd() + getPileUpDistanceBwd()) : getPileUpDistanceFwd() + getPileUpDistanceBwd(); }
90 GPUdi() float getPileUpTimeShiftMUS() const { return getPileUpMean() * o2::constants::lhc::LHCBunchSpacingMUS; }
91 GPUdi() float getPileUpTimeErrorMUS() const { return getPileUpSpan() * o2::constants::lhc::LHCBunchSpacingMUS / 3.4641016f; }
92
94
95 private:
97 o2::track::TrackParCov mParamOut;
98
99 ClassDefNV(trackInterface, 1);
100};
101
102} // namespace o2::gpu
103
104#endif
Base track model for the Barrel, params only, w/o covariance.
int32_t i
Header to collect LHC related constants.
o2::track::TrackParCov TrackParCov
Definition Recon.h:39
Track Length and TOF integral.
GPUd() trackInterface(const GPUTPCGMMergedTrack &trk)
GLfloat GLfloat GLfloat alpha
Definition glcorearb.h:279
GLint GLenum GLint x
Definition glcorearb.h:403
typedef void(APIENTRYP PFNGLCULLFACEPROC)(GLenum mode)
GLenum GLfloat param
Definition glcorearb.h:271
constexpr double LHCBunchSpacingMUS
Definition of a container to keep/associate and arbitrary number of labels associated to an index wit...
GPUdi() o2
Definition TrackTRD.h:39
GPUd() const expr uint32_t MultivariatePolynomialHelper< Dim
Global TPC definitions and constants.
Definition SimTraits.h:168
TrackParCovF TrackParCov
Definition Track.h:33
a couple of static helper functions to create timestamp values for CCDB queries or override obsolete ...