1 /**************************************************************************
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
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 **************************************************************************/
17 //////////////////////////////////////////////////////////////////////////
21 // Utility class to display ALICE outline, tracks, hits,.. //
23 //////////////////////////////////////////////////////////////////////////
32 #include <TPolyMarker3D.h>
35 #include <TPolyMarker.h>
36 #include <TPaveLabel.h>
37 #include <TPaveText.h>
44 #include <TGeometry.h>
45 #include <TSliderBox.h>
47 #include <TVirtualX.h>
50 #include <X3DBuffer.h>
51 #include <TParticle.h>
52 #include "AliRICHChamber.h"
55 #include "AliDetector.h"
57 #include "AliRICHDisplay.h"
58 #include "AliRICHPoints.h"
59 #include "AliHeader.h"
61 #include "AliRICHSDigit.h"
64 ClassImp(AliRICHDisplay)
67 //____________________________________________________________________________
68 AliRICHDisplay::AliRICHDisplay()
71 // default constructor
81 //_____________________________________________________________________________
82 AliRICHDisplay::AliRICHDisplay(Int_t size)
87 gAlice->SetDisplay(this);
89 // Initialize display default parameters
92 // Set front view by default
93 fTheta = 90; //inclined HMPID
94 fPhi = 30; //inclined HMPID
95 //fTheta = 90; //normal HMPID
96 //fPhi = 90; //normal HMPID
101 fDrawClusters = kTRUE;
103 fDrawRecHits = kTRUE;
114 // Create display canvas
116 if (ysize < 100) ysize = 750;
117 Int_t xsize = Int_t(size*830./ysize);
118 fCanvas = new TCanvas("Canvas", "RICH Clusters Display",14,47,xsize,ysize);
119 fCanvas->ToggleEventStatus();
121 // Create main display pad
122 fPad = new TPad("viewpad", "RICH display",0.15,0,0.9,1);
125 fPad->SetFillColor(1);
126 fPad->SetBorderSize(2);
131 fColPad = new TPad("colpad", "Colors pad",0.9,0,1,1);
134 fColPad->SetFillColor(19);
135 fColPad->SetBorderSize(2);
141 // Create user interface control pad
145 // Create Range and mode pad
148 fTrigPad = new TPad("trigger", "range and mode pad",0,0,dxtr,dytr);
151 fTrigPad->SetFillColor(22);
152 fTrigPad->SetBorderSize(2);
153 fRangeSlider = new TSlider("range","range",0.7,0.42,0.9,0.98);
154 fRangeSlider->SetObject(this);
155 char pickmode[] = "gAlice->Display()->SetPickMode()";
157 fPickButton = new TButton("Pick",pickmode,0.05,0.32,0.65,0.32+db);
158 fPickButton->SetFillColor(38);
160 char zoommode[] = "gAlice->Display()->SetZoomMode()";
161 fZoomButton = new TButton("Zoom",zoommode,0.05,0.21,0.65,0.21+db);
162 fZoomButton->SetFillColor(38);
164 fArcButton = new TArc(.8,fZoomButton->GetYlowNDC()+0.5*db,0.33*db);
165 fArcButton->SetFillColor(kGreen);
167 char butUnzoom[] = "gAlice->Display()->UnZoom()";
168 TButton *button = new TButton("UnZoom",butUnzoom,0.05,0.05,0.95,0.15);
169 button->SetFillColor(38);
171 AppendPad(); // append display object as last object to force selection
173 fTrigPad->SetEditable(kFALSE);
174 fButtons->SetEditable(kFALSE);
180 //_____________________________________________________________________________
181 AliRICHDisplay::~AliRICHDisplay()
183 // Delete space point structure
184 if (fPoints) fPoints->Delete();
188 if (fPhits) fPhits->Delete();
192 if (fRpoints) fRpoints->Delete();
196 if (fRecpoints) fRecpoints->Delete();
200 if (fPCerenkovs) fPCerenkovs->Delete();
205 //_____________________________________________________________________________
206 void AliRICHDisplay::Clear(Option_t *)
208 // Delete graphics temporary objects
211 //_____________________________________________________________________________
212 void AliRICHDisplay::DisplayButtons()
214 // Create the user interface buttons
217 fButtons = new TPad("buttons", "newpad",0,0.45,0.15,1);
219 fButtons->SetFillColor(38);
220 fButtons->SetBorderSize(2);
223 // Int_t butcolor = 33;
224 Float_t dbutton = 0.08;
231 char but1[] = "gAlice->Display()->ShowNextEvent(1)";
232 button = new TButton("Next",but1,x0,y-dbutton,x1,y);
233 button->SetFillColor(38);
237 char but2[] = "gAlice->Display()->ShowNextEvent(-1)";
238 button = new TButton("Previous",but2,x0,y-dbutton,x1,y);
239 button->SetFillColor(38);
243 char but7[] = "gAlice->Display()->DrawViewGL()";
244 button = new TButton("OpenGL",but7,x0,y-dbutton,x1,y);
245 button->SetFillColor(38);
249 char but8[] = "gAlice->Display()->DrawViewX3D()";
250 button = new TButton("X3D",but8,x0,y-dbutton,x1,y);
251 button->SetFillColor(38);
255 TDiamond *diamond = new TDiamond(0.05,0.015,0.95,0.22);
256 diamond->SetFillColor(50);
257 diamond->SetTextAlign(22);
258 diamond->SetTextColor(5);
259 diamond->SetTextSize(0.11);
261 diamond->AddText(".. ");
262 diamond->AddText("ROOT");
263 diamond->AddText("RICH");
264 diamond->AddText("... ");
265 diamond->AddText(" ");
268 //_____________________________________________________________________________
269 void AliRICHDisplay::CreateColors()
271 // Create the colors palette used to display clusters
286 new TColor(color,r,g,b);
296 new TColor(color,r,g,b);
306 new TColor(color,r,g,b);
316 new TColor(color,r,g,b);
326 new TColor(color,r,g,b);
333 //_____________________________________________________________________________
334 void AliRICHDisplay::DisplayColorScale()
337 // Draw the color scale in the RICH display canvas
341 Float_t xlow, ylow, xup, yup, hs;
342 Float_t x1, y1, x2, y2;
346 gPad->SetFillColor(0);
348 gPad->Range(x1,y1,x2,y2);
349 TText *text = new TText(0,0,"");
350 text->SetTextFont(61);
351 text->SetTextSize(0.2);
352 text->SetTextAlign(22);
356 //*-* draw colortable boxes
357 hs = (y2-y1)/Float_t(22);
361 ylow = y1 + hs*(Float_t(i));
362 yup = y1 + hs*(Float_t(i+1));
364 Double_t logscale=Double_t(i+1)*(TMath::Log(kadc_satm)/22);
365 Int_t scale=(Int_t)TMath::Exp(logscale);
366 sprintf(label,"%d",scale);
367 box = new TBox(xlow, ylow, xup, yup);
368 box->SetFillColor(color);
370 text->DrawText(xup+4, 0.5*(ylow+yup),label);
374 //______________________________________________________________________________
375 Int_t AliRICHDisplay::DistancetoPrimitive(Int_t px, Int_t)
377 // Compute distance from point px,py to objects in event
379 gPad->SetCursor(kCross);
381 if (gPad == fTrigPad) return 9999;
383 const Int_t kBig = 9999;
385 Float_t xmin = gPad->GetX1();
386 Float_t xmax = gPad->GetX2();
387 Float_t dx = 0.02*(xmax - xmin);
388 Float_t x = gPad->AbsPixeltoX(px);
389 if (x < xmin+dx || x > xmax-dx) return dist;
390 if (fZoomMode) return 0;
394 //_____________________________________________________________________________
395 void AliRICHDisplay::Draw(Option_t *)
397 // Display current event
401 DrawView(fTheta, fPhi, fPsi); // see how to draw PGON+inner frames
403 // Display the event number and title
408 //_____________________________________________________________________________
409 void AliRICHDisplay::DrawCoG()
411 // Draw hits for RICH chambers
413 if (!fDrawCoG) return;
415 for (Int_t chamber=0;chamber<kNCH;chamber++) {
424 ncog = points->GetEntriesFast();
425 for (icog=0; icog < ncog; icog++) {
426 pm = (AliRICHPoints*)points->UncheckedAt(icog);
432 void AliRICHDisplay::DrawRecHits()
434 // Draw rec hits for RICH chambers
436 if (!fDrawRecHits) return;
438 for (Int_t chamber=0;chamber<kNCH;chamber++) {
439 LoadRecHits(chamber,1);
447 nrec = points->GetEntriesFast();
448 //printf("Nrec %d\n",nrec);
449 for (irec=0; irec < nrec; irec++) {
450 pm = (AliRICHPoints*)points->UncheckedAt(irec);
456 //_____________________________________________________________________________
458 void AliRICHDisplay::DrawCerenkovs()
460 // Draw cerenkovs hits for RICH chambers
462 LoadCerenkovs(fChamber);
463 //printf("\nDrawCerenkovs\n");
465 Int_t ntracks, track;
470 cpoints = fPCerenkovs;
471 //printf ("Cpoints: %p",cpoints);
472 if (!cpoints) return;
473 ntracks = cpoints->GetEntriesFast();
474 //printf("DrawCerenkovs - ntracks %d \n",ntracks);
475 for (track=0;track<ntracks;track++) {
476 pm = (AliRICHPoints*)cpoints->UncheckedAt(track);
479 fHitsCuts += pm->GetN();
483 //_____________________________________________________________________________
485 void AliRICHDisplay::DrawClusters()
487 // Draw clusterss for RICH chambers
489 Int_t ndigits, digit;
496 ndigits = points->GetEntriesFast();
497 for (digit=0;digit<ndigits;digit++){
498 pm = (AliRICHPoints*)points->UncheckedAt(digit);
503 for (Int_t im=0;im<3;im++) {
504 TMarker3DBox *marker=pm->GetMarker(im);
508 fClustersCuts +=pm->GetN();
512 //_____________________________________________________________________________
513 void AliRICHDisplay::DrawHits()
515 // Draw hits for RICH chambers
519 Int_t ntracks, track;
526 // ntracks = points->GetEntriesFast();
527 ntracks = fPhits->GetEntriesFast();
529 //printf("DrawHits - ntracks %d \n",ntracks);
530 for (track=0;track<ntracks;track++) {
531 pm = (AliRICHPoints*)fPhits->UncheckedAt(track);
534 fHitsCuts += pm->GetN();
539 //_____________________________________________________________________________
540 void AliRICHDisplay::DrawTitle(Option_t *option)
542 // Draw the event title
544 Float_t xmin = gPad->GetX1();
545 Float_t xmax = gPad->GetX2();
546 Float_t ymin = gPad->GetY1();
547 Float_t ymax = gPad->GetY2();
548 Float_t dx = xmax-xmin;
549 Float_t dy = ymax-ymin;
551 if (strlen(option) == 0) {
552 TPaveText *title = new TPaveText(xmin +0.01*dx, ymax-0.09*dy, xmin +0.5*dx, ymax-0.01*dy);
553 title->SetBit(kCanDelete);
554 title->SetFillColor(42);
557 sprintf(ptitle,"Alice event: %d, Run:%d",
558 gAlice->GetHeader()->GetEvent(), gAlice->GetHeader()->GetRun());
559 title->AddText(ptitle);
560 Int_t nparticles = gAlice->GetMCApp()->Particles()->GetEntriesFast();
561 sprintf(ptitle,"Nparticles = %d Nhits = %d Npads fired = %d",
562 nparticles, fHitsCuts,fClustersCuts);
563 title->AddText(ptitle);
566 new TPaveLabel(xmin +0.01*dx, ymax-0.07*dy, xmin +0.2*dx, ymax-0.01*dy,option);
567 label->SetBit(kCanDelete);
568 label->SetFillColor(42);
573 //_____________________________________________________________________________
574 void AliRICHDisplay::DrawView(Float_t theta, Float_t phi, Float_t psi)
576 // Draw a view of RICH clusters
578 gPad->SetCursor(kWatch);
579 gPad->SetFillColor(1);
583 TView *view = new TView(1);
584 Float_t range = fRrange*fRangeSlider->GetMaximum();
585 view->SetRange(-range,-range,-range,range, range, range);
592 //Display RICH Chamber Geometry
593 gAlice->GetGeometry()->Draw("same");
595 //add clusters to the pad
601 //printf("Calling DrawCoG\n");
603 //printf("Calling DrawRecHits\n");
606 /*for (Int_t i=0;i<7;i++)
609 // add itself to the list (must be last)
612 view->SetView(phi, theta, psi, iret);
615 //______________________________________________________________________________
616 void AliRICHDisplay::ExecuteEvent(Int_t event, Int_t px, Int_t py)
618 // Execute action corresponding to the mouse event
620 static Float_t x0, y0, x1, y1;
622 static Int_t pxold, pyold;
623 static Int_t px0, py0;
624 static Int_t linedrawn;
627 if (px == 0 && py == 0) { //when called by sliders
628 if (event == kButton1Up) {
629 printf("Drawing event %d\n",event);
634 if (!fZoomMode && gPad->GetView()) {
635 gPad->GetView()->ExecuteRotateView(event, px, py);
639 // something to zoom ?
640 gPad->SetCursor(kCross);
645 gVirtualX->SetLineColor(-1);
646 gPad->TAttLine::Modify(); //Change line attributes only if necessary
647 x0 = gPad->AbsPixeltoX(px);
648 y0 = gPad->AbsPixeltoY(py);
650 pxold = px; pyold = py;
655 if (linedrawn) gVirtualX->DrawBox(px0, py0, pxold, pyold, TVirtualX::kHollow);
659 gVirtualX->DrawBox(px0, py0, pxold, pyold, TVirtualX::kHollow);
663 gPad->GetCanvas()->FeedbackMode(kFALSE);
664 if (px == px0) return;
665 if (py == py0) return;
666 x1 = gPad->AbsPixeltoX(px);
667 y1 = gPad->AbsPixeltoY(py);
669 if (x1 < x0) {temp = x0; x0 = x1; x1 = temp;}
670 if (y1 < y0) {temp = y0; y0 = y1; y1 = temp;}
671 gPad->Range(x0,y0,x1,y1);
672 if (fZooms < kMAXZOOM-1) {
674 fZoomX0[fZooms] = x0;
675 fZoomY0[fZooms] = y0;
676 fZoomX1[fZooms] = x1;
677 fZoomY1[fZooms] = y1;
679 gPad->Modified(kTRUE);
684 //___________________________________________
685 void AliRICHDisplay::LoadCoG(Int_t chamber, Int_t cathode)
687 // Read raw clusters info and store x,y,z info in arrays fRpoints
688 // Loop on all detectors
690 if (chamber > 7) return;
692 AliRICH *pRICH = (AliRICH*)gAlice->GetModule("RICH");
693 AliRICHChamber* iChamber;
695 TClonesArray *pRICHrawclust = pRICH->Clusters(chamber);
696 if (pRICHrawclust == 0) return;
698 pRICH->ResetClusters();
701 Int_t nent=(Int_t)gAlice->TreeR()->GetEntries();
702 gAlice->TreeR()->GetEvent(nent-1+cathode-1);
703 Int_t nrawcl = pRICHrawclust->GetEntriesFast();
704 //printf ("nrawcl:%d\n",nrawcl);
705 if (nrawcl == 0) return;
706 if (fRpoints == 0) fRpoints = new TObjArray(nrawcl);
708 iChamber = &(pRICH->Chamber(chamber));
709 AliRICHcluster *mRaw;
710 AliRICHPoints *points = 0;
712 //loop over all raw clusters and store their position
713 points = new AliRICHPoints(nrawcl);
714 for (Int_t iraw=0;iraw<nrawcl;iraw++) {
715 mRaw = (AliRICHcluster*)pRICHrawclust->UncheckedAt(iraw);
716 fRpoints->AddAt(points,iraw);
717 points->SetMarkerColor(3);
718 points->SetMarkerStyle(3);
719 points->SetMarkerSize(1.);
720 points->SetParticle(-1);
721 points->SetHitIndex(-1);
722 points->SetTrackIndex(-1);
723 points->SetDigitIndex(-1);
724 Float_t vectorLoc[3]={mRaw->X(),5,mRaw->Y()};
725 Float_t vectorGlob[3];
726 iChamber->LocaltoGlobal(vectorLoc,vectorGlob);
727 points->SetPoint(iraw,vectorGlob[0],vectorGlob[1],vectorGlob[2]);
730 //___________________________________________
731 void AliRICHDisplay::LoadRecHits(Int_t chamber, Int_t cathode)
735 //___________________________________________
736 void AliRICHDisplay::LoadDigits()
738 // Read digits info and store x,y,z info in arrays fPoints
739 // Loop on all detectors
742 AliRICH *pRICH = (AliRICH*)gAlice->GetDetector("RICH");
743 AliRICHChamber* iChamber;
744 AliSegmentation* segmentation;
748 //printf("Entering LoadDigits\n");
753 for (ich=1; ich<=kNCH; ich++) {
754 TClonesArray *pRICHdigits = pRICH->Digits(ich);
755 if (pRICHdigits == 0) continue;
756 gAlice->ResetDigits();
757 gAlice->TreeD()->GetEvent(0);
758 Int_t ndigits = pRICHdigits->GetEntriesFast();
762 if (fPoints == 0) fPoints = new TObjArray(nAllDigits);
764 for (ich=1; ich<=kNCH; ich++) {
765 TClonesArray *pRICHdigits = pRICH->Digits(ich);
766 if (pRICHdigits == 0) continue;
767 gAlice->ResetDigits();
768 gAlice->TreeD()->GetEvent(0);
769 Int_t ndigits = pRICHdigits->GetEntriesFast();
770 if (ndigits == 0) continue;
771 iChamber = &(pRICH->Chamber(ich));
772 segmentation=iChamber->GetSegmentationModel();
773 Float_t dpx = segmentation->Dpx();
774 Float_t dpy = segmentation->Dpy();
776 //printf("Dpx:%d, Dpy:%d\n",dpx,dpy);
779 AliRICHPoints *points = 0;
780 TMarker3DBox *marker = 0;
782 //loop over all digits and store their position
785 for (Int_t digit=0;digit<ndigits;digit++) {
786 mdig = (AliRICHdigit*)pRICHdigits->UncheckedAt(digit);
787 points = new AliRICHPoints(npoints);
788 fPoints->AddAt(points,counter);
790 Int_t charge=(Int_t)mdig->Q();
791 Int_t index=Int_t(TMath::Log(charge)/(TMath::Log(kadc_satm)/22));
792 Int_t color=701+index;
793 if (color>722) color=722;
794 points->SetMarkerColor(color);
795 points->SetMarkerStyle(21);
796 points->SetMarkerSize(0.5);
797 Float_t xpad, ypad, zpad;
798 segmentation->GetPadC(mdig->X(), mdig->Y(),xpad, ypad, zpad);
799 Float_t vectorLoc[3]={xpad,5,ypad};
800 Float_t vectorGlob[3];
801 iChamber->LocaltoGlobal(vectorLoc,vectorGlob);
802 points->SetParticle(-1);
803 points->SetHitIndex(-1);
804 points->SetTrackIndex(-1);
805 points->SetDigitIndex(digit);
806 points->SetPoint(0,vectorGlob[0],vectorGlob[1],vectorGlob[2]);
807 //printf("Y position (digit): %f\n", vectorGlob[1]);
809 segmentation->GetPadC(mdig->X(), mdig->Y(), xpad, ypad, zpad);
810 Float_t theta = iChamber->GetRotMatrix()->GetTheta();
811 Float_t phi = iChamber->GetRotMatrix()->GetPhi();
812 marker=new TMarker3DBox(vectorGlob[0],vectorGlob[1],vectorGlob[2],
813 dpy/2,0,dpx/2,theta,phi);
814 marker->SetLineColor(2);
815 marker->SetFillStyle(1001);
816 marker->SetFillColor(color);
817 marker->SetRefObject((TObject*)points);
818 points->Set3DMarker(0, marker);
819 } // loop over digits
820 } // loop over chambers
823 //__________________________________________________________________________________________________
824 void AliRICHDisplay::LoadHits(Int_t chamber)
826 // Read hits info and store x,y,z info in arrays fPhits
827 // Loop on all detectors
833 AliRICH *pRICH = (AliRICH*)gAlice->GetDetector("RICH");
834 AliRICHChamber* iChamber;
836 iChamber = &(pRICH->Chamber(chamber-1));
837 Int_t ntracks = (Int_t)pRICH->TreeH()->GetEntries();
840 if (fPhits == 0) fPhits = new TObjArray(ntracks);
841 //TVector *xp = new TVector(1000);
842 //TVector *yp = new TVector(1000);
843 //TVector *zp = new TVector(1000);
844 //TVector *ptrk = new TVector(1000);
845 //TVector *phit = new TVector(1000);
847 for (track=0; track<ntracks;track++) {
849 pRICH->TreeH()->GetEvent(track);
850 TClonesArray *pRICHhits = pRICH->Hits();
851 if (pRICHhits == 0) return;
852 Int_t nhits = pRICHhits->GetEntriesFast();
856 fPhits = new TObjArray(nAllHits);
859 for (track=0; track<ntracks;track++) {
861 pRICH->TreeH()->GetEvent(track);
862 TClonesArray *pRICHhits = pRICH->Hits();
863 if (pRICHhits == 0) return;
864 Int_t nhits = pRICHhits->GetEntriesFast();
865 if (nhits == 0) continue;
867 AliRICHPoints *points = 0;
868 for (Int_t hit=0;hit<nhits;hit++) {
869 points = new AliRICHPoints(1);
870 fPhits->AddAt(points,npoints);
871 mHit = (AliRICHhit*)pRICHhits->UncheckedAt(hit);
872 TParticle *current = (TParticle*)gAlice->GetMCApp()->Particle(mHit->Track());
873 if (current->GetPdgCode() == 50000050) {
874 points->SetMarkerColor(kBlue);
875 } else if (current->GetPdgCode() == 50000051) {
876 points->SetMarkerColor(kYellow);
878 points->SetMarkerColor(kRed);
880 points->SetMarkerStyle(5);
881 points->SetMarkerSize(1.);
882 points->SetParticle(mHit->Track());
883 points->SetHitIndex(hit);
884 points->SetTrackIndex(track);
885 points->SetDigitIndex(-1);
886 points->SetPoint(0,mHit->X(), mHit->Y(), mHit->Z());
891 //__________________________________________________________________________________________________
892 void AliRICHDisplay::LoadCerenkovs(Int_t chamber)
894 // Read cerenkov hits info and store x,y,z info in array fPCerenkovs
895 // Loop on all detectors
900 AliRICH *pRICH = (AliRICH*)gAlice->GetDetector("RICH");
901 AliRICHChamber* iChamber;
903 iChamber = &(pRICH->Chamber(chamber-1));
905 pRICH->SetTreeAddress();
906 Int_t ntracks = (Int_t)pRICH->TreeH()->GetEntries();
908 if (fPCerenkovs == 0) fPCerenkovs = new TObjArray(ntracks);
909 TVector *xp = new TVector(1000);
910 TVector *yp = new TVector(1000);
911 TVector *zp = new TVector(1000);
912 TVector *ptrk = new TVector(1000);
913 TVector *phit = new TVector(1000);
914 for (Int_t track=0; track<ntracks;track++) {
916 pRICH->TreeH()->GetEvent(track);
917 TClonesArray *pRICHCerenkovs = pRICH->Cerenkovs();
918 if (pRICHCerenkovs == 0) return;
919 Int_t nhits = pRICHCerenkovs->GetEntriesFast();
920 if (nhits == 0) continue;
921 AliRICHCerenkov *mCerenkov;
922 AliRICHPoints *cpoints = 0;
926 //Display Cerenkov hits in blue
928 for (Int_t hit=0;hit<nhits;hit++) {
929 mCerenkov = (AliRICHCerenkov*)pRICHCerenkovs->UncheckedAt(hit);
930 (*xp)(npoints)=mCerenkov->X();
931 (*yp)(npoints)=mCerenkov->Y();
932 (*zp)(npoints)=mCerenkov->Z();
933 (*ptrk)(npoints)=Float_t(mCerenkov->GetTrack());
934 (*phit)(npoints)=Float_t(hit);
937 if (npoints == 0) continue;
938 cpoints = new AliRICHPoints(npoints);
939 for (Int_t p=0;p<npoints;p++) {
940 cpoints->SetMarkerColor(kBlue);
941 cpoints->SetMarkerStyle(5);
942 cpoints->SetMarkerSize(1.);
943 cpoints->SetParticle(Int_t((*ptrk)(p)));
944 cpoints->SetHitIndex(Int_t((*phit)(p)));
945 cpoints->SetTrackIndex(track);
946 cpoints->SetDigitIndex(-1);
947 cpoints->SetPoint(p,(*xp)(p),(*yp)(p),(*zp)(p));
953 fPCerenkovs->AddAt(cpoints,track);
957 //_____________________________________________________________________________
958 void AliRICHDisplay::Paint(Option_t *)
960 // Paint miscellaneous items
964 //_____________________________________________________________________________
965 void AliRICHDisplay::SetPickMode()
972 fArcButton->SetY1(fPickButton->GetYlowNDC()+0.5*fPickButton->GetHNDC());
973 fTrigPad->Modified();
976 //_____________________________________________________________________________
977 void AliRICHDisplay::SetZoomMode()
984 fArcButton->SetY1(fZoomButton->GetYlowNDC()+0.5*fZoomButton->GetHNDC());
985 fTrigPad->Modified();
988 //_____________________________________________________________________________
989 void AliRICHDisplay::SetChamberAndCathode(Int_t chamber, Int_t cathode)
991 // Set chamber and cathode number
995 //printf("SetChamberAndCathode - fChamber fCathode %d %d\n",fChamber,fCathode);
1002 //_____________________________________________________________________________
1003 void AliRICHDisplay::SetRange(Float_t rrange, Float_t zrange)
1005 // Set view range along R and Z
1014 //_____________________________________________________________________________
1015 void AliRICHDisplay::SetView(Float_t theta, Float_t phi, Float_t psi)
1017 // change viewing angles for current event
1025 TView *view = gPad->GetView();
1026 if (view) view->SetView(fPhi, fTheta, fPsi, iret);
1032 //_____________________________________________________________________________
1033 void AliRICHDisplay::ShowNextEvent(Int_t delta)
1035 // Display (current event_number+delta)
1036 // delta = 1 shown next event
1037 // delta = -1 show previous event
1041 Int_t currentEvent = gAlice->GetHeader()->GetEvent();
1042 Int_t newEvent = currentEvent + delta;
1043 gAlice->GetEvent(newEvent);
1044 if (!gAlice->TreeD()) return;
1054 //______________________________________________________________________________
1055 void AliRICHDisplay::UnZoom()
1058 // Return to previous zoom factor
1060 if (fZooms <= 0) return;
1062 TPad *pad = (TPad*)gPad->GetPadSave();
1063 pad->Range(fZoomX0[fZooms],fZoomY0[fZooms], fZoomX1[fZooms],fZoomY1[fZooms]);
1067 //_____________________________________________________________________________
1068 void AliRICHDisplay::ResetPoints()
1071 // Reset array of points
1079 //_____________________________________________________________________________
1080 void AliRICHDisplay::ResetRpoints()
1083 // Reset array of points
1091 //_____________________________________________________________________________
1092 void AliRICHDisplay::ResetRecpoints()
1095 // Reset array of points
1098 fRecpoints->Delete();
1103 //_____________________________________________________________________________
1104 void AliRICHDisplay::ResetPhits()
1107 // Reset array of points
1115 //_____________________________________________________________________________
1116 void AliRICHDisplay::ResetPCerenkovs()
1119 // Reset array of points
1122 fPCerenkovs->Delete();
1128 //_____________________________________________________________________________
1130 void AliRICHDisplay::DrawViewGL()
1132 // Draw current view using OPENGL
1134 TPad *pad = (TPad*)gPad->GetPadSave();
1136 TView *view = pad->GetView();
1141 //_____________________________________________________________________________
1142 void AliRICHDisplay::DrawViewX3D()
1144 // Draw current view using X3D
1146 TPad *pad = (TPad*)gPad->GetPadSave();
1148 TView *view = pad->GetView();