]> git.uio.no Git - u/mrichter/AliRoot.git/blob - HLT/TPCLib/tracking-ca/AliHLTTPCCADisplay.h
Update of the HLT CA tracker
[u/mrichter/AliRoot.git] / HLT / TPCLib / tracking-ca / AliHLTTPCCADisplay.h
1 //-*- Mode: C++ -*-
2 // @(#) $Id$
3
4 //* This file is property of and copyright by the ALICE HLT Project         * 
5 //* ALICE Experiment at CERN, All rights reserved.                          *
6 //* See cxx source for full Copyright notice                                *
7
8 //*                                                                         *
9 //*  AliHLTTPCCADisplay class is a debug utility.                           *
10 //*  It is not used in the normal data processing.                          *
11 //*                                                                         *
12
13 #ifndef ALIHLTTPCCADISPLAY_H
14 #define ALIHLTTPCCADISPLAY_H
15
16
17 class AliHLTTPCCATracker;
18 class AliHLTTPCCAGBTracker;
19 class AliHLTTPCCATrack;
20 class AliHLTTPCCATrackParam;
21 class AliHLTTPCCAPerformance;
22 class TCanvas;
23 #include "TArc.h"
24 #include "TLine.h"
25 #include "TPolyLine.h"
26 #include "TBox.h"
27 #include "TCrown.h"
28 #include "TMarker.h"
29 #include "TLatex.h"
30
31 /**
32  * @class AliHLTTPCCADisplay
33  */
34 class AliHLTTPCCADisplay
35 {
36
37  public:
38
39   class AliHLTTPCCADisplayTmpHit{  
40
41   public:
42     Int_t ID() const { return fHitID; }
43     Double_t S() const { return fS; }
44     Double_t Z() const { return fZ; }
45
46     void SetID( Int_t v ){ fHitID = v; }
47     void SetS( Double_t v){ fS = v; }
48     void SetZ( Double_t v){ fZ = v; }
49
50     static Bool_t CompareHitDS( const AliHLTTPCCADisplayTmpHit &a, 
51                                  const AliHLTTPCCADisplayTmpHit  &b )
52     {    
53       return (a.fS < b.fS);
54     }
55     static Bool_t CompareHitZ( const AliHLTTPCCADisplayTmpHit &a, 
56                                  const AliHLTTPCCADisplayTmpHit  &b )
57     {    
58       return (a.fZ < b.fZ);
59     }
60   protected:
61     Int_t fHitID; // hit ID
62     Double_t fS;  // hit position on the XY track curve 
63     Double_t fZ;  // hit Z position
64   };
65
66   static AliHLTTPCCADisplay &Instance();
67   
68   AliHLTTPCCADisplay();
69   AliHLTTPCCADisplay( const AliHLTTPCCADisplay& );
70   AliHLTTPCCADisplay& operator=(const AliHLTTPCCADisplay&);
71
72   virtual ~AliHLTTPCCADisplay();
73
74   void Init();
75   void Update();
76   void ClearView();
77   void Ask();
78   void SetSliceView();
79   void SetTPCView();
80   void SetCurrentSlice( AliHLTTPCCATracker *slice ); 
81   void SetGB( AliHLTTPCCAGBTracker *GBTracker );   
82   void Set2Slices( AliHLTTPCCATracker *slice );
83
84   Int_t GetColor( Int_t i ) const;
85   Int_t GetColorZ( Double_t z ) const ;
86   Int_t GetColorY( Double_t y ) const ;
87   Int_t GetColorK( Double_t k ) const ;
88   void Global2View( Double_t x, Double_t y, Double_t *xv, Double_t *yv ) const ;
89   void Slice2View( Double_t x, Double_t y, Double_t *xv, Double_t *yv ) const ;
90   Int_t GetTrackMC( AliHLTTPCCADisplayTmpHit *vHits, Int_t NHits );
91
92   void DrawTPC();
93   void DrawSlice( AliHLTTPCCATracker *slice, Bool_t DrawRows=0 ); 
94   void DrawSliceOutTrack( Int_t itr, Int_t color=-1, Double_t width = -1  );
95   void DrawSliceOutTrack( AliHLTTPCCATrackParam &t, Double_t Alpha, Int_t itr, Int_t color=-1, Double_t width = -1  );
96   void DrawSliceTrack( Int_t itr, Int_t color=-1);
97   Bool_t DrawTrack( AliHLTTPCCATrackParam t, Double_t Alpha, AliHLTTPCCADisplayTmpHit *vHits, 
98                   Int_t NHits, Int_t color=-1, Double_t width=-1, Bool_t pPoint=0 );
99
100   void DrawGBTrack( Int_t itr, Int_t color=-1, Double_t width=-1 );
101   void DrawGBTrackFast( AliHLTTPCCAGBTracker &tracker, Int_t itr, Int_t color=-1 );
102   Bool_t DrawTracklet( AliHLTTPCCATrackParam &track, Int_t *hitstore, Int_t color=-1, Double_t width=-1, Bool_t pPoint=0 );
103  
104   void DrawGBHit( AliHLTTPCCAGBTracker &tracker, Int_t iHit, Int_t color=-1, Double_t width =-1 );
105   void DrawGBHits( AliHLTTPCCAGBTracker &tracker, Int_t color=-1, Double_t width =-1 );
106
107   void DrawSliceHit( Int_t iRow,Int_t iHit, Int_t color=-1, Double_t width=-1 );
108   void DrawSliceHits(Int_t color=-1, Double_t width=-1 );
109
110 #ifdef XXXX
111
112   void DrawMergedHit( Int_t iRow, Int_t iHit, Int_t color=-1 );
113
114   void DrawTrack( AliHLTTPCCATrack &track, Int_t color=-1, Bool_t DrawCells=1 );
115   void DrawTrackletPoint( AliHLTTPCCATrackParam &t, Int_t color=-1 );
116 #endif // XXXX
117
118   void SetSliceTransform( Double_t alpha );
119
120   void SetSliceTransform( AliHLTTPCCATracker *slice );
121
122   TCanvas *CanvasYX(){ return fYX; }
123   TCanvas *CanvasZX(){ return fZX; }
124
125  protected:
126
127   TCanvas *fYX, *fZX;               // two views
128   Bool_t fAsk;                      // flag to ask for the pressing key
129   Bool_t fSliceView;               // switch between slice/TPC zoom
130   AliHLTTPCCATracker *fSlice;      // current CA tracker, includes slice geometry
131   AliHLTTPCCAGBTracker *fGB;      // the global tracker
132   AliHLTTPCCAPerformance *fPerf; // Performance class (mc labels etc)
133   Double_t fCos, fSin, fZMin, fZMax, fYMin, fYMax;// view parameters
134   Double_t fSliceCos, fSliceSin;        // current slice angle
135   Double_t fRInnerMin, fRInnerMax, fROuterMin, fROuterMax,fTPCZMin, fTPCZMax; // view parameters
136
137   TArc fArc;       // parameters of drawing objects are copied from this members
138   TLine fLine;     //!
139   TPolyLine fPLine;//!
140   TMarker fMarker; //!
141   TBox fBox;       //!
142   TCrown fCrown;   //!
143   TLatex fLatex;   //!
144
145   Bool_t fDrawOnlyRef; // draw only clusters from ref. mc tracks
146
147 };
148
149 #endif