]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - HLT/TPCLib/tracking-ca/AliHLTTPCCAParam.h
bug fix: reconstruction crash when the output buffer size exceed
[u/mrichter/AliRoot.git] / HLT / TPCLib / tracking-ca / AliHLTTPCCAParam.h
index d146acb4d6eea6d5ab584ce98daa6ae61a02c63c..d3a7e979bdf24839abcece0d7827132038501f6c 100644 (file)
@@ -1,14 +1,18 @@
 //-*- Mode: C++ -*-
 // @(#) $Id$
-
-//* This file is property of and copyright by the ALICE HLT Project        * 
-//* ALICE Experiment at CERN, All rights reserved.                         *
-//* See cxx source for full Copyright notice                               *
+// ************************************************************************
+// This file is property of and copyright by the ALICE HLT Project        *
+// ALICE Experiment at CERN, All rights reserved.                         *
+// See cxx source for full Copyright notice                               *
+//                                                                        *
+//*************************************************************************
 
 #ifndef ALIHLTTPCCAPARAM_H
 #define ALIHLTTPCCAPARAM_H
 
 #include "AliHLTTPCCADef.h"
+#include "AliHLTTPCCAMath.h"
+#include "AliHLTTPCCATrackParam.h"
 
 #include <iostream>
 
  */
 class AliHLTTPCCAParam
 {
- public:
-
-#if !defined(HLTCA_GPUCODE)  
-  GPUd() AliHLTTPCCAParam();
-#endif
-
-  ~AliHLTTPCCAParam(){;}
-
-  GPUd() void Initialize( Int_t iSlice, Int_t nRows, Float_t rowX[],
-                  Float_t alpha, Float_t dAlpha,
-                  Float_t rMin, Float_t rMax, Float_t zMin, Float_t zMax,
-                  Float_t padPitch, Float_t zSigma, Float_t bz );
-  GPUd() void Update();
-  
-  GPUd() void Slice2Global( Float_t x, Float_t y,  Float_t z, 
-                    Float_t *X, Float_t *Y,  Float_t *Z ) const;
-  GPUd() GPUd() void Global2Slice( Float_t x, Float_t y,  Float_t z, 
-                    Float_t *X, Float_t *Y,  Float_t *Z ) const;
-
-
-  GPUhd() Int_t ISlice() const { return fISlice;}
-  GPUhd() Int_t NRows() const { return fNRows;}
-
-  GPUhd() Float_t RowX( Int_t iRow ) const { return fRowX[iRow]; }  
-
-  GPUd() Float_t Alpha() const { return fAlpha;}
-  GPUd() Float_t DAlpha() const { return fDAlpha;}
-  GPUd() Float_t CosAlpha() const { return fCosAlpha;}
-  GPUd() Float_t SinAlpha() const { return fSinAlpha;}
-  GPUd() Float_t AngleMin() const { return fAngleMin;}
-  GPUd() Float_t AngleMax() const { return fAngleMax;}
-  GPUd() Float_t RMin() const { return fRMin;}
-  GPUd() Float_t RMax() const { return fRMax;}
-  GPUd() Float_t ZMin() const { return fZMin;}
-  GPUd() Float_t ZMax() const { return fZMax;}
-  GPUd() Float_t ErrZ() const { return fErrZ;}
-  GPUd() Float_t ErrX() const { return fErrX;}
-  GPUd() Float_t ErrY() const { return fErrY;}
-  GPUd() Float_t Bz() const { return fBz;}
-
-  GPUd() Float_t TrackConnectionFactor() const { return fTrackConnectionFactor; }
-  GPUd() Float_t TrackChiCut()  const { return fTrackChiCut; }
-  GPUd() Float_t TrackChi2Cut() const { return fTrackChi2Cut; }
-  GPUd() Int_t   MaxTrackMatchDRow() const { return fMaxTrackMatchDRow; }
-  GPUd() Float_t HitPickUpFactor() const { return fHitPickUpFactor; }
-
-
-
-  GPUhd() void SetISlice( Int_t v ){  fISlice = v;}
-  GPUhd() void SetNRows( Int_t v ){  fNRows = v;}  
-  GPUhd() void SetRowX( Int_t iRow, Float_t v ){  fRowX[iRow] = v; }
-  GPUd() void SetAlpha( Float_t v ){  fAlpha = v;}
-  GPUd() void SetDAlpha( Float_t v ){  fDAlpha = v;}
-  GPUd() void SetCosAlpha( Float_t v ){  fCosAlpha = v;}
-  GPUd() void SetSinAlpha( Float_t v ){  fSinAlpha = v;}
-  GPUd() void SetAngleMin( Float_t v ){  fAngleMin = v;}
-  GPUd() void SetAngleMax( Float_t v ){  fAngleMax = v;}
-  GPUd() void SetRMin( Float_t v ){  fRMin = v;}
-  GPUd() void SetRMax( Float_t v ){  fRMax = v;}
-  GPUd() void SetZMin( Float_t v ){  fZMin = v;}
-  GPUd() void SetZMax( Float_t v ){  fZMax = v;}
-  GPUd() void SetErrZ( Float_t v ){  fErrZ = v;}
-  GPUd() void SetErrX( Float_t v ){  fErrX = v;}
-  GPUd() void SetErrY( Float_t v ){  fErrY = v;}
-  GPUd() void SetBz( Float_t v ){  fBz = v;}
-  GPUd() void SetTrackConnectionFactor( Float_t v ){ fTrackConnectionFactor = v;}
-  GPUd() void SetTrackChiCut( Float_t v ) {  fTrackChiCut = v; }
-  GPUd() void SetTrackChi2Cut( Float_t v ){  fTrackChi2Cut = v; }
-  GPUd() void SetMaxTrackMatchDRow( Int_t v ){  fMaxTrackMatchDRow = v; }
-  GPUd() void SetHitPickUpFactor( Float_t v ){  fHitPickUpFactor = v; }
-
-
-  GPUd() Float_t GetClusterError2(Int_t yz, Int_t type, Float_t z, Float_t angle ) const;
-
-  void WriteSettings( std::ostream &out ) const;
-  void ReadSettings( std::istream &in );
-  
-  GPUd() void SetParamS0Par(Int_t i, Int_t j, Int_t k, Float_t val ){
-    fParamS0Par[i][j][k] = val;
-  }
+  public:
+       AliHLTTPCCAParam();
+    ~AliHLTTPCCAParam() {}
+
+#if !defined(HLTCA_GPUCODE)
+    void Initialize( int iSlice, int nRows, float rowX[],
+                            float alpha, float dAlpha,
+                            float rMin, float rMax, float zMin, float zMax,
+                            float padPitch, float zSigma, float bz );
+    void Update();
+#endif //!HLTCA_GPUCODE
+
+       GPUd() void Slice2Global( float x, float y,  float z,
+                              float *X, float *Y,  float *Z ) const;
+
+    GPUd() void Global2Slice( float x, float y,  float z,
+                              float *X, float *Y,  float *Z ) const;
+
+
+    GPUhd() int ISlice() const { return fISlice;}
+    GPUhd() int NRows() const { return fNRows;}
+
+    GPUhd() float RowX( int iRow ) const { return fRowX[iRow]; }
+
+    GPUd() float Alpha() const { return fAlpha;}
+    GPUd() float Alpha( int iSlice ) const { return 0.174533 + DAlpha()*iSlice;}
+    GPUd() float DAlpha() const { return fDAlpha;}
+    GPUd() float CosAlpha() const { return fCosAlpha;}
+    GPUd() float SinAlpha() const { return fSinAlpha;}
+    GPUd() float AngleMin() const { return fAngleMin;}
+    GPUd() float AngleMax() const { return fAngleMax;}
+    GPUd() float RMin() const { return fRMin;}
+    GPUd() float RMax() const { return fRMax;}
+    GPUd() float ZMin() const { return fZMin;}
+    GPUd() float ZMax() const { return fZMax;}
+    GPUd() float ErrZ() const { return fErrZ;}
+    GPUd() float ErrX() const { return fErrX;}
+    GPUd() float ErrY() const { return fErrY;}
+    GPUd() float BzkG() const { return fBzkG;}
+    GPUd() float ConstBz() const { return fConstBz;}
+
+    GPUd() float NeighboursSearchArea() const { return fNeighboursSearchArea; }
+    GPUd() float TrackConnectionFactor() const { return fTrackConnectionFactor; }
+    GPUd() float TrackChiCut()  const { return fTrackChiCut; }
+    GPUd() float TrackChi2Cut() const { return fTrackChi2Cut; }
+    GPUd() int   MaxTrackMatchDRow() const { return fMaxTrackMatchDRow; }
+    GPUd() float HitPickUpFactor() const { return fHitPickUpFactor; }
+  GPUd() float ClusterError2CorrectionY() const { return fClusterError2CorrectionY; }
+  GPUd() float ClusterError2CorrectionZ() const { return fClusterError2CorrectionZ; }
+
+
+
+    GPUhd() void SetISlice( int v ) {  fISlice = v;}
+    GPUhd() void SetNRows( int v ) {  fNRows = v;}
+    GPUhd() void SetRowX( int iRow, float v ) {  fRowX[iRow] = v; }
+    GPUd() void SetAlpha( float v ) {  fAlpha = v;}
+    GPUd() void SetDAlpha( float v ) {  fDAlpha = v;}
+    GPUd() void SetCosAlpha( float v ) {  fCosAlpha = v;}
+    GPUd() void SetSinAlpha( float v ) {  fSinAlpha = v;}
+    GPUd() void SetAngleMin( float v ) {  fAngleMin = v;}
+    GPUd() void SetAngleMax( float v ) {  fAngleMax = v;}
+    GPUd() void SetRMin( float v ) {  fRMin = v;}
+    GPUd() void SetRMax( float v ) {  fRMax = v;}
+    GPUd() void SetZMin( float v ) {  fZMin = v;}
+    GPUd() void SetZMax( float v ) {  fZMax = v;}
+    GPUd() void SetErrZ( float v ) {  fErrZ = v;}
+    GPUd() void SetErrX( float v ) {  fErrX = v;}
+    GPUd() void SetErrY( float v ) {  fErrY = v;}
+    GPUd() void SetBzkG( float v ) {  fBzkG = v;}
+
+  GPUd() void SetNeighboursSearchArea( float v ) { fNeighboursSearchArea = v;}
+    GPUd() void SetTrackConnectionFactor( float v ) { fTrackConnectionFactor = v;}
+    GPUd() void SetTrackChiCut( float v ) {  fTrackChiCut = v; }
+  GPUd() void SetTrackChi2Cut( float v ) {  fTrackChi2Cut = v; }
+    GPUd() void SetMaxTrackMatchDRow( int v ) {  fMaxTrackMatchDRow = v; }
+    GPUd() void SetHitPickUpFactor( float v ) {  fHitPickUpFactor = v; }
+    GPUd() void SetClusterError2CorrectionY( float v ) { fClusterError2CorrectionY = v; }
+    GPUd() void SetClusterError2CorrectionZ( float v ) { fClusterError2CorrectionZ = v; }
+
+
+    GPUd() float GetClusterError2( int yz, int type, float z, float angle ) const;
+    GPUd() void GetClusterErrors2( int iRow, float z, float sinPhi, float cosPhi, float DzDs, float &Err2Y, float &Err2Z ) const;
+
+    void WriteSettings( std::ostream &out ) const;
+    void ReadSettings( std::istream &in );
+
+    GPUd() void SetParamS0Par( int i, int j, int k, float val ) {
+      fParamS0Par[i][j][k] = val;
+    }
+
+    GPUd() float GetBzkG() const { return fBzkG;}
+    GPUd() float GetConstBz() const { return fConstBz;}
+    GPUd() float GetBz( float x, float y, float z ) const;
+    GPUd()  float GetBz( const AliHLTTPCCATrackParam &t ) const;
 
   protected:
+    int fISlice; // slice number
+    int fNRows; // number of rows
+
+    float fAlpha, fDAlpha; // slice angle and angular size
+    float fCosAlpha, fSinAlpha;// sign and cosine of the slice angle
+    float fAngleMin, fAngleMax; // minimal and maximal angle
+    float fRMin, fRMax;// slice R range
+    float fZMin, fZMax;// slice Z range
+    float fErrX, fErrY, fErrZ;// default cluster errors
+    float fPadPitch; // pad pitch
+    float fBzkG;       // constant magnetic field value in kG
+    float fConstBz;       // constant magnetic field value in kG*clight
+
+    float fHitPickUpFactor;// multiplier for the chi2 window for hit pick up procedure
+
+    int   fMaxTrackMatchDRow;// maximal jump in TPC row for connecting track segments
+
+  float fNeighboursSearchArea; // area in cm for the search of neighbours
+
+    float fTrackConnectionFactor; // allowed distance in Chi^2/3.5 for neighbouring tracks
+    float fTrackChiCut; // cut for track Sqrt(Chi2/NDF);
+    float fTrackChi2Cut;// cut for track Chi^2/NDF
+  float fClusterError2CorrectionY; // correction for the squared cluster error during tracking
+  float fClusterError2CorrectionZ; // correction for the squared cluster error during tracking
+    float fRowX[200];// X-coordinate of rows
+    float fParamS0Par[2][3][7];    // cluster error parameterization coeficients
+    float fPolinomialFieldBz[6];   // field coefficients
 
-  Int_t fISlice; // slice number
-  Int_t fNRows; // number of rows
-
-  Float_t fAlpha, fDAlpha; // slice angle and angular size
-  Float_t fCosAlpha, fSinAlpha;// sign and cosine of the slice angle
-  Float_t fAngleMin, fAngleMax; // minimal and maximal angle
-  Float_t fRMin, fRMax;// slice R range
-  Float_t fZMin, fZMax;// slice Z range
-  Float_t fErrX, fErrY, fErrZ;// default cluster errors
-  Float_t fPadPitch; // pad pitch 
-  Float_t fBz;       // magnetic field value (only constant field can be used)
-
-  Float_t fHitPickUpFactor;// multiplier for the chi2 window for hit pick up procedure
+};
 
-  Int_t   fMaxTrackMatchDRow;// maximal jump in TPC row for connecting track segments
-  Float_t fTrackConnectionFactor; // allowed distance in Chi^2/3.5 for neighbouring tracks
-  Float_t fTrackChiCut; // cut for track Sqrt(Chi2/NDF);
-  Float_t fTrackChi2Cut;// cut for track Chi^2/NDF
 
-  Float_t fRowX[200];// X-coordinate of rows
-  Float_t fParamS0Par[2][3][7];    // cluster error parameterization coeficients
 
-};
+GPUd() inline float AliHLTTPCCAParam::GetBz( float x, float y, float z ) const
+{
+  float r2 = x * x + y * y;
+  float r  = CAMath::Sqrt( r2 );
+  const float *c = fPolinomialFieldBz;
+  return ( c[0] + c[1]*z  + c[2]*r  + c[3]*z*z + c[4]*z*r + c[5]*r2 );
+}
 
+GPUd() inline float AliHLTTPCCAParam::GetBz( const AliHLTTPCCATrackParam &t ) const
+{
+  return GetBz( t.X(), t.Y(), t.Z() );
+}
 
-#endif
+#endif //ALIHLTTPCCAPARAM_H