]> git.uio.no Git - u/mrichter/AliRoot.git/blob - STEER/AliTrackFitter.h
Common class for DCS sensors (Haavard, Marian)
[u/mrichter/AliRoot.git] / STEER / AliTrackFitter.h
1 #ifndef ALITRACKFITTER_H
2 #define ALITRACKFITTER_H
3
4 /*************************************************************************
5  * AliTrackFitter: base class for the fast track fitters                 *
6  *                                                                       *
7  *                                                                       *
8  *                                                                       *
9  *************************************************************************/
10
11 #include <TObject.h>
12 #include <TMatrixDSymfwd.h>
13
14 #include "AliTrackPointArray.h"
15 #include "AliAlignObj.h"
16
17 class TArrayI;
18
19 class AliTrackFitter : public TObject {
20
21  public:
22
23   AliTrackFitter();
24   AliTrackFitter(AliTrackPointArray *array, Bool_t owner = kTRUE);
25   AliTrackFitter(const AliTrackFitter &fitter);
26   AliTrackFitter& operator= (const AliTrackFitter& fitter);
27   virtual ~AliTrackFitter();
28
29   virtual void   Reset();
30   virtual void   SetTrackPointArray(AliTrackPointArray *array, Bool_t owner = kTRUE);
31   virtual Bool_t Fit(const TArrayI *volIds,const TArrayI *volIdsFit = 0x0,
32                      AliAlignObj::ELayerID layerRangeMin = AliAlignObj::kFirstLayer,
33                      AliAlignObj::ELayerID layerRangeMax = AliAlignObj::kLastLayer) = 0;
34   virtual Bool_t GetPCA(const AliTrackPoint &pIn, AliTrackPoint &pOut) const = 0;
35
36   Bool_t         FindVolId(const TArrayI *array, UShort_t volid) const;
37
38   void           SetMinNPoints(Int_t n) { fMinNPoints = n;}
39
40   const Float_t* GetX() const {return fPoints->GetX();}
41   const Float_t* GetY() const {return fPoints->GetY();}
42   const Float_t* GetZ() const {return fPoints->GetZ();}
43   const Double_t* GetParam() const {return &fParams[0];}
44   const TMatrixDSym &  GetCovariance() const {return *fCov;}
45   Float_t        GetChi2() const {return fChi2;}
46   Int_t          GetNdf()  const {return fNdf;}
47   Int_t          GetMinNPoints()  const {return fMinNPoints;}
48   Float_t        GetNormChi2() const { return (fNdf != 0) ? fChi2/fNdf : 0; }
49   void           GetTrackResiduals(AliTrackPointArray*& pVolId, AliTrackPointArray*& pTrack) const
50     { pVolId = fPVolId; pTrack = fPTrack; }
51
52  protected:
53
54   Double_t      fParams[6];    // Track parameters
55   TMatrixDSym  *fCov;          // Track cov matrix
56   AliTrackPointArray *fPoints; // Pointer to the array with track space points
57   AliTrackPointArray *fPVolId; // Pointer to the array with space-points in volId
58   AliTrackPointArray *fPTrack; // Pointer to the array with track extrapolation points in volId
59   Float_t       fChi2;         // Chi squared of the fit
60   Int_t         fNdf;          // Number of degrees of freedom
61   Int_t         fMinNPoints;   // Minimum allowed number of points
62   Bool_t  fIsOwner;            // Is the object owner of the space points array
63
64  private:
65
66   ClassDef(AliTrackFitter,1) // Abstract class of fast track fitters
67
68 };
69
70 #endif