]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - MUON/AliMUONPad.cxx
Modifed the files to use the constants N_ZROWS_MOD and N_ZCOLUMNS_MOD in replacement
[u/mrichter/AliRoot.git] / MUON / AliMUONPad.cxx
index 9cabb569929bec2a662ac35e3c0fbc3154cccf83..805829d55a3f05e91fe26cc948ca7cf131b18806 100644 (file)
@@ -26,6 +26,7 @@
 #include "TVector2.h"
 #include "TMath.h"
 
+//-----------------------------------------------------------------------------
 /// \class AliMUONPad
 ///
 /// Object gathering information about a hit pad.
@@ -37,6 +38,7 @@
 /// get neighboring information.
 ///
 /// \author Laurent Aphecetche
+//-----------------------------------------------------------------------------
 
 /// \cond CLASSIMP
 ClassImp(AliMUONPad)
@@ -152,6 +154,12 @@ fChargeBackup(0.0)
   Init(-1,-1,-1,-1,position,dimensions,charge);
 }
 
+//_____________________________________________________________________________
+AliMUONPad::~AliMUONPad()
+{
+/// Dtor
+}
+
 //_____________________________________________________________________________
 Bool_t 
 AliMUONPad::AreNeighbours(const AliMUONPad& d1, const AliMUONPad& d2) 
@@ -244,13 +252,21 @@ AliMUONPad::Compare(const TObject* obj) const
   
   const AliMUONPad* pad = static_cast<const AliMUONPad*>(obj);
     
+  if (DetElemId() < 0)
+  {
+    // AZ - For "pixels" from MLEM cluster finder
+    // we only sort on charge
+    if (Charge() == pad->Charge()) return 0;
+    return ( Charge() < pad->Charge() ) ? 1:-1;
+  }
+
   if ( DetElemId() > pad->DetElemId() )
   {
     return 1;
   }
-  else if ( DetElemId() > pad->DetElemId() )
+  else if ( DetElemId() < pad->DetElemId() )
   {
-    return 1;
+    return -1;
   }
   else
   {
@@ -310,13 +326,25 @@ AliMUONPad::Compare(const TObject* obj) const
             else
             {
               // same Y
-              return ( Charge() < pad->Charge() ) ? -1:1;              
-            }            
+              if ( Charge() < pad->Charge() ) 
+              {
+                return -1;
+              }
+              else if ( Charge() > pad->Charge() )
+              {
+                return 1;
+              }
+              else
+              {
+                return 0;
+              }
+            }
           }          
         }        
       }
     }
   }
+  return 0;
 }
 
 //_____________________________________________________________________________
@@ -424,6 +452,7 @@ AliMUONPad::Print(Option_t* opt) const
                  Y()-DY(),Y()+DY()) << endl;
   }
   cout << endl;
+  cout.precision(6); // reset to default precision
   cout.flags(oldflags);
 }