Consolidation of AliMUONTrackerHV class
authorlaphecet <laphecet@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 6 Nov 2012 16:07:19 +0000 (16:07 +0000)
committerlaphecet <laphecet@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 6 Nov 2012 16:07:19 +0000 (16:07 +0000)
MUON/AliMUONCalibrationData.cxx
MUON/AliMUONManuPainter.cxx
MUON/AliMUONTrackerHV.cxx
MUON/AliMUONTrackerHV.h
MUON/mapping/AliMpDCSNamer.cxx
MUON/mapping/AliMpDCSNamer.h

index 1df6ae8..b4f8462 100644 (file)
@@ -660,7 +660,7 @@ AliMUONCalibrationData::CreateHV(Int_t runNumber,
         
         if ( messages ) 
         {
-          messages->Add(new TObjString(Form("%s:%s",hvChannelName->String().Data(),msg.Data())));
+          messages->Add(new TObjString(Form("%s %s",hvChannelName->String().Data(),msg.Data())));
         }
         
         if (!ok)
index 7a484cb..4b53a0a 100644 (file)
@@ -178,11 +178,11 @@ AliMUONManuPainter::Describe(const AliMUONVTrackerData& data, Int_t dataIndex,
     {
       Int_t sector = hvNamer.ManuId2Sector(fDetElemId,fManuId);
 
-      rv += hvNamer.DCSChannelNameFromAlias(hvNamer.DCSAliasName(fDetElemId,sector));
+      rv += hvNamer.DCSNameFromAlias(hvNamer.DCSAliasName(fDetElemId,sector));
     }
     else
     {
-        rv += hvNamer.DCSChannelNameFromAlias(hvNamer.DCSAliasName(fDetElemId));
+        rv += hvNamer.DCSNameFromAlias(hvNamer.DCSAliasName(fDetElemId));
     }
   }
   
index 6fee865..8d744f7 100644 (file)
 // $Id$
 
 #include "AliMUONTrackerHV.h"
-#include "Riostream.h"
-#include "TObjArray.h"
-#include "TObjString.h"
-#include "AliDCSValue.h"
-#include "TMap.h"
+
+#include <algorithm>
 #include <map>
-#include "AliMpDCSNamer.h"
-#include "TH2.h"
-#include "TStyle.h"
-#include "AliCDBEntry.h"
-#include "AliCDBManager.h"
-#include "TLine.h"
 #include <set>
+
+#include "AliCDBManager.h"
+#include "AliCDBEntry.h"
+#include "AliDCSValue.h"
+#include "AliGRPObject.h"
+#include "AliMpDCSNamer.h"
+#include "AliMpDEStore.h"
+#include "AliMUONCalibrationData.h"
+#include "AliMUONCDB.h"
 #include "AliLog.h"
+
+#include "TCanvas.h"
 #include "TGraph.h"
+#include "TH2.h"
+#include "TLine.h"
+#include "TMap.h"
 #include "TMultiGraph.h"
-#include "AliMUONCDB.h"
-#include "TCanvas.h"
-#include "AliMUONCalibrationData.h"
-#include "AliGRPObject.h"
-#include <map>
-#include <algorithm>
+#include "TObjArray.h"
+#include "TObjString.h"
+#include "TStyle.h"
+#include "Riostream.h"
+
+//
+// Class to inspect the MUON TRACKER HV values
+//
+// With this class you can :
+//
+// a) get a list of trips (method ReportTrips)
+// b) print the values for some (or all) HV channels (method Print)
+// c) plot the values for some (or all) HV channels (method Plot)
+// d) get a list of HV channels that are "OFF" (methods Scan and HVoff)
+//
+// Note that in this class, all the output (either text or canvas) or the
+// channel *names* used are the same as in the DCS UI at Pt2
+// Specifically the chamber ids start at 1, the slat numbers at 1 and
+// the quad and sect number at 1 also. And not at zero like for the
+// DCS *aliases*. On the contraty, the internal map, coming from the OCDB,
+// only contains aliases, not names. Confusing ? It is.
+//
 
 ClassImp(AliMUONTrackerHV)
 
 //______________________________________________________________________________
-AliMUONTrackerHV::AliMUONTrackerHV(const char* runlist, const char* ocdbPath) : TObject(), fRunList(), fOCDBPath(ocdbPath)
+AliMUONTrackerHV::AliMUONTrackerHV(const char* runlist, const char* ocdbPath)
+: TObject(), fRunList(), fOCDBPath(ocdbPath), fDCSNamer(0x0)
 {
   // ctor from a runlist (txt file)
   SetRunList(runlist);
 }
 
 //______________________________________________________________________________
-AliMUONTrackerHV::AliMUONTrackerHV(Int_t runNumber, const char* ocdbPath) : TObject(), fRunList(), fOCDBPath(ocdbPath)
+AliMUONTrackerHV::AliMUONTrackerHV(Int_t runNumber, const char* ocdbPath)
+: TObject(), fRunList(), fOCDBPath(ocdbPath), fDCSNamer(0x0)
 {
   // ctor for a single run
   SetRunList(runNumber);
@@ -59,6 +82,7 @@ AliMUONTrackerHV::AliMUONTrackerHV(Int_t runNumber, const char* ocdbPath) : TObj
 AliMUONTrackerHV::~AliMUONTrackerHV()
 {
   // dtor
+  delete fDCSNamer;
 }
 
 //______________________________________________________________________________
@@ -106,6 +130,21 @@ void AliMUONTrackerHV::ReadIntegers(const char* filename, std::vector<int>& inte
   std::sort(integers.begin(),integers.end());
 }
 
+//______________________________________________________________________________
+AliMpDCSNamer*
+AliMUONTrackerHV::DCSNamer() const
+{
+  // return the dcs namer
+  if (!fDCSNamer)
+  {
+    if (!AliMpDEStore::Instance(false))
+    {
+      AliMUONCDB::LoadMapping();
+    }
+    fDCSNamer = new AliMpDCSNamer("TRACKER");
+  }
+  return fDCSNamer;
+}
 
 //______________________________________________________________________________
 void AliMUONTrackerHV::SetRunList(Int_t runNumber)
@@ -162,36 +201,30 @@ AliMUONTrackerHV::SetRunList(const char* runlist)
 
 //______________________________________________________________________________
 TGraph*
-AliMUONTrackerHV::ShowValues(TMap* m, const char* name)
+AliMUONTrackerHV::GraphValues(TMap* m, const char* dcsname)
 {
-  // make a graph of HV channels' voltage values for a given dcs alias (name)
+  // make a graph of HV channels' voltage values for a given dcs name (name, not
+  // alias)
   
-  TGraph* g(0x0);
+  if ( TString(dcsname).Contains("sw") )
+  {
+    // do not graph switches
+    return 0x0;
+  }
+
+  
+  AliInfo(dcsname);
   
-  AliInfo(name);
+  TPair* p = static_cast<TPair*>(m->FindObject(DCSNamer()->DCSAliasFromName(dcsname).Data()));
+  
+  if (!p) return 0x0;
   
-  TPair* p = static_cast<TPair*>(m->FindObject(name));
   TObjArray* a = static_cast<TObjArray*>(p->Value());
   TIter n2(a);
   AliDCSValue* val;
   Int_t i(0);
-  
-  while ( ( val = static_cast<AliDCSValue*>(n2()) ) )
-  {
-    StdoutToAliInfo(std::cout << Form("i=%5d ",i);
-                    val->Print(""););
-    ++i;
-  }
-  
-  if ( TString(name).Contains("sw") ) 
-  {
-    // do not graph switches
-    return 0x0;    
-  }
-  
-  n2.Reset();
-  g = new TGraph(a->GetEntries());
-  i = 0;
+
+  TGraph* g = new TGraph(a->GetEntries());
   while ( ( val = static_cast<AliDCSValue*>(n2()) ) )
   {
     g->SetPoint(i,val->GetTimeStamp(),val->GetFloat());
@@ -206,10 +239,13 @@ AliMUONTrackerHV::Scan(Int_t verbose)
 {
   /// Retrieve HV values from OCDB for a given run list, and check whether
   /// we have some issues with them...
+  /// If you pipe the results of this into a text file, you can then
+  /// feed it to the HVoff method for further investigations.
+  ///
   
   if ( fRunList.empty() )
   {
-    std::cout << "No runs to process..." << std::endl;
+    AliError("No runs to process...");
     return;    
   }
     
@@ -277,8 +313,6 @@ void AliMUONTrackerHV::HVoff(const char* logfile, const char* outputBaseName)
   
   results.insert(std::make_pair<int,std::string>(run,message));
   
-  AliMpDCSNamer hvNamer("TRACKER");
-  
   TH2* hvoff = new TH2I(outputBaseName,outputBaseName,1,0,1,1,0,1);
   
   std::map<int,std::string>::const_iterator it;
@@ -294,7 +328,7 @@ void AliMUONTrackerHV::HVoff(const char* logfile, const char* outputBaseName)
       TString s(str->String());
       TObjArray* parts = s.Tokenize(":");
       TString alias = (static_cast<TObjString*>(parts->At(0)))->String();
-      TString channel = hvNamer.DCSChannelNameFromAlias(alias.Data());
+      TString channel = DCSNamer()->DCSNameFromAlias(alias.Data());
       channel.ReplaceAll(".actual.vMon","");
       hvoff->Fill(Form("%6d",it->first),channel.Data(),1.0);
       delete parts;
@@ -336,20 +370,21 @@ void AliMUONTrackerHV::TimeAxis(TMultiGraph* g)
 
 //______________________________________________________________________________
 TMultiGraph*
-AliMUONTrackerHV::ShowHV(TMap* m, const char* dcsname)
+AliMUONTrackerHV::GraphHV(TMap* m, const char* dcsname)
 {
+  // Make a graph of the values matching dcsname
   TIter next(m);
   TObjString* s;
-  AliMpDCSNamer hvNamer("TRACKER");
+  
   TMultiGraph* mg = new TMultiGraph;
 
   while ( ( s = static_cast<TObjString*>(next()) ) )
   {
-    TString name(s->String());
+    TString name(DCSNamer()->DCSNameFromAlias(s->String()));
     
     if ( dcsname && !name.Contains(dcsname)) continue;
     
-    TGraph* g = ShowValues(m,name);
+    TGraph* g = GraphValues(m,name);
     
     if ( g ) 
     {
@@ -366,9 +401,60 @@ AliMUONTrackerHV::ShowHV(TMap* m, const char* dcsname)
 
 //______________________________________________________________________________
 void
+AliMUONTrackerHV::Print(Option_t* dcsname) const
+{
+  /// Print HV values for a given dcs name (or all if dcsname=0)
+  
+  AliCDBManager::Instance()->SetDefaultStorage(fOCDBPath.Data());
+  TList messages;
+  messages.SetOwner(kTRUE);
+  
+  for ( std::vector<int>::size_type iRun = 0; iRun < fRunList.size(); ++iRun )
+  {
+    Int_t runNumber = fRunList[iRun];
+    
+    AliInfo("---------------------");
+    AliInfo(Form("RUN %09d",runNumber));
+    
+    messages.Delete();
+    
+    AliCDBManager::Instance()->SetRun(runNumber);
+    
+    TMap* m = AliMUONCalibrationData::CreateHV(runNumber,0x0,kFALSE,&messages,kTRUE);
+    
+    TIter next(m);
+    TObjString* s;
+    
+    while ( ( s = static_cast<TObjString*>(next()) ) )
+    {      
+      TString name(DCSNamer()->DCSNameFromAlias(s->String()));
+      
+      if ( dcsname && !name.Contains(dcsname)) continue;
+      
+      TPair* p = static_cast<TPair*>(m->FindObject(DCSNamer()->DCSAliasFromName(dcsname).Data()));
+      
+      if (!p) continue;
+      
+      TObjArray* a = static_cast<TObjArray*>(p->Value());
+      TIter n2(a);
+      AliDCSValue* val;
+      Int_t i(0);
+      
+      while ( ( val = static_cast<AliDCSValue*>(n2()) ) )
+      {
+        std::cout << Form("i=%5d ",i) << std::endl;
+        val->Print("");
+        ++i;
+      }
+    }
+  }
+}
+
+//______________________________________________________________________________
+void
 AliMUONTrackerHV::Plot(const char* dcsname, Bool_t withPatch)
 {
-  /// Show HV values for a given dcs alias (or all if dcsname=0)
+  /// Show HV values for a given dcs name (or all if dcsname=0)
   /// Each canvas for each run will go to a separate PDF file
   
   AliCDBManager::Instance()->SetDefaultStorage(fOCDBPath.Data());
@@ -383,9 +469,9 @@ AliMUONTrackerHV::Plot(const char* dcsname, Bool_t withPatch)
     
     AliCDBManager::Instance()->SetRun(runNumber);
     
-    TMap* m = AliMUONCalibrationData::CreateHV(runNumber,0x0,withPatch,&messages);
+    TMap* m = AliMUONCalibrationData::CreateHV(runNumber,0x0,withPatch,&messages,kTRUE);
     
-    TMultiGraph* mg = ShowHV(m,dcsname);
+    TMultiGraph* mg = GraphHV(m,dcsname);
     
     if ( !mg ) continue;
     
@@ -454,16 +540,17 @@ AliMUONTrackerHV::Plot(const char* dcsname, Bool_t withPatch)
 
 //______________________________________________________________________________
 void
-AliMUONTrackerHV::ReportTrips()
+AliMUONTrackerHV::ReportTrips(Bool_t includeLowOnes)
 {
   /// Report trips
+  /// if includeLowOnes is kTRUE we'll report also the trips which starts from non-operational voltage values
   
   AliCDBManager::Instance()->SetDefaultStorage(fOCDBPath.Data());
   
   TList messages;
   messages.SetOwner(kTRUE);
   TObjString* msg(0);
-  
+
   for ( std::vector<int>::size_type i = 0; i < fRunList.size(); ++i )
   {
     Int_t runNumber = fRunList[i];
@@ -476,13 +563,18 @@ AliMUONTrackerHV::ReportTrips()
     
     AliCDBManager::Instance()->SetRun(runNumber);
     
-    AliMUONCalibrationData::CreateHV(runNumber,0x0,kTRUE,&messages);
+    AliMUONCalibrationData::CreateHV(runNumber,0x0,kTRUE,&messages,kTRUE);
+    
+    if (!AliMpDEStore::Instance(false))
+    {
+      AliMUONCDB::LoadMapping();
+    }
     
     TIter next(&messages);
 
     while ( ( msg = static_cast<TObjString*>(next())) )
     {
-      if ( msg->String().Contains("TRIP") )
+      if ( msg->String().Contains("TRIP") && ( includeLowOnes || !msg->String().Contains("LOWTRIP") ) )
       {
         ++ntrips;
       }
@@ -497,9 +589,32 @@ AliMUONTrackerHV::ReportTrips()
     {
       if ( msg->String().Contains("TRIP") )
       {
-          Int_t index = msg->String().Index("TS:");
-          UInt_t timeStamp = TString(msg->String()(index+strlen("TS:"),msg->String().Length()-index)).Atoi();
-        report[timeStamp] = msg->String().Data();
+        TObjArray* parts = msg->String().Tokenize(" ");
+        TString channelName(static_cast<TObjString*>(parts->At(0))->String());
+        
+        for ( Int_t ip = 0; ip <= parts->GetLast(); ++ip)
+        {
+          TString p(static_cast<TObjString*>(parts->At(ip))->String());
+          
+          if ( p.Contains("TRIP") )
+          {
+            if ( includeLowOnes || !p.Contains("LOWTRIP") )
+            {
+              TString ts(static_cast<TObjString*>(parts->At(ip+2))->String());
+          
+              ip += 3;
+          
+              Int_t index = ts.Index("TS:");
+          
+              UInt_t timeStamp = TString(ts(index+strlen("TS:"),ts.Length()-index)).Atoi();
+          
+              TString tmp(msg->String());
+              tmp.ReplaceAll(channelName.Data(),DCSNamer()->DCSNameFromAlias(channelName.Data()));
+              report[timeStamp] = tmp.Data();
+            }
+          }
+        }
+        delete parts;
       }
     }
 
index 7be346f..456559c 100644 (file)
@@ -16,6 +16,7 @@
 class TMultiGraph;
 class TMap;
 class TGraph;
+class AliMpDCSNamer;
 
 class AliMUONTrackerHV : public TObject
 {
@@ -32,8 +33,10 @@ public:
   void HVoff(const char* logfile="lhc11de.log", const char* outputBaseName="hvoff");
 
   void Plot(const char* dcsname=0x0, Bool_t withPatch=kFALSE);
-  
-  void ReportTrips();
+
+  void Print(Option_t* dcsname="") const;
+
+  void ReportTrips(Bool_t includeLowOnes=kFALSE);
   
   void Scan(Int_t verbose=0);
   
@@ -41,19 +44,22 @@ private:
 
   void ReadIntegers(const char* filename, std::vector<int>& integers);
 
-  TGraph* ShowValues(TMap* m, const char* name);
+  TGraph* GraphValues(TMap* m, const char* name);
   
   Int_t CheckMap(TMap* hvMap, Int_t runNumber, Bool_t verbose);
   
   void TimeAxis(TMultiGraph* g);
   
-  TMultiGraph* ShowHV(TMap* m, const char* dcsname);
+  TMultiGraph* GraphHV(TMap* m, const char* dcsname);
   
+  AliMpDCSNamer* DCSNamer() const;
+
 private:
   std::vector<int> fRunList; // input run list
   TString fOCDBPath; // ocdb path (raw:// by default)
+  mutable AliMpDCSNamer* fDCSNamer; // helper to name things
   
-  ClassDef(AliMUONTrackerHV,1) // Utility class to inspect MUON Tracker HV values
+  ClassDef(AliMUONTrackerHV,2) // Utility class to inspect MUON Tracker HV values
 };
 
 #endif
index 50b9a9b..3d06fec 100644 (file)
@@ -59,7 +59,19 @@ const char* AliMpDCSNamer::fgkDCSChannelSt345Pattern[] =
 const char* AliMpDCSNamer::fgkDCSChannelSt12Pattern[] = 
 {
   "MchHvLvLeft/Chamber%02dLeft/Quad%dSect%d.actual.vMon",
-  "MchHvLvRight/Chamber%02dRight/Quad%dSect%d.actual.vMon",
+  "MchHvLvRight/Chamber%02dRight/Quad%dSect%d.actual.vMon"
+};
+
+const char* AliMpDCSNamer::fgkDCSQuadrantPattern[] =
+{
+  "MchHvLvLeft/Chamber%02dLeft/Quad%d",
+  "MchHvLvRight/Chamber%02dRight/Quad%d"  
+};
+
+const char* AliMpDCSNamer::fgkDCSChamberPattern[] =
+{
+  "MchHvLvLeft/Chamber%02dLeft",
+  "MchHvLvRight/Chamber%02dRight"
 };
 
 const char* AliMpDCSNamer::fgkDCSSideTrackerName[] = { "Left", "Right" };
@@ -374,78 +386,170 @@ AliMpDCSNamer::DetElemId2DCS(Int_t detElemId, Int_t& side, Int_t &chId) const
   return dcsNumber;
 }
 
+//_____________________________________________________________________________
+TString
+AliMpDCSNamer::DCSNameFromAlias(const char* dcsAlias) const
+{
+  /// Convert a (possibly partial) aliasname to a name (only for MCH)
+  
+  TString salias(dcsAlias);
+  
+  if ( !salias.Contains("MchHvLv") ) return dcsAlias;
+  
+  Int_t quadrantNumber(-1);
+  Int_t chamberNumber(-1);
+  Int_t side(-1);
+  
+  if ( salias.Contains("Left")) side = 0;
+  if ( salias.Contains("Right")) side = 1;
+  
+  if ( side < 0 ) return "";
+  
+  TString channelName;
+  
+  if ( salias.Contains("Slat") )
+  {
+    Int_t slatNumber(-1);
+    sscanf(salias.Data(),fgkDCSChannelSt345Pattern[side],&chamberNumber,&slatNumber);
+    ++chamberNumber;
+    ++slatNumber;
+    channelName = TString::Format(fgkDCSChannelSt345Pattern[side],chamberNumber,slatNumber);
+  }
+  else if ( salias.Contains("Sect") )
+  {
+    Int_t sectorNumber(-1);
+    sscanf(salias.Data(),fgkDCSChannelSt12Pattern[side],&chamberNumber,&quadrantNumber,&sectorNumber);
+    ++chamberNumber;
+    ++quadrantNumber;
+    ++sectorNumber;
+    channelName =  TString::Format(fgkDCSChannelSt12Pattern[side],chamberNumber,quadrantNumber,sectorNumber);
+  }
+  else if ( salias.Contains("Quad") )
+  {
+    sscanf(salias.Data(),fgkDCSQuadrantPattern[side],&chamberNumber,&quadrantNumber);
+    ++chamberNumber;
+    ++quadrantNumber;
+    channelName =  TString::Format(fgkDCSQuadrantPattern[side],chamberNumber,quadrantNumber);
+  }
+  else if ( salias.Contains("Chamber") )
+  {
+    sscanf(salias.Data(),fgkDCSChamberPattern[side],&chamberNumber);
+    ++chamberNumber;
+    channelName =  TString::Format(fgkDCSChamberPattern[side],chamberNumber);
+  }
+
+  if ( TString(dcsAlias).Contains("iMon") )
+  {
+    channelName.ReplaceAll("vMon","iMon");
+  }
+  
+  return channelName;
+}
 
 //_____________________________________________________________________________
-const char*
-AliMpDCSNamer::DCSChannelNameFromAlias(const char* dcsAliasName) const
+TString
+AliMpDCSNamer::DCSAliasFromName(const char* dcsName) const
 {
-  /// 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
+  /// Convert a (possibly partial) dcsname to an alias (only for MCH)
+  
+  TString sname(dcsName);
+  
+  if ( !sname.Contains("MchHvLv") ) return dcsName;
+  
+  Int_t quadrantNumber(-1);
+  Int_t chamberNumber(-1);
+  Int_t side(-1);
+  
+  if ( sname.Contains("Left")) side = 0;
+  if ( sname.Contains("Right")) side = 1;
+  
+  if ( side < 0 ) return "";
+  
+  TString channelName;
+  
+  if ( sname.Contains("Slat") )
+  {
+    Int_t slatNumber(-1);
+    sscanf(sname.Data(),fgkDCSChannelSt345Pattern[side],&chamberNumber,&slatNumber);
+    --chamberNumber;
+    --slatNumber;
+    channelName = TString::Format(fgkDCSChannelSt345Pattern[side],chamberNumber,slatNumber);
+  }
+  else if ( sname.Contains("Sect") )
+  {
+    Int_t sectorNumber(-1);
+    sscanf(sname.Data(),fgkDCSChannelSt12Pattern[side],&chamberNumber,&quadrantNumber,&sectorNumber);
+    --chamberNumber;
+    --quadrantNumber;
+    --sectorNumber;
+    channelName =  TString::Format(fgkDCSChannelSt12Pattern[side],chamberNumber,quadrantNumber,sectorNumber);
+  }
+  else if ( sname.Contains("Quad") )
+  {
+    sscanf(sname.Data(),fgkDCSQuadrantPattern[side],&chamberNumber,&quadrantNumber);
+    --chamberNumber;
+    --quadrantNumber;
+    channelName =  TString::Format(fgkDCSQuadrantPattern[side],chamberNumber,quadrantNumber);
+  }
+  else if ( sname.Contains("Chamber") )
+  {
+    sscanf(sname.Data(),fgkDCSChamberPattern[side],&chamberNumber);
+    --chamberNumber;
+    channelName =  TString::Format(fgkDCSChamberPattern[side],chamberNumber);
+  }
+  
+  if ( TString(dcsName).Contains("iMon") )
+  {
+    channelName.ReplaceAll("vMon","iMon");
+  }
+  
+  return channelName;
+}
 
-  Int_t detElemId = DetElemIdFromDCSAlias(dcsAliasName);
+//_____________________________________________________________________________
+TString
+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
   
   Int_t chamberId = AliMpDEManager::GetChamberId(detElemId);
-  if ( chamberId < 0 ) return 0x0;
-    
+  if ( chamberId < 0 ) return "";
+  
   Int_t side(-1), chId(-1);
   Int_t dcsNumber = DetElemId2DCS(detElemId,side,chId);
-  Int_t index = DCSIndexFromDCSAlias(dcsAliasName);
-    
+  
+  TString aliasName;
+  
   switch (AliMpDEManager::GetStationType(detElemId))
   {
     case AliMp::kStation12:
-      return Form(fgkDCSChannelSt12Pattern[side],chamberId+1,dcsNumber+1,index+1);
+      aliasName.Form(fgkDCSChannelSt12Pattern[side],chamberId,dcsNumber,sector);
       break;
     case AliMp::kStation345:
-      return Form(fgkDCSChannelSt345Pattern[side],chamberId+1,dcsNumber+1);
+      aliasName.Form(fgkDCSChannelSt345Pattern[side],chamberId,dcsNumber);
       break;
     case AliMp::kStationTrigger:
-          return dcsAliasName;
+      return TString::Format(fgkDCSChannelTriggerPattern[side],fgkDCSSideTriggerName[side],chId,dcsNumber,fgkDCSMeasureName[dcsMeasure]);
       break;
     default:
-      return 0x0;
+      return "";
       break;
   }
+  
+  if ( dcsMeasure == AliMpDCSNamer::kDCSI )
+  {
+    aliasName.ReplaceAll("vMon","iMon");
+  }
+  
+  return aliasName;
+  
 }
 
 //_____________________________________________________________________________
-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* 
+TString
 AliMpDCSNamer::DCSSwitchAliasName(Int_t detElemId, Int_t pcbNumber) const
 {
   /// Return the alias name of the DCS Switch for a given PCB 
@@ -453,9 +557,9 @@ AliMpDCSNamer::DCSSwitchAliasName(Int_t detElemId, Int_t pcbNumber) const
   
   if (AliMpDEManager::GetStationType(detElemId) == AliMp::kStation345)
   {
-    return Form(fgkDCSSwitchSt345Pattern,detElemId,pcbNumber);
+    return TString::Format(fgkDCSSwitchSt345Pattern,detElemId,pcbNumber);
   }
-  return 0x0;
+  return "";
 }
 
 //_____________________________________________________________________________
index c2f1094..9eb54fb 100644 (file)
@@ -28,11 +28,13 @@ public:
 
   Bool_t SetDetector(const char* detName);
   
-  const char* DCSChannelNameFromAlias(const char* dcsAliasName) const;
+  TString DCSNameFromAlias(const char* dcsAlias) const;
 
-  const char* DCSAliasName(Int_t detElemId, Int_t sector=0, Int_t dcsMeasure=0) const;
+  TString DCSAliasFromName(const char* dcsName) const;
 
-  const char* DCSSwitchAliasName(Int_t detElemId, Int_t pcbNumber) const;
+  TString DCSAliasName(Int_t detElemId, Int_t sector=0, Int_t dcsMeasure=0) const;
+
+  TString DCSSwitchAliasName(Int_t detElemId, Int_t pcbNumber) const;
 
   Int_t DCS2DE(Int_t chamberId, Int_t side, Int_t dcsNumber) const;
   
@@ -85,6 +87,9 @@ private:
     
   static const char* fgkDCSChannelSt345Pattern[]; ///< DCS Tracker Channel name template
   static const char* fgkDCSChannelSt12Pattern[]; ///< DCS Tracker Channel name template
+  static const char* fgkDCSQuadrantPattern[]; ///< DCS Tracker quadrant name template
+  static const char* fgkDCSChamberPattern[]; ///< DCS Tracker chamber name template
+  
   static const char* fgkDCSSwitchSt345Pattern; ///< DCS Tracker Switch name template
   static const char* fgkDCSSideTrackerName[]; ///< DCS Tracker Name of the side written in DCS