Project
Loading...
Searching...
No Matches
GPUTPCTrackLinearisation.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 GPUTPCTRACKLINEARISATION_H
16#define GPUTPCTRACKLINEARISATION_H
17
18#include "GPUTPCTrackParam.h"
19
20namespace o2::gpu
21{
37{
38 public:
39 GPUTPCTrackLinearisation() : mSinPhi(0), mCosPhi(1), mDzDs(0), mQPt(0) {}
40 GPUTPCTrackLinearisation(float SinPhi1, float CosPhi1, float DzDs1, float QPt1) : mSinPhi(SinPhi1), mCosPhi(CosPhi1), mDzDs(DzDs1), mQPt(QPt1) {}
41
43
44 GPUd() void Set(float SinPhi1, float CosPhi1, float DzDs1, float QPt1);
45
46 GPUd() float SinPhi() const { return mSinPhi; }
47 GPUd() float CosPhi() const { return mCosPhi; }
48 GPUd() float DzDs() const { return mDzDs; }
49 GPUd() float QPt() const { return mQPt; }
50
51 GPUd() float GetSinPhi() const { return mSinPhi; }
52 GPUd() float GetCosPhi() const { return mCosPhi; }
53 GPUd() float GetDzDs() const { return mDzDs; }
54 GPUd() float GetQPt() const { return mQPt; }
55
56 GPUd() void SetSinPhi(float v) { mSinPhi = v; }
57 GPUd() void SetCosPhi(float v) { mCosPhi = v; }
58 GPUd() void SetDzDs(float v) { mDzDs = v; }
59 GPUd() void SetQPt(float v) { mQPt = v; }
60
61 private:
62 float mSinPhi; // SinPhi
63 float mCosPhi; // CosPhi
64 float mDzDs; // DzDs
65 float mQPt; // QPt
66};
67
68GPUdi() GPUTPCTrackLinearisation::GPUTPCTrackLinearisation(const GPUTPCTrackParam& GPUrestrict() t) : mSinPhi(t.SinPhi()), mCosPhi(0), mDzDs(t.DzDs()), mQPt(t.QPt())
69{
70 if (mSinPhi > GPUCA_MAX_SIN_PHI) {
71 mSinPhi = GPUCA_MAX_SIN_PHI;
72 } else if (mSinPhi < -GPUCA_MAX_SIN_PHI) {
73 mSinPhi = -GPUCA_MAX_SIN_PHI;
74 }
75 mCosPhi = CAMath::Sqrt(1 - mSinPhi * mSinPhi);
76 if (t.SignCosPhi() < 0) {
77 mCosPhi = -mCosPhi;
78 }
79}
80
81GPUdi() void GPUTPCTrackLinearisation::Set(float SinPhi1, float CosPhi1, float DzDs1, float QPt1)
82{
83 SetSinPhi(SinPhi1);
84 SetCosPhi(CosPhi1);
85 SetDzDs(DzDs1);
86 SetQPt(QPt1);
87}
88} // namespace o2::gpu
89
90#endif // GPUTPCTRACKLINEARISATION_H
#define GPUrestrict()
#define GPUCA_MAX_SIN_PHI
GPUd() GPUTPCTrackLinearisation(const GPUTPCTrackParam &t)
GPUTPCTrackLinearisation(float SinPhi1, float CosPhi1, float DzDs1, float QPt1)
GPUd() void Set(float SinPhi1
const GLdouble * v
Definition glcorearb.h:832
typedef void(APIENTRYP PFNGLCULLFACEPROC)(GLenum mode)
GPUdi() o2
Definition TrackTRD.h:38