]> git.uio.no Git - u/mrichter/AliRoot.git/blob - HLT/TPCLib/tracking-ca/AliHLTTPCCADisplay.h
bug fix: reconstruction crash when the output buffer size exceed
[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 //  AliHLTTPCCADisplay class is a debug utility.                            *
9 //  It is not used in the normal data processing.                           *
10 //                                                                          *
11 //***************************************************************************
12
13 #ifndef ALIHLTTPCCADISPLAY_H
14 #define ALIHLTTPCCADISPLAY_H
15
16
17 class AliHLTTPCCATracker;
18 class AliHLTTPCCATrack;
19 class AliHLTTPCCATrackParam;
20 class AliHLTTPCCAPerformance;
21
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
33 /**
34  * @class AliHLTTPCCADisplay
35  */
36 class AliHLTTPCCADisplay
37 {
38
39   public:
40
41     class AliHLTTPCCADisplayTmpHit;
42
43     static AliHLTTPCCADisplay &Instance();
44
45     AliHLTTPCCADisplay();
46     AliHLTTPCCADisplay( const AliHLTTPCCADisplay& );
47     const AliHLTTPCCADisplay& operator=( const AliHLTTPCCADisplay& ) const ;
48
49     virtual ~AliHLTTPCCADisplay();
50
51     void Init();
52     void Update();
53     void ClearView();
54     void Ask();
55     void SetSliceView();
56     void SetTPCView();
57     void SetCurrentSlice( AliHLTTPCCATracker *slice );
58     void Set2Slices( AliHLTTPCCATracker * const slice );
59
60     int GetColor( int i ) const;
61     int GetColorZ( double z ) const ;
62     int GetColorY( double y ) const ;
63     int GetColorK( double k ) const ;
64     void Global2View( double x, double y, double *xv, double *yv ) const ;
65     void Slice2View( double x, double y, double *xv, double *yv ) const ;
66     int GetTrackMC( const AliHLTTPCCADisplayTmpHit *vHits, int NHits );
67
68     void DrawTPC();
69     void DrawSlice( AliHLTTPCCATracker *slice, bool DrawRows = 0 );
70     void DrawSliceOutTrack( int itr, int color = -1, int width = -1  );
71     void DrawSliceOutTrack( AliHLTTPCCATrackParam &t, double Alpha, int itr, int color = -1, int width = -1  );
72     void DrawSliceTrack( int itr, int color = -1 );
73     bool DrawTrack( AliHLTTPCCATrackParam t, double Alpha, const AliHLTTPCCADisplayTmpHit *vHits,
74                     int NHits, int color = -1, int width = -1, bool pPoint = 0 );
75
76     bool DrawTracklet( AliHLTTPCCATrackParam &track, const int *hitstore, int color = -1, int width = -1, bool pPoint = 0 );
77
78     void DrawSliceHit( int iRow, int iHit, int color = -1, Size_t width = -1 );
79     void DrawSliceHits( int color = -1, Size_t width = -1 );
80     void DrawSliceLinks( int colorUp = -1, int colorDn = -1, int width = -1 );
81     void DrawSliceLink( int iRow, int iHit, int colorUp = -1, int colorDn = -1, int width = -1 );
82     void SliceHitXYZ(int iRow, int iHit, double &x, double &y, double &z );
83
84
85     void SetSliceTransform( double alpha );
86
87     void SetSliceTransform( AliHLTTPCCATracker *slice );
88
89     TCanvas *CanvasYX() const { return fYX; }
90     TCanvas *CanvasZX() const { return fZX; }
91
92   protected:
93
94     TCanvas *fYX, *fZX;               // two views
95     bool fAsk;                      // flag to ask for the pressing key
96     bool fSliceView;               // switch between slice/TPC zoom
97     AliHLTTPCCATracker *fSlice;      // current CA tracker, includes slice geometry
98     AliHLTTPCCAPerformance *fPerf; // Performance class (mc labels etc)
99     double fCos, fSin, fZMin, fZMax, fYMin, fYMax;// view parameters
100     double fSliceCos, fSliceSin;        // current slice angle
101     double fRInnerMin, fRInnerMax, fROuterMin, fROuterMax, fTPCZMin, fTPCZMax; // view parameters
102
103     TArc fArc;       // parameters of drawing objects are copied from this members
104     TLine fLine;     //!
105     TPolyLine fPLine;//!
106     TMarker fMarker; //!
107     TBox fBox;       //!
108     TCrown fCrown;   //!
109     TLatex fLatex;   //!
110
111     bool fDrawOnlyRef; // draw only clusters from ref. mc tracks
112
113 };
114
115 #endif //ALIHLTTPCCADISPLAY_H