]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - STEER/AliDisplay.cxx
Removal of useless dependecies via forward declarations
[u/mrichter/AliRoot.git] / STEER / AliDisplay.cxx
index cef75a450dfaba6b660f6b3f33e8264f9f9b1811..01ab9780c6dcf80c9df02336f5e1e5f750d2e7fe 100644 (file)
 
 /*
 $Log$
+Revision 1.9  2000/07/13 16:19:09  fca
+Mainly coding conventions + some small bug fixes
+
+Revision 1.8  2000/07/11 18:24:59  fca
+Coding convention corrections + few minor bug fixes
+
+Revision 1.7  1999/11/10 07:37:06  fca
+Pads do not inherit editability from canvas any more
+
+Revision 1.6  1999/11/09 07:38:52  fca
+Changes for compatibility with version 2.23 of ROOT
+
 Revision 1.5  1999/09/29 09:24:29  fca
 Introduction of the Copyright and cvs Log
 
@@ -55,9 +67,11 @@ Introduction of the Copyright and cvs Log
 #include "AliDisplay.h"
 #include "AliPoints.h"
 #include "TParticle.h"
+#include "AliGeometry.h"
+#include "TGeometry.h"
 
-const Float_t ptcutmax  = 2;
-const Float_t etacutmax = 1.5;
+static const Float_t kptcutmax  = 2;
+static const Float_t ketacutmax = 1.5;
 
 ClassImp(AliDisplay)
 
@@ -65,7 +79,10 @@ ClassImp(AliDisplay)
 //_____________________________________________________________________________
 AliDisplay::AliDisplay()
 {
-   fCanvas = 0;
+  //
+  // Default constructor
+  //
+  fCanvas = 0;
 }
 
 //_____________________________________________________________________________
@@ -164,7 +181,6 @@ AliDisplay::AliDisplay(Int_t size)
    if (ysize < 100) ysize = 750;
    Int_t xsize = Int_t(size*830./ysize);
    fCanvas = new TCanvas("Canvas", "ALICE Event Display",14,47,xsize,ysize);
-   fCanvas->SetEditable(kFALSE);
    fCanvas->ToggleEventStatus();
    
    // Create main display pad
@@ -182,6 +198,7 @@ AliDisplay::AliDisplay(Int_t size)
    Float_t dxtr     = 0.15;
    Float_t dytr     = 0.45;
    fTrigPad = new TPad("trigger", "range and mode pad",0,0,dxtr,dytr);
+   fTrigPad->SetEditable(kFALSE);
    fTrigPad->Draw();
    fTrigPad->cd();
    fTrigPad->SetFillColor(22);
@@ -214,13 +231,13 @@ AliDisplay::AliDisplay(Int_t size)
    fCutPad->SetFillColor(22);
    fCutPad->SetBorderSize(2);
    fCutSlider   = new TSlider("pcut","Momentum cut",0,0,1,1);
-   fCutSlider->SetRange(fPTcut/ptcutmax,1);
+   fCutSlider->SetRange(fPTcut/kptcutmax,1);
    fCutSlider->SetObject(this);
    fCutSlider->SetFillColor(45);
    TSliderBox *sbox = (TSliderBox*)fCutSlider->GetListOfPrimitives()->First();
    sbox->SetFillColor(46);
    fCutSlider->cd();
-   TGaxis *cutaxis = new TGaxis(0.02,0.8,0.98,0.8,0,ptcutmax,510,"");
+   TGaxis *cutaxis = new TGaxis(0.02,0.8,0.98,0.8,0,kptcutmax,510,"");
    cutaxis->SetLabelSize(0.5);
    cutaxis->SetTitleSize(0.6);
    cutaxis->SetTitleOffset(0.5);
@@ -240,7 +257,7 @@ AliDisplay::AliDisplay(Int_t size)
    TSliderBox *sbox2 = (TSliderBox*)fEtaSlider->GetListOfPrimitives()->First();
    sbox2->SetFillColor(46);
    fEtaSlider->cd();
-   TGaxis *etaaxis = new TGaxis(0.9,0.02,0.9,0.98,-etacutmax,etacutmax,510,"");
+   TGaxis *etaaxis = new TGaxis(0.9,0.02,0.9,0.98,-ketacutmax,ketacutmax,510,"");
    etaaxis->SetLabelSize(0.5);
    etaaxis->SetTitleSize(0.6);
    etaaxis->SetTitleOffset(0.2);
@@ -254,9 +271,21 @@ AliDisplay::AliDisplay(Int_t size)
 }
 
 
+//_____________________________________________________________________________
+AliDisplay::AliDisplay(const AliDisplay &disp)
+{
+  //
+  // Copy constructor
+  //
+  disp.Copy(*this);
+}
+
 //_____________________________________________________________________________
 AliDisplay::~AliDisplay()
 {
+  //
+  // Destructor
+  //
 }
 
 //_____________________________________________________________________________
@@ -265,10 +294,19 @@ void AliDisplay::Clear(Option_t *)
 //    Delete graphics temporary objects
 }
 
+//_____________________________________________________________________________
+void AliDisplay::Copy(AliDisplay &disp) const
+{
+  //
+  // Copy *this onto disp -- not implemented
+  //
+  Fatal("Copy","Not implemented~\n");
+}
+
 //----------------------------------------------------------------------------
 void AliDisplay::ShowTrack(Int_t idx) {
-   AliDetector *TPC=(AliDetector*)gAlice->GetModule("TPC");
-   TObjArray *points=TPC->Points();
+   AliDetector *mTPC=(AliDetector*)gAlice->GetModule("TPC");
+   TObjArray *points=mTPC->Points();
    int ntracks=points->GetEntriesFast();
    for (int track=0;track<ntracks;track++) {
       AliPoints *pm = (AliPoints*)points->UncheckedAt(track);
@@ -293,8 +331,11 @@ void AliDisplay::ShowTrack(Int_t idx) {
 
 //----------------------------------------------------------------------------
 void AliDisplay::HideTrack(Int_t idx) {
-   AliDetector *TPC=(AliDetector*)gAlice->GetModule("TPC");
-   TObjArray *points=TPC->Points();
+  //
+  // Hide track on display
+  //
+   AliDetector *mTPC=(AliDetector*)gAlice->GetModule("TPC");
+   TObjArray *points=mTPC->Points();
    int ntracks=points->GetEntriesFast();
    for (int track=0;track<ntracks;track++) {
       AliPoints *pm = (AliPoints*)points->UncheckedAt(track);
@@ -327,6 +368,7 @@ void AliDisplay::DisplayButtons()
 //    Create the user interface buttons
 
    fButtons = new TPad("buttons", "newpad",0,0.45,0.15,1);
+   fButtons->SetEditable(kFALSE);
    fButtons->Draw();
    fButtons->SetFillColor(38);
    fButtons->SetBorderSize(2);
@@ -412,8 +454,8 @@ Int_t AliDisplay::DistancetoPrimitive(Int_t px, Int_t)
    if (gPad == fCutPad)  return 9999;
    if (gPad == fEtaPad)  return 9999;
 
-   const Int_t big = 9999;
-   Int_t dist   = big;
+   const Int_t kbig = 9999;
+   Int_t dist   = kbig;
    Float_t xmin = gPad->GetX1();
    Float_t xmax = gPad->GetX2();
    Float_t dx   = 0.02*(xmax - xmin);
@@ -492,15 +534,15 @@ void AliDisplay::DrawHits()
    //Get cut slider
    smax   = fCutSlider->GetMaximum();
    smin   = fCutSlider->GetMinimum();
-   cutmin = ptcutmax*smin;
-   if (smax < 0.98) cutmax = ptcutmax*smax;
+   cutmin = kptcutmax*smin;
+   if (smax < 0.98) cutmax = kptcutmax*smax;
    else             cutmax = 100000;
    
    //Get eta slider
    smax   = fEtaSlider->GetMaximum();
    smin   = fEtaSlider->GetMinimum();
-   etamin = etacutmax*(2*smin-1);
-   etamax = etacutmax*(2*smax-1);
+   etamin = ketacutmax*(2*smin-1);
+   etamax = ketacutmax*(2*smax-1);
    if (smin < 0.02) etamin = -1000;
    if (smax > 0.98) etamax =  1000;
       
@@ -730,6 +772,9 @@ void AliDisplay::Paint(Option_t *)
 //_____________________________________________________________________________
 void AliDisplay::SetPickMode()
 {
+  //
+  // Set Pick Mode -- disable zoom
+  //
    fZoomMode = 0;
 
    fArcButton->SetY1(fPickButton->GetYlowNDC()+0.5*fPickButton->GetHNDC());
@@ -739,6 +784,9 @@ void AliDisplay::SetPickMode()
 //_____________________________________________________________________________
 void AliDisplay::SetZoomMode()
 {
+  //
+  // Set Zoom Mode -- disable pick
+  //
    fZoomMode = 1;
 
    fArcButton->SetY1(fZoomButton->GetYlowNDC()+0.5*fZoomButton->GetHNDC());
@@ -748,6 +796,9 @@ void AliDisplay::SetZoomMode()
 //_____________________________________________________________________________
 void AliDisplay::SetPTcut(Float_t ptcut)
 {
+  //
+  // Set Pt Cut
+  //
    fPTcut = ptcut;
 
    if (!fPad) return;
@@ -795,9 +846,9 @@ void AliDisplay::ShowNextEvent(Int_t delta)
 
   if (delta) {
      gAlice->Clear();
-     Int_t current_event = gAlice->GetHeader()->GetEvent();
-     Int_t new_event     = current_event + delta;
-     gAlice->GetEvent(new_event);
+     Int_t currentEvent = gAlice->GetHeader()->GetEvent();
+     Int_t newEvent     = currentEvent + delta;
+     gAlice->GetEvent(newEvent);
      if (!gAlice->TreeH()) return; 
    }
   LoadPoints();
@@ -808,9 +859,22 @@ void AliDisplay::ShowNextEvent(Int_t delta)
 //______________________________________________________________________________
 void AliDisplay::UnZoom()
 {
-   if (fZooms <= 0) return;
-   fZooms--;
-   TPad *pad = (TPad*)gPad->GetPadSave();
-   pad->Range(fZoomX0[fZooms],fZoomY0[fZooms], fZoomX1[fZooms],fZoomY1[fZooms]);
-   pad->Modified();
+  //
+  // Resets ZOOM 
+  //
+  if (fZooms <= 0) return;
+  fZooms--;
+  TPad *pad = (TPad*)gPad->GetPadSave();
+  pad->Range(fZoomX0[fZooms],fZoomY0[fZooms], fZoomX1[fZooms],fZoomY1[fZooms]);
+  pad->Modified();
+}
+
+//_____________________________________________________________________________
+AliDisplay & AliDisplay::operator=(const AliDisplay &disp)
+{
+  //
+  // Assignment operator
+  //
+  disp.Copy(*this);
+  return (*this);
 }