]> git.uio.no Git - u/mrichter/AliRoot.git/blob - EVE/EveBase/AliEveTrackFitter.h
c9731b5dabe698ac59aeffb6689de40c349fcc3d
[u/mrichter/AliRoot.git] / EVE / EveBase / AliEveTrackFitter.h
1 // $Id$
2 // Main authors: Matevz Tadel & Alja Mrak-Tadel: 2006, 2007
3
4 /**************************************************************************
5  * Copyright(c) 1998-2008, ALICE Experiment at CERN, all rights reserved. *
6  * See http://aliceinfo.cern.ch/Offline/AliRoot/License.html for          *
7  * full copyright notice.                                                 *
8  **************************************************************************/
9
10 #ifndef AliEveTrackFitter_H
11 #define AliEveTrackFitter_H
12
13 #include <TEvePointSet.h>
14 #include <map>
15
16 class TGraphErrors;
17 class TGraph;
18 class AliRieman;
19
20 class TEveTrackList;
21
22 class AliEveTrackFitter : public TEvePointSet
23 {
24 private:
25   AliEveTrackFitter(const AliEveTrackFitter&);            // Not implemented
26   AliEveTrackFitter& operator=(const AliEveTrackFitter&); // Not implemented
27
28 protected:
29
30   struct Point_t
31   {
32     TEvePointSet   *fPS;   // point set
33     Int_t           fIdx;  // id in point set
34
35     Point_t(TEvePointSet* ps=0, Int_t i=0) : fPS(ps), fIdx(i) {}
36     Point_t(const Point_t& p) : fPS(p.fPS), fIdx(p.fIdx)  {}
37
38     Point_t& operator=(const Point_t& p)
39     {
40       fPS = p.fPS; fIdx = p.fIdx; return *this;
41     }
42
43     bool operator<(const Point_t& o) const
44     {
45       if (fPS != o.fPS) return fPS < o.fPS;
46       return fIdx < o.fIdx;
47     }
48   };
49
50   typedef std::map<Point_t, Int_t> PointMap_t;
51
52   Float_t            fAlpha;           // transformation angle to AliRieman local system (where x>>y)
53   AliRieman*         fRieman;          // rieman fitter
54
55   Bool_t             fConnected;       // connection to the TEvePointSet signal
56
57   PointMap_t         fSPMap;           // map of selected points
58   TEveTrackList*     fTrackList;       // list of tracks removed in the destructor
59
60   TGraph            *fGraphPicked;     // graph of selected points debug info
61   TGraphErrors      *fGraphHelix;      // graph of fitted points for debug info
62
63 public:
64   AliEveTrackFitter(const Text_t* name = "TrackFitter", Int_t nPoints=0);
65   virtual ~AliEveTrackFitter();
66
67   virtual void DestroyElements();
68
69   virtual void  AddFitPoint(Int_t pointId);  // slot for TEvePointSet::PointSelected() signal
70
71   virtual void  Start();
72   virtual void  Stop();
73   virtual void  FitTrack();
74   virtual void  Reset(Int_t nPoints=0, Int_t nIntIds=0);
75
76   Bool_t        GetConnected() const { return fConnected; }
77   AliRieman*    GetRieman()    const { return fRieman; }
78
79   TGraph*       GetGraphPicked() const { return fGraphPicked; }
80   TGraphErrors* GetGraphHelix()  const { return fGraphHelix; }
81   void          DrawDebugGraph();
82
83   ClassDef(AliEveTrackFitter, 0); // Interface of TEvePointSet allowing helix fit.
84 };
85
86 #endif