]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - MUON/AliMUONVDigit.cxx
Put index into track's name instead of its label.
[u/mrichter/AliRoot.git] / MUON / AliMUONVDigit.cxx
index 56721f5793234b347cab80748afa59e068a3c73b..dd9c8001e8b244ce7de2bd604d3b445700403054 100644 (file)
@@ -15,6 +15,7 @@
 
 // $Id$
 
+//-----------------------------------------------------------------------------
 /// \class AliMUONVDigit
 ///
 /// This is the base class of a MUON digit that most client code should deal with.
@@ -38,6 +39,7 @@
 /// the (half) dimensions (in cm) of the pad it corresponds to.
 ///
 /// \author Laurent Aphecetche, Subatech
+//-----------------------------------------------------------------------------
 
 #include "AliMUONVDigit.h"
 
@@ -73,6 +75,10 @@ AliMUONVDigit::~AliMUONVDigit()
 Bool_t 
 AliMUONVDigit::IsEqual(const TObject* object) const
 {
+  /// Whether we're equal to object. 
+  /// WARNING : only based on our identifiers (de,manu,channel,cathode), not our
+  /// content (i.e. charge, status...)
+  
   const AliMUONVDigit* d = static_cast<const AliMUONVDigit*>(object);
     
   return ( DetElemId() == d->DetElemId() &&
@@ -85,6 +91,9 @@ AliMUONVDigit::IsEqual(const TObject* object) const
 Int_t 
 AliMUONVDigit::Compare(const TObject* object) const
 {
+  /// Compare two digits, trying to get as complete an order as possible.
+  /// We sort by DE, then by charge, then by manu, etc...
+  ///
   const AliMUONVDigit* d = static_cast<const AliMUONVDigit*>(object);
   
   if ( DetElemId() > d->DetElemId() ) 
@@ -107,17 +116,24 @@ AliMUONVDigit::Compare(const TObject* object) const
     }
     else
     {
-      if ( ManuId() < d->ManuId() )
+      if ( ManuId() > d->ManuId() )
       {
         return 1;
       }
-      else if ( ManuId() > d->ManuId() )
+      else if ( ManuId() < d->ManuId() )
       {
         return -1;
       }
       else
       {
-        return ( ManuChannel() < d->ManuChannel() ) ? 1 : -1;
+        if ( ManuChannel() > d->ManuChannel() )
+        {
+          return 1;
+        }
+        else if ( ManuChannel() < d->ManuChannel() )
+        {
+          return -1;
+        }
       }
     }
   }