From Ivana: update following changes in MUON.
[u/mrichter/AliRoot.git] / EVE / Alieve / MUONModule.cxx
CommitLineData
4d7a67a6 1/* HEAD11Jul06 */
2//////////////////////////////////////////////////////////////////////////
3// //
4// The main AliEVE drawing module for the MUON detector //
5// //
6//////////////////////////////////////////////////////////////////////////
7
34ea2f0a 8#include "EventAlieve.h"
9#include "Reve/PointSet.h"
10#include "Reve/RGTopFrame.h"
11
12#include "AliRun.h"
13#include "AliRunLoader.h"
14
15#include "AliMUON.h"
9ccbb58b 16#include "AliMpSegmentation.h"
34ea2f0a 17#include "AliMpDEIterator.h"
18#include "AliMpSectorSegmentation.h"
19#include "AliMpSector.h"
20#include "AliMUONGeometryTransformer.h"
21#include "AliMUONSegmentation.h"
34ea2f0a 22#include "AliMpStationType.h"
23#include "AliMpDEManager.h"
24#include "AliMUONConstants.h"
25#include "AliMUONDigit.h"
26#include "AliMUONRawCluster.h"
27#include "AliMUONTrack.h"
28#include "AliMUONTrackParam.h"
29
30#include "MUONModule.h"
31
32#include <TPolyLine3D.h>
33#include <TMarker3DBox.h>
34#include <TColor.h>
35
36using namespace Reve;
37using namespace Alieve;
38using namespace std;
39
40ClassImp(MUONModule)
41
34ea2f0a 42/**************************************************************************/
27db2029 43MUONModule::MUONModule(const Text_t* n, const Text_t* t, Color_t col) :
4d7a67a6 44 Reve::RenderElement(col),
27db2029 45 QuadSet(n, t),
265ecb21 46 fInfo(0),
4d7a67a6 47 fID(-1),
48 fCath(0),
265ecb21 49 fShowDigits(0), fShowClusters(0), fShowTracks(0),
50 fFrameCol(col),
51 fDetElemId(-1)
4d7a67a6 52{
53 //
54 // Default constructor
55 //
56
57}
27db2029 58
4d7a67a6 59/**************************************************************************/
34ea2f0a 60MUONModule::MUONModule(Int_t id, Int_t cath, MUONDigitsInfo* info, Bool_t dig, Bool_t clus, Color_t col ) :
4d7a67a6 61 Reve::RenderElement(col),
27db2029 62 QuadSet(Form("M-DetElemId %d C%1d",id,cath)),
265ecb21 63 fInfo(info),
4d7a67a6 64 fID(-1),
65 fCath(0),
265ecb21 66 fShowDigits(dig), fShowClusters(clus), fShowTracks(0),
67 fFrameCol(col),
68 fDetElemId(-1)
34ea2f0a 69{
4d7a67a6 70 //
71 // Constructor
72 //
34ea2f0a 73
34ea2f0a 74 if (!fShowDigits && !fShowClusters) fShowTracks = 1;
75
76 if (fShowClusters) SetName(Form("M-DetElemId %d",id));
77
78 if (id/100 >= 11 && cath == 1) SetName(Form("M-DetElemId %d X",id));
79 if (id/100 >= 11 && cath == 2) SetName(Form("M-DetElemId %d Y",id));
80 if (id == -1 && cath == -1) SetName(Form("M-Chambers"));
81 if (id > -1 && cath == -1) SetName(Form("M-Track %d",id));
82 if (cath == -2) SetName(Form("M-Chamber %2d",id));
83 if (cath == -3) SetName(Form("M-Pads %d X",id));
84 if (cath == -4) SetName(Form("M-Pads %d Y",id));
85
86 SetID(id,cath);
87
88}
89
4d7a67a6 90/**************************************************************************/
91MUONModule::MUONModule(const MUONModule &mmod) :
92 Reve::RenderElement(),
93 QuadSet(Form("M-DetElemId %d C%1d",mmod.fID,mmod.fCath)),
94 fInfo(mmod.fInfo),
95 fID(mmod.fID),
96 fCath(mmod.fCath),
97 fShowDigits(mmod.fShowDigits),
98 fShowClusters(mmod.fShowClusters),
99 fShowTracks(mmod.fShowTracks),
100 fFrameCol(mmod.fFrameCol),
101 fDetElemId(mmod.fDetElemId)
102{
103 //
104 // Copy constructor
105 //
106
107}
108
109/**************************************************************************/
110MUONModule& MUONModule::operator=(const MUONModule &mmod)
111{
112 //
113 // Assignment operator
114 //
115
116 if (this != &mmod) {
117
118 fInfo = mmod.fInfo;
119 fID = mmod.fID;
120 fCath = mmod.fCath;
121 fShowDigits = mmod.fShowDigits;
122 fShowClusters = mmod.fShowClusters;
123 fShowTracks = mmod.fShowTracks;
124 fFrameCol = mmod.fFrameCol;
125 fDetElemId = mmod.fDetElemId;
126
127 }
128
129 return *this;
130
131}
132
34ea2f0a 133/**************************************************************************/
134void MUONModule::SetID(Int_t id, Int_t cath)
135{
4d7a67a6 136 //
137 // Select a single detector element id
138 //
139
34ea2f0a 140 static const Exc_t eH("MUOModule::SetID ");
141
142 if(fInfo == 0)
143 throw(eH + "MUONDigitsInfo not set.");
144
145 fID = id;
146 fCath = cath;
147
148 InitModule();
149
150}
151
152/**************************************************************************/
153void MUONModule::InitModule()
154{
4d7a67a6 155 //
156 // Initialize and draw selected items
157 //
34ea2f0a 158
159 fDetElemId = 0;
160
161 if (fShowDigits) LoadQuadsDigits();
162 if (fShowClusters) LoadQuadsClusters();
163 if (fShowTracks) {
164 if (fCath == -1){
165 LoadQuadsTracks(fID);
166 } else if (fCath == -2 || fCath == -3 || fCath == -4) {
167 if (fCath == -2) LoadQuadsChambers(fID,fID);
168 if (fCath == -3) LoadQuadsChambers(fID,fID,-1,1);
169 if (fCath == -4) LoadQuadsChambers(fID,fID,-1,2);
170 }
171 }
172 ComputeBBox();
34ea2f0a 173
174}
175
176/**************************************************************************/
177void MUONModule::LoadQuadsChambers(Int_t chamber1, Int_t chamber2, Int_t id, Int_t cat)
178{
4d7a67a6 179 //
180 // Draw chambers
181 //
34ea2f0a 182
183 //printf("Draw chambers: %d %d %d %d %d \n",chamber1,chamber2,id,cat,fCath);
184
185 Int_t fChamber;
186
187 AliRunLoader *runLoader = Alieve::Event::AssertRunLoader();
188 runLoader->LoadgAlice();
189
190 AliMUON *pMUON = (AliMUON*)gAlice->GetModule("MUON");
191
192 const AliMUONGeometryTransformer* kGeomTransformer = pMUON->GetGeometryTransformer();
193 AliMUONSegmentation* segmentation = pMUON->GetSegmentation();
34ea2f0a 194
195 Float_t xg1, xg2, yg1, yg2, zg1, zg2;
196
197 for (fChamber = chamber1; fChamber <= chamber2; fChamber++) {
198
199 if(fChamber < 5) {
200
201 AliMpDEIterator it;
202 for ( it.First(fChamber-1); ! it.IsDone(); it.Next() ) {
203
204 Int_t detElemId = it.CurrentDE();
205
206 if (id > 0 && id != detElemId) continue;
207
208 //printf("Detector element ID for chamber %d (tracking): %d \n",fChamber,detElemId);
209
9ccbb58b 210 AliMpSectorSegmentation * seg
211 = (AliMpSectorSegmentation *) AliMpSegmentation::Instance()->GetMpSegmentation(detElemId, 0);
34ea2f0a 212 const AliMpSector * sector = seg->GetSector();
213
214 // get sector measurements
215 TVector2 position = sector->Position();
216 TVector2 dimension = sector->Dimensions(); // half length
217
218 //printf("Sector position: \n"); position.Print();
219 //printf("Sector dimensions: \n"); dimension.Print();
220
221 Float_t xlocal1 = position.Px(); // FIXME: not really needed as it's 0 ?
222 Float_t ylocal1 = position.Py(); // FIXME: not really needed as it's 0 ?
223 Float_t xlocal2 = dimension.Px() * 2.;
224 Float_t ylocal2 = dimension.Px() * 2.;
225
226 //printf("Local position and dimension: xp = %f , yp = %f xd = %f yd = %f \n",xlocal1,ylocal1,xlocal2,ylocal2);
227
228 kGeomTransformer->Local2Global(detElemId, xlocal1, ylocal1, 0, xg1, yg1, zg1);
229 kGeomTransformer->Local2Global(detElemId, xlocal2, ylocal2, 0, xg2, yg2, zg2);
230
231 //printf("Global position: xpg = %f , ypg = %f zpg = %f \n",xg1,yg1,zg1);
232 //printf("Global dimension: xdg = %f , ydg = %f zdg = %f \n",xg2,yg2,zg2);
233
234 Float_t *p;
235 if (fCath != -3 && fCath != -4) {
236 fQuads.push_back(Reve::Quad(fFrameCol));
237 p = fQuads.back().vertices;
238 /*
239 p[0] = xg1; p[1] = yg1; p[2] = zg1;
240 p[3] = xg1; p[4] = yg1; p[5] = zg1;
241 p[6] = xg1+xg2; p[7] = yg1; p[8] = zg1;
242 p[9] = xg1+xg2; p[10] = yg1; p[11] = zg1;
243 */
244 // switch x <> z
245 p[0] = zg1; p[1] = yg1; p[2] = xg1;
246 p[3] = zg1; p[4] = yg1; p[5] = xg1;
247 p[6] = zg1; p[7] = yg1; p[8] = xg1+xg2;
248 p[9] = zg1; p[10] = yg1; p[11] = xg1+xg2;
249
250 Float_t xprev = xg1+xg2;
251 Float_t yprev = yg1;
252 Int_t nstep = 100;
253 Float_t dstep = TMath::Pi()/2.0 / (Float_t)nstep;
254 Float_t d;
255 for (Int_t istep = 1; istep < (nstep+1); istep++) {
256
257 d = istep * dstep;
258 Float_t x = xg1 + xg2 * TMath::Cos(d);
259 Float_t y = yg1 + yg2 * TMath::Sin(d);
260
261 fQuads.push_back(Reve::Quad(fFrameCol));
262 p = fQuads.back().vertices;
263 /*
264 p[0] = xprev; p[1] = yprev; p[2] = zg1;
265 p[3] = xprev; p[4] = yprev; p[5] = zg1;
266 p[6] = x; p[7] = y; p[8] = zg1;
267 p[9] = x; p[10] = y; p[11] = zg1;
268 */
269 // switch x <> z
270 p[0] = zg1; p[1] = yprev; p[2] = xprev;
271 p[3] = zg1; p[4] = yprev; p[5] = xprev;
272 p[6] = zg1; p[7] = y; p[8] = x;
273 p[9] = zg1; p[10] = y; p[11] = x;
274
275 xprev = x;
276 yprev = y;
277
278 }
279
280 fQuads.push_back(Reve::Quad(fFrameCol));
281 p = fQuads.back().vertices;
282 /*
283 p[0] = xprev; p[1] = yprev; p[2] = zg1;
284 p[3] = xprev; p[4] = yprev; p[5] = zg1;
285 p[6] = xg1; p[7] = yg1; p[8] = zg1;
286 p[9] = xg1; p[10] = yg1; p[11] = zg1;
287 */
288 // switch x <> z
289 p[0] = zg1; p[1] = yprev; p[2] = xprev;
290 p[3] = zg1; p[4] = yprev; p[5] = xprev;
291 p[6] = zg1; p[7] = yg1; p[8] = xg1;
292 p[9] = zg1; p[10] = yg1; p[11] = xg1;
293 } // end fCath != -3 , -4
294 } // end detElemId
295
296 }
297
298 if (fChamber>4) {
299
300 AliMpDEIterator it;
301 for ( it.First(fChamber-1); ! it.IsDone(); it.Next() ) {
302
303 Int_t detElemId = it.CurrentDE();
304
305 if (id > 0 && id != detElemId) continue;
306
307 //AliMpStationType stationType = AliMpDEManager::GetStationType(detElemId);
308
309 //printf("Detector element ID for chamber %d (trigger, stationType %s): %d \n",fChamber,StationTypeName(stationType).Data(),detElemId);
310
311 if ( segmentation->HasDE(detElemId) ) {
9ccbb58b 312 const AliMpVSegmentation* seg1
313 = AliMpSegmentation::Instance()->GetMpSegmentation(detElemId, 0);
34ea2f0a 314 if (!seg1) {
315 // Create mapping segmentation if old trigger segmentation
316 // (not using mapping)
9ccbb58b 317 seg1 = AliMpSegmentation::Instance()->GetMpSegmentation(detElemId, 0);
34ea2f0a 318 }
319 if (seg1) {
320
321 Float_t deltax = seg1->Dimensions().X();
322 Float_t deltay = seg1->Dimensions().Y();
323 Float_t xlocal1 = -deltax;
324 Float_t ylocal1 = -deltay;
325 Float_t xlocal2 = +deltax;
326 Float_t ylocal2 = +deltay;
327
328 //printf("Local corners: x1 = %f , y1 = %f x2 = %f y2 = %f \n",xlocal1,ylocal1,xlocal2,ylocal2);
329
330 kGeomTransformer->Local2Global(detElemId, xlocal1, ylocal1, 0, xg1, yg1, zg1);
331 kGeomTransformer->Local2Global(detElemId, xlocal2, ylocal2, 0, xg2, yg2, zg2);
332
333 //printf("Global corner 1: xg1 = %f , yg1 = %f zg1 = %f \n",xg1,yg1,zg1);
334 //printf("Global corner 2: xg2 = %f , yg2 = %f zg2 = %f \n",xg2,yg2,zg2);
335
336 if (fCath != -3 && fCath != -4) {
337 fQuads.push_back(Reve::Quad(fFrameCol));
338 Float_t* p = fQuads.back().vertices;
339 // the tilting direction now known...
340 /*
341 p[0] = xg1; p[1] = yg1; p[2] = zg1;
342 p[3] = xg1; p[4] = yg2; p[5] = zg1;
343 p[6] = xg2; p[7] = yg2; p[8] = zg2;
344 p[9] = xg2; p[10] = yg1; p[11] = zg2;
345 */
346 // switch x <> z
347 p[0] = zg1; p[1] = yg1; p[2] = xg1;
348 p[3] = zg1; p[4] = yg2; p[5] = xg1;
349 p[6] = zg2; p[7] = yg2; p[8] = xg2;
350 p[9] = zg2; p[10] = yg1; p[11] = xg2;
351 }
352 if (fCath == -3 || fCath == -4) {
353 // draw all pads in the trigger chambers
354 if (fChamber > 10) {
355
356 for (Int_t ic = 1; ic <= 2; ic++) {
357
358 if (ic != cat) continue;
359
9ccbb58b 360 const AliMpVSegmentation* seg3
361 = AliMpSegmentation::Instance()->GetMpSegmentation(detElemId, ic-1);
34ea2f0a 362 Int_t maxX = seg3->MaxPadIndexX();
363 Int_t maxY = seg3->MaxPadIndexY();
364 //printf("detElemId %d ic %d maxX %d maxY %d \n",detElemId,ic,maxX,maxY);
365 for (Int_t ix = 0; ix <= maxX; ix++) {
366 for (Int_t iy = 0; iy <= maxY; iy++) {
367
368 AliMpPad pad = seg3->PadByIndices(AliMpIntPair(ix,iy),kFALSE);
369
370 if (!pad.IsValid()) continue;
371
372 // get the pad position and dimensions
373 xlocal1 = pad.Position().X();
374 ylocal1 = pad.Position().Y();
375 xlocal2 = pad.Dimensions().X();
376 ylocal2 = pad.Dimensions().Y();
377
378 kGeomTransformer->Local2Global(detElemId, xlocal1, ylocal1, 0, xg1, yg1, zg1);
379 // (no transformation for pad dimensions)
380 xg2 = xlocal2;
381 yg2 = ylocal2;
382
383 Int_t pcolor = 0;
384 if (ic == 1) pcolor = 5;
385 if (ic == 2) pcolor = 5;
386
387 fQuads.push_back(Reve::Quad());
388 fQuads.back().ColorFromIdx(pcolor);
389 Float_t* p = fQuads.back().vertices;
390 // the tilting direction now known...
391 // switch x <> z
392 p[0] = zg1; p[1] = yg1-yg2; p[2] = xg1-xg2;
393 p[3] = zg1; p[4] = yg1+yg2; p[5] = xg1-xg2;
394 p[6] = zg1; p[7] = yg1+yg2; p[8] = xg1+xg2;
395 p[9] = zg1; p[10] = yg1-yg2; p[11] = xg1+xg2;
396
397 }
398 }
399
400 } // end "cathode" loop
401
402 } // end draw pads
403 } // end fCath == -3 , -4
404 }
405
406 }
407
408 } // end detElemId
409
410 }
411
412 } // end chamber loop
413
414}
415
416/**************************************************************************/
417void MUONModule::LoadQuadsDigits()
418{
4d7a67a6 419 //
420 // Draw digits
421 //
34ea2f0a 422
423 if (fDetElemId > 0 && fDetElemId != fID) return;
424
425 Int_t fChamber;
426
427 AliRunLoader *runLoader = Alieve::Event::AssertRunLoader();
428 runLoader->LoadgAlice();
429
430 AliMUON *pMUON = (AliMUON*)gAlice->GetModule("MUON");
431
432 const AliMUONGeometryTransformer* kGeomTransformer = pMUON->GetGeometryTransformer();
433
434 fChamber = fID/100;
435
436 /* D I S P L A Y D I G I T S */
437
438 // Display X-Y strips for the trigger chambers
439
440 Float_t adcmax = 1024; // default
441 if (fChamber<11) adcmax = 4096;
442
443 TClonesArray *digits;
444 Int_t ndigits;
445 digits = fInfo->GetDigits(fChamber);
446 ndigits = digits->GetEntriesFast();
447
448 AliMUONDigit *mdig;
449
450 Int_t fCathode = fCath;
451
452 for (Int_t id = 0; id < ndigits; id++) {
453 mdig = (AliMUONDigit*)digits->UncheckedAt(id);
454 if (mdig->Cathode() != fCathode-1) continue;
455
456 // get all needed parameters
457 Int_t ix=mdig->PadX();
458 Int_t iy=mdig->PadY();
459 Int_t detElemId=mdig->DetElemId();
460 Int_t charge = mdig->Signal();
461 Int_t index = Int_t(TMath::Log(charge)/(TMath::Log(adcmax)/22));
462 Int_t color = 261+index;
463 Int_t colorTrigger = 2;
464 if (color > 282) color = 282;
465
466 if (detElemId != fID) continue;
467
9ccbb58b 468 const AliMpVSegmentation* seg2
469 = AliMpSegmentation::Instance()->GetMpSegmentation(detElemId,fCathode-1);
34ea2f0a 470
471 AliMpPad pad = seg2->PadByIndices(AliMpIntPair(ix,iy),kTRUE);
472
473 //printf("Dig ix %d iy %d \n",ix,iy);
474
4d7a67a6 475 // time delay information
34ea2f0a 476 if (fChamber > 10) { // trigger chamber
477 Int_t sumCharge = 0;
478 Int_t n = mdig->Ntracks();
479 for (Int_t icharge = 0; icharge < n; icharge++) {
480 sumCharge = sumCharge+mdig->TrackCharge(icharge);
481 }
482 assert(sumCharge==mdig->Signal());
483 Int_t testCharge = sumCharge-(Int_t(sumCharge/n))*n;
484 if(sumCharge <= n || testCharge > 0) {
4d7a67a6 485 colorTrigger = 4;
34ea2f0a 486 } else {
487 colorTrigger = 5;
488 }
489 }
490
491 // get the pad position and dimensions
492 Float_t xlocal1 = pad.Position().X();
493 Float_t ylocal1 = pad.Position().Y();
494 Float_t xlocal2 = pad.Dimensions().X();
495 Float_t ylocal2 = pad.Dimensions().Y();
496
497 Float_t xg1, xg2, yg1, yg2, zg1;
498
499 kGeomTransformer->Local2Global(detElemId, xlocal1, ylocal1, 0, xg1, yg1, zg1);
500 // (no transformation for pad dimensions)
501 xg2 = xlocal2;
502 yg2 = ylocal2;
503
4d7a67a6 504 if (fChamber > 10) {
505 color = colorTrigger;
506 }
34ea2f0a 507
508 fQuads.push_back(Reve::Quad());
509 fQuads.back().ColorFromIdx(color);
510 Float_t* p = fQuads.back().vertices;
511 // the tilting direction now known...
512 /*
513 p[0] = xg1-xg2; p[1] = yg1-yg2; p[2] = zg1;
514 p[3] = xg1-xg2; p[4] = yg1+yg2; p[5] = zg1;
515 p[6] = xg1+xg2; p[7] = yg1+yg2; p[8] = zg1;
516 p[9] = xg1+xg2; p[10] = yg1-yg2; p[11] = zg1;
517 */
518 // switch x <> z
519 p[0] = zg1; p[1] = yg1-yg2; p[2] = xg1-xg2;
520 p[3] = zg1; p[4] = yg1+yg2; p[5] = xg1-xg2;
521 p[6] = zg1; p[7] = yg1+yg2; p[8] = xg1+xg2;
522 p[9] = zg1; p[10] = yg1-yg2; p[11] = xg1+xg2;
34ea2f0a 523 /*
4d7a67a6 524 if (fChamber < 11) {
34ea2f0a 525 printf("coordinates.............................. \n");
526 for (Int_t j = 0; j < 12; j++) {
527 printf("%f ",p[j]);
528 if ((j+1)%3 == 0) printf("\n");
529 }
4d7a67a6 530 }
34ea2f0a 531 */
532
533 } // end loop over digits
534
535 LoadQuadsChambers(fChamber,fChamber,fID,fCath);
536
537}
538
539/**************************************************************************/
540void MUONModule::LoadQuadsClusters()
541{
4d7a67a6 542 //
543 // Draw clusters
544 //
34ea2f0a 545
546 Int_t fChamber;
547
548 fChamber = fID/100;
549
550 LoadQuadsChambers(fChamber,fChamber,fID);
551
552 /* D I S P L A Y C L U S T E R S */
553
554 TClonesArray *clusters;
555 Int_t nclusters;
556 clusters = fInfo->GetClusters(fChamber);
557 if (clusters == 0) return;
558 nclusters = clusters->GetEntriesFast();
559
4d7a67a6 560 //Float_t zpos = AliMUONConstants::DefaultChamberZ(fChamber-1);
34ea2f0a 561
562 AliMUONRawCluster *cls;
563 for (Int_t iCls = 0; iCls < nclusters; iCls++) {
564
565 cls = (AliMUONRawCluster*)clusters->UncheckedAt(iCls);
566
567 if (cls->GetDetElemId() != fID) continue;
568
569 Float_t x = cls->GetX(0);
570 Float_t y = cls->GetY(0);
4d7a67a6 571 Float_t z = cls->GetZ(0);
34ea2f0a 572
573 Float_t dx = 1.0/2.0;
574 Float_t dy = 1.0/2.0;
575 Float_t r = TMath::Sqrt(dx*dx+dy*dy);
576 /*
577 // just an empty square
578 fQuads.push_back(Reve::Quad(5));
579 Float_t* p = fQuads.back().vertices;
580
581 //p[0] = x-dx; p[1] = y-dy; p[2] = z;
582 //p[3] = x-dx; p[4] = y+dy; p[5] = z;
583 //p[6] = x+dx; p[7] = y+dy; p[8] = z;
584 //p[9] = x+dx; p[10] = y-dy; p[11] = z;
585
586 // switch x <> z
587 p[0] = z; p[1] = y-dy; p[2] = x-dx;
588 p[3] = z; p[4] = y+dy; p[5] = x-dx;
589 p[6] = z; p[7] = y+dy; p[8] = x+dx;
590 p[9] = z; p[10] = y-dy; p[11] = x+dx;
591 */
592 Int_t nstep = 100;
593 Float_t dstep = 2.0*TMath::Pi() / (Float_t)nstep;
594 Float_t d;
595 for (Int_t istep = 1; istep < (nstep+1); istep++) {
596
597 d = istep * dstep;
598 Float_t xc = x + r * TMath::Cos(d);
599 Float_t yc = y + r * TMath::Sin(d);
600
601 fQuads.push_back(Reve::Quad(5));
602 Float_t* p = fQuads.back().vertices;
603
604 p[0] = z; p[1] = y; p[2] = x;
605 p[3] = z; p[4] = y; p[5] = x;
606 p[6] = z; p[7] = yc; p[8] = xc;
607 p[9] = z; p[10] = yc; p[11] = xc;
608
609 }
610
611 }
612
613}
614
615/**************************************************************************/
616void MUONModule::LoadQuadsTracks(Int_t id)
617{
4d7a67a6 618 //
619 // Draw tracks
620 //
34ea2f0a 621
622 /* D I S P L A Y T R A C K S */
623
624 TClonesArray * trackParamAtHit = 0;
625 TClonesArray *tracks;
626 Int_t ntracks;
627 tracks = fInfo->GetTracks();
628 if (tracks == 0) return;
629 ntracks = tracks->GetEntriesFast();
630
631 Float_t *p;
632
633 AliMUONTrack *recTrack = (AliMUONTrack*)tracks->At(id);
634
635 Float_t xRec, xRec0;
636 Float_t yRec, yRec0;
637 Float_t zRec, zRec0;
638
639 AliMUONTrackParam *trackParam = recTrack->GetTrackParamAtVertex();
640 xRec0 = trackParam->GetNonBendingCoor();
641 yRec0 = trackParam->GetBendingCoor();
642 zRec0 = trackParam->GetZ();
643
644 Int_t nTrackHits = recTrack->GetNTrackHits();
645 for (Int_t iHit = 0; iHit < nTrackHits; iHit++){
646 trackParamAtHit = recTrack->GetTrackParamAtHit();
647 trackParam = (AliMUONTrackParam*) trackParamAtHit->At(iHit);
648 xRec = trackParam->GetNonBendingCoor();
649 yRec = trackParam->GetBendingCoor();
650 zRec = trackParam->GetZ();
651
652 fQuads.push_back(Reve::Quad());
653 fQuads.back().ColorFromIdx(4);
654 p = fQuads.back().vertices;
655
656 p[0] = zRec0; p[1] = yRec0; p[2] = xRec0;
657 p[3] = zRec0; p[4] = yRec0; p[5] = xRec0;
658 p[6] = zRec; p[7] = yRec; p[8] = xRec;
659 p[9] = zRec; p[10] = yRec; p[11] = xRec;
660
661 xRec0 = xRec;
662 yRec0 = yRec;
663 zRec0 = zRec;
664
665 } // end loop rec. hits
666
667}
668