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