]>
Commit | Line | Data |
---|---|---|
78b557c2 | 1 | // $Id$ |
2 | ||
86268ca8 | 3 | /** |
78b557c2 | 4 | <pre> |
5 | //_____________________________________________________________ | |
6 | // AliHLTTPCDisplay3D | |
7 | // | |
8 | // Display class for the HLT TPC-3D events. | |
9 | </pre> | |
10 | */ | |
11 | // Author: Jochen Thaeder <mailto:thaeder@kip.uni-heidelberg.de> | |
12 | //*-- Copyright © ALICE HLT Group | |
13 | ||
14 | #define TRACKHELIX 0 // use THelix for tracks | |
15 | #define TRACKPOLYMARKER 0 // use TPolymarker3D for tracks | |
16 | #define FIRSTLASTPOINT 0 // show first / last point of tracks | |
5235c3e9 | 17 | #define DEBUG 1 |
78b557c2 | 18 | |
19 | #define DRAWSTEP 0.2 | |
20 | ||
21 | #define UNUSEDCLUSTERCOLOR 2 | |
22 | #define USEDCLUSTERCOLOR 3 | |
23 | #define TRACKCOLOR 4 | |
24 | #define TRACKPOLYMARKERCOLOR 5 | |
25 | #define TRACKHELIXCOLOR 6 | |
26 | ||
5235c3e9 | 27 | #if defined(HAVE_HOMERREADER) |
f8c5e339 | 28 | #include HOMERREADER_HEADER |
5235c3e9 | 29 | #endif // defined(HAVE_HOMERREADER) |
30 | ||
78b557c2 | 31 | #include "AliHLTTPCDisplay3D.h" |
32 | #include "AliHLTTPCDisplayPadRow.h" | |
33 | ||
34 | #include "AliHLTStdIncludes.h" | |
ba4b0dd7 | 35 | #ifndef HAVE_NOT_TVIEW3D |
0b6c2560 | 36 | #include <TView3D.h> |
37 | #else | |
78b557c2 | 38 | #include <TView.h> |
0b6c2560 | 39 | #endif |
78b557c2 | 40 | #include <TPolyMarker3D.h> |
41 | #include <TPolyLine3D.h> | |
42 | #include <TH2.h> | |
43 | #include <TTree.h> | |
44 | #include <TNode.h> | |
45 | #include <TGeometry.h> | |
46 | #include <TShape.h> | |
47 | #include <TParticle.h> | |
48 | #include <TFile.h> | |
49 | #include <THelix.h> | |
50 | #include <TStyle.h> | |
51 | #include <TGraph.h> | |
52 | #include <TMultiGraph.h> | |
53 | #include <TAttText.h> | |
54 | #include <TAxis.h> | |
55 | #include <TCanvas.h> | |
56 | ||
57 | #ifdef use_aliroot | |
58 | #include <TClonesArray.h> | |
59 | #include <AliRun.h> | |
60 | #include <AliSimDigits.h> | |
61 | #include <AliTPCParam.h> | |
62 | #endif | |
63 | ||
64 | #include "AliHLTTPCDefinitions.h" | |
65 | #include "AliHLTDataTypes.h" | |
66 | #include "AliHLTTPCSpacePointData.h" | |
67 | #include "AliHLTTPCClusterDataFormat.h" | |
68 | #include "AliHLTTPCTrackletDataFormat.h" | |
69 | ||
70 | ||
71 | #include "AliHLTTPCDigitReader.h" | |
72 | #include "AliHLT_C_Component_WrapperInterface.h" | |
73 | ||
74 | #include "AliHLTTPCDisplayMain.h" | |
75 | ||
76 | #include "AliHLTTPCLogging.h" | |
77 | #include "AliHLTTPCDisplay.h" | |
78 | #include "AliHLTTPCTransform.h" | |
79 | #include "AliHLTTPCTrack.h" | |
80 | #include "AliHLTTPCTrackArray.h" | |
81 | #include "AliHLTTPCMemHandler.h" | |
82 | #include "AliHLTTPCDigitReaderPacked.h" | |
83 | ||
84 | ||
85 | #if __GNUC__ >= 3 | |
86 | using namespace std; | |
87 | #endif | |
88 | ||
89 | ClassImp(AliHLTTPCDisplay3D) | |
90 | ||
91 | //____________________________________________________________________________________________________ | |
5eefc803 | 92 | AliHLTTPCDisplay3D::AliHLTTPCDisplay3D(AliHLTTPCDisplayMain* display, Char_t* gfile ) : |
93 | fTrackParam(), | |
94 | fDisplay(display), | |
95 | fGeom(NULL) { | |
78b557c2 | 96 | // constructor |
5eefc803 | 97 | |
78b557c2 | 98 | LoadGeometrie(gfile); |
99 | } | |
100 | ||
101 | //____________________________________________________________________________________________________ | |
102 | AliHLTTPCDisplay3D::~AliHLTTPCDisplay3D() { | |
103 | // destructor | |
104 | ||
105 | } | |
106 | ||
107 | //____________________________________________________________________________________________________ | |
108 | void AliHLTTPCDisplay3D::Save(){ | |
109 | fDisplay->GetCanvas3D()->SaveAs("HLT-3D-View.eps"); | |
110 | } | |
111 | ||
112 | //____________________________________________________________________________________________________ | |
113 | void AliHLTTPCDisplay3D::Draw(){ | |
114 | fDisplay->GetCanvas3D()->cd(); | |
115 | fDisplay->GetCanvas3D()->Clear(); | |
116 | ||
ba4b0dd7 | 117 | #ifndef HAVE_NOT_TVIEW3D |
0b6c2560 | 118 | TView3D *v = new TView3D(); |
119 | if (v) v->SetSystem(1); | |
120 | #else | |
78b557c2 | 121 | TView *v = new TView(1); |
0b6c2560 | 122 | #endif |
123 | if (v==NULL) { | |
124 | HLTFatal("can not create viewer"); | |
125 | return; | |
126 | } | |
78b557c2 | 127 | v->SetRange(-800,-800,-800,800,800,800); |
128 | ||
129 | Float_t* etaRange = NULL; // ------ STILL TO FIX | |
130 | ||
131 | ||
132 | //-------------------------------------------------------------------------------------------- | |
133 | // DRAW 3D GEOMETRY | |
134 | //-------------------------------------------------------------------------------------------- | |
135 | if (fDisplay->Get3DSwitchGeometry()){ | |
136 | ||
137 | TList* masterNodeList = fGeom->GetListOfNodes(); | |
138 | TNode* masterNode=0; | |
139 | TIter next(masterNodeList); | |
140 | ||
141 | while ((masterNode = static_cast<TNode*> (next()))) { | |
142 | ||
143 | TList* nodeList = masterNode->GetListOfNodes(); | |
144 | TNode* node=0; | |
0fad9753 | 145 | TIter nextt(nodeList); |
78b557c2 | 146 | |
0fad9753 | 147 | while ((node = static_cast<TNode*> (nextt()))) { |
78b557c2 | 148 | |
149 | ULong_t tmpslice = atol(node->GetName() + 2); | |
150 | ||
151 | if (fDisplay->GetDisplaySlice(tmpslice)) { | |
152 | node->SetVisibility(1); | |
153 | node->SetFillColor(0); | |
154 | node->SetLineColor(fDisplay->GetLineColor()); | |
155 | } | |
156 | else node->SetVisibility(0); | |
157 | } // end while son Nodes | |
158 | } // end while master Node | |
159 | ||
160 | fGeom->Draw(""); | |
161 | } // END - DRAW 3D GEOMETRY | |
162 | ||
36782fc0 | 163 | //-------------------------------------------------------------------------------------------- |
164 | // DRAW 3D PadRow | |
165 | //-------------------------------------------------------------------------------------------- | |
78b557c2 | 166 | |
36782fc0 | 167 | if (fDisplay->ExistsRawData() && fDisplay->Get3DSwitchPadRow() && fDisplay->GetDisplaySlice(fDisplay->GetSlicePadRow())){ |
168 | ||
169 | // -- only one padrow | |
170 | if ( fDisplay->Get3DSwitchRaw() == 1 ) { | |
171 | fDisplay->GetPadRowPointer()->Draw3D(); | |
172 | } | |
173 | // show all padrows | |
174 | else { | |
175 | Int_t nRawdata = 0; | |
176 | TPolyMarker3D *pmRawdata = new TPolyMarker3D(1,6); | |
177 | pmRawdata->SetBit(kCanDelete); | |
178 | ||
179 | if ( fDisplay->GetZeroSuppression() ){ | |
180 | for (Int_t row=0; row < AliHLTTPCTransform::GetNRows(); row++){ | |
181 | for (Int_t pad=0; pad < AliHLTTPCTransform::GetNPads(row); pad++){ | |
182 | for (Int_t timeBin=fDisplay->GetTimeBinMin(); timeBin <= fDisplay->GetTimeBinMax(); timeBin++){ | |
183 | ||
184 | Int_t time = (Int_t) fDisplay->fRawDataZeroSuppressed[row][pad][timeBin]; | |
185 | ||
186 | if (time != 0) { | |
187 | Float_t xyz[3]; | |
188 | ||
189 | AliHLTTPCTransform::RawHLT2Global(xyz,fDisplay->GetSlicePadRow(), row, pad, timeBin); | |
190 | ||
191 | pmRawdata->SetPoint(nRawdata,xyz[0],xyz[1],xyz[2]); | |
192 | nRawdata++; | |
193 | } | |
194 | } // end time | |
195 | } // end pad | |
196 | } // end row | |
197 | } | |
198 | ||
199 | pmRawdata->SetMarkerSize(1); | |
200 | pmRawdata->SetMarkerColor(6); | |
201 | pmRawdata->Draw("same"); | |
202 | ||
203 | } // end show all padrows | |
204 | ||
205 | } | |
206 | ||
78b557c2 | 207 | //-------------------------------------------------------------------------------------------- |
208 | // DRAW 3D CLUSTER | |
209 | //-------------------------------------------------------------------------------------------- | |
210 | if (fDisplay->Get3DSwitchCluster() && fDisplay->ExistsClusterData()){ | |
211 | ||
212 | for (Int_t slice=0; slice <= 35; slice++){ | |
213 | ||
214 | Int_t currenttrack = -1; | |
215 | ||
216 | if (fDisplay->ExistsTrackData() && fDisplay->GetSelectTrackSwitch()) currenttrack = fDisplay->GetGlobalTrack(slice); | |
217 | ||
218 | if (!fDisplay->GetDisplaySlice(slice)) continue; | |
219 | ||
220 | for(Int_t patch=0;patch<6;patch++){ | |
221 | ||
222 | AliHLTTPCSpacePointData *points = fDisplay->GetSpacePointDataPointer(slice,patch); | |
223 | if(!points) continue; | |
224 | ||
225 | TPolyMarker3D *pmUsed = new TPolyMarker3D(1,6); | |
226 | TPolyMarker3D *pmUnused = new TPolyMarker3D(1,6); | |
227 | pmUnused->SetBit(kCanDelete); | |
228 | pmUsed->SetBit(kCanDelete); | |
229 | ||
230 | ||
231 | Int_t nUsedCluster = 0; | |
232 | Int_t nUnusedCluster = 0; | |
233 | ||
234 | Float_t xyz[3]; | |
235 | for(Int_t i=0; i< fDisplay->GetNumberSpacePoints(slice,patch); i++){ | |
236 | // Used cluster only | |
237 | if (fDisplay->GetSelectCluster() == 1 && points[i].fUsed == kFALSE) continue; | |
238 | // Unused cluster only | |
239 | if (fDisplay->GetSelectCluster() == 2 && points[i].fUsed == kTRUE) continue; | |
240 | ||
241 | // if single track is selcted draw only cluster for this track | |
242 | if (fDisplay->GetSelectCluster() == 1 && fDisplay->GetSelectTrackSwitch() && points[i].fTrackN != currenttrack) continue; | |
243 | ||
244 | xyz[0] = points[i].fX; | |
245 | xyz[1] = points[i].fY; | |
246 | xyz[2] = points[i].fZ; | |
247 | ||
248 | if ( etaRange ){ | |
249 | // Do this before the transform, because the tracker also uses | |
250 | // local coordinates when using this limit to determine | |
251 | // which clusters to use for tracking | |
252 | Double_t pointEta = AliHLTTPCTransform::GetEta( xyz ); | |
253 | if ( pointEta<etaRange[0] || pointEta>etaRange[1] ) | |
254 | continue; | |
255 | } | |
256 | ||
257 | AliHLTTPCTransform::Local2Global(xyz,slice); | |
258 | ||
259 | if (points[i].fUsed == kTRUE){ | |
260 | pmUsed->SetPoint(nUsedCluster,xyz[0],xyz[1],xyz[2]); | |
261 | nUsedCluster++; | |
262 | } | |
263 | else { | |
264 | pmUnused->SetPoint(nUnusedCluster,xyz[0],xyz[1],xyz[2]); | |
265 | nUnusedCluster++; | |
266 | } | |
267 | ||
268 | } | |
269 | pmUsed->SetMarkerSize(1); | |
270 | pmUsed->SetMarkerColor(USEDCLUSTERCOLOR); | |
271 | pmUsed->Draw("same"); | |
272 | ||
273 | pmUnused->SetMarkerSize(1); | |
274 | pmUnused->SetMarkerColor(UNUSEDCLUSTERCOLOR); | |
275 | pmUnused->Draw("same"); | |
276 | ||
277 | fDisplay->GetCanvas3D()->Modified(); | |
278 | fDisplay->GetCanvas3D()->Update(); | |
279 | ||
280 | } // END - PATCH LOOP | |
281 | } // END - SLICE LOOP | |
282 | } // END - DRAW 3D CLUSTER | |
283 | ||
284 | //-------------------------------------------------------------------------------------------- | |
285 | // DRAW 3D TRACKS | |
286 | //-------------------------------------------------------------------------------------------- | |
287 | if (fDisplay->Get3DSwitchTracks() && fDisplay->ExistsTrackData()){ | |
288 | ||
289 | AliHLTTPCTransform::SetBField( 0.5 ); // ++++++ | |
290 | ||
291 | ||
292 | AliHLTTPCTrackArray* tracks = fDisplay->GetTrackArrayPointer(); | |
293 | Int_t ntracks = tracks->GetNTracks(); | |
294 | ||
295 | // TPolyLine3D **line = new (TPolyLine3D*)[ntracks]; | |
296 | // for(Int_t j=0; j<ntracks; j++) line[j] = 0; | |
297 | #if TRACKHELIX | |
298 | // THelix **helix = new (THelix*)[ntracks]; | |
299 | // for(Int_t j=0; j<ntracks; j++) helix[j] = 0; | |
300 | ||
301 | #endif | |
302 | for(Int_t j=0; j<ntracks; j++) { | |
303 | ||
304 | AliHLTTPCTrack *gtrack = tracks->GetCheckedTrack(j); | |
305 | if(!gtrack) continue; | |
306 | ||
307 | Int_t nHits = gtrack->GetNHits(); // Number of associated hits to track | |
308 | Int_t slice = gtrack->GetSector(); | |
309 | ||
310 | // --- CHECK if track is should be drawn | |
311 | // select if slice should be displayed or not | |
312 | if (!fDisplay->GetDisplaySlice(slice)) continue; | |
313 | ||
314 | if (fDisplay->GetSelectTrackSwitch() && fDisplay->GetGlobalTrack(slice) != j) continue; | |
315 | ||
316 | Double_t radius = gtrack->GetRadius(); // radius | |
317 | Double_t kappa = gtrack->GetKappa(); // curvature = 1/R , signed | |
318 | Double_t lambda = atan( gtrack->GetTgl() ); // dipAngle lambda | |
319 | Double_t phi0 = gtrack->GetPsi() + (gtrack->GetCharge() * AliHLTTPCTransform::PiHalf() ); // azimuthal angle of startingpoint, with respect to helix axis | |
320 | ||
321 | if (kappa == 0 && AliHLTTPCTransform::GetBFieldValue() > 0.) { | |
322 | printf("================================KAPPA == 0"); | |
323 | continue; | |
324 | } | |
325 | ||
326 | Double_t xyzL[3]; // lastpoint of track | |
327 | Double_t xyzF[3]; // firstpoint of track | |
328 | ||
329 | xyzF[0] = gtrack->GetFirstPointX(); | |
330 | xyzF[1] = gtrack->GetFirstPointY(); | |
331 | xyzF[2] = gtrack->GetFirstPointZ(); | |
332 | ||
333 | xyzL[0] = gtrack->GetLastPointX(); | |
334 | xyzL[1] = gtrack->GetLastPointY(); | |
335 | xyzL[2] = gtrack->GetLastPointZ(); | |
336 | ||
36782fc0 | 337 | if ( xyzL[0] == xyzF[0] ) continue; |
338 | if ( xyzL[1] == xyzF[1] ) continue; | |
339 | if ( xyzL[2] == xyzF[2] ) continue; | |
340 | ||
341 | ||
78b557c2 | 342 | #if FIRSTLASTPOINT |
36782fc0 | 343 | TPolyMarker3D *pmL = new TPolyMarker3D(1,2); |
344 | TPolyMarker3D *pmF = new TPolyMarker3D(1,2); | |
345 | pmL->SetBit(kCanDelete); | |
346 | pmF->SetBit(kCanDelete); | |
78b557c2 | 347 | |
36782fc0 | 348 | //TPolyMarker3D pmL(1,2); |
349 | //TPolyMarker3D pmF(1,2); | |
78b557c2 | 350 | |
351 | ||
36782fc0 | 352 | pmF->SetPoint(0,xyzF[0],xyzF[1],xyzF[2]); |
353 | pmL->SetPoint(0,xyzL[0],xyzL[1],xyzL[2]); | |
78b557c2 | 354 | #endif |
355 | ||
356 | Double_t s = 0.; // length of the track | |
357 | ||
358 | ||
36782fc0 | 359 | //if ( AliHLTTPCTransform::GetBFieldValue() == 0.) |
360 | if ( radius == 999999.0){ // IVAN HACK | |
361 | ||
78b557c2 | 362 | s = sqrt ( (xyzL[0] - xyzF[0])*(xyzL[0] - xyzF[0]) + (xyzL[1] - xyzF[1])*(xyzL[1] - xyzF[1]) ); |
36782fc0 | 363 | } |
364 | else { | |
78b557c2 | 365 | // Calculate the length of the track. If it is to flat in in s,z plane use sxy, otherwise use sz |
366 | if (fabs(lambda) > 0.05){ | |
367 | // length of track calculated out of z | |
368 | s = fabs( (xyzL[2] - xyzF[2]) / sin(lambda) ); // length of track calculated out of z | |
369 | } | |
370 | else { | |
371 | Double_t d = (xyzL[0] - xyzF[0])*(xyzL[0] - xyzF[0]) + (xyzL[1] - xyzF[1])*(xyzL[1] - xyzF[1]); | |
372 | // length of track calculated out of xy | |
373 | s = fabs ( acos( 0.5 * (2 - (d / (radius*radius)))) / ( kappa * cos(lambda) ) ); | |
374 | } | |
375 | } | |
376 | ||
377 | ||
378 | // CUTS on tracks | |
379 | /* | |
380 | if (nHits < fDisplay->GetCutHits() ) continue; | |
381 | if (s < fDisplay->GetCutS() ) continue; | |
382 | if (gtrack->GetPsi() < fDisplay->GetCutPsi() ) continue; | |
383 | if (lambda < fDisplay->GetCutLambda() ) continue; | |
384 | if (gtrack->GetPt() < fDisplay->GetCutPt() && AliHLTTPCTransform::GetBFieldValue() != 0. ) continue; | |
385 | if ( AliHLTTPCTransform::GetPadRow((Float_t)xyzF[0]) > fDisplay->GetIncidentPadrow() ) continue; | |
386 | */ | |
387 | Int_t nTrackPoints = 2 + (Int_t) floor(s / DRAWSTEP); | |
388 | ||
389 | #if TRACKPOLYMARKER | |
390 | // TPolyMarker3D *pmT = new TPolyMarker3D(nTrackPoints,6); | |
391 | TPolyMarker3D pmT(nTrackPoints,6); | |
392 | ||
393 | #endif | |
394 | Double_t *xT = new Double_t[nTrackPoints]; | |
395 | Double_t *yT = new Double_t[nTrackPoints]; | |
396 | Double_t *zT = new Double_t[nTrackPoints]; | |
397 | ||
398 | Int_t trackPointCounter = 0; | |
399 | ||
400 | //Write Track Parameters for single track | |
401 | if (fDisplay->GetSelectTrackSwitch() ){ | |
402 | fDisplay->fTrackParam.id = j; | |
403 | fDisplay->fTrackParam.nHits = nHits; | |
404 | fDisplay->fTrackParam.charge = gtrack->GetCharge(); | |
405 | fDisplay->fTrackParam.lambda = lambda; | |
406 | fDisplay->fTrackParam.kappa = kappa; | |
407 | fDisplay->fTrackParam.radius = radius; | |
408 | fDisplay->fTrackParam.slice = slice; | |
409 | fDisplay->fTrackParam.phi0 = phi0; | |
410 | fDisplay->fTrackParam.pt = gtrack->GetPt(); | |
411 | fDisplay->fTrackParam.bfield = AliHLTTPCTransform::GetBFieldValue(); | |
412 | fDisplay->fTrackParam.psi = gtrack->GetPsi(); | |
413 | fDisplay->fTrackParam.s = s; | |
414 | } | |
415 | ||
416 | ||
36782fc0 | 417 | // if ( AliHLTTPCTransform::GetBFieldValue() == 0.) { |
418 | ||
419 | if ( radius == 999999.0) { // IVAN HACK | |
78b557c2 | 420 | |
36782fc0 | 421 | // cout << "ENTER IVAN 2 radius="<< radius << endl; |
78b557c2 | 422 | for (Double_t ds = 0.; ds < s; ds = ds + DRAWSTEP){ |
423 | // FILL ARRAYS IN ORDER TO DRAW THE TRACKPOINTS, OUT OF THE PARAMETER | |
36782fc0 | 424 | // xT[trackPointCounter] = xyzF[0] + ds * cos(phi0); |
425 | // yT[trackPointCounter] = xyzF[1] + ds * sin(phi0); | |
426 | xT[trackPointCounter] = xyzF[0] + ds * cos(phi0 - 1.57); | |
427 | yT[trackPointCounter] = xyzF[1] + ds * sin(phi0 - 1.57); | |
428 | zT[trackPointCounter] = xyzF[2] + ds * sin(lambda); | |
78b557c2 | 429 | #if TRACKPOLYMARKER |
430 | pmT.SetPoint(trackPointCounter,xT[trackPointCounter],yT[trackPointCounter],zT[trackPointCounter]); | |
431 | #endif | |
432 | trackPointCounter++; | |
433 | } | |
434 | ||
435 | if (trackPointCounter > nTrackPoints) printf("N=%d n=%d", nTrackPoints,trackPointCounter); | |
436 | else { | |
36782fc0 | 437 | //xT[trackPointCounter] = xyzF[0] + s * cos(phi0); |
438 | //yT[trackPointCounter] = xyzF[1] + s * sin(phi0); | |
439 | ||
440 | xT[trackPointCounter] = xyzF[0] + s * cos(phi0 - 1.57); | |
441 | yT[trackPointCounter] = xyzF[1] + s * sin(phi0 - 1.57); | |
442 | zT[trackPointCounter] = xyzF[2] + s * sin(lambda); | |
78b557c2 | 443 | #if TRACKPOLYMARKER |
444 | pmT.SetPoint(trackPointCounter,xT[trackPointCounter],yT[trackPointCounter],zT[trackPointCounter]); | |
445 | #endif | |
446 | } | |
447 | ||
448 | } | |
449 | else { | |
450 | ||
451 | for (Double_t ds = 0.; ds < s; ds = ds + DRAWSTEP){ | |
452 | // FILL ARRAYS IN ORDER TO DRAW THE TRACKPOINTS, OUT OF THE PARAMETER | |
453 | xT[trackPointCounter] = xyzF[0] + radius * ( cos( phi0 + (ds*kappa*cos(lambda)) ) - cos(phi0) ); | |
454 | yT[trackPointCounter] = xyzF[1] + radius * ( sin( phi0 + (ds*kappa*cos(lambda)) ) - sin(phi0) ); | |
455 | zT[trackPointCounter] = xyzF[2] + ds * sin(lambda); | |
456 | #if TRACKPOLYMARKER | |
457 | pmT.SetPoint(trackPointCounter,xT[trackPointCounter],yT[trackPointCounter],zT[trackPointCounter]); | |
458 | #endif | |
459 | trackPointCounter++; | |
460 | } | |
461 | ||
462 | if (trackPointCounter > nTrackPoints) printf("N=%d n=%d", nTrackPoints,trackPointCounter); | |
463 | else { | |
464 | xT[trackPointCounter] = xyzF[0] + radius * ( cos( phi0 + (s*kappa*cos(lambda)) ) - cos(phi0) ); | |
465 | yT[trackPointCounter] = xyzF[1] + radius * ( sin( phi0 + (s*kappa*cos(lambda)) ) - sin(phi0) ); | |
466 | zT[trackPointCounter] = xyzF[2] + s * sin(lambda); | |
467 | #if TRACKPOLYMARKER | |
468 | pmT.SetPoint(trackPointCounter,xT[trackPointCounter],yT[trackPointCounter],zT[trackPointCounter]); | |
469 | #endif | |
470 | } | |
471 | } | |
472 | ||
473 | // Draw Track -- as line | |
474 | //line[j] = new TPolyLine3D(nTrackPoints,xT,yT,zT,""); | |
475 | //TPolyLine3D *currentline = line[j]; | |
476 | //* currentline = new TPolyLine3D(nTrackPoints,xT,yT,zT,""); | |
477 | // TPolyLine3D currentline(nTrackPoints,xT,yT,zT,""); | |
478 | ||
479 | TPolyLine3D *currentline = new TPolyLine3D(nTrackPoints,xT,yT,zT,""); | |
480 | currentline->SetBit(kCanDelete); | |
481 | currentline->SetLineColor(TRACKCOLOR); | |
482 | currentline->SetLineWidth(2); | |
483 | currentline->Draw("same"); | |
484 | ||
485 | ||
486 | ||
487 | // --- ADDITIONAL DRAW OPTIONS | |
488 | #if FIRSTLASTPOINT | |
489 | // Draw last point of Track | |
36782fc0 | 490 | pmL->SetMarkerSize(3); |
491 | pmL->SetMarkerColor(4); | |
492 | pmL->Draw(); | |
78b557c2 | 493 | |
494 | // Draw first point of Track | |
36782fc0 | 495 | pmF->SetMarkerSize(3); |
496 | pmF->SetMarkerColor(5); | |
497 | pmF->Draw(); | |
78b557c2 | 498 | #endif |
499 | #if TRACKPOLYMARKER | |
500 | // Draw Track -- as polymarker | |
501 | pmT.SetMarkerSize(3); | |
502 | pmT.SetMarkerColor(TRACKPOLYMARKERCOLOR); | |
503 | pmT.Draw(); | |
504 | #endif | |
505 | #if TRACKHELIX | |
506 | // Draw Track -- as helix | |
507 | // works ok, execpt for very small dipangles -> track almost horizontal | |
508 | Double_t hrange[2]; | |
509 | Double_t v0[3]; | |
510 | Double_t omega; | |
511 | hrange[0] = xyzF[2]; | |
512 | hrange[1] = xyzL[2]; | |
513 | v0[0] = gtrack->GetPx(); | |
514 | v0[1] = gtrack->GetPy(); | |
515 | v0[2] = gtrack->GetPz(); | |
516 | omega = AliHLTTPCTransform::GetBFieldValue() * gtrack->GetCharge(); | |
517 | ||
518 | // helix[j] = new THelix(xyzF,v0,omega,hrange,kHelixZ,0); | |
519 | // THelix *currenthelix = helix[j]; | |
520 | // currenthelix = new THelix(xyzF,v0,omega,hrange,kHelixZ,0); | |
521 | THelix currenthelix(xyzF,v0,omega,hrange,kHelixZ,0); | |
522 | currenthelix.SetLineColor(TRACKHELIXCOLOR); | |
523 | currenthelix.SetLineWidth(1); | |
524 | currenthelix.Draw("same"); | |
525 | #endif | |
526 | ||
527 | ||
528 | // delete[] | |
529 | //Double_t *xT = new Double_t[nTrackPoints]; | |
530 | // Double_t *yT = new Double_t[nTrackPoints]; | |
531 | // Double_t *zT = new Double_t[nTrackPoints]; | |
532 | if (xT){ | |
533 | delete[] xT; | |
534 | xT = NULL; | |
535 | } | |
536 | if (yT){ | |
537 | delete[] yT; | |
538 | yT = NULL; | |
539 | } | |
540 | if (zT){ | |
541 | delete[] zT; | |
542 | zT = NULL; | |
543 | } | |
544 | ||
545 | } // END for track loop | |
546 | ||
547 | ||
548 | // NO !!! DELETE line #ifdef helix delete helix | |
549 | ||
550 | ||
551 | } // END - DRAW 3D Tracks | |
36782fc0 | 552 | |
78b557c2 | 553 | //-------------------------------------------------------------------------------------------- |
554 | // DRAW 3D | |
555 | //-------------------------------------------------------------------------------------------- | |
556 | // v->ZoomView(0,3); | |
557 | // v->Draw(); | |
558 | ||
559 | fDisplay->GetCanvas3D()->SetFillColor(fDisplay->GetBackColor()); | |
560 | ||
561 | if ( !fDisplay->GetKeepView() ){ | |
562 | fDisplay->GetCanvas3D()->SetTheta(fDisplay->GetTheta()); | |
563 | fDisplay->GetCanvas3D()->SetPhi(fDisplay->GetPhi()); | |
564 | } | |
565 | ||
36782fc0 | 566 | // fDisplay->GetCanvas3D()->Modified(); |
78b557c2 | 567 | |
36782fc0 | 568 | fDisplay->GetCanvas3D()->Update(); |
78b557c2 | 569 | |
78b557c2 | 570 | } |
571 | ||
572 | //____________________________________________________________________________________________________ | |
573 | void AliHLTTPCDisplay3D::LoadGeometrie(Char_t *gfile) { | |
574 | if (gfile) { | |
575 | TFile *file = TFile::Open(gfile); | |
576 | if(!file) { | |
577 | LOG(AliHLTTPCLog::kError,"AliHLTTPCDisplay3D::AliHLTDisplay","File Open") | |
578 | <<"Geometry file " << gfile << " does not exist!"<<ENDLOG; | |
579 | exit(-1); | |
580 | } | |
581 | ||
582 | fGeom = (TGeometry*)file->Get("AliceGeom"); | |
583 | ||
584 | file->Close(); | |
78b557c2 | 585 | } |
586 | } |