The Init method of AliITSreconstruction has to be called by the user. This was done...
[u/mrichter/AliRoot.git] / RICH / AliRICHPoints.cxx
index 0bb4911..771bc73 100644 (file)
 
 /*
   $Log$
+  Revision 1.9  2001/02/27 15:20:56  jbarbosa
+  Transition to SDigits.
+
+  Revision 1.8  2001/01/26 20:00:27  hristov
+  Major upgrade of AliRoot code
+
+  Revision 1.7  2000/11/02 09:10:57  jbarbosa
+  Removed AliRICHRecHit.h from include.
+
+  Revision 1.6  2000/10/03 21:44:09  morsch
+  Use AliSegmentation and AliHit abstract base classes.
+
+  Revision 1.5  2000/10/02 21:28:12  fca
+  Removal of useless dependecies via forward declarations
+
+  Revision 1.4  2000/10/02 15:50:43  jbarbosa
+  Fixed forward declarations.
+
+  Revision 1.3  2000/06/12 15:26:36  jbarbosa
+  Cleaned up version.
+
   Revision 1.2  2000/05/18 13:43:54  jbarbosa
   Added the ShowRing function.
 
 //                                                                           //
 ///////////////////////////////////////////////////////////////////////////////
 #include <TPad.h>
+#include <TTree.h>
 #include <TView.h>
 #include <TMath.h>
+#include <TPolyMarker3D.h>
+#include <TMarker3DBox.h>
 
+#include <AliRICH.h>
+#include "TParticle.h"
 #include "AliRICHDisplay.h"
 #include "AliRICHPoints.h"
 #include "AliRun.h"
 #include "AliRICHHit.h"
 #include "AliRICHCerenkov.h"
-#include "AliRICHPadHit.h"
+#include "AliRICHSDigit.h"
 #include "AliRICHDigit.h"
 #include "AliRICHRawCluster.h"
-#include "AliRICHRecHit.h"
 
 const Int_t kMaxNipx=400, kMaxNipy=800;
  
@@ -146,10 +171,8 @@ TParticle *AliRICHPoints::GetParticle() const
   //
   //   Returns pointer to particle index in AliRun::fParticles
   //
-  TClonesArray *particles = gAlice->Particles();
-  Int_t nparticles = particles->GetEntriesFast();
-  if (fIndex < 0 || fIndex >= nparticles) return 0;
-  return (TParticle*)particles->UncheckedAt(fIndex);
+  if (fIndex < 0 || fIndex >= gAlice->GetNtrack()) return 0;
+  return gAlice->Particle(fIndex);
 }
 
 //_____________________________________________________________________________
@@ -193,7 +216,7 @@ void AliRICHPoints::ShowRing(Int_t highlight) {
    
   AliRICH *pRICH  = (AliRICH*)gAlice->GetDetector("RICH");
   AliRICHChamber*       iChamber;
-  AliRICHSegmentation*  segmentation;
+  AliSegmentation*      segmentation;
 
       
   AliRICHPoints *points = 0;
@@ -201,10 +224,10 @@ void AliRICHPoints::ShowRing(Int_t highlight) {
     
   AliRICHHit *mHit = GetHit();
 
-  printf("Hit %d on chamber: %d\n",fHitIndex, mHit->fChamber);
+  printf("Hit %d on chamber: %d\n",fHitIndex, mHit->Chamber());
 
-  TClonesArray *digits  = pRICH->DigitsAddress(mHit->fChamber - 1);
-  iChamber = &(pRICH->Chamber(mHit->fChamber - 1));
+  TClonesArray *digits  = pRICH->DigitsAddress(mHit->Chamber() - 1);
+  iChamber = &(pRICH->Chamber(mHit->Chamber() - 1));
   segmentation=iChamber->GetSegmentationModel();
 
   Float_t dpx  = segmentation->Dpx();
@@ -221,19 +244,19 @@ void AliRICHPoints::ShowRing(Int_t highlight) {
      //printf("Particle %d belongs to ring %d \n", fTrackIndex, mdig->fTracks[1]);
 
     if (!points) continue;
-    if (fTrackIndex == mdig->fTracks[0]) {
+    if (fTrackIndex == mdig->Track(0)) {
 
-      printf("Digit %d from particle %d belongs to ring %d \n", digit, fTrackIndex, mdig->fTracks[0]);
+      printf("Digit %d from particle %d belongs to ring %d \n", digit, fTrackIndex, mdig->Track(0));
 
-      Int_t charge=mdig->fSignal;
+      Int_t charge=mdig->Signal();
       Int_t index=Int_t(TMath::Log(charge)/(TMath::Log(adc_satm)/22));
       Int_t color=701+index;
       if (color>722) color=722;
       points->SetMarkerColor(color);
       points->SetMarkerStyle(21);
       points->SetMarkerSize(.5);
-      Float_t xpad, ypad;
-      segmentation->GetPadCxy(mdig->fPadX, mdig->fPadY,xpad, ypad);
+      Float_t xpad, ypad, zpad;
+      segmentation->GetPadC(mdig->PadX(), mdig->PadY(),xpad, ypad, zpad);
       Float_t vectorLoc[3]={xpad,6.276,ypad};
       Float_t  vectorGlob[3];
       points->SetParticle(-1);
@@ -243,7 +266,7 @@ void AliRICHPoints::ShowRing(Int_t highlight) {
       iChamber->LocaltoGlobal(vectorLoc,vectorGlob);
       points->SetPoint(0,vectorGlob[0],vectorGlob[1],vectorGlob[2]);
       
-      segmentation->GetPadCxy(mdig->fPadX, mdig->fPadY, xpad, ypad);
+      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],
@@ -260,8 +283,7 @@ void AliRICHPoints::ShowRing(Int_t highlight) {
        if (marker)
          marker->Draw();
       }
-      TClonesArray *particles=gAlice->Particles();
-      TParticle *p = (TParticle*)particles->UncheckedAt(fIndex);
+      TParticle *p = gAlice->Particle(fIndex);
       printf("\nTrack index %d\n",fTrackIndex);
       printf("Particle ID %d\n",p->GetPdgCode());
       printf("Parent %d\n",p->GetFirstMother());