Clear up a confusion between HV channel alias and name (where there is a -1 offset...
authorlaphecet <laphecet@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 22 Oct 2012 16:30:36 +0000 (16:30 +0000)
committerlaphecet <laphecet@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 22 Oct 2012 16:30:36 +0000 (16:30 +0000)
MUON/AliMUONHVSubprocessor.cxx
MUON/AliMUONManuPainter.cxx
MUON/AliMUONPadStatusMaker.cxx
MUON/AliMUONQADataMakerRec.cxx
MUON/AliMUONTrackerConditionDataMaker.cxx
MUON/AliMUONTriggerDCSSubprocessor.cxx
MUON/AliMUONTriggerQADataMakerRec.cxx
MUON/mapping/AliMpDCSNamer.cxx
MUON/mapping/AliMpDCSNamer.h

index f639b7a..89205e3 100644 (file)
@@ -89,16 +89,16 @@ AliMUONHVSubprocessor::Process(TMap* dcsAliasMap)
       {
         for ( int i = 0; i <3; ++i)
         {
-          aliases.Add(new TObjString(hvNamer.DCSChannelName(detElemId,i)));
+          aliases.Add(new TObjString(hvNamer.DCSAliasName(detElemId,i)));
         }
       }
       break;
       case AliMp::kStation345:
       {
-        aliases.Add(new TObjString(hvNamer.DCSChannelName(detElemId)));
+        aliases.Add(new TObjString(hvNamer.DCSAliasName(detElemId)));
         for ( int i = 0; i < hvNamer.NumberOfPCBs(detElemId); ++i)
         {
-          aliases.Add(new TObjString(hvNamer.DCSSwitchName(detElemId,i)));
+          aliases.Add(new TObjString(hvNamer.DCSSwitchAliasName(detElemId,i)));
         }
       }
       break;
index e416f9e..7a484cb 100644 (file)
@@ -178,11 +178,11 @@ AliMUONManuPainter::Describe(const AliMUONVTrackerData& data, Int_t dataIndex,
     {
       Int_t sector = hvNamer.ManuId2Sector(fDetElemId,fManuId);
 
-      rv += hvNamer.DCSChannelName(fDetElemId,sector);
+      rv += hvNamer.DCSChannelNameFromAlias(hvNamer.DCSAliasName(fDetElemId,sector));
     }
     else
     {
-      rv += hvNamer.DCSChannelName(fDetElemId);
+        rv += hvNamer.DCSChannelNameFromAlias(hvNamer.DCSAliasName(fDetElemId));
     }
   }
   
index 81fbe54..e9a2a34 100644 (file)
@@ -234,7 +234,7 @@ AliMUONPadStatusMaker::HVSt12Status(Int_t detElemId, Int_t sector,
   
   AliMpDCSNamer hvNamer("TRACKER");
   
-  TString hvChannel(hvNamer.DCSChannelName(detElemId,sector));
+  TString hvChannel(hvNamer.DCSAliasName(detElemId,sector));
   
   TMap* hvMap = fkCalibrationData.HV();
   TPair* hvPair = static_cast<TPair*>(hvMap->FindObject(hvChannel.Data()));
@@ -345,7 +345,7 @@ AliMUONPadStatusMaker::HVSt345Status(Int_t detElemId, Int_t pcbIndex,
   
   Int_t chamberId = AliMpDEManager::GetChamberId(detElemId);
   
-  TString hvChannel(hvNamer.DCSChannelName(detElemId));
+  TString hvChannel(hvNamer.DCSAliasName(detElemId));
   
   TMap* hvMap = fkCalibrationData.HV();
   
@@ -384,7 +384,7 @@ AliMUONPadStatusMaker::HVSt345Status(Int_t detElemId, Int_t pcbIndex,
     }
   }
   
-  TString hvSwitch(hvNamer.DCSSwitchName(detElemId,pcbIndex));
+  TString hvSwitch(hvNamer.DCSSwitchAliasName(detElemId,pcbIndex));
   TPair* switchPair = static_cast<TPair*>(hvMap->FindObject(hvSwitch.Data()));
   if (!switchPair)
   {
index 88ee923..0f91829 100644 (file)
@@ -46,6 +46,7 @@ fTracker(tracker ? new AliMUONTrackerQADataMakerRec(this) : 0x0),
 fTrigger(trigger ? new AliMUONTriggerQADataMakerRec(this) : 0x0)
 {
   /// ctor
+  AliInfo(Form("tracker=%d trigger=%d",tracker,trigger));
 }
 
 //__________________________________________________________________
index 4379f55..beaf3c1 100644 (file)
@@ -297,7 +297,7 @@ AliMUONTrackerConditionDataMaker::CreateHVStore(TMap& m)
       
       if ( nPCBs ) 
       {
-        TString switchName(hvNamer.DCSSwitchName(detElemId,i));
+        TString switchName(hvNamer.DCSSwitchAliasName(detElemId,i));
 
         TPair* p = static_cast<TPair*>(m.FindObject(switchName.Data()));
         TObjArray* a = static_cast<TObjArray*>(p->Value());
index 4476895..50b57e9 100644 (file)
@@ -88,7 +88,7 @@ AliMUONTriggerDCSSubprocessor::Process(TMap* dcsAliasMap)
     if ( AliMpDEManager::GetStationType(detElemId) == AliMp::kStationTrigger) {
 
       for(Int_t iMeas=0; iMeas<AliMpDCSNamer::kNDCSMeas; iMeas++){
-       aliases.Add(new TObjString(dcsMapNamer.DCSChannelName(detElemId, 0, iMeas)));
+       aliases.Add(new TObjString(dcsMapNamer.DCSAliasName(detElemId, 0, iMeas)));
       }
 
     }
index 733f6f3..1799139 100644 (file)
@@ -1158,7 +1158,7 @@ AliMUONTriggerQADataMakerRec::GetDCSValues(Int_t iMeas, Int_t detElemId,
 
   if ( AliMpDEManager::GetStationType(detElemId) != AliMp::kStationTrigger) return 0x0;
 
-  TString currAlias = triggerDcsNamer.DCSChannelName(detElemId, 0, iMeas);
+  TString currAlias = triggerDcsNamer.DCSAliasName(detElemId, 0, iMeas);
 
   TPair* triggerDcsPair = static_cast<TPair*>(triggerDcsMap->FindObject(currAlias.Data()));
 
index ae17c7c..50b9a9b 100644 (file)
@@ -376,30 +376,35 @@ AliMpDCSNamer::DetElemId2DCS(Int_t detElemId, Int_t& side, Int_t &chId) const
 
 
 //_____________________________________________________________________________
-const char* 
-  AliMpDCSNamer::DCSChannelName(Int_t detElemId, Int_t sector, Int_t dcsMeasure) const
+const char*
+AliMpDCSNamer::DCSChannelNameFromAlias(const char* dcsAliasName) const
 {
-  /// Return the alias name of the DCS Channel for a given DCS area 
-  /// \param detElemId 
-  /// \param sector = 0,1 or 2 for St12, and is unused for st345 and trigger
-  /// \param dcsMeasure = kDCSHV, kDCSI and is unused for tracker
+  /// Convert an AliasName to a ChannelName.
+  /// This method is needed because there is, for MCH, a -1 offset
+  /// between channel and alias name for some
+  /// unknown reason deeply rooted in DCS ???)
+  ///
+  /// \param dcsAliasName
+
+  Int_t detElemId = DetElemIdFromDCSAlias(dcsAliasName);
   
   Int_t chamberId = AliMpDEManager::GetChamberId(detElemId);
   if ( chamberId < 0 ) return 0x0;
-
+    
   Int_t side(-1), chId(-1);
   Int_t dcsNumber = DetElemId2DCS(detElemId,side,chId);
-
+  Int_t index = DCSIndexFromDCSAlias(dcsAliasName);
+    
   switch (AliMpDEManager::GetStationType(detElemId))
   {
     case AliMp::kStation12:
-      return Form(fgkDCSChannelSt12Pattern[side],chamberId,dcsNumber,sector);
+      return Form(fgkDCSChannelSt12Pattern[side],chamberId+1,dcsNumber+1,index+1);
       break;
     case AliMp::kStation345:
-      return Form(fgkDCSChannelSt345Pattern[side],chamberId,dcsNumber);
+      return Form(fgkDCSChannelSt345Pattern[side],chamberId+1,dcsNumber+1);
       break;
     case AliMp::kStationTrigger:
-      return Form(fgkDCSChannelTriggerPattern[side],fgkDCSSideTriggerName[side],chId,dcsNumber,fgkDCSMeasureName[dcsMeasure]);
+          return dcsAliasName;
       break;
     default:
       return 0x0;
@@ -408,8 +413,40 @@ const char*
 }
 
 //_____________________________________________________________________________
+const char*
+AliMpDCSNamer::DCSAliasName(Int_t detElemId, Int_t sector, Int_t dcsMeasure) const
+{
+    /// Return the alias name of the DCS Channel for a given DCS area
+    /// \param detElemId
+    /// \param sector = 0,1 or 2 for St12, and is unused for st345 and trigger
+    /// \param dcsMeasure = kDCSHV, kDCSI and is unused for tracker
+    
+    Int_t chamberId = AliMpDEManager::GetChamberId(detElemId);
+    if ( chamberId < 0 ) return 0x0;
+    
+    Int_t side(-1), chId(-1);
+    Int_t dcsNumber = DetElemId2DCS(detElemId,side,chId);
+    
+    switch (AliMpDEManager::GetStationType(detElemId))
+    {
+        case AliMp::kStation12:
+            return Form(fgkDCSChannelSt12Pattern[side],chamberId,dcsNumber,sector);
+            break;
+        case AliMp::kStation345:
+            return Form(fgkDCSChannelSt345Pattern[side],chamberId,dcsNumber);
+            break;
+        case AliMp::kStationTrigger:
+            return Form(fgkDCSChannelTriggerPattern[side],fgkDCSSideTriggerName[side],chId,dcsNumber,fgkDCSMeasureName[dcsMeasure]);
+            break;
+        default:
+            return 0x0;
+            break;
+    }
+}
+
+//_____________________________________________________________________________
 const char* 
-AliMpDCSNamer::DCSSwitchName(Int_t detElemId, Int_t pcbNumber) const
+AliMpDCSNamer::DCSSwitchAliasName(Int_t detElemId, Int_t pcbNumber) const
 {
   /// Return the alias name of the DCS Switch for a given PCB 
   /// within a slat of St345
@@ -604,14 +641,14 @@ AliMpDCSNamer::GenerateAliases() const
        case AliMp::kStation12:
          for ( int sector = 0; sector < 3; ++sector)
          {
-           aliases->Add(new TObjString(DCSChannelName(detElemId,sector)));
+           aliases->Add(new TObjString(DCSAliasName(detElemId,sector)));
          }
          break;
        case AliMp::kStation345:
-         aliases->Add(new TObjString(DCSChannelName(detElemId)));
+         aliases->Add(new TObjString(DCSAliasName(detElemId)));
          for ( Int_t i = 0; i < NumberOfPCBs(detElemId); ++i )
          {
-           aliases->Add(new TObjString(DCSSwitchName(detElemId,i)));
+           aliases->Add(new TObjString(DCSSwitchAliasName(detElemId,i)));
          }
          break;
        default:
@@ -625,7 +662,7 @@ AliMpDCSNamer::GenerateAliases() const
        {
        case AliMp::kStationTrigger:
          AliDebug(10,Form("Current DetElemId %i",detElemId));
-         aliases->Add(new TObjString(DCSChannelName(detElemId,0,iMeas)));
+         aliases->Add(new TObjString(DCSAliasName(detElemId,0,iMeas)));
          break;
        default:
          break;
index 503fb89..c2f1094 100644 (file)
@@ -28,9 +28,11 @@ public:
 
   Bool_t SetDetector(const char* detName);
   
-  const char* DCSChannelName(Int_t detElemId, Int_t sector=0, Int_t dcsMeasure=0) const;
-  
-  const char* DCSSwitchName(Int_t detElemId, Int_t pcbNumber) const;
+  const char* DCSChannelNameFromAlias(const char* dcsAliasName) const;
+
+  const char* DCSAliasName(Int_t detElemId, Int_t sector=0, Int_t dcsMeasure=0) const;
+
+  const char* DCSSwitchAliasName(Int_t detElemId, Int_t pcbNumber) const;
 
   Int_t DCS2DE(Int_t chamberId, Int_t side, Int_t dcsNumber) const;