PandaRoot
PndFTSCADisplay.h
Go to the documentation of this file.
1 //-*- Mode: C++ -*-
2 // @(#) $Id: PndFTSCADisplay.h,v 1.8 2016/12/16 19:39:31 mpugach Exp $
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 // PndFTSCADisplay class is a debug utility. *
9 // It is not used in the normal data processing. *
10 // *
11 //***************************************************************************
12 
13 #ifndef PNDFTSCADISPLAY_H
14 #define PNDFTSCADISPLAY_H
15 
16 #include "PndFTSCAParameters.h"
17 #include "PndFTSPerformanceBase.h"
18 #include "PndFTSArray.h"
19 #include "FTSCANPletsV.h"
20 
21 class PndFTSCAGBTracker;
22 class PndFTSCATracker;
23 class PndFTSCATrack;
24 class PndFTSCATrackParam;
25 class PndFTSCAParam;
26 class PndFTSCAPerformance;
27 // class PndFTSCAMCTrack;
28 // class PndFTSCALocalMCPoint;
29 class TCanvas;
30 class TPad;
31 class FTSCAHit;
32 class FTSCAHitV;
33 class FTSCAHitsV;
34 class FTSCATracks;
35 
36 #include "TArc.h"
37 #include "TLine.h"
38 #include "TPolyLine.h"
39 #include "TArrow.h"
40 #include "TBox.h"
41 #include "TCrown.h"
42 #include "TMarker.h"
43 #include "TLatex.h"
44 
45 #include <vector>
46 using std::vector;
47 
52 
53  public:
54  class PndFTSCADisplayTmpHit;
55 
56  static PndFTSCADisplay &Instance();
57 
59 
60  virtual ~PndFTSCADisplay();
61 
62  void Init();
63  void Update();
64  void ClearView();
65  void Ask();
66  void SetTPC(const PndFTSCAParam &tpcParam);
67  void SetGB(const PndFTSCAGBTracker *GBTracker);
68 
69  const PndFTSCAGBTracker *GetGB() { return fGB; };
70  int GetColor(int i) const;
71  int GetColorZ(double z) const;
72  int GetColorY(double y) const;
73  int GetColorK(double k) const;
74  int GetTrackMC(const PndFTSCADisplayTmpHit *vHits, int NHits);
75 
76  void DrawTPC();
77  void DrawSlice(PndFTSCATracker *slice, bool DrawRows = 0, bool DrawGrid = 1);
78 
79  void DrawArc(float x, float y, float r, int Start = 1, Size_t width = 1);
80  void DrawPoint(float x, float y, float z, int Start = 1, Size_t width = 1);
81 
82  void DrawGBPoint(float x, float y, float z, int Start = 1, Size_t width = 1);
83  void DrawGBPoint(float x, float y, float z, float angle = 0, int Start = 1, Size_t width = 1);
84  void DrawSliceOutTrackParam(int itr, int color, Size_t width);
85  void DrawSliceOutTrack1(int itr, int color, Size_t width);
86  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);
87  void DrawParticleGlobal(float *param, float q, float tStart, float tEnd, float b, int color = kOrange, Size_t width = 1);
88  void DrawParticleGlobal(float *param, float q, float n[4], float b, int color = kOrange, Size_t width = 1);
89  void DrawGBLine(float x, float y, float z, float x2, float y2, float z2, int Start = 1, Size_t width = 1, int projection = -1);
90 
91  bool DrawTrack(PndFTSCATrackParam t, double Alpha, const PndFTSCADisplayTmpHit *vHits, int NHits, int color = -1, Size_t width = -1, bool pPoint = 0);
92 
93  void DrawGBTrack(int itr, int color = -1, int width = -1);
94  void DrawRecoTrack(int itr, int color = -1, int width = -1);
95  void DrawMCTrack(int itr, int color = -1, int width = -1);
96 
97  void HitToGlobal(const FTSCAHit &hit, float &x, float &y, float &z);
98  void HitToGlobal(const FTSCAHitV &hit, int iV, float &x, float &y, float &z);
99 
100  void DrawGBHits(const FTSCAHitsV &all);
101 
102  void DrawGBHits(const FTSCAHits &all);
103 
104  void DrawGBPoints();
105  void DrawPVHisto(const vector<float> &pvHist, const PndFTSCAParam &param);
106  void DrawGBNPlets(const FTSCANPletsV &all);
107 
109 
110  void DrawGBTracks(const FTSCATracks &all);
111 
112 #if !defined(PANDA_FTS)
113  void DrawGBTrackFast(const PndFTSCAGBTracker &tracker, int itr, int color = -1);
114 #endif
115  bool DrawTracklet(PndFTSCATrackParam &track, const int *hitstore, int color = -1, int width = -1, bool pPoint = 0);
116 
117  // void DrawGBLinks( const PndFTSCAGBTracker &tracker, int color = -1, Size_t width = -1 );
118 
119  void DrawGBHit(const PndFTSCAGBTracker &tracker, int iHit, int color = -1, Size_t width = -1);
120  void DrawGBHits(const PndFTSCAGBTracker &tracker, int color = -1, Size_t width = -1, int hitsType = -1);
121 
122 #if !defined(PANDA_FTS)
123  void DrawTrackParam(PndFTSCATrackParam t, int color = 1);
124 #endif
125 
126  void SaveCanvasToFile(TString fileName);
127 
128  TPad *CanvasYX() { return fYX; }
129  TPad *CanvasZX() { return fZX; }
130 
131  protected:
132  TCanvas *fCanvas; // the canvas
133  TPad *fYX, // in case of PANDA_FTS fYX states for XY plane
134  *fZX, *fZR; // two views
135  bool fAsk; // flag to ask for the pressing key
136  const PndFTSCAGBTracker *fGB; // the Aliglobal tracker
137  PndFTSCAPerformance *fPerf; // Performance class (mc labels etc)
138  double fZMin, fZMax, fYMin, fYMax; // view parameters
139 #ifdef PANDA_FTS
140  double fXMin, fXMax;
141 #else
142  double fRInnerMin, fRInnerMax, fROuterMin, fROuterMax, fTPCZMin, fTPCZMax; // view parameters
143 #endif
144 
145  TArc fArc; // parameters of drawing objects are copied from this members
146  TLine fLine;
147  TPolyLine fPLine;
148  TMarker fMarker;
149  TBox fBox;
150  TCrown fCrown;
151  TLatex fLatex;
152  TArrow fArrow;
153 
154  bool fDrawOnlyRef; // draw only clusters from ref. mc tracks
155 
156  private:
158  PndFTSCADisplay &operator=(const PndFTSCADisplay &);
159 };
160 
161 #endif
void HitToGlobal(const FTSCAHit &hit, float &x, float &y, float &z)
static PndFTSCADisplay & Instance()
void SetTPC(const PndFTSCAParam &tpcParam)
void DrawRecoTrack(int itr, int color=-1, int width=-1)
void DrawPVHisto(const vector< float > &pvHist, const PndFTSCAParam &param)
bool DrawTracklet(PndFTSCATrackParam &track, const int *hitstore, int color=-1, int width=-1, bool pPoint=0)
void DrawGBPoint(float x, float y, float z, int Start=1, Size_t width=1)
int GetTrackMC(const PndFTSCADisplayTmpHit *vHits, int NHits)
void DrawGBHit(const PndFTSCAGBTracker &tracker, int iHit, int color=-1, Size_t width=-1)
const PndFTSCAGBTracker * fGB
unsigned int i
Definition: P4_F32vec4.h:21
void DrawGBLine(float x, float y, float z, float x2, float y2, float z2, int Start=1, Size_t width=1, int projection=-1)
int GetColorZ(double z) const
int GetColorK(double k) const
const PndFTSCAGBTracker * GetGB()
void DrawGBTrackFast(const PndFTSCAGBTracker &tracker, int itr, int color=-1)
void DrawMCTrack(int itr, int color=-1, int width=-1)
int GetColorY(double y) const
PndFTSCAPerformance * fPerf
void DrawSlice(PndFTSCATracker *slice, bool DrawRows=0, bool DrawGrid=1)
void SetGB(const PndFTSCAGBTracker *GBTracker)
void DrawGBTracks(const FTSCATracks &all)
void DrawGBTrack(int itr, int color=-1, int width=-1)
virtual ~PndFTSCADisplay()
void SaveCanvasToFile(TString fileName)
bool DrawTrack(PndFTSCATrackParam t, double Alpha, const PndFTSCADisplayTmpHit *vHits, int NHits, int color=-1, Size_t width=-1, bool pPoint=0)
void DrawGBNPlets(const FTSCANPletsV &all)
void DrawPoint(float x, float y, float z, int Start=1, Size_t width=1)
int GetColor(int i) const
void DrawSliceOutTrackParam(int itr, int color, Size_t width)
void DrawTrackParam(PndFTSCATrackParam t, int color=1)
void DrawArc(float x, float y, float r, int Start=1, Size_t width=1)
void DrawSliceOutTrack1(int itr, int color, Size_t width)
void DrawParticleGlobal(float *param, float q, float tStart, float tEnd, float b, int color=kOrange, Size_t width=1)
void DrawGBHits(const FTSCAHitsV &all)
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)