]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - RICH/AliRICHDisplay.cxx
Several pointers were set to zero in the default constructors to avoid memory managem...
[u/mrichter/AliRoot.git] / RICH / AliRICHDisplay.cxx
index 674a91070ef92186187d073f64449c5dd39f1384..f586d63ee4250a406f3621c50c2b4413de124a06 100644 (file)
 
 /*
   $Log$
+  Revision 1.15  2001/10/09 07:34:09  hristov
+  Modifications needed by Root.03.01.06 (J.Chudoba)
+
+  Revision 1.14  2001/05/16 14:57:20  alibrary
+  New files for folders and Stack
+
+  Revision 1.13  2001/05/10 12:35:16  jbarbosa
+  Removed hit display, added rec. ring properties.
+
+  Revision 1.12  2001/03/14 18:15:03  jbarbosa
+  Changes to adapt to new IO.
+  Removed verbose output.
+
   Revision 1.11  2001/02/27 15:21:34  jbarbosa
   Transition to SDigits.
 
 #include "AliRICHConst.h"
 #include "AliRICHDisplay.h"
 #include "AliRICHPoints.h"
+#include "AliHeader.h"
 
 #include "AliRICHHit.h"
 #include "AliRICHCerenkov.h"
@@ -109,7 +123,7 @@ AliRICHDisplay::AliRICHDisplay()
 { 
 
 // default constructor
-
+    fColPad = 0;
     fPoints = 0;
     fPhits = 0;
     fPCerenkovs = 0;
@@ -234,7 +248,6 @@ AliRICHDisplay::AliRICHDisplay(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);
@@ -259,6 +272,8 @@ AliRICHDisplay::AliRICHDisplay(Int_t size)
     button->Draw();
     AppendPad(); // append display object as last object to force selection
     
+    fTrigPad->SetEditable(kFALSE);
+    fButtons->SetEditable(kFALSE);
     fCanvas->cd();
     fCanvas->Update();
 }
@@ -302,7 +317,6 @@ void AliRICHDisplay::DisplayButtons()
     
     
     fButtons = new TPad("buttons", "newpad",0,0.45,0.15,1);
-    fButtons->SetEditable(kFALSE);
     fButtons->Draw();
     fButtons->SetFillColor(38);
     fButtons->SetBorderSize(2);
@@ -682,7 +696,7 @@ void AliRICHDisplay::DrawView(Float_t theta, Float_t phi, Float_t psi)
    
    //add clusters to the pad
    DrawClusters();
-   DrawHits();
+   //DrawHits();
 //   DrawCerenkovs();
    if (gAlice->TreeR())
      {
@@ -714,7 +728,8 @@ void AliRICHDisplay::ExecuteEvent(Int_t event, Int_t px, Int_t py)
    
    if (px == 0 && py == 0) { //when called by sliders
        if (event == kButton1Up) {
-          Draw();
+        printf("Drawing event %d\n",event);
+        Draw();
        }
        return;
    }
@@ -812,7 +827,7 @@ void AliRICHDisplay::LoadCoG(Int_t chamber, Int_t cathode)
        points->SetHitIndex(-1);
        points->SetTrackIndex(-1);
        points->SetDigitIndex(-1);
-       Float_t  vectorLoc[3]={mRaw->fX,-5,mRaw->fY};
+       Float_t  vectorLoc[3]={mRaw->fX,5,mRaw->fY};
        Float_t  vectorGlob[3];
        iChamber->LocaltoGlobal(vectorLoc,vectorGlob);
        points->SetPoint(iraw,vectorGlob[0],vectorGlob[1],vectorGlob[2]);
@@ -866,7 +881,7 @@ void AliRICHDisplay::LoadRecHits(Int_t chamber, Int_t cathode)
             points1D->SetHitIndex(-1);
             points1D->SetTrackIndex(-1);
             points1D->SetDigitIndex(-1);
-            Float_t  vectorLoc[3]={mRec1D->fX,-5,mRec1D->fY};
+            Float_t  vectorLoc[3]={mRec1D->fX,5,mRec1D->fY};
             Float_t  vectorGlob[3];
             iChamber->LocaltoGlobal(vectorLoc,vectorGlob);
             points1D->SetPoint(irec,vectorGlob[0],vectorGlob[1],vectorGlob[2]);
@@ -875,6 +890,8 @@ void AliRICHDisplay::LoadRecHits(Int_t chamber, Int_t cathode)
             //ellipse=new TEllipse(vectorGlob[0],vectorGlob[2],10,10,0,360,phi);
             //printf("Generating ellipse %d\n",irec);
             AliRICHEllipse *ellipse=new AliRICHEllipse(mRec1D->fX,mRec1D->fY,mRec1D->fOmega,mRec1D->fTheta,mRec1D->fPhi,mRec1D->fEmissPoint);
+            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());
+            printf("fEmissPoint:%f\n",mRec1D->fEmissPoint);
             ellipse->CerenkovRingDrawing(chamber,irec);
             //ellipse->SetFillStyle(1001);
             ellipse->SetMarkerColor(38);
@@ -919,7 +936,7 @@ void AliRICHDisplay::LoadRecHits(Int_t chamber, Int_t cathode)
             points3D->SetHitIndex(-1);
             points3D->SetTrackIndex(-1);
             points3D->SetDigitIndex(-1);
-            Float_t  vectorLoc[3]={mRec3D->fX,-5,mRec3D->fY};
+            Float_t  vectorLoc[3]={mRec3D->fX,5,mRec3D->fY};
             Float_t  vectorGlob[3];
             iChamber->LocaltoGlobal(vectorLoc,vectorGlob);
             points3D->SetPoint(irec,vectorGlob[0],vectorGlob[1],vectorGlob[2]);
@@ -928,6 +945,7 @@ void AliRICHDisplay::LoadRecHits(Int_t chamber, Int_t cathode)
             //ellipse=new TEllipse(vectorGlob[0],vectorGlob[2],10,10,0,360,phi);
             //printf("Generating ellipse %d\n",irec);
             AliRICHEllipse *ellipse=new AliRICHEllipse(mRec3D->fX,mRec3D->fY,mRec3D->fOmega,mRec3D->fTheta,mRec3D->fPhi,0.75);
+            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());
             ellipse->CerenkovRingDrawing(chamber,irec);
             //ellipse->SetFillStyle(1001);
             ellipse->SetMarkerColor(42);
@@ -1004,7 +1022,7 @@ void AliRICHDisplay::LoadDigits()
           points->SetMarkerSize(0.5);
           Float_t xpad, ypad, zpad;
           segmentation->GetPadC(mdig->fPadX, mdig->fPadY,xpad, ypad, zpad);
-          Float_t vectorLoc[3]={xpad,-5,ypad};
+          Float_t vectorLoc[3]={xpad,5,ypad};
           Float_t  vectorGlob[3];
           iChamber->LocaltoGlobal(vectorLoc,vectorGlob);
           points->SetParticle(-1);
@@ -1012,6 +1030,7 @@ void AliRICHDisplay::LoadDigits()
           points->SetTrackIndex(-1);
           points->SetDigitIndex(digit);
           points->SetPoint(0,vectorGlob[0],vectorGlob[1],vectorGlob[2]);
+          //printf("Y position (digit): %f\n", vectorGlob[1]);
           
           segmentation->GetPadC(mdig->fPadX, mdig->fPadY, xpad, ypad, zpad);
           Float_t theta = iChamber->GetRotMatrix()->GetTheta();
@@ -1093,6 +1112,7 @@ void AliRICHDisplay::LoadHits(Int_t chamber)
             points->SetTrackIndex(track);
             points->SetDigitIndex(-1);
             points->SetPoint(hit,mHit->X(), mHit->Y(), mHit->Z());
+           //printf("Y position: %f\n", mHit->Y());
            npoints++;
        }
     }