]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - RICH/AliRICHDisplay.cxx
MC-dependent part of AliRun extracted in AliMC (F.Carminati)
[u/mrichter/AliRoot.git] / RICH / AliRICHDisplay.cxx
index f8321ed4f105cce427f951152874687da3a4bdc4..4d67d3435243b4130e655ab6b346cd5dc88a53a0 100644 (file)
  * provided "as is" without express or implied warranty.                  *
  **************************************************************************/
 
-/*
-  $Log$
-  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.
-
-  Revision 1.10  2001/02/13 20:18:48  jbarbosa
-  Corrected some more positioning of points. Changes in LoadDigits to accomodate the new IO.
-
-  Revision 1.9  2000/11/01 15:33:11  jbarbosa
-  Updated to handle both reconstruction algorithms.
-
-  Revision 1.8  2000/10/03 21:44:09  morsch
-  Use AliSegmentation and AliHit abstract base classes.
-
-  Revision 1.7  2000/10/02 21:28:12  fca
-  Removal of useless dependecies via forward declarations
-
-  Revision 1.6  2000/10/02 15:46:38  jbarbosa
-  Fixed forward declarations.
-
-  Revision 1.5  2000/06/30 16:49:34  dibari
-  Different call for ring drawing.
-
-  Revision 1.4  2000/06/12 15:21:08  jbarbosa
-  Cleaned up version.
-
-  Revision 1.3  2000/06/09 14:52:08  jbarbosa
-  New tentative ellipse drawing routine
-
-  Revision 1.1  2000/04/19 13:07:45  morsch
-  Digits, clusters and reconstruction results added.
-
-*/
-
+/* $Id$ */
 
 //////////////////////////////////////////////////////////////////////////
 //                                                                      //
 #include "AliRICHPoints.h"
 #include "AliHeader.h"
 
-#include "AliRICHHit.h"
-#include "AliRICHCerenkov.h"
 #include "AliRICHSDigit.h"
 #include "AliRICHDigit.h"
 #include "AliRICHRawCluster.h"
 #include "AliRICHRecHit1D.h"
-#include "AliRICHRecHit3D.h"
-#include "AliRICHEllipse.h"
+#include "AliMC.h"
 
 ClassImp(AliRICHDisplay)
     
@@ -120,7 +74,7 @@ AliRICHDisplay::AliRICHDisplay()
 { 
 
 // default constructor
-
+    fColPad = 0;
     fPoints = 0;
     fPhits = 0;
     fPCerenkovs = 0;
@@ -191,8 +145,10 @@ AliRICHDisplay::AliRICHDisplay(Int_t size)
     SetRange();
     
     // Set front view by default
-    fTheta = 90;
-    fPhi   = 90;
+    fTheta = 90;              //inclined HMPID
+    fPhi   = 30;              //inclined HMPID
+    //fTheta = 90;               //normal HMPID
+    //fPhi   = 90;                //normal HMPID
     fPsi   = 0;
     fChamber = 1;
     fCathode = 1;
@@ -447,7 +403,7 @@ void AliRICHDisplay::DisplayColorScale()
     gPad->Range(x1,y1,x2,y2);
     TText *text = new TText(0,0,"");
     text->SetTextFont(61);
-    text->SetTextSize(0.03);
+    text->SetTextSize(0.2);
     text->SetTextAlign(22);
     
     TBox *box;
@@ -460,7 +416,7 @@ void AliRICHDisplay::DisplayColorScale()
        ylow = y1 + hs*(Float_t(i));
        yup  = y1 + hs*(Float_t(i+1));
        color = 701+i;
-       Double_t logscale=Double_t(i+1)*(TMath::Log(adc_satm)/22);
+       Double_t logscale=Double_t(i+1)*(TMath::Log(kadc_satm)/22);
        Int_t scale=(Int_t)TMath::Exp(logscale);
        sprintf(label,"%d",scale);
        box = new TBox(xlow, ylow, xup, yup);
@@ -656,7 +612,7 @@ void AliRICHDisplay::DrawTitle(Option_t *option)
        sprintf(ptitle,"Alice event: %d, Run:%d",
                gAlice->GetHeader()->GetEvent(), gAlice->GetHeader()->GetRun());
        title->AddText(ptitle);
-       Int_t nparticles = gAlice->Particles()->GetEntriesFast();
+       Int_t nparticles = gAlice->GetMCApp()->Particles()->GetEntriesFast();
        sprintf(ptitle,"Nparticles = %d Nhits = %d Npads fired = %d",
                nparticles, fHitsCuts,fClustersCuts);
        title->AddText(ptitle);
@@ -693,14 +649,14 @@ void AliRICHDisplay::DrawView(Float_t theta, Float_t phi, Float_t psi)
    
    //add clusters to the pad
    DrawClusters();
-   //DrawHits();
-//   DrawCerenkovs();
+   DrawHits();
+   //DrawCerenkovs();
    if (gAlice->TreeR())
      {
        //printf("Calling DrawCoG\n");
-       DrawCoG();
+        DrawCoG();
        //printf("Calling DrawRecHits\n");
-       DrawRecHits();
+        DrawRecHits();
      }
    /*for (Int_t i=0;i<7;i++)
      LoadRecHits(i,1);*/
@@ -863,8 +819,6 @@ void AliRICHDisplay::LoadRecHits(Int_t chamber, Int_t cathode)
           iChamber = &(pRICH->Chamber(chamber));
           AliRICHRecHit1D  *mRec1D;
           AliRICHPoints *points1D = 0;
-          //AliRICHEllipse *ellipse = 0;
-          //
           //loop over all rechits and store their position  
           
           points1D = new AliRICHPoints(nrechits1D);
@@ -873,7 +827,7 @@ void AliRICHDisplay::LoadRecHits(Int_t chamber, Int_t cathode)
             fRecpoints->AddAt(points1D,irec);
             points1D->SetMarkerColor(38);
             points1D->SetMarkerStyle(8);
-            points1D->SetMarkerSize(1.);
+            points1D->SetMarkerSize(.5);
             points1D->SetParticle(-1);
             points1D->SetHitIndex(-1);
             points1D->SetTrackIndex(-1);
@@ -882,76 +836,10 @@ void AliRICHDisplay::LoadRecHits(Int_t chamber, Int_t cathode)
             Float_t  vectorGlob[3];
             iChamber->LocaltoGlobal(vectorLoc,vectorGlob);
             points1D->SetPoint(irec,vectorGlob[0],vectorGlob[1],vectorGlob[2]);
-            //Float_t theta = iChamber->GetRotMatrix()->GetTheta();
-            //Float_t phi   = iChamber->GetRotMatrix()->GetPhi();         
-            //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);
-            ellipse->Draw();
-            //marker->SetRefObject((TObject*)points1D);
-            //points1D->Set3DMarker(0, marker); 
           }
         }
      }
 
-   TClonesArray *pRICHrechits3D  = pRICH->RecHitsAddress3D(chamber);
-   //printf ("Chamber:%d\n", chamber);
-   if (pRICHrechits3D != 0)
-     {
-       
-       //RICH->ResetRecHits();
-       
-       
-       Int_t nent3D=(Int_t)gAlice->TreeR()->GetEntries();
-       gAlice->TreeR()->GetEvent(nent3D-1+cathode-1);
-       Int_t nrechits3D = pRICHrechits3D->GetEntriesFast();
-       //printf ("nrechits3D:%d\n",nrechits3D);
-       if (nrechits3D != 0)
-        {
-          if (fRecpoints == 0) fRecpoints = new TObjArray(50);
-          
-          iChamber = &(pRICH->Chamber(chamber));
-          AliRICHRecHit3D  *mRec3D;
-          AliRICHPoints *points3D = 0;
-          //AliRICHEllipse *ellipse = 0;
-          //
-          //loop over all rechits and store their position  
-          
-          points3D = new AliRICHPoints(nrechits3D);
-          for (Int_t irec=0;irec<nrechits3D;irec++) {
-            mRec3D   = (AliRICHRecHit3D*)pRICHrechits3D->UncheckedAt(irec);
-            fRecpoints->AddAt(points3D,irec);
-            points3D->SetMarkerColor(42);
-            points3D->SetMarkerStyle(8);
-            points3D->SetMarkerSize(1.);
-            points3D->SetParticle(-1);
-            points3D->SetHitIndex(-1);
-            points3D->SetTrackIndex(-1);
-            points3D->SetDigitIndex(-1);
-            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]);
-            //Float_t theta = iChamber->GetRotMatrix()->GetTheta();
-            //Float_t phi   = iChamber->GetRotMatrix()->GetPhi();         
-            //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);
-            ellipse->Draw();
-            //marker->SetRefObject((TObject*)points3D);
-            //points3D->Set3DMarker(0, marker); 
-          }
-        }
-     }
 }
 //___________________________________________
 void AliRICHDisplay::LoadDigits()
@@ -1010,15 +898,15 @@ void AliRICHDisplay::LoadDigits()
           points = new AliRICHPoints(npoints);
           fPoints->AddAt(points,counter);
           counter++;
-          Int_t charge=mdig->fSignal;
-          Int_t index=Int_t(TMath::Log(charge)/(TMath::Log(adc_satm)/22));
+          Int_t charge=mdig->Signal();
+          Int_t index=Int_t(TMath::Log(charge)/(TMath::Log(kadc_satm)/22));
           Int_t color=701+index;
           if (color>722) color=722;
           points->SetMarkerColor(color);
           points->SetMarkerStyle(21);
           points->SetMarkerSize(0.5);
           Float_t xpad, ypad, zpad;
-          segmentation->GetPadC(mdig->fPadX, mdig->fPadY,xpad, ypad, zpad);
+          segmentation->GetPadC(mdig->PadX(), mdig->PadY(),xpad, ypad, zpad);
           Float_t vectorLoc[3]={xpad,5,ypad};
           Float_t  vectorGlob[3];
           iChamber->LocaltoGlobal(vectorLoc,vectorGlob);
@@ -1029,7 +917,7 @@ void AliRICHDisplay::LoadDigits()
           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);
+          segmentation->GetPadC(mdig->PadX(), mdig->PadY(), xpad, ypad, zpad);
           Float_t theta = iChamber->GetRotMatrix()->GetTheta();
           Float_t phi   = iChamber->GetRotMatrix()->GetPhi();     
           marker=new TMarker3DBox(vectorGlob[0],vectorGlob[1],vectorGlob[2],
@@ -1059,7 +947,7 @@ void AliRICHDisplay::LoadHits(Int_t chamber)
     AliRICHChamber*  iChamber;
     
     iChamber = &(pRICH->Chamber(chamber-1));
-    Int_t ntracks = (Int_t)gAlice->TreeH()->GetEntries();
+    Int_t ntracks = (Int_t)pRICH->TreeH()->GetEntries();
     Int_t track;
     
     if (fPhits == 0) fPhits = new TObjArray(ntracks);
@@ -1071,7 +959,7 @@ void AliRICHDisplay::LoadHits(Int_t chamber)
     Int_t nAllHits=0;
     for (track=0; track<ntracks;track++) {
        gAlice->ResetHits();
-       gAlice->TreeH()->GetEvent(track);
+       pRICH->TreeH()->GetEvent(track);
        TClonesArray *pRICHhits  = pRICH->Hits();
        if (pRICHhits == 0) return;
        Int_t nhits = pRICHhits->GetEntriesFast();
@@ -1083,18 +971,18 @@ void AliRICHDisplay::LoadHits(Int_t chamber)
     Int_t npoints=0;
     for (track=0; track<ntracks;track++) {
        gAlice->ResetHits();
-       gAlice->TreeH()->GetEvent(track);
+       pRICH->TreeH()->GetEvent(track);
        TClonesArray *pRICHhits  = pRICH->Hits();
        if (pRICHhits == 0) return;
        Int_t nhits = pRICHhits->GetEntriesFast();
        if (nhits == 0) continue;
-       AliRICHHit *mHit;
+       AliRICHhit *mHit;
        AliRICHPoints *points = 0;
        for (Int_t hit=0;hit<nhits;hit++) {
            points = new AliRICHPoints(1);
            fPhits->AddAt(points,npoints);
-            mHit = (AliRICHHit*)pRICHhits->UncheckedAt(hit);
-           TParticle *current = (TParticle*)gAlice->Particle(mHit->Track());
+            mHit = (AliRICHhit*)pRICHhits->UncheckedAt(hit);
+           TParticle *current = (TParticle*)gAlice->GetMCApp()->Particle(mHit->Track());
            if (current->GetPdgCode() == 50000050) {
                points->SetMarkerColor(kBlue);
            } else if (current->GetPdgCode() == 50000051) {
@@ -1108,8 +996,7 @@ void AliRICHDisplay::LoadHits(Int_t chamber)
            points->SetHitIndex(hit);
             points->SetTrackIndex(track);
             points->SetDigitIndex(-1);
-            points->SetPoint(hit,mHit->X(), mHit->Y(), mHit->Z());
-           //printf("Y position: %f\n", mHit->Y());
+            points->SetPoint(0,mHit->X(), mHit->Y(), mHit->Z());
            npoints++;
        }
     }
@@ -1131,7 +1018,7 @@ void AliRICHDisplay::LoadCerenkovs(Int_t chamber)
     iChamber = &(pRICH->Chamber(chamber-1));
     
     pRICH->SetTreeAddress();
-    Int_t ntracks = (Int_t)gAlice->TreeH()->GetEntries();
+    Int_t ntracks = (Int_t)pRICH->TreeH()->GetEntries();
     
     if (fPCerenkovs == 0) fPCerenkovs = new TObjArray(ntracks);
     TVector *xp = new TVector(1000);
@@ -1141,7 +1028,7 @@ void AliRICHDisplay::LoadCerenkovs(Int_t chamber)
     TVector *phit = new TVector(1000);
     for (Int_t track=0; track<ntracks;track++) {
        gAlice->ResetHits();
-       gAlice->TreeH()->GetEvent(track);
+       pRICH->TreeH()->GetEvent(track);
        TClonesArray *pRICHCerenkovs  = pRICH->Cerenkovs();
        if (pRICHCerenkovs == 0) return;
        Int_t nhits = pRICHCerenkovs->GetEntriesFast();