Back to home page

sPhenix code displayed by LXR

 
 

    


File indexing completed on 2025-08-06 08:18:23

0001 // Copyright CERN and copyright holders of ALICE O2. This software is
0002 // distributed under the terms of the GNU General Public License v3 (GPL
0003 // Version 3), copied verbatim in the file "COPYING".
0004 //
0005 // See http://alice-o2.web.cern.ch/license for full licensing information.
0006 //
0007 // In applying this license CERN does not waive the privileges and immunities
0008 // granted to it by virtue of its status as an Intergovernmental Organization
0009 // or submit itself to any jurisdiction.
0010 
0011 /// \file GPUTPCTrackLinearisation.h
0012 /// \author Sergey Gorbunov, David Rohr
0013 
0014 #ifndef GPUTPCTRACKLINEARISATION_H
0015 #define GPUTPCTRACKLINEARISATION_H
0016 
0017 #include "GPUTPCTrackParam.h"
0018 
0019 /**
0020  * @class GPUTPCTrackLinearisation
0021  *
0022  * GPUTPCTrackLinearisation class describes the parameters which are used
0023  * to linearise the transport equations for the track trajectory.
0024  *
0025  * The class is used during track (re)fit, when the AliHLTTPCTrackParam track is only
0026  * partially fitted, and there is some apriory knowledge about trajectory.
0027  * This apriory knowledge is used to linearise the transport equations.
0028  *
0029  * In case the track is fully fitted, the best linearisation point is
0030  * the track trajectory itself (GPUTPCTrackLinearisation = AliHLTTPCTrackParam ).
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; // SinPhi
0060   double mCosPhi; // CosPhi
0061   double mDzDs;   // DzDs
0062   double mQPt;    // QPt
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 // GPUTPCTRACKLINEARISATION_H