]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - MUON/mapping/AliMpDEManager.cxx
In MUONChamberMaterialBudget.C
[u/mrichter/AliRoot.git] / MUON / mapping / AliMpDEManager.cxx
index 4b65e37a26dcedae9b1da03602932c98fb16237d..0b308e12ae30f57a5fcdaa9a1d4c57d93c6506bf 100644 (file)
 // $Id$
 // $MpId: AliMpDEManager.cxx,v 1.4 2006/05/24 13:58:34 ivana Exp $
 // Category: management
-//
+
+//-----------------------------------------------------------------------------
 // Class AliMpDEManager
 // --------------------
 // The manager class for definition of detection element types
 // Authors: Ivana Hrivnacova, IPN Orsay
 //          Laurent Aphecetche, SUBATECH Nantes
+//-----------------------------------------------------------------------------
 
 #include "AliMpDEManager.h"
 #include "AliMpDEStore.h"
 #include "AliMpDetElement.h"
 #include "AliMpConstants.h"
 #include "AliMpCathodType.h"
+#include "AliMpEncodePair.h"
 
 #include "AliLog.h"
 
@@ -152,12 +155,12 @@ Int_t AliMpDEManager::GetGeomModuleId(Int_t detElemId, Bool_t warn)
   if ( ! IsValidDetElemId(detElemId, warn) ) return -1;
   
   return detElemId/fgkCoefficient 
-           + (detElemId >=  505 && detElemId <=  513 || detElemId >= 600 )
-          + (detElemId >=  605 && detElemId <=  613 || detElemId >= 700 )
-          + (detElemId >=  707 && detElemId <=  719 || detElemId >= 800 )
-          + (detElemId >=  807 && detElemId <=  819 || detElemId >= 900 )
-          + (detElemId >=  907 && detElemId <=  919 || detElemId >= 1000 )
-          + (detElemId >= 1007 && detElemId <= 1019 || detElemId >= 1100 ) - 1;
+    + ((detElemId >=  505 && detElemId <=  513) || detElemId >= 600 )
+    + ((detElemId >=  605 && detElemId <=  613) || detElemId >= 700 )
+    + ((detElemId >=  707 && detElemId <=  719) || detElemId >= 800 )
+    + ((detElemId >=  807 && detElemId <=  819) || detElemId >= 900 )
+    + ((detElemId >=  907 && detElemId <=  919) || detElemId >= 1000 )
+    + ((detElemId >= 1007 && detElemId <= 1019) || detElemId >= 1100 ) - 1;
 }  
 
 //______________________________________________________________________________
@@ -184,12 +187,27 @@ AliMp::StationType AliMpDEManager::GetStationType(Int_t detElemId)
 
   if ( ! IsValidDetElemId(detElemId, true) ) {
     AliFatalClass("Cannot return AliMp::StationType value.");
-    return AliMp::kStation1;
+    return AliMp::kStation12;
   }  
   
   return GetDetElement(detElemId)->GetStationType();
 }
 
+//______________________________________________________________________________
+AliMq::Station12Type AliMpDEManager::GetStation12Type(Int_t detElemId)
+{
+/// Return station12 type                                                    \n
+/// Failure causes Fatal error - as AliMp::StationNumber has no possibility
+/// to return undefined value
+
+  if ( ! IsValidDetElemId(detElemId, true) ) {
+    AliFatalClass("Cannot return AliMp::Station12Type value.");
+    return AliMq::kNotSt12;
+  }  
+  
+  return GetDetElement(detElemId)->GetStation12Type();
+}
+
 //______________________________________________________________________________
 AliMp::CathodType 
 AliMpDEManager::GetCathod(Int_t detElemId, AliMp::PlaneType planeType)
@@ -228,13 +246,14 @@ Int_t AliMpDEManager::GetNofDEInChamber(Int_t chamberId, Bool_t warn)
 }
 
 //______________________________________________________________________________
-AliMpIntPair AliMpDEManager::GetDetElemIdRange(Int_t chamberId)
+MpPair_t AliMpDEManager::GetDetElemIdRange(Int_t chamberId)
 {
 /// Return the detection element Id range for given chamberId
+/// es encoded pair
  
-  if ( ! IsValidChamberId(chamberId) ) return AliMpIntPair::Invalid();
+  if ( ! IsValidChamberId(chamberId) ) return 0;
 
-  return AliMpIntPair(
+  return AliMp::Pair(
            (chamberId+1)*fgkCoefficient,
            (chamberId+1)*fgkCoefficient + GetNofDEInChamber(chamberId) - 1);