]> git.uio.no Git - u/mrichter/AliRoot.git/blob - RICH/AliRICHDisplay.cxx
Modifications needed by Root.03.01.06 (J.Chudoba)
[u/mrichter/AliRoot.git] / RICH / AliRICHDisplay.cxx
1 /**************************************************************************
2  * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
3  *                                                                        *
4  * Author: The ALICE Off-line Project.                                    *
5  * Contributors are mentioned in the code where appropriate.              *
6  *                                                                        *
7  * Permission to use, copy, modify and distribute this software and its   *
8  * documentation strictly for non-commercial purposes is hereby granted   *
9  * without fee, provided that the above copyright notice appears in all   *
10  * copies and that both the copyright notice and this permission notice   *
11  * appear in the supporting documentation. The authors make no claims     *
12  * about the suitability of this software for any purpose. It is          *
13  * provided "as is" without express or implied warranty.                  *
14  **************************************************************************/
15
16 /*
17   $Log$
18   Revision 1.14  2001/05/16 14:57:20  alibrary
19   New files for folders and Stack
20
21   Revision 1.13  2001/05/10 12:35:16  jbarbosa
22   Removed hit display, added rec. ring properties.
23
24   Revision 1.12  2001/03/14 18:15:03  jbarbosa
25   Changes to adapt to new IO.
26   Removed verbose output.
27
28   Revision 1.11  2001/02/27 15:21:34  jbarbosa
29   Transition to SDigits.
30
31   Revision 1.10  2001/02/13 20:18:48  jbarbosa
32   Corrected some more positioning of points. Changes in LoadDigits to accomodate the new IO.
33
34   Revision 1.9  2000/11/01 15:33:11  jbarbosa
35   Updated to handle both reconstruction algorithms.
36
37   Revision 1.8  2000/10/03 21:44:09  morsch
38   Use AliSegmentation and AliHit abstract base classes.
39
40   Revision 1.7  2000/10/02 21:28:12  fca
41   Removal of useless dependecies via forward declarations
42
43   Revision 1.6  2000/10/02 15:46:38  jbarbosa
44   Fixed forward declarations.
45
46   Revision 1.5  2000/06/30 16:49:34  dibari
47   Different call for ring drawing.
48
49   Revision 1.4  2000/06/12 15:21:08  jbarbosa
50   Cleaned up version.
51
52   Revision 1.3  2000/06/09 14:52:08  jbarbosa
53   New tentative ellipse drawing routine
54
55   Revision 1.1  2000/04/19 13:07:45  morsch
56   Digits, clusters and reconstruction results added.
57
58 */
59
60
61 //////////////////////////////////////////////////////////////////////////
62 //                                                                      //
63 // AliDisplay                                                           //
64 //                                                                      //
65 // Utility class to display ALICE outline, tracks, hits,..              //
66 //                                                                      //
67 //////////////////////////////////////////////////////////////////////////
68
69 #include <TROOT.h>
70 #include <TTree.h>
71 #include <TButton.h>
72 #include <TColor.h>
73 #include <TCanvas.h>
74 #include <TView.h>
75 #include <TText.h>
76 #include <TPolyMarker3D.h>
77 #include <TAtt3D.h>
78 #include <TAttLine.h>
79 #include <TPolyMarker.h>
80 #include <TPaveLabel.h>
81 #include <TPaveText.h>
82 #include <TList.h>
83 #include <TDiamond.h>
84 #include <TNode.h>
85 #include <TArc.h>
86 #include <TTUBE.h>
87 #include <TSlider.h>
88 #include <TGeometry.h>
89 #include <TSliderBox.h>
90 #include <TGaxis.h>
91 #include <TVirtualX.h>
92 #include <TMath.h>
93 #include <TRandom.h>
94 #include <X3DBuffer.h>
95 #include <TParticle.h>
96
97 #include "AliRun.h"
98 #include "AliPDG.h"
99 #include "AliDetector.h"
100 #include "AliRICH.h"
101 #include "AliRICHConst.h"
102 #include "AliRICHDisplay.h"
103 #include "AliRICHPoints.h"
104 #include "AliHeader.h"
105
106 #include "AliRICHHit.h"
107 #include "AliRICHCerenkov.h"
108 #include "AliRICHSDigit.h"
109 #include "AliRICHDigit.h"
110 #include "AliRICHRawCluster.h"
111 #include "AliRICHRecHit1D.h"
112 #include "AliRICHRecHit3D.h"
113 #include "AliRICHEllipse.h"
114
115 ClassImp(AliRICHDisplay)
116     
117
118 //____________________________________________________________________________
119 AliRICHDisplay::AliRICHDisplay()
120
121
122 // default constructor
123
124     fPoints = 0;
125     fPhits = 0;
126     fPCerenkovs = 0;
127     fCanvas = 0;
128     fRpoints = 0;
129     fRecpoints = 0; 
130 }
131
132 //_____________________________________________________________________________
133 AliRICHDisplay::AliRICHDisplay(Int_t size)
134 {
135 // Create an event display object.
136 // A canvas named "edisplay" is created with a vertical size in pixels
137 //
138 //    A QUICK Overview of the Event Display functions
139 //    ===============================================
140 //
141 //  The event display can ve invoked by executing the macro "display.C"
142 // A canvas like in the picture below will appear.
143 //
144 //  On the left side of the canvas, the following buttons appear:
145 //   *Next*       to move to the next event
146 //   *Previous*   to move to the previous event
147
148 //   *Pick*       Select this option to be able to point on a track with the
149 //                mouse. Once on the track, use the right button to select
150 //                an action. For example, select SetMarkerAttributes to
151 //                change the marker type/color/size for the track.
152 //   *Zoom*       Select this option (default) if you want to zoom.
153 //                To zoom, simply select the selected area with the left button.
154 //   *UnZoom*     To revert to the previous picture size.
155 //
156 //   slider R     On the left side, the vertical slider can be used to
157 //                set the default picture size.
158 //
159 //    When you are in Zoom mode, you can click on the black part of the canvas
160 //  to select special options with the right mouse button.
161
162 //
163 //  When you are in pick mode, you can "Inspect" the object pointed by the mouse.
164 //  When you are on a track, select the menu item "InspectParticle"
165 //  to display the current particle attributes.
166 //
167 //  You can activate the Root browser by selecting the Inspect menu
168 //  in the canvas tool bar menu. Then select "Start Browser"
169 //  This will open a new canvas with the browser. At this point, you may want
170 //  to display some histograms (from the Trees). Go to the "File" menu
171 //  of the browser and click on "New canvas".
172 //  In the browser, click on item "ROOT files" in the left pane.
173 //  Click on galice.root.
174 //  Click on TH
175 //  Click on TPC for example
176 //  Click on any variable (eg TPC.fX) to histogram the variable.
177 //
178 //   If you are lost, you can click on HELP in any Root canvas or browser.
179 //Begin_Html
180 /*
181   <img src="gif/AliRICHDisplay.gif">
182 */
183 //End_Html
184     
185     
186     fPad = 0;
187     
188     gAlice->SetDisplay(this);
189     
190     // Initialize display default parameters
191     SetRange();
192     
193     // Set front view by default
194     fTheta = 90;
195     fPhi   = 90;
196     fPsi   = 0;
197     fChamber = 1;
198     fCathode = 1;
199     //   fRzone   = 1.e10;
200     fDrawClusters  = kTRUE;
201     fDrawCoG       = kTRUE;
202     fDrawRecHits   = kTRUE;
203     fZoomMode      = 1;
204     fZooms         = 0;
205     fClustersCuts  = 0;
206     fPoints        = 0;
207     fPCerenkovs    = 0;
208     fPhits         = 0;
209     fRpoints       = 0;   
210     fRecpoints       = 0;
211     // Create colors
212     CreateColors();
213     // Create display canvas
214     Int_t ysize = size;
215     if (ysize < 100) ysize = 750;
216     Int_t xsize = Int_t(size*830./ysize);
217     fCanvas = new TCanvas("Canvas", "RICH Clusters Display",14,47,xsize,ysize);
218     fCanvas->ToggleEventStatus();
219     
220     // Create main display pad
221     fPad = new TPad("viewpad", "RICH display",0.15,0,0.9,1);
222     fPad->Draw();
223     fPad->Modified();
224     fPad->SetFillColor(1);
225     fPad->SetBorderSize(2);
226     
227     fCanvas->cd();
228     
229     // Create colors pad
230     fColPad = new TPad("colpad", "Colors pad",0.9,0,1,1);
231     fColPad->Draw();
232     fColPad->Modified();
233     fColPad->SetFillColor(19);
234     fColPad->SetBorderSize(2);
235     fColPad->cd();
236     DisplayColorScale();
237     
238     fCanvas->cd();
239     
240     // Create user interface control pad
241     DisplayButtons();
242     fCanvas->cd();
243     
244     // Create Range and mode pad
245     Float_t dxtr     = 0.15;
246     Float_t dytr     = 0.45;
247     fTrigPad = new TPad("trigger", "range and mode pad",0,0,dxtr,dytr);
248     fTrigPad->Draw();
249     fTrigPad->cd();
250     fTrigPad->SetFillColor(22);
251     fTrigPad->SetBorderSize(2);
252     fRangeSlider = new TSlider("range","range",0.7,0.42,0.9,0.98);
253     fRangeSlider->SetObject(this);
254     char pickmode[] = "gAlice->Display()->SetPickMode()";
255     Float_t db = 0.09;
256     fPickButton = new TButton("Pick",pickmode,0.05,0.32,0.65,0.32+db);
257     fPickButton->SetFillColor(38);
258     fPickButton->Draw();
259     char zoommode[] = "gAlice->Display()->SetZoomMode()";
260     fZoomButton = new TButton("Zoom",zoommode,0.05,0.21,0.65,0.21+db);
261     fZoomButton->SetFillColor(38);
262     fZoomButton->Draw();
263     fArcButton = new TArc(.8,fZoomButton->GetYlowNDC()+0.5*db,0.33*db);
264     fArcButton->SetFillColor(kGreen);
265     fArcButton->Draw();
266     char butUnzoom[] = "gAlice->Display()->UnZoom()";
267     TButton *button = new TButton("UnZoom",butUnzoom,0.05,0.05,0.95,0.15);
268     button->SetFillColor(38);
269     button->Draw();
270     AppendPad(); // append display object as last object to force selection
271     
272     fTrigPad->SetEditable(kFALSE);
273     fButtons->SetEditable(kFALSE);
274     fCanvas->cd();
275     fCanvas->Update();
276 }
277
278
279 //_____________________________________________________________________________
280 AliRICHDisplay::~AliRICHDisplay()
281 {
282     // Delete space point structure
283     if (fPoints) fPoints->Delete();
284     delete fPoints;
285     fPoints     = 0;
286     //
287     if (fPhits) fPhits->Delete();
288     delete fPhits;
289     fPhits     = 0;
290     //
291     if (fRpoints) fRpoints->Delete();
292     delete fRpoints;
293     fRpoints     = 0;
294     //
295     if (fRecpoints) fRecpoints->Delete();
296     delete fRecpoints;
297     fRecpoints     = 0;
298     //
299     if (fPCerenkovs) fPCerenkovs->Delete();
300     delete fPCerenkovs;
301     fPCerenkovs     = 0;
302 }
303
304 //_____________________________________________________________________________
305 void AliRICHDisplay::Clear(Option_t *)
306 {
307 //    Delete graphics temporary objects
308 }
309
310 //_____________________________________________________________________________
311 void AliRICHDisplay::DisplayButtons()
312 {
313 //    Create the user interface buttons
314     
315     
316     fButtons = new TPad("buttons", "newpad",0,0.45,0.15,1);
317     fButtons->Draw();
318     fButtons->SetFillColor(38);
319     fButtons->SetBorderSize(2);
320     fButtons->cd();
321     
322     //   Int_t butcolor = 33;
323     Float_t dbutton = 0.08;
324     Float_t y  = 0.96;
325     Float_t dy = 0.014;
326     Float_t x0 = 0.05;
327     Float_t x1 = 0.95;
328     
329     TButton *button;
330     char but1[] = "gAlice->Display()->ShowNextEvent(1)";
331     button = new TButton("Next",but1,x0,y-dbutton,x1,y);
332     button->SetFillColor(38);
333     button->Draw();
334     
335     y -= dbutton +dy;
336     char but2[] = "gAlice->Display()->ShowNextEvent(-1)";
337     button = new TButton("Previous",but2,x0,y-dbutton,x1,y);
338     button->SetFillColor(38);
339     button->Draw();
340
341     y -= dbutton +dy;
342     char but7[] = "gAlice->Display()->DrawViewGL()";
343     button = new TButton("OpenGL",but7,x0,y-dbutton,x1,y);
344     button->SetFillColor(38);
345     button->Draw();
346     
347     y -= dbutton +dy;
348     char but8[] = "gAlice->Display()->DrawViewX3D()";
349     button = new TButton("X3D",but8,x0,y-dbutton,x1,y);
350     button->SetFillColor(38);
351     button->Draw();
352     
353     // display logo
354     TDiamond *diamond = new TDiamond(0.05,0.015,0.95,0.22);
355     diamond->SetFillColor(50);
356     diamond->SetTextAlign(22);
357     diamond->SetTextColor(5);
358     diamond->SetTextSize(0.11);
359     diamond->Draw();
360     diamond->AddText(".. ");
361     diamond->AddText("ROOT");
362     diamond->AddText("RICH");
363     diamond->AddText("... ");
364     diamond->AddText(" ");
365 }
366
367 //_____________________________________________________________________________
368 void AliRICHDisplay::CreateColors()
369 {
370 //    Create the colors palette used to display clusters
371     
372     Int_t k,i;
373     Int_t color;
374     Float_t r,g,b;
375     
376     for (k=1;k<=5;k++) {
377         switch(k) {
378         case 1:
379             for (i=1;i<=5;i++) {
380                 r=1.;
381                 g=i*0.2;  
382                 b=0.;
383                 color=i;
384                 color=700+23-color;
385                 new TColor(color,r,g,b);
386             } 
387             break;
388         case 2:
389             for (i=1;i<=4;i++) {
390                 r=1.1-i*0.2;
391                 g=1.;  
392                 b=0.;
393                 color=i+5;
394                 color=700+23-color;
395                 new TColor(color,r,g,b);
396             } 
397             break;
398     case 3:
399         for (i=1;i<=4;i++) {
400             r=0.;
401             g=1.;  
402             b=i*0.2+0.2;
403             color=i+9;
404             color=700+23-color;
405             new TColor(color,r,g,b);
406         } 
407         break;
408         case 4:
409             for (i=1;i<=4;i++) {
410                 r=0.;
411                 g=1.1-i*0.2;  
412                 b=1.;
413                 color=i+13;
414                 color=700+23-color;
415                 new TColor(color,r,g,b);
416             } 
417             break;
418         case 5:
419             for (i=1;i<=5;i++) {
420                 r=i*0.2;
421                 g=0.;  
422                 b=1.;
423                 color=i+17;
424                 color=700+23-color;
425                 new TColor(color,r,g,b);
426             } 
427             break;
428         }
429     }
430 }
431
432 //_____________________________________________________________________________
433 void AliRICHDisplay::DisplayColorScale()
434 {
435
436 // Draw the color scale in the RICH display canvas
437     
438     Int_t i;
439     Int_t color;
440     Float_t xlow, ylow, xup, yup, hs;
441     Float_t x1, y1, x2, y2;
442     x1 = y1 = 0;
443     x2 = y2 = 20;
444     
445     gPad->SetFillColor(0);
446     gPad->Clear();
447     gPad->Range(x1,y1,x2,y2);
448     TText *text = new TText(0,0,"");
449     text->SetTextFont(61);
450     text->SetTextSize(0.03);
451     text->SetTextAlign(22);
452     
453     TBox *box;
454     char label[8];
455 //*-* draw colortable boxes
456     hs = (y2-y1)/Float_t(22);
457     xlow=x1+1;
458     xup=x2-9;
459     for (i=0;i<22;i++) {
460         ylow = y1 + hs*(Float_t(i));
461         yup  = y1 + hs*(Float_t(i+1));
462         color = 701+i;
463         Double_t logscale=Double_t(i+1)*(TMath::Log(adc_satm)/22);
464         Int_t scale=(Int_t)TMath::Exp(logscale);
465         sprintf(label,"%d",scale);
466         box = new TBox(xlow, ylow, xup, yup);
467         box->SetFillColor(color);
468         box->Draw();
469         text->DrawText(xup+4, 0.5*(ylow+yup),label);
470     }
471 }
472
473 //______________________________________________________________________________
474 Int_t AliRICHDisplay::DistancetoPrimitive(Int_t px, Int_t)
475 {
476 // Compute distance from point px,py to objects in event
477     
478     gPad->SetCursor(kCross);
479     
480     if (gPad == fTrigPad) return 9999;
481     
482     const Int_t kBig = 9999;
483     Int_t dist   = kBig;
484     Float_t xmin = gPad->GetX1();
485     Float_t xmax = gPad->GetX2();
486     Float_t dx   = 0.02*(xmax - xmin);
487     Float_t x    = gPad->AbsPixeltoX(px);
488     if (x < xmin+dx || x > xmax-dx) return dist;
489     if (fZoomMode) return 0;
490     else           return 7;
491 }
492
493 //_____________________________________________________________________________
494 void AliRICHDisplay::Draw(Option_t *)
495 {
496 //    Display current event
497
498     fPad->cd();
499     
500     DrawView(fTheta, fPhi, fPsi);      // see how to draw PGON+inner frames
501     
502     // Display the event number and title
503     fPad->cd();
504     DrawTitle();
505 }
506
507 //_____________________________________________________________________________
508 void AliRICHDisplay::DrawCoG()
509 {
510 //    Draw hits for RICH chambers
511
512     if (!fDrawCoG) return;
513     ResetRpoints();
514     for (Int_t chamber=0;chamber<kNCH;chamber++) {
515         LoadCoG(chamber,1);
516     }
517     
518     Int_t ncog, icog;
519     TObjArray *points;
520     AliRICHPoints *pm;
521     points = fRpoints;
522     if (!points) return;
523     ncog = points->GetEntriesFast();
524     for (icog=0; icog < ncog; icog++) {
525         pm = (AliRICHPoints*)points->UncheckedAt(icog);
526         if (!pm) continue;
527         pm->Draw();
528     }
529 }
530
531 void AliRICHDisplay::DrawRecHits()
532 {
533 //    Draw rec hits for RICH chambers
534
535     if (!fDrawRecHits) return;
536     //ResetRecpoints();
537     for (Int_t chamber=0;chamber<kNCH;chamber++) {
538         LoadRecHits(chamber,1);
539     }
540     
541     Int_t nrec, irec;
542     TObjArray *points;
543     AliRICHPoints *pm;
544     points = fRecpoints;
545     if (!points) return;
546     nrec = points->GetEntriesFast();
547     //printf("Nrec %d\n",nrec);
548     for (irec=0; irec < nrec; irec++) {
549         pm = (AliRICHPoints*)points->UncheckedAt(irec);
550         if (!pm) continue;
551         pm->Draw();
552     }
553 }
554
555 //_____________________________________________________________________________
556
557 void AliRICHDisplay::DrawCerenkovs()
558 {
559 //    Draw cerenkovs hits for RICH chambers
560     
561     LoadCerenkovs(fChamber);
562     //printf("\nDrawCerenkovs\n");
563     
564     Int_t ntracks, track;
565     TObjArray *cpoints;
566     AliRICHPoints *pm;
567     
568     fHitsCuts = 0;
569     cpoints = fPCerenkovs;
570     //printf ("Cpoints: %p",cpoints);
571     if (!cpoints) return;
572     ntracks = cpoints->GetEntriesFast();
573     //printf("DrawCerenkovs - ntracks %d \n",ntracks);
574     for (track=0;track<ntracks;track++) {
575         pm = (AliRICHPoints*)cpoints->UncheckedAt(track);
576         if (!pm) continue;
577         pm->Draw();
578         fHitsCuts += pm->GetN();
579     }
580 }
581
582 //_____________________________________________________________________________
583
584 void AliRICHDisplay::DrawClusters()
585 {
586 //    Draw clusterss for RICH chambers
587     
588     Int_t ndigits, digit;
589     TObjArray *points;
590     AliRICHPoints *pm;
591     
592     fClustersCuts = 0;
593     points = fPoints;
594     if (!points) return;
595     ndigits = points->GetEntriesFast();
596     for (digit=0;digit<ndigits;digit++){
597         pm = (AliRICHPoints*)points->UncheckedAt(digit);
598         if (!pm) continue;
599         pm->Draw();
600         Float_t *pxyz;
601         pxyz=pm->GetP();
602         for (Int_t im=0;im<3;im++) {
603             TMarker3DBox *marker=pm->GetMarker(im);
604             if (marker)
605                 marker->Draw();
606         }
607         fClustersCuts +=pm->GetN();
608     }
609 }
610
611 //_____________________________________________________________________________
612 void AliRICHDisplay::DrawHits()
613 {
614 //    Draw hits for RICH chambers
615     
616     LoadHits(fChamber);
617     
618     Int_t ntracks, track;
619     TObjArray *points;
620     AliRICHPoints *pm;
621     
622     fHitsCuts = 0;
623     points = Phits();
624     if (!fPhits) return;
625 //    ntracks = points->GetEntriesFast();
626     ntracks = fPhits->GetEntriesFast();
627     
628     //printf("DrawHits - ntracks %d \n",ntracks);
629     for (track=0;track<ntracks;track++) {
630         pm = (AliRICHPoints*)fPhits->UncheckedAt(track);
631         if (!pm) continue;
632         pm->Draw();
633         fHitsCuts += pm->GetN();
634     }
635 }
636
637
638 //_____________________________________________________________________________
639 void AliRICHDisplay::DrawTitle(Option_t *option)
640 {
641 //    Draw the event title
642     
643     Float_t xmin = gPad->GetX1();
644     Float_t xmax = gPad->GetX2();
645     Float_t ymin = gPad->GetY1();
646     Float_t ymax = gPad->GetY2();
647     Float_t dx   = xmax-xmin;
648     Float_t dy   = ymax-ymin;
649     
650     if (strlen(option) == 0) {
651         TPaveText *title = new TPaveText(xmin +0.01*dx, ymax-0.09*dy, xmin +0.5*dx, ymax-0.01*dy);
652         title->SetBit(kCanDelete);
653         title->SetFillColor(42);
654         title->Draw();
655         char ptitle[100];
656         sprintf(ptitle,"Alice event: %d, Run:%d",
657                 gAlice->GetHeader()->GetEvent(), gAlice->GetHeader()->GetRun());
658         title->AddText(ptitle);
659         Int_t nparticles = gAlice->Particles()->GetEntriesFast();
660         sprintf(ptitle,"Nparticles = %d Nhits = %d Npads fired = %d",
661                 nparticles, fHitsCuts,fClustersCuts);
662         title->AddText(ptitle);
663     } else {
664         TPaveLabel *label = 
665             new TPaveLabel(xmin +0.01*dx, ymax-0.07*dy, xmin +0.2*dx, ymax-0.01*dy,option);
666         label->SetBit(kCanDelete);
667         label->SetFillColor(42);
668         label->Draw();
669     }
670 }
671
672 //_____________________________________________________________________________
673 void AliRICHDisplay::DrawView(Float_t theta, Float_t phi, Float_t psi)
674 {
675 //    Draw a view of RICH clusters
676     
677    gPad->SetCursor(kWatch);
678    gPad->SetFillColor(1);
679    gPad->Clear();
680    
681    Int_t iret;
682    TView *view = new TView(1);
683    Float_t range = fRrange*fRangeSlider->GetMaximum();
684    view->SetRange(-range,-range,-range,range, range, range);
685    fZoomX0[0] = -1;
686    fZoomY0[0] = -1;
687    fZoomX1[0] =  1;
688    fZoomY1[0] =  1;
689    fZooms = 0;
690    
691    //Display RICH Chamber Geometry
692    gAlice->GetGeometry()->Draw("same");
693    
694    //add clusters to the pad
695    DrawClusters();
696    //DrawHits();
697 //   DrawCerenkovs();
698    if (gAlice->TreeR())
699      {
700        //printf("Calling DrawCoG\n");
701        DrawCoG();
702        //printf("Calling DrawRecHits\n");
703        DrawRecHits();
704      }
705    /*for (Int_t i=0;i<7;i++)
706      LoadRecHits(i,1);*/
707    
708    // add itself to the list (must be last)
709    AppendPad();
710    
711    view->SetView(phi, theta, psi, iret);
712 }
713
714 //______________________________________________________________________________
715 void AliRICHDisplay::ExecuteEvent(Int_t event, Int_t px, Int_t py)
716 {
717 //  Execute action corresponding to the mouse event
718     
719     static Float_t x0, y0, x1, y1;
720     
721    static Int_t pxold, pyold;
722    static Int_t px0, py0;
723    static Int_t linedrawn;
724    Float_t temp;
725    
726    if (px == 0 && py == 0) { //when called by sliders
727        if (event == kButton1Up) {
728          printf("Drawing event %d\n",event);
729          Draw();
730        }
731        return;
732    }
733    if (!fZoomMode && gPad->GetView()) {
734        gPad->GetView()->ExecuteRotateView(event, px, py);
735        return;
736    }
737
738    // something to zoom ?
739    gPad->SetCursor(kCross);
740    
741    switch (event) {
742        
743    case kButton1Down:
744        gVirtualX->SetLineColor(-1);
745        gPad->TAttLine::Modify();  //Change line attributes only if necessary
746        x0 = gPad->AbsPixeltoX(px);
747        y0 = gPad->AbsPixeltoY(py);
748        px0   = px; py0   = py;
749        pxold = px; pyold = py;
750        linedrawn = 0;
751        return;
752        
753    case kButton1Motion:
754        if (linedrawn) gVirtualX->DrawBox(px0, py0, pxold, pyold, TVirtualX::kHollow);
755        pxold = px;
756        pyold = py;
757        linedrawn = 1;
758        gVirtualX->DrawBox(px0, py0, pxold, pyold, TVirtualX::kHollow);
759        return;
760        
761    case kButton1Up:
762        gPad->GetCanvas()->FeedbackMode(kFALSE);
763        if (px == px0) return;
764        if (py == py0) return;
765        x1 = gPad->AbsPixeltoX(px);
766        y1 = gPad->AbsPixeltoY(py);
767        
768        if (x1 < x0) {temp = x0; x0 = x1; x1 = temp;}
769        if (y1 < y0) {temp = y0; y0 = y1; y1 = temp;}
770        gPad->Range(x0,y0,x1,y1);
771        if (fZooms < kMAXZOOM-1) {
772            fZooms++;
773            fZoomX0[fZooms] = x0;
774            fZoomY0[fZooms] = y0;
775            fZoomX1[fZooms] = x1;
776            fZoomY1[fZooms] = y1;
777        }
778        gPad->Modified(kTRUE);
779        return;
780    }
781    
782 }
783 //___________________________________________
784 void AliRICHDisplay::LoadCoG(Int_t chamber, Int_t cathode)
785 {
786 // Read raw clusters info and store x,y,z info in arrays fRpoints
787 // Loop on all detectors
788
789    if (chamber > 6) return;
790
791    //printf("Entering LoadCoG\n");
792
793
794    AliRICH *pRICH  = (AliRICH*)gAlice->GetModule("RICH");
795    AliRICHChamber*  iChamber;
796
797    TClonesArray *pRICHrawclust  = pRICH->RawClustAddress(chamber);
798    //printf ("Chamber:%d has adress:%p\n", chamber, pRICHrawclust );
799    if (pRICHrawclust == 0) return;
800
801    pRICH->ResetRawClusters();
802
803
804    Int_t nent=(Int_t)gAlice->TreeR()->GetEntries();
805    gAlice->TreeR()->GetEvent(nent-1+cathode-1);
806    Int_t nrawcl = pRICHrawclust->GetEntriesFast();
807    //printf ("nrawcl:%d\n",nrawcl);
808    if (nrawcl == 0) return;
809    if (fRpoints == 0) fRpoints = new TObjArray(nrawcl);
810    
811    iChamber = &(pRICH->Chamber(chamber));
812    AliRICHRawCluster  *mRaw;
813    AliRICHPoints *points = 0;
814    //
815    //loop over all raw clusters and store their position
816    points = new AliRICHPoints(nrawcl);
817    for (Int_t iraw=0;iraw<nrawcl;iraw++) {
818        mRaw   = (AliRICHRawCluster*)pRICHrawclust->UncheckedAt(iraw);
819        fRpoints->AddAt(points,iraw);
820        points->SetMarkerColor(3);
821        points->SetMarkerStyle(3);
822        points->SetMarkerSize(1.);
823        points->SetParticle(-1);
824        points->SetHitIndex(-1);
825        points->SetTrackIndex(-1);
826        points->SetDigitIndex(-1);
827        Float_t  vectorLoc[3]={mRaw->fX,5,mRaw->fY};
828        Float_t  vectorGlob[3];
829        iChamber->LocaltoGlobal(vectorLoc,vectorGlob);
830        points->SetPoint(iraw,vectorGlob[0],vectorGlob[1],vectorGlob[2]);
831    }
832 }
833 //___________________________________________
834 void AliRICHDisplay::LoadRecHits(Int_t chamber, Int_t cathode)
835 {
836 // Read rec. hits info 
837 // Loop on all detectors
838
839    if (chamber > 6) return;
840
841    ///printf("Entering LoadRecHits\n");
842
843
844    AliRICH *pRICH  = (AliRICH*)gAlice->GetModule("RICH");
845    AliRICHChamber*  iChamber;
846
847    TClonesArray *pRICHrechits1D  = pRICH->RecHitsAddress1D(chamber);
848    //printf ("Chamber:%d\n", chamber);
849    if (pRICHrechits1D != 0)
850      {
851
852        //RICH->ResetRecHits();
853
854
855        Int_t nent1D=(Int_t)gAlice->TreeR()->GetEntries();
856        gAlice->TreeR()->GetEvent(nent1D-1+cathode-1);
857        Int_t nrechits1D = pRICHrechits1D->GetEntriesFast();
858        //printf ("nrechits1D:%d\n",nrechits1D);
859        if (nrechits1D != 0)
860          {
861            if (fRecpoints == 0) fRecpoints = new TObjArray(50);
862            
863            iChamber = &(pRICH->Chamber(chamber));
864            AliRICHRecHit1D  *mRec1D;
865            AliRICHPoints *points1D = 0;
866            //AliRICHEllipse *ellipse = 0;
867            //
868            //loop over all rechits and store their position  
869            
870            points1D = new AliRICHPoints(nrechits1D);
871            for (Int_t irec=0;irec<nrechits1D;irec++) {
872              mRec1D   = (AliRICHRecHit1D*)pRICHrechits1D->UncheckedAt(irec);
873              fRecpoints->AddAt(points1D,irec);
874              points1D->SetMarkerColor(38);
875              points1D->SetMarkerStyle(8);
876              points1D->SetMarkerSize(1.);
877              points1D->SetParticle(-1);
878              points1D->SetHitIndex(-1);
879              points1D->SetTrackIndex(-1);
880              points1D->SetDigitIndex(-1);
881              Float_t  vectorLoc[3]={mRec1D->fX,5,mRec1D->fY};
882              Float_t  vectorGlob[3];
883              iChamber->LocaltoGlobal(vectorLoc,vectorGlob);
884              points1D->SetPoint(irec,vectorGlob[0],vectorGlob[1],vectorGlob[2]);
885              //Float_t theta = iChamber->GetRotMatrix()->GetTheta();
886              //Float_t phi   = iChamber->GetRotMatrix()->GetPhi();         
887              //ellipse=new TEllipse(vectorGlob[0],vectorGlob[2],10,10,0,360,phi);
888              //printf("Generating ellipse %d\n",irec);
889              AliRICHEllipse *ellipse=new AliRICHEllipse(mRec1D->fX,mRec1D->fY,mRec1D->fOmega,mRec1D->fTheta,mRec1D->fPhi,mRec1D->fEmissPoint);
890              printf("Ring at x:%f, y:%f - Omega:%f rad, theta:%3.1f deg, phi:%3.1f deg\n",mRec1D->fX,mRec1D->fY,mRec1D->fOmega,mRec1D->fTheta*180/TMath::Pi(),mRec1D->fPhi*180/TMath::Pi());
891              printf("fEmissPoint:%f\n",mRec1D->fEmissPoint);
892              ellipse->CerenkovRingDrawing(chamber,irec);
893              //ellipse->SetFillStyle(1001);
894              ellipse->SetMarkerColor(38);
895              ellipse->Draw();
896              //marker->SetRefObject((TObject*)points1D);
897              //points1D->Set3DMarker(0, marker); 
898            }
899          }
900      }
901
902    TClonesArray *pRICHrechits3D  = pRICH->RecHitsAddress3D(chamber);
903    //printf ("Chamber:%d\n", chamber);
904    if (pRICHrechits3D != 0)
905      {
906        
907        //RICH->ResetRecHits();
908        
909        
910        Int_t nent3D=(Int_t)gAlice->TreeR()->GetEntries();
911        gAlice->TreeR()->GetEvent(nent3D-1+cathode-1);
912        Int_t nrechits3D = pRICHrechits3D->GetEntriesFast();
913        //printf ("nrechits3D:%d\n",nrechits3D);
914        if (nrechits3D != 0)
915          {
916            if (fRecpoints == 0) fRecpoints = new TObjArray(50);
917            
918            iChamber = &(pRICH->Chamber(chamber));
919            AliRICHRecHit3D  *mRec3D;
920            AliRICHPoints *points3D = 0;
921            //AliRICHEllipse *ellipse = 0;
922            //
923            //loop over all rechits and store their position  
924            
925            points3D = new AliRICHPoints(nrechits3D);
926            for (Int_t irec=0;irec<nrechits3D;irec++) {
927              mRec3D   = (AliRICHRecHit3D*)pRICHrechits3D->UncheckedAt(irec);
928              fRecpoints->AddAt(points3D,irec);
929              points3D->SetMarkerColor(42);
930              points3D->SetMarkerStyle(8);
931              points3D->SetMarkerSize(1.);
932              points3D->SetParticle(-1);
933              points3D->SetHitIndex(-1);
934              points3D->SetTrackIndex(-1);
935              points3D->SetDigitIndex(-1);
936              Float_t  vectorLoc[3]={mRec3D->fX,5,mRec3D->fY};
937              Float_t  vectorGlob[3];
938              iChamber->LocaltoGlobal(vectorLoc,vectorGlob);
939              points3D->SetPoint(irec,vectorGlob[0],vectorGlob[1],vectorGlob[2]);
940              //Float_t theta = iChamber->GetRotMatrix()->GetTheta();
941              //Float_t phi   = iChamber->GetRotMatrix()->GetPhi();         
942              //ellipse=new TEllipse(vectorGlob[0],vectorGlob[2],10,10,0,360,phi);
943              //printf("Generating ellipse %d\n",irec);
944              AliRICHEllipse *ellipse=new AliRICHEllipse(mRec3D->fX,mRec3D->fY,mRec3D->fOmega,mRec3D->fTheta,mRec3D->fPhi,0.75);
945              printf("Ring at x:%f, y:%f - Omega:%f rad, theta:%3.1f deg, phi:%3.1f deg\n",mRec3D->fX,mRec3D->fY,mRec3D->fOmega,mRec3D->fTheta*180/TMath::Pi(),mRec3D->fPhi*180/TMath::Pi());
946              ellipse->CerenkovRingDrawing(chamber,irec);
947              //ellipse->SetFillStyle(1001);
948              ellipse->SetMarkerColor(42);
949              ellipse->Draw();
950              //marker->SetRefObject((TObject*)points3D);
951              //points3D->Set3DMarker(0, marker); 
952            }
953          }
954      }
955 }
956 //___________________________________________
957 void AliRICHDisplay::LoadDigits()
958 {
959 // Read digits info and store x,y,z info in arrays fPoints
960 // Loop on all detectors
961     
962    ResetPoints();
963    AliRICH *pRICH  = (AliRICH*)gAlice->GetDetector("RICH");
964    AliRICHChamber*       iChamber;
965    AliSegmentation*      segmentation;
966    Int_t nAllDigits=0;
967    Int_t ich;
968
969    //printf("Entering LoadDigits\n");
970
971    if (gAlice->TreeD())
972      {
973    
974        for (ich=0; ich<kNCH; ich++) {
975          TClonesArray *pRICHdigits  = pRICH->DigitsAddress(ich);
976          //printf ("Chamber:%d has adress:%p\n", ich, pRICHdigits );
977          if (pRICHdigits == 0) continue;
978          gAlice->ResetDigits();
979          gAlice->TreeD()->GetEvent(0);
980          Int_t ndigits = pRICHdigits->GetEntriesFast();
981          //printf("ndigits:%d\n",ndigits);
982          nAllDigits+=ndigits;
983        }
984        
985        if (fPoints == 0) fPoints = new TObjArray(nAllDigits);   
986        Int_t counter=0;
987        for (ich=0; ich<kNCH; ich++) {
988          TClonesArray *pRICHdigits  = pRICH->DigitsAddress(ich);
989          if (pRICHdigits == 0) continue;
990          gAlice->ResetDigits();
991          gAlice->TreeD()->GetEvent(0);
992          Int_t ndigits = pRICHdigits->GetEntriesFast();
993          if (ndigits == 0) continue;
994          iChamber = &(pRICH->Chamber(ich));
995          segmentation=iChamber->GetSegmentationModel();
996          Float_t dpx  = segmentation->Dpx();
997          Float_t dpy  = segmentation->Dpy();
998          
999          //printf("Dpx:%d, Dpy:%d\n",dpx,dpy);
1000          
1001          AliRICHDigit  *mdig;
1002          AliRICHPoints *points = 0;
1003          TMarker3DBox  *marker = 0;
1004          //
1005          //loop over all digits and store their position
1006          Int_t npoints=1;
1007          
1008          for (Int_t digit=0;digit<ndigits;digit++) {
1009            mdig    = (AliRICHDigit*)pRICHdigits->UncheckedAt(digit);
1010            points = new AliRICHPoints(npoints);
1011            fPoints->AddAt(points,counter);
1012            counter++;
1013            Int_t charge=mdig->fSignal;
1014            Int_t index=Int_t(TMath::Log(charge)/(TMath::Log(adc_satm)/22));
1015            Int_t color=701+index;
1016            if (color>722) color=722;
1017            points->SetMarkerColor(color);
1018            points->SetMarkerStyle(21);
1019            points->SetMarkerSize(0.5);
1020            Float_t xpad, ypad, zpad;
1021            segmentation->GetPadC(mdig->fPadX, mdig->fPadY,xpad, ypad, zpad);
1022            Float_t vectorLoc[3]={xpad,5,ypad};
1023            Float_t  vectorGlob[3];
1024            iChamber->LocaltoGlobal(vectorLoc,vectorGlob);
1025            points->SetParticle(-1);
1026            points->SetHitIndex(-1);
1027            points->SetTrackIndex(-1);
1028            points->SetDigitIndex(digit);
1029            points->SetPoint(0,vectorGlob[0],vectorGlob[1],vectorGlob[2]);
1030            //printf("Y position (digit): %f\n", vectorGlob[1]);
1031            
1032            segmentation->GetPadC(mdig->fPadX, mdig->fPadY, xpad, ypad, zpad);
1033            Float_t theta = iChamber->GetRotMatrix()->GetTheta();
1034            Float_t phi   = iChamber->GetRotMatrix()->GetPhi();     
1035            marker=new TMarker3DBox(vectorGlob[0],vectorGlob[1],vectorGlob[2],
1036                                    dpy/2,0,dpx/2,theta,phi);
1037            marker->SetLineColor(2);
1038            marker->SetFillStyle(1001);
1039            marker->SetFillColor(color);
1040            marker->SetRefObject((TObject*)points);
1041            points->Set3DMarker(0, marker);
1042          } // loop over digits
1043        } // loop over chambers 
1044      } //if TreeD
1045 }
1046
1047
1048 //___________________________________________
1049 void AliRICHDisplay::LoadHits(Int_t chamber)
1050 {
1051 // Read hits info and store x,y,z info in arrays fPhits
1052 // Loop on all detectors
1053     
1054     
1055     fChamber=chamber; 
1056     ResetPhits();
1057     
1058     AliRICH *pRICH  = (AliRICH*)gAlice->GetDetector("RICH");
1059     AliRICHChamber*  iChamber;
1060     
1061     iChamber = &(pRICH->Chamber(chamber-1));
1062     Int_t ntracks = (Int_t)gAlice->TreeH()->GetEntries();
1063     Int_t track;
1064     
1065     if (fPhits == 0) fPhits = new TObjArray(ntracks);
1066     //TVector *xp = new TVector(1000);
1067     //TVector *yp = new TVector(1000);
1068     //TVector *zp = new TVector(1000);
1069     //TVector *ptrk = new TVector(1000);
1070     //TVector *phit = new TVector(1000);
1071     Int_t nAllHits=0;
1072     for (track=0; track<ntracks;track++) {
1073         gAlice->ResetHits();
1074         gAlice->TreeH()->GetEvent(track);
1075         TClonesArray *pRICHhits  = pRICH->Hits();
1076         if (pRICHhits == 0) return;
1077         Int_t nhits = pRICHhits->GetEntriesFast();
1078         nAllHits+=nhits;
1079     }
1080
1081     fPhits = new TObjArray(nAllHits);
1082
1083     Int_t npoints=0;
1084     for (track=0; track<ntracks;track++) {
1085         gAlice->ResetHits();
1086         gAlice->TreeH()->GetEvent(track);
1087         TClonesArray *pRICHhits  = pRICH->Hits();
1088         if (pRICHhits == 0) return;
1089         Int_t nhits = pRICHhits->GetEntriesFast();
1090         if (nhits == 0) continue;
1091         AliRICHHit *mHit;
1092         AliRICHPoints *points = 0;
1093         for (Int_t hit=0;hit<nhits;hit++) {
1094             points = new AliRICHPoints(1);
1095             fPhits->AddAt(points,npoints);
1096             mHit = (AliRICHHit*)pRICHhits->UncheckedAt(hit);
1097             TParticle *current = (TParticle*)gAlice->Particle(mHit->Track());
1098             if (current->GetPdgCode() == 50000050) {
1099                 points->SetMarkerColor(kBlue);
1100             } else if (current->GetPdgCode() == 50000051) {
1101                 points->SetMarkerColor(kYellow);
1102             } else {
1103                 points->SetMarkerColor(kRed);
1104             }
1105             points->SetMarkerStyle(5);
1106             points->SetMarkerSize(1.);
1107             points->SetParticle(mHit->Track());
1108             points->SetHitIndex(hit);
1109             points->SetTrackIndex(track);
1110             points->SetDigitIndex(-1);
1111             points->SetPoint(hit,mHit->X(), mHit->Y(), mHit->Z());
1112             //printf("Y position: %f\n", mHit->Y());
1113             npoints++;
1114         }
1115     }
1116 }
1117
1118 //_____________________________________________________________________________
1119
1120 void AliRICHDisplay::LoadCerenkovs(Int_t chamber)
1121 {
1122 // Read cerenkov hits info and store x,y,z info in array fPCerenkovs
1123 // Loop on all detectors
1124     
1125     fChamber=chamber; 
1126     ResetPCerenkovs();
1127     
1128     AliRICH *pRICH  = (AliRICH*)gAlice->GetDetector("RICH");
1129     AliRICHChamber*  iChamber;
1130     
1131     iChamber = &(pRICH->Chamber(chamber-1));
1132     
1133     pRICH->SetTreeAddress();
1134     Int_t ntracks = (Int_t)gAlice->TreeH()->GetEntries();
1135     
1136     if (fPCerenkovs == 0) fPCerenkovs = new TObjArray(ntracks);
1137     TVector *xp = new TVector(1000);
1138     TVector *yp = new TVector(1000);
1139     TVector *zp = new TVector(1000);
1140     TVector *ptrk = new TVector(1000);
1141     TVector *phit = new TVector(1000);
1142     for (Int_t track=0; track<ntracks;track++) {
1143         gAlice->ResetHits();
1144         gAlice->TreeH()->GetEvent(track);
1145         TClonesArray *pRICHCerenkovs  = pRICH->Cerenkovs();
1146         if (pRICHCerenkovs == 0) return;
1147         Int_t nhits = pRICHCerenkovs->GetEntriesFast();
1148         if (nhits == 0) continue;
1149         AliRICHCerenkov *mCerenkov;
1150         AliRICHPoints *cpoints = 0;
1151         Int_t npoints=0;
1152         
1153         
1154 //Display Cerenkov hits in blue
1155         
1156         for (Int_t hit=0;hit<nhits;hit++) {
1157             mCerenkov = (AliRICHCerenkov*)pRICHCerenkovs->UncheckedAt(hit);
1158             (*xp)(npoints)=mCerenkov->X();
1159             (*yp)(npoints)=mCerenkov->Y();
1160             (*zp)(npoints)=mCerenkov->Z();
1161             (*ptrk)(npoints)=Float_t(mCerenkov->GetTrack());
1162             (*phit)(npoints)=Float_t(hit);
1163             npoints++;
1164         }
1165         if (npoints == 0) continue;
1166         cpoints = new AliRICHPoints(npoints);
1167         for (Int_t p=0;p<npoints;p++) {
1168             cpoints->SetMarkerColor(kBlue);
1169             cpoints->SetMarkerStyle(5);
1170             cpoints->SetMarkerSize(1.);
1171             cpoints->SetParticle(Int_t((*ptrk)(p)));
1172             cpoints->SetHitIndex(Int_t((*phit)(p)));
1173             cpoints->SetTrackIndex(track);
1174             cpoints->SetDigitIndex(-1);
1175             cpoints->SetPoint(p,(*xp)(p),(*yp)(p),(*zp)(p));
1176         }
1177         xp->Zero();
1178         yp->Zero();
1179         ptrk->Zero();
1180         phit->Zero();
1181         fPCerenkovs->AddAt(cpoints,track);
1182     }
1183 }
1184
1185 //_____________________________________________________________________________
1186 void AliRICHDisplay::Paint(Option_t *)
1187 {
1188 //    Paint miscellaneous items
1189
1190 }
1191
1192 //_____________________________________________________________________________
1193 void AliRICHDisplay::SetPickMode()
1194 {
1195
1196 // Toggle pick mode
1197
1198     fZoomMode = 0;
1199     
1200     fArcButton->SetY1(fPickButton->GetYlowNDC()+0.5*fPickButton->GetHNDC());
1201     fTrigPad->Modified();
1202 }
1203
1204 //_____________________________________________________________________________
1205 void AliRICHDisplay::SetZoomMode()
1206 {
1207
1208 // Toggle Zoom mode
1209
1210     fZoomMode = 1;
1211     
1212     fArcButton->SetY1(fZoomButton->GetYlowNDC()+0.5*fZoomButton->GetHNDC());
1213     fTrigPad->Modified();
1214 }
1215
1216 //_____________________________________________________________________________
1217 void AliRICHDisplay::SetChamberAndCathode(Int_t chamber, Int_t cathode)
1218 {
1219 // Set chamber and cathode number
1220     fChamber = chamber;
1221     fCathode = cathode;
1222     
1223     //printf("SetChamberAndCathode - fChamber fCathode %d %d\n",fChamber,fCathode);
1224     if (!fPad) return;
1225     fPad->Clear();
1226     LoadDigits();
1227     Draw();
1228 }
1229
1230 //_____________________________________________________________________________
1231 void AliRICHDisplay::SetRange(Float_t rrange, Float_t zrange)
1232 {
1233 // Set view range along R and Z
1234     fRrange = rrange;
1235     fZrange = zrange;
1236     
1237    if (!fPad) return;
1238    fPad->Clear();
1239    Draw();
1240 }
1241
1242 //_____________________________________________________________________________
1243 void AliRICHDisplay::SetView(Float_t theta, Float_t phi, Float_t psi)
1244 {
1245 //  change viewing angles for current event
1246     
1247     fPad->cd();
1248     fPhi   = phi;
1249     fTheta = theta;
1250     fPsi   = psi;
1251     Int_t iret = 0;
1252     
1253     TView *view = gPad->GetView();
1254     if (view) view->SetView(fPhi, fTheta, fPsi, iret);
1255     else      Draw();
1256     
1257     gPad->Modified();
1258 }
1259
1260 //_____________________________________________________________________________
1261 void AliRICHDisplay::ShowNextEvent(Int_t delta)
1262 {
1263 //  Display (current event_number+delta)
1264 //    delta =  1  shown next event
1265 //    delta = -1 show previous event
1266     
1267     if (delta) {
1268         gAlice->Clear();
1269         Int_t currentEvent = gAlice->GetHeader()->GetEvent();
1270         Int_t newEvent     = currentEvent + delta;
1271         gAlice->GetEvent(newEvent);
1272         if (!gAlice->TreeD()) return; 
1273     }
1274     LoadDigits();
1275     DrawClusters();
1276     fPad->cd(); 
1277     Draw();
1278
1279   
1280 }
1281
1282 //______________________________________________________________________________
1283 void AliRICHDisplay::UnZoom()
1284 {
1285
1286 // Return to previous zoom factor
1287
1288     if (fZooms <= 0) return;
1289     fZooms--;
1290     TPad *pad = (TPad*)gPad->GetPadSave();
1291     pad->Range(fZoomX0[fZooms],fZoomY0[fZooms], fZoomX1[fZooms],fZoomY1[fZooms]);
1292     pad->Modified();
1293 }
1294
1295 //_____________________________________________________________________________
1296 void AliRICHDisplay::ResetPoints()
1297 {
1298     //
1299     // Reset array of points
1300     //
1301     if (fPoints) {
1302         fPoints->Delete();
1303         delete fPoints;
1304         fPoints = 0;
1305   }
1306 }
1307 //_____________________________________________________________________________
1308 void AliRICHDisplay::ResetRpoints()
1309 {
1310   //
1311   // Reset array of points
1312   //
1313   if (fRpoints) {
1314     fRpoints->Delete();
1315     delete fRpoints;
1316     fRpoints = 0;
1317   }
1318 }
1319 //_____________________________________________________________________________
1320 void AliRICHDisplay::ResetRecpoints()
1321 {
1322   //
1323   // Reset array of points
1324   //
1325   if (fRecpoints) {
1326     fRecpoints->Delete();
1327     delete fRecpoints;
1328     fRecpoints = 0;
1329   }
1330 }
1331 //_____________________________________________________________________________
1332 void AliRICHDisplay::ResetPhits()
1333 {
1334     //
1335     // Reset array of points
1336     //
1337     if (fPhits) {
1338         fPhits->Delete();
1339         delete fPhits;
1340         fPhits = 0;
1341     }
1342 }
1343 //_____________________________________________________________________________
1344 void AliRICHDisplay::ResetPCerenkovs()
1345 {
1346     //
1347     // Reset array of points
1348     //
1349     if (fPCerenkovs) {
1350         fPCerenkovs->Delete();
1351         delete fPCerenkovs;
1352         fPCerenkovs = 0;
1353     }
1354 }
1355
1356 //_____________________________________________________________________________
1357
1358 void AliRICHDisplay::DrawViewGL()
1359 {
1360 //    Draw current view using OPENGL
1361
1362    TPad *pad = (TPad*)gPad->GetPadSave();
1363    pad->cd();
1364    TView *view = pad->GetView();
1365    if (!view) return;
1366    pad->x3d("OPENGL");
1367 }
1368
1369 //_____________________________________________________________________________
1370 void AliRICHDisplay::DrawViewX3D()
1371 {
1372 //    Draw current view using X3D
1373
1374    TPad *pad = (TPad*)gPad->GetPadSave();
1375    pad->cd();
1376    TView *view = pad->GetView();
1377    if (!view) return;
1378    pad->x3d();
1379 }