]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - MUON/mapping/AliMpDetElement.cxx
Fixing previous change, empty argument macros not supported everywhere
[u/mrichter/AliRoot.git] / MUON / mapping / AliMpDetElement.cxx
index 1948c9fca8c8b938b96f982016526701996bbae9..7a66c6983bd7a73bc33077544b9a91eb1680b682 100644 (file)
@@ -30,7 +30,7 @@
 #include "AliMpArrayI.h"
 #include "AliMpConstants.h"
 #include "AliMpDEManager.h"
-#include "AliMpHVNamer.h"
+#include "AliMpDCSNamer.h"
 #include "AliMpHVUID.h"
 #include "AliMpManuUID.h"
 #include "AliMpPadUID.h"
@@ -58,8 +58,6 @@ AliMpDetElement::AliMpDetElement(Int_t id, const TString& name,
     fSegType(segType),
     fPlaneType(planeType),
     fBusPatchIds(false),
-    fManuToSerialNbs(),
-    fSerialNbToManus(),
     fManuList(),
     fTrackerChannels(),
     fHVmanus(),
@@ -77,8 +75,6 @@ AliMpDetElement::AliMpDetElement(TRootIOCtor* ioCtor)
     fSegType(),
     fPlaneType(),
     fBusPatchIds(),
-    fManuToSerialNbs(),
-    fSerialNbToManus(),
     fManuList(),
     fTrackerChannels(),
     fHVmanus(ioCtor),
@@ -115,21 +111,6 @@ Bool_t AliMpDetElement::AddBusPatch(Int_t busPatchId)
   return true;
 }  
  
-//______________________________________________________________________________
-void AliMpDetElement::AddManuSerial(Int_t manuId, Int_t serialNb)
-{
-/// Map the serial manu number 
-/// (Eventually add check if the given pair already present)
-
-  AliCodeTimerAuto("");
-  
-  AliDebug(1,Form("DE %4d ManuId %4d SerialNB %d",
-               fId,manuId,serialNb));
-  
-  fManuToSerialNbs.Add(Long_t(manuId), Long_t(serialNb)); 
-  fSerialNbToManus.Add(Long_t(serialNb), Long_t(manuId));
-}      
-
 //______________________________________________________________________________
 TString AliMpDetElement::GetSegName(AliMp::CathodType cathType) const
 {
@@ -179,17 +160,38 @@ AliMp::StationType AliMpDetElement::GetStationType() const
   Int_t chamberId = AliMpDEManager::GetChamberId(fId, false);
   if ( ! AliMpDEManager::IsValidChamberId(chamberId, true) ) {
     AliFatal("Cannot return AliMp::StationType value.");
-    return AliMp::kStation1;
+    return AliMp::kStation12;
   }  
   
-  if ( chamberId ==  0 || chamberId ==  1 )  return AliMp::kStation1;
-  if ( chamberId ==  2 || chamberId ==  3 )  return AliMp::kStation2;
+  if ( chamberId >=  0 && chamberId <=  3 )  return AliMp::kStation12;
   if ( chamberId >=  4 && chamberId <=  9 )  return AliMp::kStation345;
   if ( chamberId >= 10 && chamberId <= 13 )  return AliMp::kStationTrigger;
 
   // Should never get to this line
   AliFatal("Cannot return AliMp::StationType value.");
-  return AliMp::kStation1;
+  return AliMp::kStation12;
+}
+
+//______________________________________________________________________________
+AliMq::Station12Type AliMpDetElement::GetStation12Type() const
+{
+/// Return station12 type                                                      \n
+/// Failure causes Fatal error - as AliMp::Station12Type has no possibility
+/// to return undefined value
+
+  Int_t chamberId = AliMpDEManager::GetChamberId(fId, false);
+  if ( ! AliMpDEManager::IsValidChamberId(chamberId, true) ) {
+    AliFatal("Cannot return AliMp::StationType value.");
+    return AliMq::kNotSt12;
+  }  
+  
+  if ( chamberId ==  0 || chamberId ==  1 )  return AliMq::kStation1;
+  if ( chamberId ==  2 || chamberId ==  3 )  return AliMq::kStation2;
+  if ( chamberId >=  4 || chamberId <= 13 )  return AliMq::kNotSt12;
+
+  // Should never get to this line
+  AliFatal("Cannot return AliMp::StationType value.");
+  return AliMq::kNotSt12;
 }
 
 //______________________________________________________________________________
@@ -223,22 +225,6 @@ Bool_t  AliMpDetElement::HasBusPatchId(Int_t busPatchId) const
   return fBusPatchIds.HasValue(busPatchId);; 
 }
 
-//______________________________________________________________________________
-Int_t  AliMpDetElement::GetManuSerialFromId(Int_t manuId) const
-{
-/// Return manu serial number from manuId
-
-  return (Int_t)fManuToSerialNbs.GetValue(Long_t(manuId));
-}
-
-//______________________________________________________________________________
-Int_t  AliMpDetElement::GetManuIdFromSerial(Int_t serialNb) const
-{
-/// Return manuId from manu serial number
-  
-  return (Int_t)fSerialNbToManus.GetValue(Long_t(serialNb));
-}
-
 //______________________________________________________________________________
 Int_t 
 AliMpDetElement::NofChannelsInManu(Int_t manuId) const
@@ -288,7 +274,7 @@ AliMpDetElement::AddManu(Int_t manuId)
   
   if ( stationType == AliMp::kStationTrigger ) return;
     
-  AliCodeTimerAuto("")
+  AliCodeTimerAuto("",0)
   
   AliDebug(1,Form("DE %4d Manu %4d",fId,manuId));
 
@@ -324,7 +310,7 @@ AliMpDetElement::AddManu(Int_t manuId)
   
   for ( Int_t i = 0; i < AliMpConstants::ManuNofChannels(); ++i ) 
   {
-    if ( seg->PadByLocation(AliMpIntPair(manuId,i),kFALSE).IsValid() )
+    if ( seg->PadByLocation(manuId,i,kFALSE).IsValid() )
     {
       ++n;
       fTrackerChannels.Add((Long_t)AliMpPadUID::BuildUniqueID(fId,manuId,i),
@@ -336,7 +322,7 @@ AliMpDetElement::AddManu(Int_t manuId)
 
   fNofChannels += n;
   
-  AliMpHVNamer hvNamer;
+  AliMpDCSNamer hvNamer("TRACKER");
   
   Int_t index = hvNamer.ManuId2Index(fId,manuId);
                             
@@ -364,14 +350,6 @@ AliMpDetElement::ManusForHV(Int_t hvIndex) const
   return static_cast<AliMpArrayI*>(fHVmanus.GetValue(AliMpHVUID::BuildUniqueID(fId,hvIndex)));
 }
 
-//______________________________________________________________________________
-Int_t 
-AliMpDetElement::NofManusWithSerialNumber() const
-{
-  /// Return the number of manus which have a serial number in this detection element  
-  return fManuToSerialNbs.GetSize();
-}
-
 //______________________________________________________________________________
 Int_t 
 AliMpDetElement::NofManus() const