FairRoot/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 
37 
41 class PndCADisplay
42 {
43 
44 public:
45 
46  class PndCADisplayTmpHit;
47 
48  static PndCADisplay &Instance();
49 
50  PndCADisplay();
51 
52  virtual ~PndCADisplay();
53 
54  void Init();
55  void Update();
56  void ClearView();
57  void Ask();
58  void SetTPC( const PndCAParam& tpcParam); // iklm
59  void SetGB( const PndCAGBTracker * GBTracker );
60 
61  const PndCAGBTracker * GetGB(){return fGB;};
62  int GetColor( int i ) const;
63  int GetColorZ( double z ) const ;
64  int GetColorY( double y ) const ;
65  int GetColorK( double k ) const ;
66  int GetTrackMC( const PndCADisplayTmpHit *vHits, int NHits );
67 
68 
69  void DrawTPC();
70  void DrawFwdMvd();
71  void DrawFwdGBHits( const PndCAGBTracker &tracker);
72  void DrawSlice( PndCATracker *slice, bool DrawRows = 0, bool DrawGrid = 1 );
73 
74  void DrawArc(float x, float y, float r, int Start = 1, Size_t width = 1 );
75  void DrawPoint(float x, float y, float z, int Start = 1, Size_t width = 1 );
76 
77  void DrawGBPoint(float x, float y, float z, int Start = 1, Size_t width = 1 );
78  void DrawGBPoint(float x, float y, float z, float angle = 0, int Start = 1, Size_t width = 1 );
79  void DrawSliceOutTrackParam( int itr, int color, Size_t width );
80  void DrawSliceOutTrack1( int itr, int color, Size_t width );
81  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);
82  void DrawParticleGlobal(float *param, float q, float tStart, float tEnd, float b, int color=kOrange, Size_t width = 1);
83  void DrawParticleGlobal(float *param, float q, float n[4], float b, int color=kOrange, Size_t width = 1);
84  void DrawGBLine(float x, float y, float z, float x2, float y2, float z2, int Start=1, Size_t width=1, int projection = -1 );
85 
86  bool DrawTrack( PndCATrackParam t, double Alpha, const PndCADisplayTmpHit *vHits,
87  int NHits, int color = -1, Size_t width = -1, bool pPoint = 0 );
88 
89  void DrawGBTrack( int itr, int color = -1, int width = -1 );
90  void DrawRecoTrack( int itr, int color = -1, int width = -1 );
91  void DrawMCTrack( int itr, int color = -1, int width = -1 );
92 
93  void HitToGlobal( const PndCAHit& hit, float& x, float& y, float &z );
94  void HitToGlobal( const PndCAHitV& hit, int iV, float& x, float& y, float &z );
95 
96  void DrawGBHits (const PndCAHits& all);
97  void DrawGBPoints();
98  void DrawPVHisto(const vector<float>& pvHist, const PndCAParam& param);
99  void DrawGBNPlets(const PndCANPletsV& all);
100  void DrawGBTracks(const PndCATracks& all);
101 
102  void DrawGBTrackFast( const PndCAGBTracker &tracker, int itr, int color = -1 );
103  bool DrawTracklet( PndCATrackParam &track, const int *hitstore, int color = -1, int width = -1, bool pPoint = 0 );
104 
105  // void DrawGBLinks( const PndCAGBTracker &tracker, int color = -1, Size_t width = -1 );
106 
107  void DrawGBHit( const PndCAGBTracker &tracker, int iHit, int color = -1, Size_t width = -1 );
108  void DrawGBHits( const PndCAGBTracker &tracker, int color = -1, Size_t width = -1, int hitsType = -1 );
109 
110  void DrawTrackParam( PndCATrackParam t, int color = 1 );
111 
112  void SaveCanvasToFile( TString fileName);
113 
114  TPad *CanvasYX() { return fYX; }
115  TPad *CanvasZX() { return fZX; }
116 
117 protected:
118 
119  TCanvas *fCanvas; // the canvas
120  TPad *fYX, *fZX, *fZR; // two views
121  TCanvas *fFwdMvdCanvas;//, *fFwdMvdXYCanvas; // the canvas
122  TPad *fFwdMvdZY, *fFwdMvdZX, *fFwdMvdZR; //*fFwdMvdXY; // two views
123  bool fAsk; // flag to ask for the pressing key
124  const PndCAGBTracker *fGB; // the Aliglobal tracker
125  PndCAPerformance *fPerf; // Performance class (mc labels etc)
126  double fZMin, fZMax, fYMin, fYMax;// view parameters
127  double fRInnerMin, fRInnerMax, fROuterMin, fROuterMax, fTPCZMin, fTPCZMax; // view parameters
128 
129  TArc fArc; // parameters of drawing objects are copied from this members
130  TLine fLine;
131  TPolyLine fPLine;
132  TMarker fMarker;
133  TBox fBox;
134  TCrown fCrown;
135  TLatex fLatex;
136  TArrow fArrow;
137 
138  bool fDrawOnlyRef; // draw only clusters from ref. mc tracks
139 
140 private:
141  PndCADisplay( const PndCADisplay& );
142  PndCADisplay& operator=( const PndCADisplay& );
143 };
144 
145 #endif //CATRACKER_DISPLAY
146 
147 #endif
Double_t z0
Definition: checkhelixhit.C:62
double r
Definition: RiemannTest.C:14
Int_t i
Definition: run_full.C:25
TTree * b
int n
timer Start()
FairBoxGenerator * fBox
c2 Update()
PndMCTrack * track
Definition: anaLmdCluster.C:89
Double_t z
Double_t x
fRun Init()
Definition: NHitsPerEvent.C:20
TTree * t
Definition: bump_analys.C:13
PndSdsMCPoint * hit
Definition: anasim.C:70
Double_t y
Double_t angle