File indexing completed on 2025-08-06 08:18:23
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014 #ifndef GPUTPCTRACKLINEARISATION_H
0015 #define GPUTPCTRACKLINEARISATION_H
0016
0017 #include "GPUTPCTrackParam.h"
0018
0019
0020
0021
0022
0023
0024
0025
0026
0027
0028
0029
0030
0031
0032
0033 class GPUTPCTrackLinearisation
0034 {
0035 public:
0036 GPUTPCTrackLinearisation() : mSinPhi(0), mCosPhi(1), mDzDs(0), mQPt(0) {}
0037 GPUTPCTrackLinearisation(double SinPhi1, double CosPhi1, double DzDs1, double QPt1) : mSinPhi(SinPhi1), mCosPhi(CosPhi1), mDzDs(DzDs1), mQPt(QPt1) {}
0038
0039 GPUTPCTrackLinearisation(const GPUTPCTrackParam& t);
0040
0041 void Set(double SinPhi1, double CosPhi1, double DzDs1, double QPt1);
0042
0043 double SinPhi() const { return mSinPhi; }
0044 double CosPhi() const { return mCosPhi; }
0045 double DzDs() const { return mDzDs; }
0046 double QPt() const { return mQPt; }
0047
0048 double GetSinPhi() const { return mSinPhi; }
0049 double GetCosPhi() const { return mCosPhi; }
0050 double GetDzDs() const { return mDzDs; }
0051 double GetQPt() const { return mQPt; }
0052
0053 void SetSinPhi(double v) { mSinPhi = v; }
0054 void SetCosPhi(double v) { mCosPhi = v; }
0055 void SetDzDs(double v) { mDzDs = v; }
0056 void SetQPt(double v) { mQPt = v; }
0057
0058 private:
0059 double mSinPhi;
0060 double mCosPhi;
0061 double mDzDs;
0062 double mQPt;
0063 };
0064
0065 inline GPUTPCTrackLinearisation::GPUTPCTrackLinearisation(const GPUTPCTrackParam& t) : mSinPhi(t.SinPhi()), mCosPhi(0), mDzDs(t.DzDs()), mQPt(t.QPt())
0066 {
0067 if (mSinPhi > GPUCA_MAX_SIN_PHI) {
0068 mSinPhi = GPUCA_MAX_SIN_PHI;
0069 } else if (mSinPhi < -GPUCA_MAX_SIN_PHI) {
0070 mSinPhi = -GPUCA_MAX_SIN_PHI;
0071 }
0072 mCosPhi = sqrt(1 - mSinPhi * mSinPhi);
0073 if (t.SignCosPhi() < 0) {
0074 mCosPhi = -mCosPhi;
0075 }
0076 }
0077
0078 inline void GPUTPCTrackLinearisation::Set(double SinPhi1, double CosPhi1, double DzDs1, double QPt1)
0079 {
0080 SetSinPhi(SinPhi1);
0081 SetCosPhi(CosPhi1);
0082 SetDzDs(DzDs1);
0083 SetQPt(QPt1);
0084 }
0085
0086 #endif