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;
24class GPUTPCGMMergedTrack;
25namespace gputpcgmmergertypes
26{
27struct GPUTPCOuterParam;
28} // namespace gputpcgmmergertypes
29} // namespace o2::gpu
30
37
38namespace o2::gpu
39{
40
41template <>
43{
44 public:
46 trackInterface(const o2::track::TrackParCov& param) = delete;
47 GPUd() trackInterface(const o2::dataformats::TrackTPCITS& trkItsTpc) : o2::track::TrackParCov(trkItsTpc.getParamOut()) {}
48 GPUd() trackInterface(const o2::tpc::TrackTPC& trkTpc) : o2::track::TrackParCov(trkTpc.getParamOut()) {}
49
50 GPUd() void set(float x, float alpha, const float* param, const float* cov)
51 {
52 setX(x);
54 for (int32_t i = 0; i < 5; i++) {
55 setParam(param[i], i);
56 }
57 for (int32_t i = 0; i < 15; i++) {
58 setCov(cov[i], i);
59 }
60 }
62 GPUd() trackInterface(const gputpcgmmergertypes::GPUTPCOuterParam& param);
63 GPUd() void updateCovZ2(float addZerror) { updateCov(addZerror, o2::track::CovLabels::kSigZ2); }
64 GPUd() o2::track::TrackLTIntegral& getLTIntegralOut() { return mLTOut; }
65 GPUd() const o2::track::TrackLTIntegral& getLTIntegralOut() const { return mLTOut; }
66 GPUd() o2::track::TrackParCov& getOuterParam() { return mParamOut; }
67 GPUd() const o2::track::TrackParCov& getOuterParam() const { return mParamOut; }
68
69 GPUdi() const float* getPar() const { return getParams(); }
70
71 GPUdi() bool CheckNumericalQuality() const { return true; }
72
73 GPUdi() void setPileUpDistance(uint8_t bwd, uint8_t fwd) { setUserField((((uint16_t)bwd) << 8) | fwd); }
74 GPUdi() bool hasPileUpInfo() const { return getUserField() != 0; }
75 GPUdi() bool hasPileUpInfoBothSides() const { return getPileUpDistanceBwd() > 0 && getPileUpDistanceFwd() > 0; }
76 GPUdi() uint8_t getPileUpDistanceBwd() const { return getUserField() >> 8; }
77 GPUdi() uint8_t getPileUpDistanceFwd() const { return getUserField() & 255; }
78 GPUdi() uint16_t getPileUpSpan() const { return ((uint16_t)getPileUpDistanceBwd()) + getPileUpDistanceFwd(); }
79 GPUdi() float getPileUpMean() const { return hasPileUpInfoBothSides() ? 0.5f * (getPileUpDistanceFwd() + getPileUpDistanceBwd()) : getPileUpDistanceFwd() + getPileUpDistanceBwd(); }
80 GPUdi() float getPileUpTimeShiftMUS() const { return getPileUpMean() * o2::constants::lhc::LHCBunchSpacingMUS; }
81 GPUdi() float getPileUpTimeErrorMUS() const { return getPileUpSpan() * o2::constants::lhc::LHCBunchSpacingMUS / 3.4641016f; }
82
84
85 private:
87 o2::track::TrackParCov mParamOut;
88
89 ClassDefNV(trackInterface, 1);
90};
91
92} // namespace o2::gpu
93
94#endif
Base track model for the Barrel, params only, w/o covariance.
int32_t i
Global index for barrel track: provides provenance (detectors combination), index in respective array...
Header to collect LHC related constants.
o2::track::TrackParCov TrackParCov
Definition Recon.h:39
Track Length and TOF integral.
Result of refitting TPC-ITS matched track.
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
GPUdi() o2
Definition TrackTRD.h:38
GPUd() const expr uint32_t MultivariatePolynomialHelper< Dim
TrackParCovF TrackParCov
Definition Track.h:33
a couple of static helper functions to create timestamp values for CCDB queries or override obsolete ...