]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - MUON/AliMUONCluster.cxx
Sergey: bug fix with storing cluster id's
[u/mrichter/AliRoot.git] / MUON / AliMUONCluster.cxx
index d12ee700c524e119ae89f3cde680cbcb46527d30..2ab947e661bf03f99a54c23ba191df8ce51d5af5 100644 (file)
 #include <TVirtualX.h>
 
 #include "AliMUONCluster.h"
+#include "AliMUONPad.h"
+
+#include "AliMpEncodePair.h"
 
 #include "AliLog.h"
-#include "AliMUONPad.h"
 
 //-----------------------------------------------------------------------------
 /// \class AliMUONCluster
@@ -274,8 +276,8 @@ AliMUONCluster::Area() const
   }
 
   // then construct the area from those limits
-  return AliMpArea((lowerLeft+upperRight)/2,
-                   (upperRight-lowerLeft)/2);
+  return AliMpArea((lowerLeft+upperRight).X()/2,(lowerLeft+upperRight).Y()/2, 
+                   (upperRight-lowerLeft).X()/2, (upperRight-lowerLeft).Y()/2);
 }
 
 //_____________________________________________________________________________
@@ -304,8 +306,8 @@ AliMUONCluster::Area(Int_t cathode) const
   }
   
   // then construct the area from those limits
-  return AliMpArea((lowerLeft+upperRight)/2,
-                   (upperRight-lowerLeft)/2);
+  return AliMpArea((lowerLeft+upperRight).X()/2,(lowerLeft+upperRight).Y()/2,
+                   (upperRight-lowerLeft).X()/2, (upperRight-lowerLeft).Y()/2);
 }
 
 //_____________________________________________________________________________
@@ -504,43 +506,43 @@ AliMUONCluster::Multiplicity(Int_t cathode) const
 }
 
 //_____________________________________________________________________________
-AliMpIntPair
+Long_t
 AliMUONCluster::NofPads(Int_t statusMask, Bool_t matchMask) const
 {
   /// Number of pads satisfying (or not, depending matchMask) a
-  /// given mask
+  /// given mask 
   
   Int_t nx, ny;
   
   TVector2 dim0(MinPadDimensions(0,statusMask,matchMask));
   TVector2 dim1(MinPadDimensions(1,statusMask,matchMask));
   
-  AliMpIntPair npad0(NofPads(0,statusMask,matchMask));
-  AliMpIntPair npad1(NofPads(1,statusMask,matchMask));
+  Long_t npad0(NofPads(0,statusMask,matchMask));
+  Long_t npad1(NofPads(1,statusMask,matchMask));
   
   if ( TMath::Abs( (dim0-dim1).X() ) < 1E-3 )
   {
-    nx = TMath::Max( npad0.GetFirst(), npad1.GetFirst() );
+    nx = TMath::Max( AliMp::PairFirst(npad0), AliMp::PairFirst(npad1) );
   }
   else
   {
-    nx = dim0.X() < dim1.X() ? npad0.GetFirst() : npad1.GetFirst();
+    nx = dim0.X() < dim1.X() ? AliMp::PairFirst(npad0) : AliMp::PairFirst(npad1);
   }
   
   if ( TMath::Abs( (dim0-dim1).Y() ) < 1E-3 )
   {
-    ny = TMath::Max( npad0.GetSecond(), npad1.GetSecond() );
+    ny = TMath::Max( AliMp::PairSecond(npad0), AliMp::PairSecond(npad1) );
   }
   else
   {
-    ny = dim0.Y() < dim1.Y() ? npad0.GetSecond() : npad1.GetSecond();
+    ny = dim0.Y() < dim1.Y() ? AliMp::PairSecond(npad0) : AliMp::PairSecond(npad1);
   }
   
-  return AliMpIntPair(nx,ny);
+  return AliMp::Pair(nx,ny);
 }
 
 //_____________________________________________________________________________
-AliMpIntPair
+Long_t
 AliMUONCluster::NofPads(Int_t cathode,
                         Int_t statusMask, Bool_t matchMask) const
 {
@@ -550,7 +552,7 @@ AliMUONCluster::NofPads(Int_t cathode,
   Int_t n = Multiplicity(cathode);
   if (!n) 
   {
-    return AliMpIntPair(0,0);
+    return 0;
   }
   Double_t* x = new Double_t[n];
   Double_t* y = new Double_t[n];
@@ -573,7 +575,7 @@ AliMUONCluster::NofPads(Int_t cathode,
   delete[] x;
   delete[] y;
   
-  return AliMpIntPair(cx,cy);
+  return AliMp::Pair(cx,cy);
 }
 
 //_____________________________________________________________________________
@@ -700,21 +702,21 @@ AliMUONCluster::Compare(const TObject* obj) const
   AliMpArea carea(cluster->Area());
   AliMpArea area(Area());
 
-  if ( carea.Position().X() > area.Position().X() ) 
+  if ( carea.GetPositionX() > area.GetPositionX() ) 
   {
     return 1;
   }
-  else if ( carea.Position().X() < area.Position().X() ) 
+  else if ( carea.GetPositionX() < area.GetPositionX() ) 
   {
     return -1;
   }
   else 
   {
-    if ( carea.Position().Y() > area.Position().Y() ) 
+    if ( carea.GetPositionY() > area.GetPositionY() ) 
     {
       return 1;
     }
-    else if ( carea.Position().Y() < area.Position().Y() ) 
+    else if ( carea.GetPositionY() < area.GetPositionY() ) 
     {
       return -1;
     }