]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - MUON/mapping/AliMpMotif.cxx
Adding comment lines to class description needed for Root documentation,
[u/mrichter/AliRoot.git] / MUON / mapping / AliMpMotif.cxx
index 96d1b65fd6173947cc3c3de8ba0d6d930f7ab744..816d7396549ca207071898601516ef21b5caaac4 100755 (executable)
  **************************************************************************/
 
 // $Id$
-// $MpId: AliMpMotif.cxx,v 1.7 2005/08/26 15:43:36 ivana Exp $
+// $MpId: AliMpMotif.cxx,v 1.8 2006/05/24 13:58:41 ivana Exp $
 // Category: motif
-//
+
+//-----------------------------------------------------------------------------
 // Class AliMpMotif
 // ----------------
 // Class that defines a motif with its unique ID
 // and the motif type.
 // Included in AliRoot: 2003/05/02
 // Authors: David Guez, Ivana Hrivnacova; IPN Orsay
+//-----------------------------------------------------------------------------
 
 #include "AliMpMotif.h"
-#include "AliMpMotifType.h"
+
+#include "AliMpConstants.h"
 #include "AliMpIntPair.h"
+#include "AliMpMotifType.h"
 
+/// \cond CLASSIMP
 ClassImp(AliMpMotif)
+/// \endcond
 
 //_____________________________________________________________________________
 AliMpMotif::AliMpMotif()
@@ -96,9 +102,12 @@ AliMpIntPair AliMpMotif::PadIndicesLocal(const TVector2& localPos) const
   /// or (-1,-1) if this position doesn't correspond to any valid
   /// connection
 
-  TVector2 lowerLeft = localPos+Dimensions();
+  TVector2 lowerLeft(localPos);
+  
+  lowerLeft += Dimensions();
 
- if ( lowerLeft.X() < 0 || lowerLeft.Y() < 0 ) 
+  if ( lowerLeft.X() < - AliMpConstants::LengthTolerance() || 
+       lowerLeft.Y() < - AliMpConstants::LengthTolerance() ) 
     {
       return AliMpIntPair::Invalid();
     }
@@ -106,8 +115,8 @@ AliMpIntPair AliMpMotif::PadIndicesLocal(const TVector2& localPos) const
   Int_t ix = (Int_t)(lowerLeft.X()/(2.*fPadDimensions.X()));
   Int_t iy = (Int_t)(lowerLeft.Y()/(2.*fPadDimensions.Y()));
   
-  if (!GetMotifType()->FindConnectionByLocalIndices(AliMpIntPair(ix,iy))) {
-    //Warning("PadIndicesLocal","Position outside motif");
+  if (!GetMotifType()->FindConnectionByLocalIndices(AliMpIntPair(ix,iy)))
+  {
     return AliMpIntPair::Invalid();
   }
   return AliMpIntPair(ix,iy);