PandaRoot
PndCADisplay.h
Go to the documentation of this file.
1 #ifndef PNDCADISPLAY_H
2 #define PNDCADISPLAY_H
3 
4 #ifdef CATRACKER_DISPLAY
5 
6 #include "PndCAParameters.h"
7 #include "PndCAPerformanceBase.h"
8 #include "PndCANPletsV.h"
9 
10 class PndCAGBTracker;
11 class PndCATracker;
12 class PndCATrack;
13 class PndCATrackParam;
14 class PndCAParam;
15 class PndCAPerformance;
16 class PndCAMCTrack;
17 class PndCALocalMCPoint;
18 class TCanvas;
19 class TPad;
20 class PndCAHit;
21 class PndCAHitV;
22 class PndCAHitsV;
23 class PndCATracks;
24 
25 #include "TArc.h"
26 #include "TLine.h"
27 #include "TPolyLine.h"
28 #include "TArrow.h"
29 #include "TBox.h"
30 #include "TCrown.h"
31 #include "TMarker.h"
32 #include "TLatex.h"
33 
34 #include <vector>
35 using std::vector;
36 
40 class PndCADisplay {
41 
42  public:
43  class PndCADisplayTmpHit;
44 
45  static PndCADisplay &Instance();
46 
47  PndCADisplay();
48 
49  virtual ~PndCADisplay();
50 
51  void Init();
52  void Update();
53  void ClearView();
54  void Ask();
55  void SetTPC(const PndCAParam &tpcParam); // iklm
56  void SetGB(const PndCAGBTracker *GBTracker);
57 
58  const PndCAGBTracker *GetGB() { return fGB; };
59  int GetColor(int i) const;
60  int GetColorZ(double z) const;
61  int GetColorY(double y) const;
62  int GetColorK(double k) const;
63  int GetTrackMC(const PndCADisplayTmpHit *vHits, int NHits);
64 
65  void DrawTPC();
66  void DrawFwdMvd();
67  void DrawFwdGBHits(const PndCAGBTracker &tracker);
68  void DrawSlice(PndCATracker *slice, bool DrawRows = 0, bool DrawGrid = 1);
69 
70  void DrawArc(float x, float y, float r, int Start = 1, Size_t width = 1);
71  void DrawPoint(float x, float y, float z, int Start = 1, Size_t width = 1);
72 
73  void DrawGBPoint(float x, float y, float z, int Start = 1, Size_t width = 1);
74  void DrawGBPoint(float x, float y, float z, float angle = 0, int Start = 1, Size_t width = 1);
75  void DrawSliceOutTrackParam(int itr, int color, Size_t width);
76  void DrawSliceOutTrack1(int itr, int color, Size_t width);
77  void DrawHelix(float p0, float c, float z, float zStart, float z0, float xc, float yc, float r, float b, int color, Size_t width);
78  void DrawParticleGlobal(float *param, float q, float tStart, float tEnd, float b, int color = kOrange, Size_t width = 1);
79  void DrawParticleGlobal(float *param, float q, float n[4], float b, int color = kOrange, Size_t width = 1);
80  void DrawGBLine(float x, float y, float z, float x2, float y2, float z2, int Start = 1, Size_t width = 1, int projection = -1);
81 
82  bool DrawTrack(PndCATrackParam t, double Alpha, const PndCADisplayTmpHit *vHits, int NHits, int color = -1, Size_t width = -1, bool pPoint = 0);
83 
84  void DrawGBTrack(int itr, int color = -1, int width = -1);
85  void DrawRecoTrack(int itr, int color = -1, int width = -1);
86  void DrawMCTrack(int itr, int color = -1, int width = -1);
87 
88  void HitToGlobal(const PndCAHit &hit, float &x, float &y, float &z);
89  void HitToGlobal(const PndCAHitV &hit, int iV, float &x, float &y, float &z);
90 
91  void DrawGBHits(const PndCAHits &all);
92  void DrawGBPoints();
93  void DrawPVHisto(const vector<float> &pvHist, const PndCAParam &param);
94  void DrawGBNPlets(const PndCANPletsV &all);
95  void DrawGBTracks(const PndCATracks &all);
96 
97  void DrawGBTrackFast(const PndCAGBTracker &tracker, int itr, int color = -1);
98  bool DrawTracklet(PndCATrackParam &track, const int *hitstore, int color = -1, int width = -1, bool pPoint = 0);
99 
100  // void DrawGBLinks( const PndCAGBTracker &tracker, int color = -1, Size_t width = -1 );
101 
102  void DrawGBHit(const PndCAGBTracker &tracker, int iHit, int color = -1, Size_t width = -1);
103  void DrawGBHits(const PndCAGBTracker &tracker, int color = -1, Size_t width = -1, int hitsType = -1);
104 
105  void DrawTrackParam(PndCATrackParam t, int color = 1);
106 
107  void SaveCanvasToFile(TString fileName);
108 
109  TPad *CanvasYX() { return fYX; }
110  TPad *CanvasZX() { return fZX; }
111 
112  protected:
113  TCanvas *fCanvas; // the canvas
114  TPad *fYX, *fZX, *fZR; // two views
115  TCanvas *fFwdMvdCanvas; //, *fFwdMvdXYCanvas; // the canvas
116  TPad *fFwdMvdZY, *fFwdMvdZX, *fFwdMvdZR; //*fFwdMvdXY; // two views
117  bool fAsk; // flag to ask for the pressing key
118  const PndCAGBTracker *fGB; // the Aliglobal tracker
119  PndCAPerformance *fPerf; // Performance class (mc labels etc)
120  double fZMin, fZMax, fYMin, fYMax; // view parameters
121  double fRInnerMin, fRInnerMax, fROuterMin, fROuterMax, fTPCZMin, fTPCZMax; // view parameters
122 
123  TArc fArc; // parameters of drawing objects are copied from this members
124  TLine fLine;
125  TPolyLine fPLine;
126  TMarker fMarker;
127  TBox fBox;
128  TCrown fCrown;
129  TLatex fLatex;
130  TArrow fArrow;
131 
132  bool fDrawOnlyRef; // draw only clusters from ref. mc tracks
133 
134  private:
135  PndCADisplay(const PndCADisplay &);
136  PndCADisplay &operator=(const PndCADisplay &);
137 };
138 
139 #endif // CATRACKER_DISPLAY
140 
141 #endif
unsigned int i
Definition: P4_F32vec4.h:21