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