AliHLTTPCDisplay.cxx moved from TPCLib to TPCLib/OnlineDisplay
[u/mrichter/AliRoot.git] / HLT / TPCLib / AliHLTTPCDisplay.cxx
CommitLineData
a6c02c85 1// @(#) $Id$
c2f37813 2// Original: AliL3Display.cxx,v 1.26 2005/06/14 10:55:21 cvetan
a6c02c85 3
4/** \class AliHLTTPCDisplay
5<pre>
6//_____________________________________________________________
7// AliHLTTPCDisplay
8//
44be0fde 9// Display class for the HLT TPC events.
a6c02c85 10</pre>
11*/
44be0fde 12// Author: Jochen Thaeder <mailto:thaeder@kip.uni-heidelberg.de>
13// Anders Vestbo <mailto:vestbo@fi.uib.no>
a6c02c85 14//*-- Copyright &copy ALICE HLT Group
15
738c049f 16#define TRACKHELIX 0
17#define TRACKPOLYMARKER 0
18#define BACKWARD 0
db16520a 19#define FIRSTLASTPOINT 0
20
21#define TRACKCOLOR
22#define USEDCLUSTERCOLOR
23#define UNUSEDCLUSTERCOLOR
c846a312 24
a6c02c85 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>
c846a312 35#include <THelix.h>
36#include <TStyle.h>
23c36ba2 37#include <TGraph.h>
738c049f 38#include <TMultiGraph.h>
23c36ba2 39#include <TAttText.h>
40#include <TAxis.h>
41
738c049f 42#if TRACKHELIX
43#include <THelix.h>
44#endif
c846a312 45
a6c02c85 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"
c846a312 60#include "AliHLTTPCDigitReaderPacked.h"
a6c02c85 61
62#if __GNUC__ == 3
63using namespace std;
64#endif
65
a6c02c85 66ClassImp(AliHLTTPCDisplay)
67
44be0fde 68// #############################################################################
738c049f 69void AliHLTTPCDisplay::InitDisplay(Char_t *gfile) {
44be0fde 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;
738c049f 80 fHistallresidualsY = NULL;
81 fHistallresidualsZ = NULL;
23c36ba2 82 fHistcharge = NULL;
738c049f 83 fGraphresidualsY = NULL;
84 fGraphresidualsZ = NULL;
85 fGraphresidualsYLength = NULL;
86 fGraphresidualsZLength = NULL;
44be0fde 87
44be0fde 88
738c049f 89 fGeom = NULL;
90// ---------------------------------------------------
91// In order to be backward compatible
92// ---------------------------------------------------
93#if BACKWARD
94 //fc1 = NULL;
95#endif
96// ---------------------------------------------------
44be0fde 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;
738c049f 117 fKeepView = kFALSE;
44be0fde 118
119 fSwitch3DCluster = kFALSE;
120 fSwitch3DTracks = kFALSE;
121 fSwitch3DPadRow = kFALSE;
122 fSwitch3DGeometry = kFALSE;
123
738c049f 124 AliHLTTPCTransform::SetBField(0.4);
44be0fde 125 LoadGeometrie(gfile);
a6c02c85 126}
127
a6c02c85 128
44be0fde 129// #############################################################################
130AliHLTTPCDisplay::~AliHLTTPCDisplay() {
131 //destructor
132 if(fTracks) delete fTracks;
133 fTracks = NULL;
a6c02c85 134}
135
44be0fde 136// #############################################################################
137Bool_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");
a6c02c85 146
44be0fde 147 file->Close();
148 delete file;
149 }
150 return kTRUE;
c846a312 151}
152
44be0fde 153// #############################################################################
db16520a 154// EXECUTER
155// #############################################################################
156void 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// #############################################################################
44be0fde 177// SETTER
178// #############################################################################
179void AliHLTTPCDisplay::SetHistPadRowAxis() {
180 // Set Axis range of Histogramm, due to variable NPads per padrow
c846a312 181
44be0fde 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");
c846a312 187}
188
44be0fde 189void AliHLTTPCDisplay::SetSliceArray() {
190 Int_t slice=0;
191 Int_t minSlice = fMinSlice;
192 Int_t maxSlice = fMaxSlice;
193 Int_t realslice = 0;
c846a312 194
44be0fde 195 for (slice=0;slice<=35;slice++){
196 fSliceArray[slice] = kFALSE;
a6c02c85 197 }
a6c02c85 198
44be0fde 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;
a6c02c85 206 }
a6c02c85 207
44be0fde 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;
a6c02c85 219 }
220 }
a6c02c85 221}
222
44be0fde 223// #############################################################################
224// SETUP
225// #############################################################################
226void AliHLTTPCDisplay::SetupCluster(Int_t slice, Int_t patch, UInt_t nofClusters, AliHLTTPCSpacePointData* data) {
a6c02c85 227
44be0fde 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}
c846a312 244
44be0fde 245// #############################################################################
246void AliHLTTPCDisplay::SetupTracks(AliHLTTPCTrackArray *tracks) {
247 fTracks=tracks;
c846a312 248
44be0fde 249 // Set USED cluster
c846a312 250 Int_t ntracks = fTracks->GetNTracks();
251
44be0fde 252 for(Int_t j=0; j<ntracks; j++) {
c846a312 253 AliHLTTPCTrack *gtrack = fTracks->GetCheckedTrack(j);
254 if(!gtrack) continue;
c846a312 255
256 Int_t nHits = gtrack->GetNHits();
257 UInt_t *hitnum = gtrack->GetHitNumbers();
c846a312 258
44be0fde 259 for(Int_t h=0; h<nHits; h++){
260
c846a312 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;
44be0fde 265
c846a312 266 AliHLTTPCSpacePointData *points = fClusters[slice][patch];
44be0fde 267
c846a312 268 if(!points) {
44be0fde 269 LOG(AliHLTTPCLog::kError,"AliHLTTPCDisplay::Draw3D","Clusterarray") <<"No points at slice "<<slice<<" patch "<<patch<<" pos "<<pos<<ENDLOG;
270 continue;
c846a312 271 }
272
273 if(pos>=fNcl[slice][patch]) {
44be0fde 274 LOG(AliHLTTPCLog::kError,"AliHLTTPCDisplay::Draw3D","Clusterarray") <<"Pos is too large: pos "<<pos <<" ncl "<<fNcl[slice][patch]<<ENDLOG;
275 continue;
c846a312 276 }
44be0fde 277 points[pos].fUsed = kTRUE;
738c049f 278 points[pos].fTrackN = j;
44be0fde 279 }
280 }
a6c02c85 281}
282
44be0fde 283// #############################################################################
23c36ba2 284void AliHLTTPCDisplay::SetupHist(){
a6c02c85 285
44be0fde 286 Int_t maxpads = 150;
287 fNTimes = AliHLTTPCTransform::GetNTimeBins();
c846a312 288
44be0fde 289 if ( fHistraw ){
290 delete fHistraw;
291 fHistraw = NULL;
c846a312 292 }
44be0fde 293 if ( fHistrawcl ){
294 delete fHistrawcl;
295 fHistrawcl = NULL;
c846a312 296 }
297
44be0fde 298 if ( fHistpad1 ){
299 delete fHistpad1;
300 fHistpad1 = NULL;
a6c02c85 301 }
a6c02c85 302
44be0fde 303 if ( fHistpad2 ){
304 delete fHistpad2;
305 fHistpad2 = NULL;
a6c02c85 306 }
c846a312 307
44be0fde 308 if ( fHistpad3 ){
309 delete fHistpad3;
310 fHistpad3 = NULL;
a6c02c85 311 }
c846a312 312
738c049f 313 if ( fHistallresidualsY){
314 delete fHistallresidualsY;
315 fHistallresidualsY = NULL;
23c36ba2 316 }
317
738c049f 318 if ( fHistallresidualsZ){
319 delete fHistallresidualsZ;
320 fHistallresidualsZ = NULL;
321 }
23c36ba2 322 if ( fHistcharge){
323 delete fHistcharge;
324 fHistcharge = NULL;
325 }
326
44be0fde 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);
db16520a 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);
738c049f 336 fHistcharge = new TH1F ("fHistcharge","Cluster distribution per charge;charge;#cluster",5000,0,30000);
c846a312 337
44be0fde 338 fHistraw->SetOption("COLZ");
c846a312 339
738c049f 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);
23c36ba2 345
738c049f 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);
23c36ba2 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);
44be0fde 381
23c36ba2 382 gStyle->SetPalette(1);
383
44be0fde 384 SetHistPadRowAxis();
a6c02c85 385}
386
44be0fde 387// ####################################################################################################
388void AliHLTTPCDisplay::FillPadRow(Int_t patch, ULong_t dataBlock, ULong_t dataLen){
74c73e5a 389#if defined(HAVE_ALIRAWDATA) && defined(HAVE_ALITPCRAWSTREAM_H)
84645eb0 390 AliHLTTPCDigitReader* digitReader = new AliHLTTPCDigitReaderPacked();
c846a312 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
44be0fde 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
c846a312 401 // Initialize block for reading packed data
402 void* tmpdataBlock = (void*) dataBlock;
84645eb0 403 digitReader->InitBlock(tmpdataBlock,dataLen,firstRow,lastRow,patch,0);
c846a312 404
84645eb0 405 readValue = digitReader->Next();
c846a312 406
407 if (!readValue){
408 LOG(AliHLTTPCLog::kError,"AliHLTTPCDisplay::FillPadRow","Read first value") << "No value in data block" << ENDLOG;
409 return;
410 }
44be0fde 411
412 // FILL PADROW 3D --- Initialize the colorbins
413 if (fSwitch3DPadRow){
c846a312 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
84645eb0 422 Int_t row = digitReader->GetRow() + rowOffset;
c846a312 423
424 if (row == fPadRow){
84645eb0 425 UInt_t charge = digitReader->GetSignal();
c846a312 426
427 for (UInt_t ii=0;ii < 19;ii++){
738c049f 428 if ( charge > (ii*15) && charge <= ((ii*15) + 15) ) fcolorbin[ii]++;
c846a312 429 }
738c049f 430 // larger than 19 * 15
431 if (charge > 285 ) fcolorbin[19]++;
c846a312 432 }
433
434 // read next value
84645eb0 435 readValue = digitReader->Next();
a6c02c85 436
c846a312 437 if(!readValue) break; //No more value
438 }
c846a312 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
84645eb0 462 digitReader->InitBlock(tmpdataBlock,dataLen,firstRow,lastRow,patch,0);
c846a312 463
84645eb0 464 readValue = digitReader->Next();
44be0fde 465 } // END if (fSwitch3DPadRow)
c846a312 466
44be0fde 467 // -- Fill Raw Data
c846a312 468 while ( readValue ){
469
84645eb0 470 Int_t row = digitReader->GetRow() + rowOffset;
c846a312 471
472 // select padrow to fill in histogramm
473 if (row == fPadRow){
84645eb0 474 UChar_t pad = digitReader->GetPad();
475 UShort_t time = digitReader->GetTime();
476 UInt_t charge = digitReader->GetSignal();
c846a312 477 Float_t xyz[3];
44be0fde 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);
c846a312 487
488 for (UInt_t ii=0;ii < 19;ii++){
738c049f 489 if ( charge > (ii*15) && charge <= ((ii*15) + 15) ){
c846a312 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 }
738c049f 496 // larger than 19 * 15
497 if (charge > 285 ) {
c846a312 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 }
44be0fde 503 } // END if (fSwitch3DPadRow)
504
a6c02c85 505 }
44be0fde 506
c846a312 507 // read next value
84645eb0 508 readValue = digitReader->Next();
a6c02c85 509
c846a312 510 //Check where to stop:
511 if(!readValue) break; //No more value
512 }
513
84645eb0 514 if ( digitReader )
515 delete digitReader;
516 digitReader = NULL;
c846a312 517
44be0fde 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 }
74c73e5a 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)
44be0fde 538}
539
44be0fde 540// #############################################################################
541void AliHLTTPCDisplay::ResetHistPadRow(){
542 fHistraw->Reset();
543 fHistrawcl->Reset();
544 fHistpad1->Reset();
545 fHistpad2->Reset();
546 fHistpad3->Reset();
547}
548
23c36ba2 549// #############################################################################
550void AliHLTTPCDisplay::ResetHistResiduals(){
738c049f 551 fHistallresidualsY->Reset();
552 fHistallresidualsZ->Reset();
23c36ba2 553}
554
555// #############################################################################
556void AliHLTTPCDisplay::ResetHistCharge(){
557 fHistcharge->Reset();
558}
559
44be0fde 560
561// #############################################################################
562// DRAWER
563// #############################################################################
564void 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// #############################################################################
586void 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// #############################################################################
602void 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// #############################################################################
611void 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// #############################################################################
621void 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// #############################################################################
738c049f 631void AliHLTTPCDisplay::DrawHistResiduals(Bool_t ySwitch){
23c36ba2 632 if (fSwitch3DTracks){
738c049f 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 }
23c36ba2 671 }
738c049f 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 }
23c36ba2 700 }
701 }
702}
703
704// #############################################################################
705void AliHLTTPCDisplay::DrawHistCharge(){
706 if (fSwitch3DCluster){
707// fHistcharge->SetStats(kFALSE);
708 fHistcharge->Draw();
709 }
710}
711
712// #############################################################################
44be0fde 713void 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
23c36ba2 719
44be0fde 720
721 //--------------------------------------------------------------------------------------------
722 // DRAW 3D CLUSTER
723 //--------------------------------------------------------------------------------------------
724 if (fSwitch3DCluster){
738c049f 725 Int_t maxCharge = 0;
726
44be0fde 727 for (Int_t slice=0; slice <= 35; slice++){
23c36ba2 728
738c049f 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++;
23c36ba2 753
738c049f 754 if((fPtThreshold > 0) && (gtrack->GetPt()< fPtThreshold)) continue;
755 if(nHits < fMinHits) continue;
756
757 currenttrack = j;
758 break;
759 }
760 }
761
44be0fde 762 if (!fSliceArray[slice]) continue;
c846a312 763
44be0fde 764 for(Int_t p=0;p<6;p++){
765
23c36ba2 766 AliHLTTPCSpacePointData *points = fClusters[slice][p];
767 if(!points) continue;
768 Int_t npoints = fNcl[slice][p];
738c049f 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
23c36ba2 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;
738c049f 780
781 // if single track is selcted draw only cluster for this track
782 if (fSelectCluster == 1 && fSelectTrackSwitch && points[i].fTrackN != currenttrack) continue;
23c36ba2 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;
44be0fde 795 }
738c049f 796
23c36ba2 797 AliHLTTPCTransform::Local2Global(xyz,slice);
738c049f 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
23c36ba2 808 // Fill Charge Histogram
809 fHistcharge->Fill(points[i].fCharge);
738c049f 810 if ((Int_t)points[i].fCharge > maxCharge ) maxCharge = (Int_t) points[i].fCharge;
44be0fde 811 }
738c049f 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);
44be0fde 822 } // END - DRAW 3D CLUSTER
823
824 //--------------------------------------------------------------------------------------------
825 // DRAW 3D TRACKS
826 //--------------------------------------------------------------------------------------------
827 if (fSwitch3DTracks){
828
738c049f 829 Int_t trackcounter = 0;
44be0fde 830 Int_t ntracks = fTracks->GetNTracks();
738c049f 831 Double_t drawStep = 0.2;
44be0fde 832
738c049f 833 Double_t maxResidualY = 0.;
834 Double_t maxResidualZ = 0.;
44be0fde 835
738c049f 836 TPolyLine3D *line = new TPolyLine3D[ntracks];
837#if TRACKHELIX
838 THelix *helix = new THelix[ntracks];
839#endif
44be0fde 840 for(Int_t j=0; j<ntracks; j++) {
841
842 AliHLTTPCTrack *gtrack = fTracks->GetCheckedTrack(j);
843 if(!gtrack) continue;
844
738c049f 845 Int_t nHits = gtrack->GetNHits(); // Number of associated hits to track
846 Int_t slice = gtrack->GetSector();
44be0fde 847
738c049f 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
23c36ba2 866 TPolyMarker3D *pmL = new TPolyMarker3D(1,2);
867 TPolyMarker3D *pmF = new TPolyMarker3D(1,2);
44be0fde 868
738c049f 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
23c36ba2 873
874 Double_t xyzL[3]; // lastpoint of track
875 Double_t xyzF[3]; // firstpoint of track
876
738c049f 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]);
44be0fde 881
738c049f 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]);
23c36ba2 886
738c049f 887 Double_t s = 0.; // length of the track
44be0fde 888
738c049f 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);
44be0fde 901
738c049f 902#if TRACKPOLYMARKER
903 TPolyMarker3D *pmT = new TPolyMarker3D(nTrackPoints,6);
904#endif
23c36ba2 905
738c049f 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 }
44be0fde 931
738c049f 932 Int_t trackPointCounter = 0;
44be0fde 933
738c049f 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 }
44be0fde 944
738c049f 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();
23c36ba2 956
738c049f 957 Double_t *resY= new Double_t[nHits];
958 Double_t *resZ= new Double_t[nHits];
23c36ba2 959
738c049f 960 Double_t *resYLength= new Double_t[2*nHits];
961 Double_t *resZLength= new Double_t[2*nHits];
23c36ba2 962
738c049f 963 Double_t *padrows = new Double_t[nHits];
964 Double_t *padrowsLength = new Double_t[2*nHits];
23c36ba2 965
738c049f 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;
44be0fde 970
738c049f 971 AliHLTTPCSpacePointData *points = fClusters[slice][patch];
44be0fde 972
23c36ba2 973 Float_t xyzCtmp[3]; // cluster tmp
738c049f 974 Float_t xyzTtmp[3]; // track tmp
23c36ba2 975
976 xyzCtmp[0] = points[pos].fX;
977 xyzCtmp[1] = points[pos].fY;
978 xyzCtmp[2] = points[pos].fZ;
979
738c049f 980 Int_t padrow = AliHLTTPCTransform::GetPadRow(points[pos].fX);
981 xyzTtmp[0] = gtrack->GetFirstPointX();
982 if(gtrack->GetCrossingPoint(padrow,xyzTtmp)) {
23c36ba2 983
738c049f 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 }
23c36ba2 1006
738c049f 1007 gtrack->Rotate(slice,kFALSE);
1008 // --- RESIDUALS ---
23c36ba2 1009
738c049f 1010 // Draw last point of Track
1011 pmL->SetMarkerSize(3);
1012 pmL->SetMarkerColor(4);
db16520a 1013// pmL->Draw();
23c36ba2 1014
738c049f 1015 // Draw first point of Track
1016 pmF->SetMarkerSize(3);
1017 pmF->SetMarkerColor(5);
db16520a 1018// pmF->Draw();
23c36ba2 1019
738c049f 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
23c36ba2 1052
738c049f 1053 //Residuals
1054 if ( fGraphresidualsY){
1055 delete fGraphresidualsY;
1056 fGraphresidualsY = NULL;
c846a312 1057 }
c846a312 1058
738c049f 1059 if ( fGraphresidualsZ){
1060 delete fGraphresidualsZ;
1061 fGraphresidualsZ = NULL;
1062 }
1063 //Residuals
1064 if ( fGraphresidualsYLength){
1065 delete fGraphresidualsYLength;
1066 fGraphresidualsYLength = NULL;
1067 }
44be0fde 1068
738c049f 1069 if ( fGraphresidualsZLength){
1070 delete fGraphresidualsZLength;
1071 fGraphresidualsZLength = NULL;
23c36ba2 1072 }
1073
23c36ba2 1074
23c36ba2 1075
738c049f 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);
23c36ba2 1082
738c049f 1083 if (xT) delete xT;
1084 if (yT) delete yT;
1085 if (zT) delete zT;
23c36ba2 1086
44be0fde 1087 } // END for tracks
1088
db16520a 1089 fHistallresidualsY->SetAxisRange(-maxResidualY,maxResidualY);
1090 fHistallresidualsZ->SetAxisRange(-maxResidualZ,maxResidualZ);
738c049f 1091
44be0fde 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);
c846a312 1102 }
44be0fde 1103 } // END - DRAW 3D GEOMETRY
1104
1105 //--------------------------------------------------------------------------------------------
1106 // DRAW 3D PadRow
1107 //--------------------------------------------------------------------------------------------
1108 if (fSwitch3DPadRow && fSliceArray[fSlicePadRow]){
c846a312 1109 Int_t markercolor = 51;
1110
c846a312 1111 for (UInt_t ii=0;ii < 20;ii++){
1112 if (fcolorbin[ii]> 0){
44be0fde 1113
c846a312 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 }
a6c02c85 1124 }
c846a312 1125
44be0fde 1126 //--------------------------------------------------------------------------------------------
1127 // DRAW 3D
1128 //--------------------------------------------------------------------------------------------
1129 v->ZoomView(0,4);
1130 v->Draw();
a6c02c85 1131}
44be0fde 1132
738c049f 1133// ---------------------------------------------------
1134// In order to be backward compatible
1135// ---------------------------------------------------
1136#if BACKWARD
1137void AliHLTTPCDisplay::DisplayClusters(Bool_t x3don,Float_t* etaRange) {
1138 if (!fc1){
1139 fc1 = new TCanvas("c1","",900,900);
1140 fc1->cd();
1141 }
44be0fde 1142
738c049f 1143 fSwitch3DTracks = kFALSE;
1144 fSwitch3DCluster = kTRUE;
1145 fSwitch3DPadRow = kFALSE;
1146 fSwitch3DGeometry = kFALSE;
44be0fde 1147
738c049f 1148 Draw3D();
1149}
1150// ---------------------------------------------------
1151void 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// ---------------------------------------------------
1167void 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// ---------------------------------------------------