]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - MUON/AliMUONVDigit.cxx
Updating macro to test GRP preprocessor with new input files.
[u/mrichter/AliRoot.git] / MUON / AliMUONVDigit.cxx
index 56721f5793234b347cab80748afa59e068a3c73b..8d8107e8a28c47cee6d6b10ed25dd5736373e94e 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"
 
@@ -59,6 +61,7 @@ AliMUONVDigit::AliMUONVDigit(Int_t detElemId, Int_t eCardId,
 
 //_____________________________________________________________________________
 AliMUONVDigit::AliMUONVDigit()
+: TObject() 
 {
   /// Default ctor
 }
@@ -73,6 +76,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 +92,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 +117,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;
+        }
       }
     }
   }