]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - MUON/mapping/AliMpSector.cxx
- Adding *.C *.txt *.sh to FILE_PATTERNS
[u/mrichter/AliRoot.git] / MUON / mapping / AliMpSector.cxx
index 94c942b066fc61e42f2ba5904f8992042c894dbc..91bf9fe733be1b32d072bcbe1aa9cde842502a17 100755 (executable)
@@ -33,6 +33,8 @@
 #include "AliMpIntPair.h"
 #include "AliMpConstants.h"
 
+#include "AliLog.h"
+
 #include <Riostream.h>
 
 /// \cond CLASSIMP
@@ -41,7 +43,7 @@ ClassImp(AliMpSector)
 
 //_____________________________________________________________________________
 AliMpSector::AliMpSector(const TString& id, Int_t nofZones, Int_t nofRows, 
-                         AliMpDirection direction, const TVector2& offset) 
+                         AliMp::Direction direction, const TVector2& offset) 
   : TNamed("Sector", ""),
     fID(id),
     fOffset(offset),
@@ -50,6 +52,7 @@ AliMpSector::AliMpSector(const TString& id, Int_t nofZones, Int_t nofRows,
     fMotifMap(0),
     fDirection(direction),
     fMinPadDimensions(TVector2(1.e6, 1.e6)),
+    fMaxPadDimensions(),
     fMaxPadIndices(AliMpIntPair::Invalid()),
     fNofPads(0)
 {
@@ -85,8 +88,9 @@ AliMpSector::AliMpSector()
     fZones(),
     fRows(),
     fMotifMap(0),
-    fDirection(kX),
+    fDirection(AliMp::kX),
     fMinPadDimensions(TVector2(0., 0.)),
+    fMaxPadDimensions(),
     fMaxPadIndices(AliMpIntPair::Invalid()),
     fNofPads(0)
 {
@@ -178,19 +182,26 @@ void  AliMpSector::SetGlobalIndices()
 }
 
 //_____________________________________________________________________________
-void  AliMpSector::SetMinPadDimensions()
+void  AliMpSector::SetMinMaxPadDimensions()
 {
 /// Set the minimal pad dimensions.
 
   for (Int_t i=1; i<GetNofZones()+1; i++) {
     TVector2 padDimensions = GetZone(i)->GetPadDimensions();
     
-    if ( fDirection == kX &&  
+    if ( fDirection == AliMp::kX &&  
          padDimensions.Y() > 0. && padDimensions.Y() < fMinPadDimensions.Y() ||
-         fDirection == kY && 
+         fDirection == AliMp::kY && 
         padDimensions.X() > 0. && padDimensions.X() < fMinPadDimensions.X())
       
       fMinPadDimensions = padDimensions;
+
+    if ( fDirection == AliMp::kX &&  
+         padDimensions.Y() > 0. && padDimensions.Y() > fMaxPadDimensions.Y() ||
+         fDirection == AliMp::kY && 
+        padDimensions.X() > 0. && padDimensions.X() > fMinPadDimensions.X())
+      
+      fMaxPadDimensions = padDimensions;
   }
 }
 
@@ -246,7 +257,7 @@ void AliMpSector::Initialize()
   SetRowOffsets();
   SetMotifPositions();
   SetGlobalIndices();
-  SetMinPadDimensions();
+  SetMinMaxPadDimensions();
   SetMaxPadIndices();
   SetNofPads();
 }  
@@ -507,12 +518,12 @@ AliMpRow* AliMpSector::GetRow(Int_t rowID) const
 }
 
 //_____________________________________________________________________________
-AliMpPlaneType
+AliMp::PlaneType
 AliMpSector::GetPlaneType() const
 {
 /// Return the plane type
 
-  return GetDirection()==kY ? kBendingPlane : kNonBendingPlane;
+  return GetDirection()==AliMp::kY ? AliMp::kBendingPlane : AliMp::kNonBendingPlane;
 }
 
 //_____________________________________________________________________________