AliHLTTPCDisplay.cxx moved from TPCLib to TPCLib/OnlineDisplay
[u/mrichter/AliRoot.git] / HLT / TPCLib / AliHLTTPCDisplay.cxx
1 // @(#) $Id$
2 // Original: AliL3Display.cxx,v 1.26 2005/06/14 10:55:21 cvetan 
3
4 /** \class AliHLTTPCDisplay
5 <pre>
6 //_____________________________________________________________
7 // AliHLTTPCDisplay
8 //
9 // Display class for the HLT TPC events.
10 </pre>
11 */
12 // Author: Jochen Thaeder <mailto:thaeder@kip.uni-heidelberg.de>
13 //         Anders Vestbo <mailto:vestbo@fi.uib.no>      
14 //*-- Copyright &copy ALICE HLT Group 
15
16 #define TRACKHELIX 0
17 #define TRACKPOLYMARKER 0
18 #define BACKWARD 0
19 #define FIRSTLASTPOINT 0
20
21 #define TRACKCOLOR 
22 #define USEDCLUSTERCOLOR
23 #define UNUSEDCLUSTERCOLOR
24
25 #include <TView.h>
26 #include <TPolyMarker3D.h>
27 #include <TPolyLine3D.h>
28 #include <TH2.h>
29 #include <TTree.h>
30 #include <TNode.h>
31 #include <TGeometry.h>
32 #include <TShape.h>
33 #include <TParticle.h>
34 #include <TFile.h>
35 #include <THelix.h>
36 #include <TStyle.h>
37 #include <TGraph.h>
38 #include <TMultiGraph.h>
39 #include <TAttText.h>
40 #include <TAxis.h>
41
42 #if TRACKHELIX
43 #include <THelix.h>
44 #endif
45
46 #ifdef use_aliroot
47 #include <TClonesArray.h>
48 #include <AliRun.h>
49 #include <AliSimDigits.h>
50 #include <AliTPCParam.h>
51 #endif
52
53 #include "AliHLTTPCLogging.h"
54 #include "AliHLTTPCDisplay.h"
55 #include "AliHLTTPCTransform.h"
56 #include "AliHLTTPCTrack.h"
57 #include "AliHLTTPCTrackArray.h"
58 #include "AliHLTTPCSpacePointData.h"
59 #include "AliHLTTPCMemHandler.h"
60 #include "AliHLTTPCDigitReaderPacked.h"
61
62 #if __GNUC__ == 3
63 using namespace std;
64 #endif
65
66 ClassImp(AliHLTTPCDisplay)
67
68 // #############################################################################
69 void AliHLTTPCDisplay::InitDisplay(Char_t *gfile) {
70     //constructor
71     memset(fClusters,0,36*6*sizeof(AliHLTTPCSpacePointData*));
72     memset(fNcl, 0, 36*6*sizeof(UInt_t)); 
73
74     fTracks = NULL;
75     fHistrawcl = NULL;
76     fHistraw = NULL;
77     fHistpad1 = NULL;
78     fHistpad2 = NULL;
79     fHistpad3 = NULL;
80     fHistallresidualsY = NULL;   
81     fHistallresidualsZ = NULL;
82     fHistcharge = NULL;
83     fGraphresidualsY = NULL;
84     fGraphresidualsZ = NULL;
85     fGraphresidualsYLength = NULL;
86     fGraphresidualsZLength = NULL;
87
88
89     fGeom = NULL;
90 // ---------------------------------------------------
91 // In order to be backward compatible
92 // ---------------------------------------------------
93 #if BACKWARD
94     //fc1 = NULL;
95 #endif 
96 // ---------------------------------------------------
97     fNPads = 0;
98     fNTimes = 0;
99     fMinHits = 0;
100     fPtThreshold = 0.;
101     fPad = -1;
102     fPadRow = 0;
103     fSlicePadRow = 0; 
104     fSelectTrack = -1;
105     fSelectTrackSlice = 0;
106     fSelectTrackSwitch = kFALSE;
107     fSelectCluster = 0;
108
109     fMinSlice = 0;
110     fMaxSlice = 35;
111     fSlicePair = kFALSE;
112
113     SetSliceArray();
114
115     fBackColor = 1; 
116     fLineColor = 0;
117     fKeepView = kFALSE;
118
119     fSwitch3DCluster = kFALSE;
120     fSwitch3DTracks = kFALSE;
121     fSwitch3DPadRow = kFALSE;
122     fSwitch3DGeometry = kFALSE;
123
124     AliHLTTPCTransform::SetBField(0.4);
125     LoadGeometrie(gfile);
126 }
127
128
129 // #############################################################################
130 AliHLTTPCDisplay::~AliHLTTPCDisplay() {
131     //destructor
132     if(fTracks) delete fTracks;
133     fTracks = NULL;
134 }
135
136 // #############################################################################
137 Bool_t AliHLTTPCDisplay::LoadGeometrie(Char_t *gfile) {
138     if (gfile) {
139         TFile *file = TFile::Open(gfile);
140         if(!file) {
141             LOG(AliHLTTPCLog::kError,"AliHLTTPCDisplay::AliHLTTPCDisplay","File Open") <<"Geometry file " << gfile << " does not exist!"<<ENDLOG;
142             return kFALSE;
143         }
144         
145         fGeom = (TGeometry*)file->Get("AliceGeom");
146
147         file->Close();
148         delete file;
149     }
150     return kTRUE;
151 }
152
153 // #############################################################################
154 //                 EXECUTER
155 // #############################################################################
156 void AliHLTTPCDisplay::ExecPadRow(){
157    int event = gPad->GetEvent();
158    if (event != 11) return;
159
160    printf("TEST !!!!!!!!!!!!!!!");
161 /*   int px = gPad->GetEventX();
162    TObject *select = gPad->GetSelected();
163    if (!select) return;
164    if (select->InheritsFrom("TH1")) {
165       TH1 *h = (TH1*)select;
166       Float_t xx = gPad->AbsPixeltoX(px);
167       Float_t x  = gPad->PadtoX(xx);
168       Int_t binx = h->GetXaxis()->FindBin(x);
169       printf("event=%d, hist:%s, bin=%d, content=%f\n",event,h->GetName(),binx,h->GetBinContent(binx));
170    }
171
172 */
173
174 }
175
176 // #############################################################################
177 //                 SETTER
178 // #############################################################################
179 void AliHLTTPCDisplay::SetHistPadRowAxis() {
180     // Set Axis range of Histogramm, due to variable NPads per padrow
181
182     fNPads = AliHLTTPCTransform::GetNPads(fPadRow);
183     fHistrawcl->SetAxisRange(0,fNPads);
184     fHistraw->SetAxisRange(0,fNPads);
185     fHistrawcl->SetAxisRange(0,fNTimes,"Y");
186     fHistraw->SetAxisRange(0,fNTimes,"Y");
187 }
188
189 void AliHLTTPCDisplay::SetSliceArray() {
190     Int_t slice=0;
191     Int_t minSlice = fMinSlice; 
192     Int_t maxSlice = fMaxSlice; 
193     Int_t realslice = 0;
194
195     for (slice=0;slice<=35;slice++){
196         fSliceArray[slice] = kFALSE;
197     }
198
199     // Single Slice, or Range
200     if (minSlice > maxSlice) maxSlice += 17;
201         
202     for (slice=minSlice;slice<=maxSlice;slice++){
203         realslice = slice % 18;
204         fSliceArray[realslice] = kTRUE;
205         fSliceArray[realslice+18] = kTRUE;
206     }
207
208     // Pair of Slices
209     if (fSlicePair) {
210         minSlice = fMinSlice + 9;
211         maxSlice = fMaxSlice + 9;
212         
213         if (minSlice > maxSlice) maxSlice += 17;
214         
215         for (slice=minSlice;slice<=maxSlice;slice++){
216             realslice = slice % 18;
217             fSliceArray[realslice] = kTRUE;     
218             fSliceArray[realslice+18] = kTRUE;
219         }
220     }
221 }
222
223 // #############################################################################
224 //                 SETUP
225 // #############################################################################
226 void AliHLTTPCDisplay::SetupCluster(Int_t slice, Int_t patch, UInt_t nofClusters, AliHLTTPCSpacePointData* data)  {  
227
228     if (data && slice>=0 && slice<36 && patch>=0 && patch<AliHLTTPCTransform::GetNPatches()) {
229         if (fClusters[slice][patch]!=NULL) {
230             delete(fClusters[slice][patch]);
231             fClusters[slice][patch]=NULL;
232         }
233         Int_t arraysize=nofClusters*sizeof(AliHLTTPCSpacePointData);
234         fClusters[slice][patch] = (AliHLTTPCSpacePointData*)new Byte_t[arraysize];
235         if (fClusters[slice][patch]) {
236             memcpy(fClusters[slice][patch], data, arraysize);
237             fNcl[slice][patch]=nofClusters;
238         } else {
239             fNcl[slice][patch]=nofClusters;
240             LOG(AliHLTTPCLog::kError,"AliHLTTPCDisplay::SetupCluster","memory allocation") << "memory allocation failed "<<ENDLOG; 
241         }
242     } else LOG(AliHLTTPCLog::kError,"AliHLTTPCDisplay::SetupCluster","argument check") << "invalid argument "<<ENDLOG; 
243 }
244
245 // #############################################################################
246 void AliHLTTPCDisplay::SetupTracks(AliHLTTPCTrackArray *tracks) {
247     fTracks=tracks;
248
249     // Set USED cluster
250     Int_t ntracks = fTracks->GetNTracks();
251
252     for(Int_t j=0; j<ntracks; j++) {    
253         AliHLTTPCTrack *gtrack = fTracks->GetCheckedTrack(j); 
254         if(!gtrack) continue;
255
256         Int_t nHits = gtrack->GetNHits();
257         UInt_t *hitnum = gtrack->GetHitNumbers();
258
259         for(Int_t h=0; h<nHits; h++){
260           
261             UInt_t id=hitnum[h];
262             Int_t slice = (id>>25) & 0x7f;
263             Int_t patch = (id>>22) & 0x7;
264             UInt_t pos = id&0x3fffff;       
265                 
266             AliHLTTPCSpacePointData *points = fClusters[slice][patch];
267             
268             if(!points) {
269                 LOG(AliHLTTPCLog::kError,"AliHLTTPCDisplay::Draw3D","Clusterarray") <<"No points at slice "<<slice<<" patch "<<patch<<" pos "<<pos<<ENDLOG;
270                 continue;
271             }
272  
273             if(pos>=fNcl[slice][patch]) {
274                 LOG(AliHLTTPCLog::kError,"AliHLTTPCDisplay::Draw3D","Clusterarray") <<"Pos is too large: pos "<<pos <<" ncl "<<fNcl[slice][patch]<<ENDLOG;
275                 continue;
276             }
277             points[pos].fUsed = kTRUE;
278             points[pos].fTrackN = j;
279         }
280     }
281 }
282
283 // #############################################################################
284 void AliHLTTPCDisplay::SetupHist(){
285
286     Int_t maxpads = 150;
287     fNTimes = AliHLTTPCTransform::GetNTimeBins();
288
289     if ( fHistraw ){
290         delete fHistraw;
291         fHistraw = NULL;
292     }
293     if ( fHistrawcl ){
294         delete fHistrawcl;
295         fHistrawcl = NULL;
296     }
297
298     if ( fHistpad1 ){
299         delete fHistpad1;
300         fHistpad1 = NULL;
301     }
302
303     if ( fHistpad2 ){
304         delete fHistpad2;
305         fHistpad2 = NULL;
306     }
307
308     if ( fHistpad3 ){
309         delete fHistpad3;
310         fHistpad3 = NULL;
311     }
312
313     if ( fHistallresidualsY){
314         delete fHistallresidualsY;
315         fHistallresidualsY = NULL;
316     }
317
318     if ( fHistallresidualsZ){
319         delete fHistallresidualsZ;
320         fHistallresidualsZ = NULL;
321     }
322     if ( fHistcharge){
323         delete fHistcharge;
324         fHistcharge = NULL;
325     }
326
327     // Setup the histograms
328     Int_t padbinning = maxpads*10;
329     fHistraw = new TH2F("fHistraw","Selected PadRow with found Clusters;Pad #;Timebin #",maxpads,0,maxpads-1,fNTimes,0,fNTimes-1);
330     fHistrawcl = new TH1F("fHistrawcl","",padbinning,0,maxpads-1);
331     fHistpad1 = new TH1F ("fHistpad1","Selected Pad -1;Timebin #",fNTimes,0,fNTimes-1);
332     fHistpad2 = new TH1F ("fHistpad2","Selected Pad;Timebin #",fNTimes,0,fNTimes-1); 
333     fHistpad3 = new TH1F ("fHistpad3","Selected Pad +1;Timebin #",fNTimes,0,fNTimes-1);
334     fHistallresidualsY = new TH1F ("fHistallresiduals","Y Residuals of all Tracks in selected slices;residuals",5000,-100,100);
335     fHistallresidualsZ = new TH1F ("fHistallresiduals","Z Residuals of all Tracks in selected slices;residuals",5000,-100,100);
336     fHistcharge = new TH1F ("fHistcharge","Cluster distribution per charge;charge;#cluster",5000,0,30000);
337
338     fHistraw->SetOption("COLZ"); 
339
340     fHistallresidualsY->SetTitleSize(0.03);
341     fHistallresidualsY->GetXaxis()->SetLabelSize(0.03);
342     fHistallresidualsY->GetXaxis()->SetTitleSize(0.03);
343     fHistallresidualsY->GetYaxis()->SetLabelSize(0.03);
344     fHistallresidualsY->GetYaxis()->SetTitleSize(0.03);
345
346     fHistallresidualsZ->SetTitleSize(0.03);
347     fHistallresidualsZ->GetXaxis()->SetLabelSize(0.03);
348     fHistallresidualsZ->GetXaxis()->SetTitleSize(0.03);
349     fHistallresidualsZ->GetYaxis()->SetLabelSize(0.03);
350     fHistallresidualsZ->GetYaxis()->SetTitleSize(0.03);
351
352     fHistcharge->SetTitleSize(0.03);
353     fHistcharge->GetXaxis()->SetLabelSize(0.03);
354     fHistcharge->GetXaxis()->SetTitleSize(0.03);
355     fHistcharge->GetYaxis()->SetLabelSize(0.03);
356     fHistcharge->GetYaxis()->SetTitleSize(0.03);
357
358     fHistraw->SetTitleSize(0.03);
359     fHistraw->GetXaxis()->SetLabelSize(0.03);
360     fHistraw->GetXaxis()->SetTitleSize(0.03);
361     fHistraw->GetYaxis()->SetLabelSize(0.03);
362     fHistraw->GetYaxis()->SetTitleSize(0.03);
363
364     fHistpad1->SetTitleSize(0.03);
365     fHistpad1->GetXaxis()->SetLabelSize(0.03);
366     fHistpad1->GetXaxis()->SetTitleSize(0.03);
367     fHistpad1->GetYaxis()->SetLabelSize(0.03);
368     fHistpad1->GetYaxis()->SetTitleSize(0.03);
369
370     fHistpad2->SetTitleSize(0.03);
371     fHistpad2->GetXaxis()->SetLabelSize(0.03);
372     fHistpad2->GetXaxis()->SetTitleSize(0.03);
373     fHistpad2->GetYaxis()->SetLabelSize(0.03);
374     fHistpad2->GetYaxis()->SetTitleSize(0.03);
375
376     fHistpad3->SetTitleSize(0.03);
377     fHistpad3->GetXaxis()->SetLabelSize(0.03);
378     fHistpad3->GetXaxis()->SetTitleSize(0.03);
379     fHistpad3->GetYaxis()->SetLabelSize(0.03);
380     fHistpad3->GetYaxis()->SetTitleSize(0.03);
381
382     gStyle->SetPalette(1);
383     
384     SetHistPadRowAxis();
385 }
386
387 // ####################################################################################################
388 void AliHLTTPCDisplay::FillPadRow(Int_t patch, ULong_t dataBlock, ULong_t dataLen){
389 #if defined(HAVE_ALIRAWDATA) && defined(HAVE_ALITPCRAWSTREAM_H)
390     AliHLTTPCDigitReader* digitReader = new AliHLTTPCDigitReaderPacked();
391     bool readValue = true;
392     Int_t rowOffset = 0;
393
394     // Initialize RAW DATA
395     Int_t firstRow = AliHLTTPCTransform::GetFirstRow(patch);
396     Int_t lastRow = AliHLTTPCTransform::GetLastRow(patch);
397
398     // Outer sector, patches 2, 3, 4, 5 -  start counting in patch 2 with row 0
399     if ( patch >= 2 ) rowOffset = AliHLTTPCTransform::GetFirstRow( 2 );
400
401     // Initialize block for reading packed data
402     void* tmpdataBlock = (void*) dataBlock;
403     digitReader->InitBlock(tmpdataBlock,dataLen,firstRow,lastRow,patch,0);
404
405     readValue = digitReader->Next();
406
407     if (!readValue){    
408         LOG(AliHLTTPCLog::kError,"AliHLTTPCDisplay::FillPadRow","Read first value") << "No value in data block" << ENDLOG;
409         return;
410     }
411     
412     // FILL PADROW 3D --- Initialize the colorbins
413     if (fSwitch3DPadRow){
414         for (UInt_t ii=0;ii < 20;ii++){
415             fbinct[ii] = 0;
416             fcolorbin[ii] = 0;
417         }
418
419         // read number of entries in colorbin
420         while ( readValue ){ 
421
422             Int_t row = digitReader->GetRow() + rowOffset;
423             
424             if (row == fPadRow){    
425                 UInt_t charge = digitReader->GetSignal();
426                 
427                 for (UInt_t ii=0;ii < 19;ii++){
428                     if ( charge > (ii*15) && charge <= ((ii*15) + 15) ) fcolorbin[ii]++;
429                 }
430                 // larger than 19 * 15  
431                 if (charge > 285 ) fcolorbin[19]++;
432             }
433
434             // read next value
435             readValue = digitReader->Next();
436       
437             if(!readValue) break; //No more value
438         } 
439         //Initialize fpmarr[color][3*colorbin[ii]]  
440         fpmarr[0] = new Float_t[fcolorbin[0]*3]; 
441         fpmarr[1] = new Float_t[fcolorbin[1]*3]; 
442         fpmarr[2] = new Float_t[fcolorbin[2]*3]; 
443         fpmarr[3] = new Float_t[fcolorbin[3]*3]; 
444         fpmarr[4] = new Float_t[fcolorbin[4]*3];  
445         fpmarr[5] = new Float_t[fcolorbin[5]*3]; 
446         fpmarr[6] = new Float_t[fcolorbin[6]*3]; 
447         fpmarr[7] = new Float_t[fcolorbin[7]*3]; 
448         fpmarr[8] = new Float_t[fcolorbin[8]*3]; 
449         fpmarr[9] = new Float_t[fcolorbin[9]*3]; 
450         fpmarr[10] = new Float_t[fcolorbin[10]*3]; 
451         fpmarr[11] = new Float_t[fcolorbin[11]*3]; 
452         fpmarr[12] = new Float_t[fcolorbin[12]*3]; 
453         fpmarr[13] = new Float_t[fcolorbin[13]*3]; 
454         fpmarr[14] = new Float_t[fcolorbin[14]*3]; 
455         fpmarr[15] = new Float_t[fcolorbin[15]*3]; 
456         fpmarr[16] = new Float_t[fcolorbin[16]*3]; 
457         fpmarr[17] = new Float_t[fcolorbin[17]*3]; 
458         fpmarr[18] = new Float_t[fcolorbin[18]*3]; 
459         fpmarr[19] = new Float_t[fcolorbin[19]*3]; 
460         
461         // Rewind the raw reader and fill the polymarker3D
462         digitReader->InitBlock(tmpdataBlock,dataLen,firstRow,lastRow,patch,0);
463         
464         readValue = digitReader->Next();
465     } // END if (fSwitch3DPadRow)
466
467     // -- Fill Raw Data
468     while ( readValue ){ 
469
470         Int_t row = digitReader->GetRow() + rowOffset;
471
472         // select padrow to fill in histogramm
473         if (row == fPadRow){    
474             UChar_t pad = digitReader->GetPad();
475             UShort_t time = digitReader->GetTime();
476             UInt_t charge = digitReader->GetSignal();
477             Float_t xyz[3];
478             fHistraw->Fill(pad,time,charge);
479
480             if (pad == (fPad-1) ) fHistpad1->Fill(time,charge);
481             if (pad == fPad) fHistpad2->Fill(time,charge);
482             if (pad == (fPad+1) ) fHistpad3->Fill(time,charge);
483
484             if (fSwitch3DPadRow) {
485                 // Transform raw coordinates to local coordinates
486                 AliHLTTPCTransform::RawHLT2Global(xyz, fSlicePadRow, fPadRow, pad, time);
487
488                 for (UInt_t ii=0;ii < 19;ii++){
489                     if ( charge > (ii*15) && charge <= ((ii*15) + 15) ){
490                         fpmarr[ii][fbinct[ii]] = xyz[0];
491                         fpmarr[ii][fbinct[ii]+1] = xyz[1];
492                         fpmarr[ii][fbinct[ii]+2] = xyz[2];
493                         fbinct[ii] += 3;
494                     }
495                 }
496                 // larger than 19 * 15
497                 if (charge > 285 ) {
498                     fpmarr[19][fbinct[19]] = xyz[0];
499                     fpmarr[19][fbinct[19]+1] = xyz[1];
500                     fpmarr[19][fbinct[19]+2] = xyz[2];
501                     fbinct[19] += 3;
502                 }
503             } // END if (fSwitch3DPadRow)
504         
505         }
506         
507         // read next value
508         readValue = digitReader->Next();
509       
510         //Check where to stop:
511         if(!readValue) break; //No more value
512     } 
513     
514     if ( digitReader )
515         delete digitReader;
516     digitReader = NULL;
517
518     AliHLTTPCSpacePointData *points = fClusters[fSlicePadRow][patch];
519     if(!points) return;
520     Int_t npoints = fNcl[fSlicePadRow][patch];
521     
522     Float_t xyz[3];
523     for(Int_t i=0; i<npoints; i++){
524         xyz[0] = points[i].fX;
525         xyz[1] = points[i].fY;
526         xyz[2] = points[i].fZ;
527         
528         Int_t clrow = AliHLTTPCTransform::GetPadRow(xyz[0]);
529         // select padrow to fill in histogramm
530         if (clrow == fPadRow){
531             AliHLTTPCTransform::LocHLT2Raw(xyz, fSlicePadRow, fPadRow);
532             fHistrawcl->Fill(xyz[1],xyz[2]);
533         }
534     }
535 #else //! if defined(HAVE_ALIRAWDATA) && defined(HAVE_ALITPCRAWSTREAM_H)
536     HLTFatal("DigitReaderPacked not available - check your build");
537 #endif //defined(HAVE_ALIRAWDATA) && defined(HAVE_ALITPCRAWSTREAM_H)
538 }
539
540 // #############################################################################
541 void AliHLTTPCDisplay::ResetHistPadRow(){  
542     fHistraw->Reset();   
543     fHistrawcl->Reset(); 
544     fHistpad1->Reset(); 
545     fHistpad2->Reset();  
546     fHistpad3->Reset(); 
547 }
548
549 // #############################################################################
550 void AliHLTTPCDisplay::ResetHistResiduals(){  
551     fHistallresidualsY->Reset();
552     fHistallresidualsZ->Reset();
553 }
554
555 // #############################################################################
556 void AliHLTTPCDisplay::ResetHistCharge(){  
557     fHistcharge->Reset();
558 }
559
560
561 // #############################################################################
562 //                 DRAWER
563 // #############################################################################
564 void AliHLTTPCDisplay::DrawGeomSector(Int_t sector) {  
565   Char_t fname[256];
566   Int_t realsector = sector;// % 18;
567   
568   if (realsector < 10){
569     sprintf(fname,"LS0%d",realsector);
570     fGeom->GetNode(fname)->SetLineColor(fLineColor);
571     fGeom->GetNode(fname)->Draw("same");
572     sprintf(fname,"US0%d",realsector);
573     fGeom->GetNode(fname)->SetLineColor(fLineColor); 
574     fGeom->GetNode(fname)->Draw("same");
575   }
576   else {
577     sprintf(fname,"LS%d",realsector);
578     fGeom->GetNode(fname)->SetLineColor(fLineColor);
579     fGeom->GetNode(fname)->Draw("same");
580     sprintf(fname,"US%d",realsector);
581     fGeom->GetNode(fname)->SetLineColor(fLineColor); 
582     fGeom->GetNode(fname)->Draw("same");
583   }   
584 }
585 // #############################################################################
586 void AliHLTTPCDisplay::DrawHistPadRow(){  
587     Char_t title[256];
588     sprintf(title,"Selected PadRow %d with found Clusters",fPadRow);
589
590     fHistraw->SetTitle(title);
591     fHistraw->SetStats(kFALSE);
592     fHistraw->Draw("COLZ");
593
594     fHistrawcl->SetStats(kFALSE);
595     fHistrawcl->SetMarkerStyle(28);
596     fHistrawcl->SetMarkerSize(2);
597     fHistrawcl->SetMarkerColor(1);
598     fHistrawcl->Draw("psame");
599 }
600
601 // #############################################################################
602 void AliHLTTPCDisplay::DrawHistPad1(){  
603     Char_t title[256];
604     sprintf(title,"Selected Pad %d",fPad -1);
605     fHistpad1->SetStats(kFALSE);
606     fHistpad1->SetTitle(title);
607     fHistpad1->Draw();
608 }
609
610 // #############################################################################
611 void AliHLTTPCDisplay::DrawHistPad2(){  
612     Char_t title[256];
613     sprintf(title,"Selected Pad %d",fPad);
614
615     fHistpad2->SetStats(kFALSE);
616     fHistpad2->SetTitle(title);
617     fHistpad2->Draw();
618 }
619
620 // #############################################################################
621 void AliHLTTPCDisplay::DrawHistPad3(){  
622     Char_t title[256];
623     sprintf(title,"Selected Pad %d",fPad +1);
624
625     fHistpad3->SetStats(kFALSE);
626     fHistpad3->SetTitle(title);
627     fHistpad3->Draw();
628 }
629
630 // #############################################################################
631 void AliHLTTPCDisplay::DrawHistResiduals(Bool_t ySwitch){  
632     if (fSwitch3DTracks){
633         if (ySwitch){
634             // Y Residual histogram for 1 track
635
636             if (fSelectTrackSwitch){
637                 Char_t title[256];
638                 sprintf(title,"Y Residuals of Track %d in Slice %d",fSelectTrack, fSelectTrackSlice );
639
640                 TMultiGraph *mgY = new TMultiGraph();
641
642
643 //              fGraphresidualsY->SetTitle(title);      
644                 fGraphresidualsY->GetXaxis()->SetTitle("padrow");       
645                 fGraphresidualsY->GetYaxis()->SetTitle("residuals");
646 //              fGraphresidualsY->Draw("A*");
647                 fGraphresidualsY->GetXaxis()->SetLabelSize(0.02);
648                 fGraphresidualsY->GetXaxis()->SetTitleSize(0.02);
649                 fGraphresidualsY->GetYaxis()->SetLabelSize(0.02);
650                 fGraphresidualsY->GetYaxis()->SetTitleSize(0.02);
651                 fGraphresidualsYLength->SetMarkerColor(2);
652                 fGraphresidualsYLength->SetMarkerStyle(5);
653                 fGraphresidualsY->SetMarkerColor(1);
654                 fGraphresidualsY->SetMarkerStyle(3);
655
656 //              fGraphresidualsY->Draw("A*");
657 //              fGraphresidualsYLength->Draw("*");
658
659                 mgY->Add(fGraphresidualsY);
660                 mgY->Add(fGraphresidualsYLength);
661                 mgY->SetTitle(title);
662 //              mgY->GetXaxis()->SetTitle("padrow");    
663 //              mgY->GetYaxis()->SetTitle("residuals");
664                 mgY->Draw("AP");
665             }
666             // Global residuals histogram
667             else{
668                 fHistallresidualsY->SetStats(kFALSE);
669                 fHistallresidualsY->Draw();
670             }
671         }
672         else {
673             // Z Residual histogram for 1 track
674             if (fSelectTrackSwitch){
675                 Char_t title[256];
676                 sprintf(title,"Z Residuals of Track %d in Slice %d",fSelectTrack, fSelectTrackSlice );
677
678                 TMultiGraph *mgZ = new TMultiGraph();
679
680                 fGraphresidualsZ->SetTitle(title);      
681                 fGraphresidualsZ->GetXaxis()->SetTitle("padrow");       
682                 fGraphresidualsZ->GetYaxis()->SetTitle("residuals");
683                 fGraphresidualsZ->GetXaxis()->SetLabelSize(0.02);
684                 fGraphresidualsZ->GetXaxis()->SetTitleSize(0.02);
685                 fGraphresidualsZ->GetYaxis()->SetLabelSize(0.02);
686                 fGraphresidualsZ->GetYaxis()->SetTitleSize(0.02);
687 //              fGraphresidualsZLength->Draw("F*");
688 //              fGraphresidualsZ->Draw("A*");
689         
690                 mgZ->Add(fGraphresidualsZ);
691 //              mgZ->Add(fGraphresidualsZLength);
692                 mgZ->SetTitle(title);
693                 mgZ->Draw("A*");
694             }
695             // Global residuals histogram
696             else{
697                 fHistallresidualsZ->SetStats(kFALSE);
698                 fHistallresidualsZ->Draw();
699             }
700         }
701     }
702 }
703
704 // #############################################################################
705 void AliHLTTPCDisplay::DrawHistCharge(){  
706     if (fSwitch3DCluster){
707 //      fHistcharge->SetStats(kFALSE);
708         fHistcharge->Draw();
709     }
710 }
711
712 // #############################################################################
713 void AliHLTTPCDisplay::Draw3D(){        
714     
715     TView *v = new TView(1);
716     v->SetRange(-800,-800,-800,800,800,800);
717
718     Float_t* etaRange = NULL;   // ------  STILL TO FIX
719     
720
721     //--------------------------------------------------------------------------------------------
722     // DRAW 3D CLUSTER
723     //--------------------------------------------------------------------------------------------
724     if (fSwitch3DCluster){
725         Int_t maxCharge = 0;
726
727         for (Int_t slice=0; slice <= 35; slice++){
728
729             Int_t currenttrack = -1;
730
731             if (fSelectCluster == 1 && fSelectTrackSwitch && slice == fSelectTrackSlice ){
732
733                 Int_t trackcounter = 0;
734                 Int_t ntracks = fTracks->GetNTracks();
735         
736                 for(Int_t j=0; j<ntracks; j++) {        
737
738                     AliHLTTPCTrack *gtrack = fTracks->GetCheckedTrack(j); 
739                     if(!gtrack) continue;
740
741                     Int_t nHits = gtrack->GetNHits();  // Number of associated hits to track
742                     Int_t tmpslice = gtrack->GetSector();
743
744                     // --- CHECK if track is should be drawn
745                     // select Single Track
746                     if(tmpslice != fSelectTrackSlice) continue;
747                         
748                     if (trackcounter != fSelectTrack){
749                         trackcounter++;  
750                         continue;
751                     }
752                     trackcounter++;
753
754                     if((fPtThreshold > 0) && (gtrack->GetPt()< fPtThreshold)) continue;
755                     if(nHits < fMinHits) continue;
756
757                     currenttrack = j;
758                     break;
759                 }
760             }
761             
762             if (!fSliceArray[slice]) continue;
763             
764             for(Int_t p=0;p<6;p++){
765
766                 AliHLTTPCSpacePointData *points = fClusters[slice][p];
767                 if(!points) continue;
768                 Int_t npoints = fNcl[slice][p];
769                 TPolyMarker3D *pmUsed = new TPolyMarker3D(1,6);
770                 TPolyMarker3D *pmUnused = new TPolyMarker3D(1,6);
771                 Int_t nUsedCluster = 0;
772                 Int_t nUnusedCluster = 0;
773
774                 Float_t xyz[3];
775                 for(Int_t i=0; i<npoints; i++){
776                     // Used  cluster only
777                     if (fSelectCluster == 1  && points[i].fUsed == kFALSE) continue; 
778                     // Unused cluster only
779                     if (fSelectCluster == 2  && points[i].fUsed == kTRUE) continue; 
780
781                     // if single track is selcted draw only cluster for this track
782                     if (fSelectCluster == 1 && fSelectTrackSwitch && points[i].fTrackN != currenttrack) continue;
783                     
784                     xyz[0] = points[i].fX;
785                     xyz[1] = points[i].fY;
786                     xyz[2] = points[i].fZ;
787                     
788                     if ( etaRange ){              
789                         // Do this before the transform, because the tracker also uses
790                         // local coordinates when using this limit to determine 
791                         // which clusters to use for tracking
792                         Double_t pointEta = AliHLTTPCTransform::GetEta( xyz );
793                         if ( pointEta<etaRange[0] || pointEta>etaRange[1] )
794                             continue;
795                     }
796
797                     AliHLTTPCTransform::Local2Global(xyz,slice);
798                  
799                     if (points[i].fUsed == kTRUE){
800                         pmUsed->SetPoint(nUsedCluster,xyz[0],xyz[1],xyz[2]);
801                         nUsedCluster++;
802                     }
803                     else {
804                         pmUnused->SetPoint(nUnusedCluster,xyz[0],xyz[1],xyz[2]);
805                         nUnusedCluster++;
806                     }
807
808                     // Fill Charge Histogram
809                     fHistcharge->Fill(points[i].fCharge);
810                     if ((Int_t)points[i].fCharge > maxCharge ) maxCharge = (Int_t) points[i].fCharge; 
811                 }
812                 pmUsed->SetMarkerSize(1);
813                 pmUsed->SetMarkerColor(3); 
814                 pmUsed->Draw("");
815
816                 pmUnused->SetMarkerSize(1);
817                 pmUnused->SetMarkerColor(2); 
818                 pmUnused->Draw("");
819             } // END - PATCH LOOP           
820         }  // END - SLICE LOOP
821         fHistcharge->SetAxisRange(0,maxCharge);
822     }   // END - DRAW 3D CLUSTER 
823
824     //--------------------------------------------------------------------------------------------
825     // DRAW 3D TRACKS
826     //--------------------------------------------------------------------------------------------
827     if (fSwitch3DTracks){
828
829         Int_t trackcounter = 0;
830         Int_t ntracks = fTracks->GetNTracks();
831         Double_t drawStep = 0.2;
832
833         Double_t maxResidualY = 0.;
834         Double_t maxResidualZ = 0.;
835
836         TPolyLine3D *line = new TPolyLine3D[ntracks];
837 #if TRACKHELIX
838         THelix *helix = new THelix[ntracks];
839 #endif
840         for(Int_t j=0; j<ntracks; j++) {        
841
842             AliHLTTPCTrack *gtrack = fTracks->GetCheckedTrack(j); 
843             if(!gtrack) continue;
844
845             Int_t nHits = gtrack->GetNHits();  // Number of associated hits to track
846             Int_t slice = gtrack->GetSector();
847
848             // --- CHECK if track is should be drawn
849             // select if slice should be displayed or not
850             if (!fSliceArray[slice]) continue;  
851             
852             // select Single Track
853             if (fSelectTrackSwitch){
854                 if(slice != fSelectTrackSlice) continue;
855         
856                 if (trackcounter != fSelectTrack){
857                     trackcounter++;  
858                     continue;
859                 }
860                 trackcounter++;
861             }
862     
863             if((fPtThreshold > 0) && (gtrack->GetPt()< fPtThreshold)) continue;
864             if(nHits < fMinHits) continue;
865             
866             TPolyMarker3D *pmL = new TPolyMarker3D(1,2);
867             TPolyMarker3D *pmF = new TPolyMarker3D(1,2);
868
869             Double_t radius = gtrack->GetRadius();      // radius
870             Double_t kappa = gtrack->GetKappa();        // curvature = 1/R , signed
871             Double_t lambda = atan( gtrack->GetTgl() ); // dipAngle lambda
872             Double_t phi0 = gtrack->GetPsi() + (gtrack->GetCharge() * AliHLTTPCTransform::PiHalf() ); // azimuthal angle of startingpoint, with respect to helix axis
873
874             Double_t xyzL[3];      // lastpoint of track
875             Double_t xyzF[3];      // firstpoint of track
876
877             xyzF[0] = gtrack->GetFirstPointX();
878             xyzF[1] = gtrack->GetFirstPointY();
879             xyzF[2] = gtrack->GetFirstPointZ();
880             pmF->SetPoint(0,xyzF[0],xyzF[1],xyzF[2]);
881
882             xyzL[0] = gtrack->GetLastPointX();
883             xyzL[1] = gtrack->GetLastPointY();
884             xyzL[2] = gtrack->GetLastPointZ();
885             pmL->SetPoint(0,xyzL[0],xyzL[1],xyzL[2]);
886
887             Double_t s = 0.;       // length of the track
888
889             // Calculate the length of the track. If it is to flat in in s,z plane use sxy, otherwise use sz
890             if (fabs(lambda) > 0.05){
891                 // length of track calculated out of z
892                 s = fabs( (xyzL[2] - xyzF[2]) / sin(lambda) ); // length of track calculated out of z
893             }
894             else {
895                 Double_t d =  (xyzL[0] - xyzF[0])*(xyzL[0] - xyzF[0]) + (xyzL[1] - xyzF[1])*(xyzL[1] - xyzF[1]);
896                 // length of track calculated out of xy
897                 s = fabs ( acos( 0.5 * (2 - (d / (radius*radius)))) / ( kappa * cos(lambda) ) );                
898             }
899             
900             Int_t nTrackPoints = 2 + (Int_t) floor(s / drawStep);
901
902 #if TRACKPOLYMARKER
903             TPolyMarker3D *pmT = new TPolyMarker3D(nTrackPoints,6);
904 #endif
905
906             Double_t *xT = new Double_t[nTrackPoints];
907             Double_t *yT = new Double_t[nTrackPoints];
908             Double_t *zT = new Double_t[nTrackPoints];
909
910             //Write Track Parameters for single track
911             if (fSelectTrackSwitch){
912                 fTrackParam.id = trackcounter - 1;
913                 fTrackParam.nHits = nHits;
914                 fTrackParam.charge = gtrack->GetCharge();
915                 fTrackParam.lambda = lambda;
916                 fTrackParam.kappa = kappa;
917                 fTrackParam.radius = radius;
918                 fTrackParam.slice = slice;
919                 fTrackParam.phi0 = phi0;
920                 fTrackParam.pt = gtrack->GetPt();
921                 fTrackParam.bfield = AliHLTTPCTransform::GetBFieldValue();
922                 fTrackParam.xyzF[0] = gtrack->GetFirstPointX();
923                 fTrackParam.xyzF[1] = gtrack->GetFirstPointY();
924                 fTrackParam.xyzF[2] = gtrack->GetFirstPointZ();
925                 fTrackParam.xyzL[0] = gtrack->GetLastPointX();
926                 fTrackParam.xyzL[1] = gtrack->GetLastPointY();
927                 fTrackParam.xyzL[2] = gtrack->GetLastPointZ();
928                 fTrackParam.psi = gtrack->GetPsi();
929                 fTrackParam.s = s;
930             }
931
932             Int_t trackPointCounter = 0;
933
934             for (Double_t ds = 0.; ds < s; ds = ds + drawStep){
935                 // FILL ARRAYS IN ORDER TO DRAW THE TRACKPOINTS, OUT OF THE PARAMETER
936                 xT[trackPointCounter] = xyzF[0] + radius * ( cos( phi0 + (ds*kappa*cos(lambda)) ) - cos(phi0) );
937                 yT[trackPointCounter] = xyzF[1] + radius * ( sin( phi0 + (ds*kappa*cos(lambda)) ) - sin(phi0) );
938                 zT[trackPointCounter] = xyzF[2] + ds * sin(lambda);
939 #if TRACKPOLYMARKER
940                 pmT->SetPoint(trackPointCounter,xT[trackPointCounter],yT[trackPointCounter],zT[trackPointCounter]);
941 #endif
942                 trackPointCounter++;
943             }
944
945             xT[trackPointCounter] = xyzF[0] + radius * ( cos( phi0 + (s*kappa*cos(lambda)) ) - cos(phi0) );
946             yT[trackPointCounter] = xyzF[1] + radius * ( sin( phi0 + (s*kappa*cos(lambda)) ) - sin(phi0) );
947             zT[trackPointCounter] = xyzF[2] + s * sin(lambda);
948 #if TRACKPOLYMARKER       
949             pmT->SetPoint(trackPointCounter,xT[trackPointCounter],yT[trackPointCounter],zT[trackPointCounter]);
950 #endif
951             // --- RESIDUALS ---
952             gtrack->Rotate(slice,kTRUE);
953             Int_t nRes = 0;  // number of resiudals
954             
955             UInt_t *hitnum = gtrack->GetHitNumbers();
956
957             Double_t *resY= new Double_t[nHits];
958             Double_t *resZ= new Double_t[nHits];
959
960             Double_t *resYLength= new Double_t[2*nHits];
961             Double_t *resZLength= new Double_t[2*nHits];
962
963             Double_t *padrows = new Double_t[nHits];
964             Double_t *padrowsLength = new Double_t[2*nHits];
965
966             for(Int_t h=0; h<nHits; h++){
967                 UInt_t id=hitnum[h];
968                 Int_t patch = (id>>22) & 0x7;
969                 UInt_t pos = id&0x3fffff; 
970
971                 AliHLTTPCSpacePointData *points = fClusters[slice][patch];
972
973                 Float_t xyzCtmp[3];    // cluster tmp
974                 Float_t xyzTtmp[3];    // track tmp
975
976                 xyzCtmp[0] = points[pos].fX;
977                 xyzCtmp[1] = points[pos].fY;
978                 xyzCtmp[2] = points[pos].fZ;
979
980                 Int_t padrow = AliHLTTPCTransform::GetPadRow(points[pos].fX);
981                 xyzTtmp[0] = gtrack->GetFirstPointX();
982                 if(gtrack->GetCrossingPoint(padrow,xyzTtmp)) {
983
984                     Float_t deltaY = ( xyzCtmp[1] - xyzTtmp[1] );
985                     Float_t deltaZ = ( xyzCtmp[2] - xyzTtmp[2] );
986 //                  Float_t residual = sqrt( deltaY*deltaY + deltaZ*deltaZ );
987                     
988                     padrows[nRes] = (Double_t) padrow;
989                     resY[nRes] = (Double_t) deltaY;
990                     resZ[nRes] = (Double_t) deltaZ;
991
992                     resYLength[(2*nRes)] = 0.5 * AliHLTTPCTransform::GetPadLength(padrow);
993                     resYLength[(2*nRes)+1] = -0.5 * AliHLTTPCTransform::GetPadLength(padrow);
994                     resZLength[nRes] = AliHLTTPCTransform::GetZLength();
995                     padrowsLength[(2*nRes)] = (Double_t) padrow;
996                     padrowsLength[(2*nRes)+1] = (Double_t) padrow;
997
998                     // FILL RESIDUALS HISTOGRAM
999                     fHistallresidualsY->Fill(resY[nRes]);
1000                     fHistallresidualsZ->Fill(resZ[nRes]);
1001                     if (resY[nRes] > maxResidualY ) maxResidualY = resY[nRes];
1002                     if (resZ[nRes] > maxResidualZ ) maxResidualZ = resZ[nRes];
1003                     nRes++;
1004                 }
1005             }
1006
1007             gtrack->Rotate(slice,kFALSE);
1008             // --- RESIDUALS ---
1009
1010             // Draw last point of Track
1011             pmL->SetMarkerSize(3);
1012             pmL->SetMarkerColor(4); 
1013 //          pmL->Draw();
1014
1015             // Draw first point of Track
1016             pmF->SetMarkerSize(3);
1017             pmF->SetMarkerColor(5); 
1018 //          pmF->Draw();
1019
1020 #if TRACKPOLYMARKER
1021             // Draw Track -- as polymarker
1022             pmT->SetMarkerSize(3);
1023             pmT->SetMarkerColor(3); 
1024             pmT->Draw();
1025 #endif
1026             // Draw Track -- as line
1027             TPolyLine3D *currentline = &(line[j]);
1028             currentline = new TPolyLine3D(nTrackPoints,xT,yT,zT,"");
1029             currentline->SetLineColor(4);   
1030             currentline->SetLineWidth(2);
1031             currentline->Draw("same");
1032
1033 #if TRACKHELIX
1034             // Draw Track -- as helix
1035             // works ok, execpt for very small dipangles -> track almost horizontal
1036             Double_t hrange[2];
1037             Double_t v0[3];
1038             Double_t omega;
1039             hrange[0] = xyzF[2];
1040             hrange[1] = xyzL[2];
1041             v0[0] = gtrack->GetPx();
1042             v0[1] = gtrack->GetPy();
1043             v0[2] = gtrack->GetPz();
1044             omega = AliHLTTPCTransform::GetBFieldValue() * gtrack->GetCharge();
1045
1046             THelix *currenthelix = &(helix[j]);
1047             currenthelix = new THelix(xyzF,v0,omega,hrange,kHelixZ,0);
1048             currenthelix->SetLineColor(6);   
1049             currenthelix->SetLineWidth(1);
1050             currenthelix->Draw("same");             
1051 #endif
1052
1053             //Residuals
1054             if ( fGraphresidualsY){
1055                 delete fGraphresidualsY;
1056                 fGraphresidualsY = NULL;
1057             }
1058
1059             if ( fGraphresidualsZ){
1060                 delete fGraphresidualsZ;
1061                 fGraphresidualsZ = NULL;
1062             }
1063             //Residuals
1064             if ( fGraphresidualsYLength){
1065                 delete fGraphresidualsYLength;
1066                 fGraphresidualsYLength = NULL;
1067             }
1068
1069             if ( fGraphresidualsZLength){
1070                 delete fGraphresidualsZLength;
1071                 fGraphresidualsZLength = NULL;
1072             }
1073
1074
1075
1076             // FILL Y RESIDUALS GRAPH
1077             fGraphresidualsY = new TGraph(nRes-1,padrows,resY);
1078             fGraphresidualsYLength = new TGraph((2*nRes)-2,padrowsLength,resYLength);
1079             // FILL Z RESIDUALS GRAPH
1080             fGraphresidualsZ = new TGraph(nRes-1,padrows,resZ);
1081             fGraphresidualsZLength = new TGraph(nRes-1,padrows,resZLength);
1082
1083             if (xT) delete xT;
1084             if (yT) delete yT;
1085             if (zT) delete zT;
1086
1087         } // END for tracks
1088
1089         fHistallresidualsY->SetAxisRange(-maxResidualY,maxResidualY);
1090         fHistallresidualsZ->SetAxisRange(-maxResidualZ,maxResidualZ);
1091
1092     }   // END - DRAW 3D Tracks
1093
1094     //--------------------------------------------------------------------------------------------
1095     // DRAW 3D GEOMETRY
1096     //--------------------------------------------------------------------------------------------
1097     if (fSwitch3DGeometry){
1098
1099         for (Int_t slice=0; slice <= 17; slice++){
1100             if (!fSliceArray[slice]) continue;
1101             DrawGeomSector(slice);
1102         }
1103     }   // END - DRAW 3D GEOMETRY
1104     
1105     //--------------------------------------------------------------------------------------------
1106     // DRAW 3D PadRow
1107     //--------------------------------------------------------------------------------------------
1108     if (fSwitch3DPadRow && fSliceArray[fSlicePadRow]){
1109         Int_t markercolor = 51;
1110
1111         for (UInt_t ii=0;ii < 20;ii++){
1112             if (fcolorbin[ii]> 0){
1113                 
1114                 TPolyMarker3D *pm = new TPolyMarker3D(fcolorbin[ii], fpmarr[ii], 7 );
1115
1116                 pm->SetMarkerColor(markercolor); 
1117                 pm->Draw(""); 
1118             }
1119
1120             // in order to have the SetPalette(1), so called "pretty"
1121             if (ii % 2 == 0 ) markercolor += 2;
1122             else  markercolor += 3;
1123         }
1124     }
1125
1126     //--------------------------------------------------------------------------------------------
1127     // DRAW 3D 
1128     //--------------------------------------------------------------------------------------------
1129     v->ZoomView(0,4);
1130     v->Draw();   
1131 }
1132
1133 // ---------------------------------------------------
1134 // In order to be backward compatible
1135 // ---------------------------------------------------
1136 #if BACKWARD
1137 void AliHLTTPCDisplay::DisplayClusters(Bool_t x3don,Float_t* etaRange) {
1138     if (!fc1){
1139         fc1 = new TCanvas("c1","",900,900);
1140         fc1->cd();
1141     }
1142
1143     fSwitch3DTracks = kFALSE; 
1144     fSwitch3DCluster = kTRUE; 
1145     fSwitch3DPadRow = kFALSE; 
1146     fSwitch3DGeometry = kFALSE;
1147
1148     Draw3D();
1149 }
1150 // ---------------------------------------------------
1151 void AliHLTTPCDisplay::DisplayTracks(Int_t minhits,Bool_t x3don,Float_t thr) {
1152     if (!fc1){
1153         fc1 = new TCanvas("c1","",900,900);
1154         fc1->cd();
1155     }
1156
1157     fMinHits = minhits; 
1158     fPtThreshold = thr;
1159     fSwitch3DTracks = kTRUE; 
1160     fSwitch3DCluster = kFALSE; 
1161     fSwitch3DPadRow = kFALSE; 
1162     fSwitch3DGeometry = kFALSE;
1163
1164     Draw3D();
1165 }
1166 // ---------------------------------------------------
1167 void AliHLTTPCDisplay::DisplayAll(Int_t minhits,Bool_t clusterswitch,Bool_t trackswitch,Bool_t x3don, Float_t thr, Float_t* etaRange){
1168     if (!fc1){
1169         fc1 = new TCanvas("c1","",900,900);
1170         fc1->cd();
1171     }
1172
1173     fMinHits = minhits; 
1174     fPtThreshold = thr;
1175     fSwitch3DTracks = trackswitch; 
1176     fSwitch3DCluster = clusterswitch; 
1177     fSwitch3DPadRow = kFALSE; 
1178     fSwitch3DGeometry = kFALSE;
1179
1180     Draw3D();
1181 }
1182 #endif
1183 // ---------------------------------------------------