]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - EMCAL/AliEMCALRecPoint.cxx
Changed arrays
[u/mrichter/AliRoot.git] / EMCAL / AliEMCALRecPoint.cxx
index 613116b06bc29a412fc5bff294384611d2338128..88ef2a9052ddf530dc39c8d3a3153ea295256481 100644 (file)
@@ -25,8 +25,6 @@
 #include "TClonesArray.h"
 
 // --- Standard library ---
-#include <iostream.h>
-#include <stdio.h>
 
 // --- AliRoot header files ---
 
@@ -47,7 +45,7 @@ AliEMCALRecPoint::AliEMCALRecPoint()
   fMaxTrack = 0 ;
   fTheta = fPhi = 0. ; 
   fEMCALArm = 0;
-
+  fPRESection = fECASection = fHCASection = kFALSE ; 
 }
 
 //____________________________________________________________________________
@@ -110,8 +108,7 @@ void AliEMCALRecPoint::ExecuteEvent(Int_t event, Int_t px, Int_t py)
     
   case kButton1Down:{
     AliEMCALDigit * digit ;
-    AliEMCALGetter * gime = AliEMCALGetter::GetInstance() ; 
-    AliEMCALGeometry * emcalgeom =  const_cast<AliEMCALGeometry*>(gime->EMCALGeometry());
+    AliEMCALGeometry * emcalgeom =  (AliEMCALGetter::Instance())->EMCALGeometry() ;
 
     Int_t iDigit;
     Int_t relid[4] ;
@@ -170,7 +167,8 @@ break;
   }
 }
 //____________________________________________________________________________
-void AliEMCALRecPoint::EvalAll(Float_t logWeight,TClonesArray * digits) {
+void AliEMCALRecPoint::EvalAll(Float_t logWeight,TClonesArray * digits) 
+{
   //evaluates (if necessary) all RecPoint data members 
 
   EvalPrimaries(digits) ;
@@ -185,8 +183,7 @@ void AliEMCALRecPoint::EvalEMCALArm(AliEMCALDigit * digit)
   if( fEMCALArm == 0){
   Int_t relid[4] ; 
   
-  AliEMCALGetter * gime = AliEMCALGetter::GetInstance() ; 
-  AliEMCALGeometry * emcalgeom =  const_cast<AliEMCALGeometry*>(gime->EMCALGeometry());
+  AliEMCALGeometry * emcalgeom = (AliEMCALGetter::Instance())->EMCALGeometry();
 
   emcalgeom->AbsToRelNumbering(digit->GetId(), relid) ;
   fEMCALArm = relid[0];
@@ -214,7 +211,7 @@ void  AliEMCALRecPoint::EvalPrimaries(TClonesArray * digits)
     for ( jndex = 0 ; jndex < nprimaries ; jndex++ ) { // all primaries in digit
       if ( fMulTrack > fMaxTrack ) {
        fMulTrack = - 1 ;
-       cout << "AliEMCALRecPoint::GetNprimaries ERROR > increase fMaxTrack " << endl ;
+       Error("GetNprimaries", "increase fMaxTrack ")  ;
        break ;
       }
       Int_t newprimary = newprimaryarray[jndex] ;
@@ -242,19 +239,34 @@ void  AliEMCALRecPoint::EvalPrimaries(TClonesArray * digits)
   delete tempo ;
 
 }
+
 //____________________________________________________________________________
 void AliEMCALRecPoint::GetGlobalPosition(TVector3 & gpos) const
 {
   // returns the position of the cluster in the global reference system of ALICE
-  // and the uncertainty on this position
   
-  AliEMCALGeometry * emcalgeom = AliEMCALGetter::GetInstance()->EMCALGeometry();  
+  AliEMCALGeometry * emcalgeom = AliEMCALGetter::Instance()->EMCALGeometry();  
   gpos.SetX(fPhi) ;
-  gpos.SetY(emcalgeom->GetIPDistance() + emcalgeom->GetAirGap()) ;
+  if ( IsInECA() ) 
+    gpos.SetY(emcalgeom->GetIP2ECASection()) ;
+  else if ( IsInPRE() )
+    gpos.SetY(emcalgeom->GetIP2PRESection()) ;
+  else if ( IsInHCA() )
+    gpos.SetY(emcalgeom->GetIP2HCASection()) ;
+  else 
+    Fatal("GetGlobalPosition", "Unexpected tower section") ; 
   gpos.SetZ(fTheta) ; 
 }
 
+//____________________________________________________________________________
+void AliEMCALRecPoint::GetLocalPosition(TVector3 & lpos) const
+{
+  // returns the position of the cluster in the global reference system of ALICE
+  
+  lpos.SetX(fLocPos.X()) ;
+  lpos.SetY(fLocPos.Y()) ;
+  lpos.SetZ(fLocPos.Z()) ;
+}
 
 //______________________________________________________________________________
 void AliEMCALRecPoint::Paint(Option_t *)