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