FairRoot/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;
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 
48 
53 {
54 
55  public:
56 
58 
59  static PndFTSCADisplay &Instance();
60 
62 
63  virtual ~PndFTSCADisplay();
64 
65  void Init();
66  void Update();
67  void ClearView();
68  void Ask();
69  void SetTPC( const PndFTSCAParam& tpcParam);
70  void SetGB( const PndFTSCAGBTracker * GBTracker );
71 
72  const PndFTSCAGBTracker * GetGB(){return fGB;};
73  int GetColor( int i ) const;
74  int GetColorZ( double z ) const ;
75  int GetColorY( double y ) const ;
76  int GetColorK( double k ) const ;
77  int GetTrackMC( const PndFTSCADisplayTmpHit *vHits, int NHits );
78 
79 
80  void DrawTPC();
81  void DrawSlice( PndFTSCATracker *slice, bool DrawRows = 0, bool DrawGrid = 1 );
82 
83  void DrawArc(float x, float y, float r, int Start = 1, Size_t width = 1 );
84  void DrawPoint(float x, float y, float z, int Start = 1, Size_t width = 1 );
85 
86  void DrawGBPoint(float x, float y, float z, int Start = 1, Size_t width = 1 );
87  void DrawGBPoint(float x, float y, float z, float angle = 0, int Start = 1, Size_t width = 1 );
88  void DrawSliceOutTrackParam( int itr, int color, Size_t width );
89  void DrawSliceOutTrack1( int itr, int color, Size_t width );
90  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);
91  void DrawParticleGlobal(float *param, float q, float tStart, float tEnd, float b, int color=kOrange, Size_t width = 1);
92  void DrawParticleGlobal(float *param, float q, float n[4], float b, int color=kOrange, Size_t width = 1);
93  void DrawGBLine(float x, float y, float z, float x2, float y2, float z2, int Start=1, Size_t width=1, int projection = -1 );
94 
95  bool DrawTrack( PndFTSCATrackParam t, double Alpha, const PndFTSCADisplayTmpHit *vHits,
96  int NHits, int color = -1, Size_t width = -1, bool pPoint = 0 );
97 
98  void DrawGBTrack( int itr, int color = -1, int width = -1 );
99  void DrawRecoTrack( int itr, int color = -1, int width = -1 );
100  void DrawMCTrack( int itr, int color = -1, int width = -1 );
101 
102  void HitToGlobal( const FTSCAHit& hit, float& x, float& y, float &z );
103  void HitToGlobal( const FTSCAHitV& hit, int iV, float& x, float& y, float &z );
104 
105  void DrawGBHits (const FTSCAHitsV& all);
106 
107  void DrawGBHits(const FTSCAHits& all);
108 
109  void DrawGBPoints();
110  void DrawPVHisto(const vector<float>& pvHist, const PndFTSCAParam& param);
111  void DrawGBNPlets(const FTSCANPletsV& all);
112 
114 
115  void DrawGBTracks(const FTSCATracks& all);
116 
117 #if !defined(PANDA_FTS)
118  void DrawGBTrackFast( const PndFTSCAGBTracker &tracker, int itr, int color = -1 );
119 #endif
120  bool DrawTracklet( PndFTSCATrackParam &track, const int *hitstore, int color = -1, int width = -1, bool pPoint = 0 );
121 
122 // void DrawGBLinks( const PndFTSCAGBTracker &tracker, int color = -1, Size_t width = -1 );
123 
124  void DrawGBHit( const PndFTSCAGBTracker &tracker, int iHit, int color = -1, Size_t width = -1 );
125  void DrawGBHits( const PndFTSCAGBTracker &tracker, int color = -1, Size_t width = -1, int hitsType = -1 );
126 
127 #if !defined(PANDA_FTS)
128  void DrawTrackParam( PndFTSCATrackParam t, int color = 1 );
129 #endif
130 
131  void SaveCanvasToFile( TString fileName);
132 
133  TPad *CanvasYX() { return fYX; }
134  TPad *CanvasZX() { return fZX; }
135 
136  protected:
137 
138  TCanvas *fCanvas; // the canvas
139  TPad *fYX, // in case of PANDA_FTS fYX states for XY plane
140  *fZX, *fZR; // two views
141  bool fAsk; // flag to ask for the pressing key
142  const PndFTSCAGBTracker *fGB; // the Aliglobal tracker
143  PndFTSCAPerformance *fPerf; // Performance class (mc labels etc)
144  double fZMin, fZMax, fYMin, fYMax; // view parameters
145 #ifdef PANDA_FTS
146  double fXMin, fXMax;
147 #else
148  double fRInnerMin, fRInnerMax, fROuterMin, fROuterMax, fTPCZMin, fTPCZMax; // view parameters
149 #endif
150 
151  TArc fArc; // parameters of drawing objects are copied from this members
152  TLine fLine;
153  TPolyLine fPLine;
154  TMarker fMarker;
155  TBox fBox;
156  TCrown fCrown;
157  TLatex fLatex;
158  TArrow fArrow;
159 
160  bool fDrawOnlyRef; // draw only clusters from ref. mc tracks
161 
162  private:
165 };
166 
167 #endif
void HitToGlobal(const FTSCAHit &hit, float &x, float &y, float &z)
Double_t z0
Definition: checkhelixhit.C:62
void SetTPC(const PndFTSCAParam &tpcParam)
double r
Definition: RiemannTest.C:14
void DrawRecoTrack(int itr, int color=-1, int width=-1)
void DrawPVHisto(const vector< float > &pvHist, const PndFTSCAParam &param)
Int_t i
Definition: run_full.C:25
TTree * b
PndRiemannTrack track
Definition: RiemannTest.C:33
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)
TLorentzVector s
Definition: Pnd2DStar.C:50
int n
int GetColorK(double k) const
int GetTrackMC(const PndFTSCADisplayTmpHit *vHits, int NHits)
void DrawGBHit(const PndFTSCAGBTracker &tracker, int iHit, int color=-1, Size_t width=-1)
static PndFTSCADisplay & Instance()
timer Start()
const PndFTSCAGBTracker * fGB
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 GetColorY(double y) const
const PndFTSCAGBTracker * GetGB()
void DrawGBTrackFast(const PndFTSCAGBTracker &tracker, int itr, int color=-1)
void DrawMCTrack(int itr, int color=-1, int width=-1)
PndFTSCAPerformance * fPerf
void DrawSlice(PndFTSCATracker *slice, bool DrawRows=0, bool DrawGrid=1)
void SetGB(const PndFTSCAGBTracker *GBTracker)
void DrawGBTracks(const FTSCATracks &all)
int GetColor(int i) const
void DrawGBTrack(int itr, int color=-1, int width=-1)
void SaveCanvasToFile(TString fileName)
Double_t z
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)
PndFTSCADisplay & operator=(const PndFTSCADisplay &)
virtual ~PndFTSCADisplay()
void DrawPoint(float x, float y, float z, int Start=1, Size_t width=1)
int hit(Int_t nEvents=0, TString inFile="sim.root", TString parFile="par.root", TString inDigi="digi.root", TString outFile="hit.root", Int_t timeBased=0)
Definition: hit.C:1
Double_t x
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)
TTree * t
Definition: bump_analys.C:13
Double_t y
Double_t angle
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)
int GetColorZ(double z) const