]> git.uio.no Git - u/mrichter/AliRoot.git/blob - HLT/TPCLib/AliHLTTPCDisplay.h
dc101774cb97c6eeceeadb2f8645a804ddce9ee6
[u/mrichter/AliRoot.git] / HLT / TPCLib / AliHLTTPCDisplay.h
1 // @(#) $Id$
2 // Original: AliL3Display.h,v 1.14 2004/06/30 08:30:14 loizides 
3
4 #ifndef ALIHLTTPCDISPLAY_H
5 #define ALIHLTTPCDISPLAY_H
6
7 /** \class AliHLTTPCDisplay
8 <pre>
9 //_____________________________________________________________
10 // AliHLTTPCDisplay
11 //
12 // Display class for the HLT TPC events.
13 </pre>
14 */
15 // Author: Jochen Thaeder <mailto:thaeder@kip.uni-heidelberg.de>
16 //         Anders Vestbo <mailto:vestbo@fi.uib.no>
17 //*-- Copyright &copy ALICE HLT Group 
18
19 #include <TGeometry.h>
20 #include <TObject.h>
21 #include <TCanvas.h>
22 #include <TH2.h>
23 #include <TGraph.h>
24 #include "AliHLTLogging.h"
25
26 class AliHLTTPCSpacePointData;
27 class AliHLTTPCTrackArray;
28
29 class AliHLTTPCDisplay : public TObject, public AliHLTLogging {
30
31  public:
32     AliHLTTPCDisplay(Char_t *gfile="$(ALIHLT_BASEDIR)/geo/alice.geom") {InitDisplay(gfile);}
33     virtual ~AliHLTTPCDisplay();
34
35     void InitDisplay(Char_t *gfile);
36   
37     // SETUP
38     void SetupHist();
39     void SetupCluster(Int_t slice, Int_t patch, UInt_t nofClusters, AliHLTTPCSpacePointData* data);
40     void SetupTracks(AliHLTTPCTrackArray *tracks);
41     
42     // HISTOGRAM FILL/RESET FUNCTIONS
43     void FillPadRow(Int_t patch, ULong_t dataBlock, ULong_t dataLen);
44     void ResetHistPadRow();
45     void ResetHistResiduals();
46     void ResetHistCharge();
47
48     // DRAWER
49     void Draw3D();
50     void DrawHistPadRow(); 
51     void DrawGeomSector(Int_t sector);
52     void DrawHistPad1();
53     void DrawHistPad2();
54     void DrawHistPad3();
55     void DrawHistResiduals(Bool_t ySwitch);
56     void DrawHistCharge();
57     
58     // SETTER  
59     void SetSlices(){fMinSlice = 0; fMaxSlice = 35; fSlicePair = kFALSE; SetSliceArray();}
60     void SetSlices(Int_t s){fMinSlice = s; fMaxSlice = s; fSlicePair = kFALSE; SetSliceArray();}
61     void SetSlices(Int_t mins, Int_t maxs){fMinSlice = mins; fMaxSlice = maxs; fSlicePair = kFALSE; SetSliceArray();}
62     void SetSlicesPair(Int_t s){fMinSlice = s; fMaxSlice = s; fSlicePair = kTRUE; SetSliceArray();}
63     void SetSlicesPair(Int_t mins, Int_t maxs){fMinSlice = mins; fMaxSlice = maxs; fSlicePair = kTRUE; SetSliceArray();}
64
65     void SetPad(Int_t f){fPad = f;}
66     void SetPadRow(Int_t f){fPadRow = f;}
67     void SetSlicePadRow(Int_t f){fSlicePadRow = f;}
68
69     void SetMinHits(Int_t f){fMinHits = f;}
70     void SetPtThreshold(Float_t f){fPtThreshold = f;}
71
72     void SetSwitches(Bool_t f1, Bool_t f2, Bool_t f3, Bool_t f4) {fSwitch3DTracks = f1; fSwitch3DCluster = f2; fSwitch3DPadRow = f3; fSwitch3DGeometry = f4;} 
73     void Set3DSwitchTracks(Bool_t f1) {fSwitch3DTracks = f1;}
74     void Set3DSwitchCluster(Bool_t f1) {fSwitch3DCluster = f1;}
75     void Set3DSwitchPadRow(Bool_t f1) {fSwitch3DPadRow = f1;}
76     void Set3DSwitchGeometry(Bool_t f1) {fSwitch3DGeometry = f1;}
77
78     void SetSelectTrack(Int_t f) {fSelectTrack = f;}
79     void SetSelectTrackSlice(Int_t f) {fSelectTrackSlice = f;}
80     void SetSelectTrackSwitch(Bool_t f) {fSelectTrackSwitch = f;}
81     void SetSelectCluster(Int_t f) {fSelectCluster = f;}
82
83     void SetHistPadRowAxis();
84
85     void SetInvert() {Int_t tmp = fBackColor; fBackColor = fLineColor; fLineColor = tmp; }
86     void SetKeepView(Bool_t f){fKeepView = f;} 
87
88     // GETTER
89     Int_t GetPadRow(){return fPadRow;}
90     Int_t GetSlicePadRow(){return fSlicePadRow;}
91     Int_t GetNPads(){return fNPads;}
92     Int_t GetBackColor(){return fBackColor;}
93     Bool_t GetKeepView(){return fKeepView;}
94     
95     Bool_t Get3DSwitchTracks() {return fSwitch3DTracks;}
96     Bool_t Get3DSwitchCluster() {return fSwitch3DCluster;}
97     Bool_t Get3DSwitchPadRow() {return fSwitch3DPadRow;}
98
99     Bool_t GetSelectTrackSwitch() {return fSelectTrackSwitch;}
100
101     struct AliHLTTPCTrackParameter{
102         Int_t nHits;
103         Int_t charge;
104         Double_t kappa;
105         Double_t radius;
106         Double_t xyzF[3];
107         Double_t xyzL[3];
108         Int_t slice;
109         Double_t phi0;
110         Double_t psi;
111         Double_t lambda;
112         Double_t pt;
113         Int_t id;
114         Double_t bfield;
115         Double_t s;
116     };
117     
118     AliHLTTPCTrackParameter fTrackParam;
119
120 // ---------------------------------------------------
121 // In order to be backward compatible
122 // ---------------------------------------------------
123 /*
124     AliHLTTPCDisplay(Int_t *slice, Char_t *gfile ) { InitDisplay(gfile);}
125
126     // SETUP
127     void SetupClusterDataForPatch(Int_t slice, Int_t patch, UInt_t nofClusters, AliHLTTPCSpacePointData* data) {SetupCluster(slice, patch, nofClusters, data);}
128     void SetTracks(AliHLTTPCTrackArray *tracks) { SetupTracks(tracks);}
129     void DisplayClusters(Bool_t x3don=kTRUE,Float_t* etaRange=NULL);
130     void DisplayTracks(Int_t minhits=10,Bool_t x3don=kTRUE,Float_t thr=0.);
131     void DisplayAll(Int_t minhits=10,Bool_t clusterswitch=kTRUE,Bool_t trackswitch=kTRUE,Bool_t x3don=kTRUE, Float_t thr=0., Float_t* etaRange=NULL);
132 */
133 // ---------------------------------------------------
134  private:
135 // ---------------------------------------------------
136 // In order to be backward compatible
137 // ---------------------------------------------------
138 /*    TCanvas *fc1; */
139 // ---------------------------------------------------
140     Bool_t LoadGeometrie(Char_t *gfile);
141     void SetSliceArray();
142
143     AliHLTTPCDisplay(const AliHLTTPCDisplay &/*d*/):TObject(){;}
144     AliHLTTPCDisplay& operator=(const AliHLTTPCDisplay &/*d*/){return *this;}
145     
146     AliHLTTPCSpacePointData *fClusters[36][6]; 
147     AliHLTTPCTrackArray *fTracks; 
148     
149     UInt_t fNcl[36][6];//number of cluster
150
151     TH1F *fHistrawcl;  // histogram for cluster in padrow
152     TH2F *fHistraw;    // histogram for signals in padrow
153     TH1F *fHistpad1;   // histogram for pad in padrow
154     TH1F *fHistpad2;   // histogram for pad in padrow
155     TH1F *fHistpad3;   // histogram for pad in padrow
156     TH1F *fHistallresidualsY;//histogram for all Y residuals
157     TH1F *fHistallresidualsZ;//histogram for all Z residuals
158     TH1F *fHistcharge; // histogram for clustercharge
159     
160     TGraph *fGraphresidualsY; // graph of the Y residuals for one track
161     TGraph *fGraphresidualsZ; // graph of the Z residuals for one track
162     TGraph *fGraphresidualsYLength; // graph of the Y residuals for one track
163     TGraph *fGraphresidualsZLength; // graph of the Z residuals for one track
164
165
166     TGeometry *fGeom;  // geometry
167     Int_t fBackColor;  // Background color
168     Int_t fLineColor;  // Line color
169     Bool_t fKeepView;  // Keep View when redisplaying
170     
171     Int_t fPad;        // pad
172     Int_t fPadRow;     // padrow
173     Int_t fSlicePadRow;// slice where padrow is in
174     Int_t fNPads;      // number of pads in padrow
175     Int_t fNTimes;     // number of timebins
176     Int_t fMinHits;    // minimum cluster per track
177     Float_t fPtThreshold;// pt threshold for tracks
178     
179     Bool_t fSelectTrackSwitch;// switch ti single track mode
180     Int_t fSelectTrack;// select single track
181     Int_t fSelectTrackSlice; // select slice for single track
182     
183     Int_t fSelectCluster; // select all=0, used=1, unused=2 cluster
184     
185     Int_t fMinSlice;   //min slice
186     Int_t fMaxSlice;   //max slice
187     Bool_t fSlicePair; //draw pair of slices;
188     Bool_t fSliceArray[36];//Array if slice should be drawn or not
189     
190     Bool_t fDrawGeo;
191     Int_t fcolorbin[20]; // number of entries per colorbin
192     Int_t fbinct[20];    // index of colorbin
193     Float_t *fpmarr[20]; // contains point data
194     
195     Bool_t fSwitch3DCluster;
196     Bool_t fSwitch3DTracks;
197     Bool_t fSwitch3DPadRow;
198     Bool_t fSwitch3DGeometry;
199
200     ClassDef(AliHLTTPCDisplay,1) //Display class
201 };
202
203 #endif