Update in trigger code:
authorivana <ivana@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 20 Jan 2009 17:50:59 +0000 (17:50 +0000)
committerivana <ivana@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 20 Jan 2009 17:50:59 +0000 (17:50 +0000)
 - Creating shuttle preprocessor (AliMUONTriggerDCSSubprocessor) for getting
   trigger RPC HV and currents.
 - Add Trigger RPC HV and currents in QA.
 - Removed class AliMpHVNamer (using AliMpDCSNamer instead to handle both
   tracker and trigger)
 - Changed some variable, data members and function names to be consistent
Also:
 - Updated documentation of class AliMUONTriggerDisplay with further details.
(Diego)

27 files changed:
MUON/AliMUONCDB.cxx
MUON/AliMUONCDB.h
MUON/AliMUONCalibrationData.cxx
MUON/AliMUONCalibrationData.h
MUON/AliMUONHVSubprocessor.cxx
MUON/AliMUONPadStatusMaker.cxx
MUON/AliMUONQADataMakerRec.cxx
MUON/AliMUONQADataMakerRec.h
MUON/AliMUONTrackerData.cxx
MUON/AliMUONTrackerOCDBDataMaker.cxx
MUON/AliMUONTriggerDCSSubprocessor.cxx [new file with mode: 0644]
MUON/AliMUONTriggerDCSSubprocessor.h [new file with mode: 0644]
MUON/AliMUONTriggerDisplay.cxx
MUON/AliMUONTriggerPreprocessor.cxx
MUON/AliMUONTriggerPreprocessor.h
MUON/CMake_libMUONmapping.txt
MUON/CMake_libMUONshuttle.txt
MUON/MUONmappingLinkDef.h
MUON/MUONshuttleLinkDef.h
MUON/READMEshuttle.txt
MUON/TestMUONPreprocessor.C
MUON/libMUONmapping.pkg
MUON/libMUONshuttle.pkg
MUON/mapping/AliMpDCSNamer.cxx [moved from MUON/mapping/AliMpHVNamer.cxx with 50% similarity]
MUON/mapping/AliMpDCSNamer.h [new file with mode: 0644]
MUON/mapping/AliMpDetElement.cxx
MUON/mapping/AliMpHVNamer.h [deleted file]

index 7ccf9f7..a068741 100644 (file)
@@ -53,7 +53,7 @@
 #include "AliMpDEManager.h"
 #include "AliMpDetElement.h"
 #include "AliMpFiles.h"
-#include "AliMpHVNamer.h"
+#include "AliMpDCSNamer.h"
 #include "AliMpManuIterator.h"
 #include "AliMpSegmentation.h"
 #include "AliMpStationType.h"
@@ -326,7 +326,7 @@ AliMUONCDB::MakeHVStore(TMap& aliasMap, Bool_t defaultValues)
 {
   /// Create a HV store
   
-  AliMpHVNamer hvNamer;
+  AliMpDCSNamer hvNamer("TRACKER");
   
   TObjArray* aliases = hvNamer.GenerateAliases();
   
@@ -384,6 +384,54 @@ AliMUONCDB::MakeHVStore(TMap& aliasMap, Bool_t defaultValues)
 
 //_____________________________________________________________________________
 Int_t 
+AliMUONCDB::MakeTriggerDCSStore(TMap& aliasMap, Bool_t defaultValues)
+{
+  /// Create a Trigger HV and Currents store
+  
+  AliMpDCSNamer triggerDCSNamer("TRIGGER");
+  
+  TObjArray* aliases = triggerDCSNamer.GenerateAliases();
+  
+  Int_t nChannels[2] = {0, 0};
+  
+  for ( Int_t i = 0; i < aliases->GetEntries(); ++i ) 
+  {
+    TObjString* alias = static_cast<TObjString*>(aliases->At(i));
+    TString& aliasName = alias->String();
+
+    TObjArray* valueSet = new TObjArray;
+    valueSet->SetOwner(kTRUE);
+    Int_t measureType = triggerDCSNamer.DCSvariableFromDCSAlias(aliasName.Data());
+    for ( UInt_t timeStamp = 0; timeStamp < 60*15; timeStamp += 120 )
+    {
+      Float_t value = 
+       (measureType == AliMpDCSNamer::kDCSI) ? 0.4 : 8000.;
+      if (!defaultValues) {
+       switch (measureType){
+       case AliMpDCSNamer::kDCSI:
+         value = GetRandom(0.4,0.02,true);
+         break;
+       case AliMpDCSNamer::kDCSHV:
+         value = GetRandom(8000.,100.,true);
+         break;
+       }
+      }
+      AliDCSValue* dcsValue = new AliDCSValue(value,timeStamp);
+      valueSet->Add(dcsValue);
+    }
+    aliasMap.Add(new TObjString(*alias),valueSet);
+    ++nChannels[measureType];
+  }
+  
+  delete aliases;
+  
+  AliInfo(Form("Trigger channels I -> %i   HV -> %i",nChannels[0], nChannels[1]));
+  
+  return nChannels[0] + nChannels[1];
+}
+
+//_____________________________________________________________________________
+Int_t 
 AliMUONCDB::MakePedestalStore(AliMUONVStore& pedestalStore, Bool_t defaultValues)
 {
   /// Create a pedestal store. if defaultValues=true, ped.mean=ped.sigma=1,
@@ -952,6 +1000,26 @@ AliMUONCDB::WriteHV(Bool_t defaultValues,
 
 //_____________________________________________________________________________
 void 
+AliMUONCDB::WriteTriggerDCS(Bool_t defaultValues,
+                    Int_t startRun, Int_t endRun)
+{
+  /// generate Trigger HV and current values (either const if defaultValues=true or random
+  /// if defaultValues=false, see makeTriggerDCSStore) and
+  /// store them into CDB located at cdbpath, with a validity period
+  /// ranging from startRun to endRun
+  
+  TMap* triggerDCSStore = new TMap;
+  Int_t ngenerated = MakeTriggerDCSStore(*triggerDCSStore,defaultValues);
+  AliInfo(Form("Ngenerated = %d",ngenerated));
+  if (ngenerated>0)
+  {
+    WriteToCDB("MUON/Calib/TriggerDCS",triggerDCSStore,startRun,endRun,defaultValues);
+  }
+  delete triggerDCSStore;
+}
+
+//_____________________________________________________________________________
+void 
 AliMUONCDB::WritePedestals(Bool_t defaultValues,
                            Int_t startRun, Int_t endRun)
 {
@@ -1023,9 +1091,10 @@ AliMUONCDB::WriteCapacitances(Bool_t defaultValues,
 
 //_____________________________________________________________________________
 void
-AliMUONCDB::WriteTrigger(Int_t startRun, Int_t endRun)
+AliMUONCDB::WriteTrigger(Bool_t defaultValues, Int_t startRun, Int_t endRun)
 {
   /// Writes all Trigger related calibration to CDB
+  WriteTriggerDCS(defaultValues,startRun,endRun);
   WriteLocalTriggerMasks(startRun,endRun);
   WriteRegionalTriggerConfig(startRun,endRun);
   WriteGlobalTriggerConfig(startRun,endRun);
index 86595b5..39e6ba7 100644 (file)
@@ -16,7 +16,6 @@
 #include "AliCDBRunRange.h"
 
 class AliMUONVStore;
-class AliMUONVStore;
 class TMap;
 class AliMUONVCalibParam;
 class AliMUONTriggerLut;
@@ -37,6 +36,7 @@ public:
   Int_t MakeNeighbourStore(AliMUONVStore& neighbourStore);
 
   Int_t MakeHVStore(TMap& aliasMap, Bool_t defaultValues);
+  Int_t MakeTriggerDCSStore(TMap& aliasMap, Bool_t defaultValues);
   Int_t MakePedestalStore(AliMUONVStore& pedestalStore, Bool_t defaultValues);
   Int_t MakeCapacitanceStore(AliMUONVStore& capaStore, Bool_t defaultValues);
   Int_t MakeCapacitanceStore(AliMUONVStore& capaStore, const char* file);
@@ -62,11 +62,12 @@ public:
   void WriteToCDB(TObject* object, const char* calibpath, Int_t startRun=0, Int_t endRun=AliCDBRunRange::Infinity(),
                  const char* comment="", const char* responsible="AliMUONCDB tester class");
 
-  void WriteTrigger(Int_t startRun=0,Int_t endRun=AliCDBRunRange::Infinity());
+  void WriteTrigger(Bool_t defaultValues=kTRUE, Int_t startRun=0,Int_t endRun=AliCDBRunRange::Infinity());
   void WriteTracker(Bool_t defaultValues=kTRUE, Int_t startRun=0,Int_t endRun=AliCDBRunRange::Infinity());
   
   void WriteNeighbours(Int_t startRun=0, Int_t endRun=AliCDBRunRange::Infinity());
   void WriteHV(Bool_t defaultValues, Int_t startRun, Int_t endRun=AliCDBRunRange::Infinity());
+  void WriteTriggerDCS(Bool_t defaultValues, Int_t startRun, Int_t endRun=AliCDBRunRange::Infinity());
   void WritePedestals(Bool_t defaultValues, Int_t startRun, Int_t endRun=AliCDBRunRange::Infinity());
   void WriteGains(Bool_t defaultValues, Int_t startRun, Int_t endRun=AliCDBRunRange::Infinity());
   void WriteCapacitances(Bool_t defaultValues, Int_t startRun=0, Int_t endRun=AliCDBRunRange::Infinity());
index 8749b9b..07dff51 100644 (file)
@@ -62,6 +62,7 @@ fRunNumber(runNumber),
 fGains(0x0), 
 fPedestals(0x0),
 fHV(0x0),
+fTriggerDCS(0x0),
 fLocalTriggerBoardMasks(0x0),
 fRegionalTriggerConfig(0x0),
 fGlobalTriggerCrateConfig(0x0),
@@ -83,6 +84,7 @@ fNeighbours(0x0)
     Gains();
     Pedestals();
     HV();
+    TriggerDCS();
     LocalTriggerBoardMasks(0);
     RegionalTriggerConfig();
     GlobalTriggerCrateConfig();
@@ -151,6 +153,14 @@ AliMUONCalibrationData::CreateHV(Int_t runNumber, Int_t* startOfValidity)
 }
 
 //_____________________________________________________________________________
+TMap*
+AliMUONCalibrationData::CreateTriggerDCS(Int_t runNumber, Int_t* startOfValidity)
+{
+  /// Create a new Trigger HV and curent map from the OCDB for a given run
+  return dynamic_cast<TMap*>(CreateObject(runNumber,"MUON/Calib/TriggerDCS",startOfValidity));
+}
+
+//_____________________________________________________________________________
 AliMUONVStore*
 AliMUONCalibrationData::CreateLocalTriggerBoardMasks(Int_t runNumber, Int_t* startOfValidity)
 {
@@ -290,6 +300,19 @@ AliMUONCalibrationData::HV() const
 }
 
 //_____________________________________________________________________________
+TMap*
+AliMUONCalibrationData::TriggerDCS() const
+{
+  /// Return the calibration for a given (detElemId, manuId) pair
+  
+  if (!fTriggerDCS)
+  {
+    fTriggerDCS = CreateTriggerDCS(fRunNumber);
+  }
+  return fTriggerDCS;
+}
+
+//_____________________________________________________________________________
 AliMUONVStore*
 AliMUONCalibrationData::Neighbours() const
 {
@@ -364,6 +387,7 @@ AliMUONCalibrationData::Print(Option_t*) const
   << " fGains=" << fGains
   << " fPedestals=" << fPedestals
   << " fHV=" << fHV
+  << " fTriggerDCS=" << fTriggerDCS
   << " fLocalTriggerBoardMasks=" << fLocalTriggerBoardMasks
   << " fRegionalTriggerConfig=" << fRegionalTriggerConfig
   << " fGlobalTriggerCrateConfig=" << fGlobalTriggerCrateConfig
@@ -425,6 +449,8 @@ AliMUONCalibrationData::Reset()
   fGains = 0x0;
   delete fHV;
   fHV = 0x0;
+  delete fTriggerDCS;
+  fTriggerDCS = 0x0;
   delete fLocalTriggerBoardMasks;
   fLocalTriggerBoardMasks = 0x0;
   delete fRegionalTriggerConfig;
@@ -485,6 +511,15 @@ AliMUONCalibrationData::Check(Int_t runNumber)
     AliInfoClass("HV read OK");
   }
 
+  if ( !  CreateTriggerDCS(runNumber) )
+  {
+    AliErrorClass("Could not read Trigger HV and Currents");
+  }
+  else
+  {
+    AliInfoClass("Trigger HV and Currents read OK");
+  }
+
   if ( ! CreateNeighbours(runNumber) )
   {
     AliErrorClass("Could not read Neighbours");
index 69beda0..8bb1778 100644 (file)
@@ -51,6 +51,9 @@ public:
   /// Create a hv map (which must be deleted) from OCDB for the given run
   static TMap* CreateHV(Int_t runNumber, Int_t* startOfValidity=0);
 
+  /// Create a Trigger HV and current  map (which must be deleted) from OCDB for the given run
+  static TMap* CreateTriggerDCS(Int_t runNumber, Int_t* startOfValidity=0);
+
   /// Create a neighbours store (which must be deleted) from OCDB for the given run
   static AliMUONVStore* CreateNeighbours(Int_t runNumber, Int_t* startOfValidity=0);
   
@@ -79,6 +82,9 @@ public:
     
   /// Get the HV values
   TMap* HV() const;
+
+  /// Get the Trigger HV and current values
+  TMap* TriggerDCS() const;
     
   /// Whether this object is valid or not (might be invalid if fetching from CDB failed).
   Bool_t IsValid() const { return fIsValid; }
@@ -129,6 +135,7 @@ private:
   mutable AliMUONVStore* fGains; //!< Gains
   mutable AliMUONVStore* fPedestals; //!< Pedestals
   mutable TMap* fHV; //!< HV
+  mutable TMap* fTriggerDCS; //!< Trigger HV and Currents
   mutable AliMUONVStore* fLocalTriggerBoardMasks; //!< Local trigger board maska  
   mutable AliMUONRegionalTriggerConfig* fRegionalTriggerConfig; //!< Regional trigger config
   mutable AliMUONGlobalCrateConfig* fGlobalTriggerCrateConfig; //!< Global trigger crate config
@@ -138,7 +145,7 @@ private:
   mutable AliMUONVStore* fCapacitances; //!< Manu capacitances
   mutable AliMUONVStore* fNeighbours; //!< list of neighbours for all channels
   
-  ClassDef(AliMUONCalibrationData,7) // Storage for all MUON calibration data.
+  ClassDef(AliMUONCalibrationData,8) // Storage for all MUON calibration data.
 };
 
 #endif
index b782e5f..0f14525 100644 (file)
@@ -31,7 +31,7 @@
 
 #include "AliMpDEIterator.h"
 #include "AliMpDEManager.h"
-#include "AliMpHVNamer.h"
+#include "AliMpDCSNamer.h"
 
 #include "AliCDBMetaData.h"
 #include "AliLog.h"
@@ -68,7 +68,7 @@ AliMUONHVSubprocessor::Process(TMap* dcsAliasMap)
   TMap hv;
   hv.SetOwner(kTRUE);
   
-  AliMpHVNamer hvNamer;
+  AliMpDCSNamer hvNamer("TRACKER");
 
   AliMpDEIterator deIt;
 
@@ -90,16 +90,16 @@ AliMUONHVSubprocessor::Process(TMap* dcsAliasMap)
       {
         for ( int i = 0; i <3; ++i)
         {
-          aliases.Add(new TObjString(hvNamer.DCSHVChannelName(detElemId,i)));
+          aliases.Add(new TObjString(hvNamer.DCSChannelName(detElemId,i)));
         }
       }
       break;
       case AliMp::kStation345:
       {
-        aliases.Add(new TObjString(hvNamer.DCSHVChannelName(detElemId)));
+        aliases.Add(new TObjString(hvNamer.DCSChannelName(detElemId)));
         for ( int i = 0; i < hvNamer.NumberOfPCBs(detElemId); ++i)
         {
-          aliases.Add(new TObjString(hvNamer.DCSHVSwitchName(detElemId,i)));
+          aliases.Add(new TObjString(hvNamer.DCSSwitchName(detElemId,i)));
         }
       }
       break;
index d054910..6ebb8db 100644 (file)
@@ -42,7 +42,7 @@
 #include "AliMpDDLStore.h"
 #include "AliMpDEManager.h"
 #include "AliMpDetElement.h"
-#include "AliMpHVNamer.h"
+#include "AliMpDCSNamer.h"
 #include "AliMpManuUID.h"
 
 #include "AliCDBEntry.h"
@@ -263,9 +263,9 @@ AliMUONPadStatusMaker::HVSt12Status(Int_t detElemId, Int_t sector,
   hvChannelTooHigh = kFALSE;
   hvChannelON = kTRUE;
 
-  AliMpHVNamer hvNamer;
+  AliMpDCSNamer hvNamer("TRACKER");
   
-  TString hvChannel(hvNamer.DCSHVChannelName(detElemId,sector));
+  TString hvChannel(hvNamer.DCSChannelName(detElemId,sector));
   
   TMap* hvMap = fCalibrationData.HV();
   TPair* hvPair = static_cast<TPair*>(hvMap->FindObject(hvChannel.Data()));
@@ -331,9 +331,9 @@ AliMUONPadStatusMaker::HVSt345Status(Int_t detElemId, Int_t pcbIndex,
   hvSwitchON = kTRUE;
   hvChannelON = kTRUE;
   
-  AliMpHVNamer hvNamer;
+  AliMpDCSNamer hvNamer("TRACKER");
   
-  TString hvChannel(hvNamer.DCSHVChannelName(detElemId));
+  TString hvChannel(hvNamer.DCSChannelName(detElemId));
   
   TMap* hvMap = fCalibrationData.HV();
   
@@ -376,7 +376,7 @@ AliMUONPadStatusMaker::HVSt345Status(Int_t detElemId, Int_t pcbIndex,
     }
   }
   
-  TString hvSwitch(hvNamer.DCSHVSwitchName(detElemId,pcbIndex));
+  TString hvSwitch(hvNamer.DCSSwitchName(detElemId,pcbIndex));
   TPair* switchPair = static_cast<TPair*>(hvMap->FindObject(hvSwitch.Data()));
   if (!switchPair)
   {
@@ -446,7 +446,7 @@ AliMUONPadStatusMaker::HVStatus(Int_t detElemId, Int_t manuId) const
 
   Int_t status(0);
   
-  AliMpHVNamer hvNamer;
+  AliMpDCSNamer hvNamer("TRACKER");
   
   switch ( AliMpDEManager::GetStationType(detElemId) )
   {
index 7009631..5b9def3 100644 (file)
@@ -40,6 +40,7 @@
 #include "AliMUONTrack.h"
 #include "AliMUONTrackParam.h"
 #include "AliMUONESDInterface.h"
+#include "AliMUONCalibrationData.h"
 #include "AliMpBusPatch.h"
 #include "AliMpCDB.h"
 #include "AliMpConstants.h"
@@ -49,6 +50,7 @@
 #include "AliMpLocalBoard.h"
 #include "AliMpStationType.h"
 #include "AliMpTriggerCrate.h"
+#include "AliMpDCSNamer.h"
 #include "AliRawEventHeaderBase.h"
 
 // --- AliRoot header files ---
@@ -61,6 +63,7 @@
 #include "AliRawReader.h"
 #include "AliQAChecker.h"
 #include "AliCodeTimer.h"
+#include "AliDCSValue.h"
 
 // --- ROOT system ---
 #include <TClonesArray.h>
@@ -318,9 +321,40 @@ void AliMUONQADataMakerRec::InitRaws()
                        histoTitle = Form("Chamber %i: Scalers %s", 11+iChamber, cathName.Data());
                        TH2F* h5 = (TH2F*)triggerDisplay.GetEmptyDisplayHisto(histoName, AliMUONTriggerDisplay::kDisplayStrips, 
                                                                              iCath, iChamber, histoTitle);
-                       Add2RawsList(h5, kTriggerScalersDisplay + AliMpConstants::NofTriggerChambers()*iCath + iChamber,forExpert);
+                       Add2RawsList(h5, kTriggerScalersDisplay + AliMpConstants::NofTriggerChambers()*iCath + iChamber,!forExpert);
                }
        }
+
+       TH2F* h6 = new TH2F("hTriggerRPCI", "Trigger RPC currents",
+                           4, 10.5, 14.5,
+                           18, -0.5, 17.5);
+       h6->GetXaxis()->SetTitle("Chamber");
+       h6->GetYaxis()->SetTitle("RPC");
+       Add2RawsList(h6, kTriggerRPCi, forExpert);
+
+       TH2F* h7 = new TH2F("hTriggerRPCHV", "Trigger RPC HV",
+                           4, 10.5, 14.5,
+                           18, -0.5, 17.5);
+       h7->GetXaxis()->SetTitle("Chamber");
+       h7->GetYaxis()->SetTitle("RPC");
+       Add2RawsList(h7, kTriggerRPChv, forExpert);
+       
+       for(Int_t iChamber=0; iChamber<AliMpConstants::NofTriggerChambers(); iChamber++){
+         histoName = Form("hRPCIChamber%i", 11+iChamber);
+         histoTitle = Form("Chamber %i: RPC Currents (#muA)", 11+iChamber);
+         TH2F* h8 = (TH2F*)triggerDisplay.GetEmptyDisplayHisto(histoName, AliMUONTriggerDisplay::kDisplaySlats, 
+                                                               0, iChamber, histoTitle);
+         Add2RawsList(h8, kTriggerIDisplay + iChamber, !forExpert);
+       }
+
+       for(Int_t iChamber=0; iChamber<AliMpConstants::NofTriggerChambers(); iChamber++){
+         histoName = Form("hRPCHVChamber%i", 11+iChamber);
+         histoTitle = Form("Chamber %i: RPC HV (V)", 11+iChamber);
+         TH2F* h9 = (TH2F*)triggerDisplay.GetEmptyDisplayHisto(histoName, AliMUONTriggerDisplay::kDisplaySlats, 
+                                                               0, iChamber, histoTitle);
+         Add2RawsList(h9, kTriggerHVDisplay + iChamber, !forExpert);
+       }
+
        
   Int_t nbp(0);
   TIter next(AliMpDDLStore::Instance()->CreateBusPatchIterator());
@@ -457,13 +491,13 @@ void AliMUONQADataMakerRec::InitRecPointsTrigger()
        histoTitle = Form("Chamber %i: Fired pads %s", 11+iChamber, cathName.Data());
        TH2F* h3 = (TH2F*)triggerDisplay.GetEmptyDisplayHisto(histoName, AliMUONTriggerDisplay::kDisplayStrips, 
                                                              iCath, iChamber, histoTitle);
-       Add2RecPointsList(h3, kTriggerDigitsDisplay + AliMpConstants::NofTriggerChambers()*iCath + iChamber,forExpert);
+       Add2RecPointsList(h3, kTriggerDigitsDisplay + AliMpConstants::NofTriggerChambers()*iCath + iChamber,!forExpert);
       }
     }
 
     TH2F* h4 = (TH2F*)triggerDisplay.GetEmptyDisplayHisto("hFiredBoardsDisplay", AliMUONTriggerDisplay::kDisplayBoards,
                                                          0, 0, "Fired boards");
-    Add2RecPointsList(h4, kTriggerBoardsDisplay,forExpert);
+    Add2RecPointsList(h4, kTriggerBoardsDisplay,!forExpert);
        
        fIsInitRecPointsTrigger = kTRUE;
 }
@@ -915,6 +949,7 @@ void AliMUONQADataMakerRec::DisplayTriggerInfo(AliQA::TASKINDEX_t task)
   /// Display trigger information in a user-friendly way:
   /// from local board and strip numbers to their position on chambers
   //
+
   if(task!=AliQA::kRECPOINTS && task!=AliQA::kRAWS) return;
 
   AliMUONTriggerDisplay triggerDisplay;
@@ -933,7 +968,7 @@ void AliMUONQADataMakerRec::DisplayTriggerInfo(AliQA::TASKINDEX_t task)
       ERaw hindex 
        = ( iCath == 0 ) ? kTriggerScalersBP : kTriggerScalersNBP;
       histoStrips = (TH3F*)GetRawsData(hindex);
-      if(histoStrips->GetEntries()==0) return; // No scalers found
+      if(histoStrips->GetEntries()==0) continue; // No scalers found
     }
     
     for (Int_t iChamber = 0; iChamber < AliMpConstants::NofTriggerChambers(); iChamber++)
@@ -951,8 +986,109 @@ void AliMUONQADataMakerRec::DisplayTriggerInfo(AliQA::TASKINDEX_t task)
     } // iChamber
   } // iCath
 
-  if(task!=AliQA::kRECPOINTS) return;
-  TH1F* histoBoards = (TH1F*)GetRecPointsData(kTriggeredBoards);
-  TH2F* histoDisplayBoards = (TH2F*)GetRecPointsData(kTriggerBoardsDisplay);
-  triggerDisplay.FillDisplayHistogram(histoBoards, histoDisplayBoards, AliMUONTriggerDisplay::kDisplayBoards, 0, 0);
+  if(task==AliQA::kRAWS){    
+    TH2F* histoI  = (TH2F*) GetRawsData(kTriggerRPCi);
+    TH2F* histoHV = (TH2F*) GetRawsData(kTriggerRPChv);
+    FillTriggerDCSHistos();
+    for (Int_t iChamber = 0; iChamber < AliMpConstants::NofTriggerChambers(); iChamber++) {
+      Int_t bin = histoI->GetXaxis()->FindBin(11+iChamber);
+      TH2F* histoDisplayI = (TH2F*)GetRawsData(kTriggerIDisplay + iChamber);
+      triggerDisplay.FillDisplayHistogram(histoI->ProjectionY("_px", bin, bin), histoDisplayI, AliMUONTriggerDisplay::kDisplaySlats, 0, iChamber);
+      TH2F* histoDisplayHV = (TH2F*)GetRawsData(kTriggerHVDisplay + iChamber);
+      bin = histoHV->GetXaxis()->FindBin(11+iChamber);
+      triggerDisplay.FillDisplayHistogram(histoHV->ProjectionY("_px", bin, bin), histoDisplayHV, AliMUONTriggerDisplay::kDisplaySlats, 0, iChamber);
+    }
+  }
+
+  if(task==AliQA::kRECPOINTS){
+    TH1F* histoBoards = (TH1F*)GetRecPointsData(kTriggeredBoards);
+    TH2F* histoDisplayBoards = (TH2F*)GetRecPointsData(kTriggerBoardsDisplay);
+    triggerDisplay.FillDisplayHistogram(histoBoards, histoDisplayBoards, AliMUONTriggerDisplay::kDisplayBoards, 0, 0);
+  }
+}
+
+
+//_____________________________________________________________________________
+Bool_t 
+AliMUONQADataMakerRec::FillTriggerDCSHistos()
+{
+  /// Get HV and currents values for one trigger chamber
+  
+  AliCodeTimerAuto("");
+
+  AliMpDEIterator deIt;
+
+  deIt.First();
+
+  AliMUONCalibrationData calibrationData(AliCDBManager::Instance()->GetRun());
+
+  TMap* triggerDcsMap = calibrationData.TriggerDCS();
+
+  AliMpDCSNamer triggerDcsNamer("TRIGGER");
+
+  TH2* currHisto = 0x0;
+
+  Bool_t error = kFALSE;
+  
+  while ( !deIt.IsDone() )
+  {
+    Int_t detElemId = deIt.CurrentDEId();
+    
+    if ( AliMpDEManager::GetStationType(detElemId) == AliMp::kStationTrigger) {
+
+      Int_t iChamber = AliMpDEManager::GetChamberId(detElemId);
+      Int_t slat = detElemId%100;
+
+      for(Int_t iMeas=0; iMeas<AliMpDCSNamer::kNDCSMeas; iMeas++){
+       TString currAlias = triggerDcsNamer.DCSChannelName(detElemId, 0, iMeas);
+
+       AliDebug(2, Form("\nDetElemId %i   dcsAlias %s", detElemId, currAlias.Data()));
+
+       TPair* triggerDcsPair = static_cast<TPair*>(triggerDcsMap->FindObject(currAlias.Data()));
+
+       if (!triggerDcsPair)
+       {
+         AliError(Form("Did not find expected alias (%s) for DE %d",
+                       currAlias.Data(),detElemId));  
+         error = kTRUE;
+       }
+       else
+       {
+         TObjArray* values = static_cast<TObjArray*>(triggerDcsPair->Value());
+         if (!values)
+         {
+           AliError(Form("Could not get values for alias %s",currAlias.Data()));
+           error = kTRUE;
+         }
+         else
+         {
+           TIter next(values);
+           AliDCSValue* val;
+
+           while ( ( val = static_cast<AliDCSValue*>(next()) ) )
+           {
+             Float_t hvi = val->GetFloat();
+
+             AliDebug(2, Form("Value %f", hvi));
+
+             switch(iMeas){
+             case AliMpDCSNamer::kDCSI:
+               currHisto = (TH2F*) GetRawsData(kTriggerRPCi);
+               break;
+             case AliMpDCSNamer::kDCSHV:
+               currHisto = (TH2F*) GetRawsData(kTriggerRPChv);
+               break;
+             } 
+             Int_t binX = currHisto->GetXaxis()->FindBin(iChamber+1);
+             Int_t binY = currHisto->GetYaxis()->FindBin(slat);
+             currHisto->SetBinContent(binX, binY, hvi);
+           } // loop on values
+         } // if (!values)
+       } // if (!triggerDcsPair)
+      } // loop on measured types (HV and currents)
+    } // if (stationType == kStationTrigger)
+
+    deIt.Next();
+  }
+  return error;
 }
index 081786f..759722c 100644 (file)
@@ -45,6 +45,10 @@ private:
     kTriggeredBoards           = 2,  ///< Triggered boards histogram index
     kTriggerDigitsDisplay      = 3,  ///< Trigger digits display histogram per plane index
     kTriggerBoardsDisplay      = 11, ///< Triggered boards display histogram index
+    kTriggerRPCi               = 12, ///< Trigger chamber currents index
+    kTriggerRPChv              = 13, ///< Trigger chamber HV index
+    kTriggerIDisplay           = 14, ///< Trigger chamber currents display histogram index
+    kTriggerHVDisplay          = 18, ///< Trigger chamber HV display histogram index
     
     kTrackerNumberOfClustersPerChamber    = 100, ///< Tracker: # of clusters per chamber
     kTrackerClusterMultiplicityPerChamber = 200, ///< Tracker: cluster multiplicity per chamber
@@ -105,6 +109,7 @@ private:
        
        void Ctor();
   void DisplayTriggerInfo(AliQA::TASKINDEX_t task);
+  Bool_t FillTriggerDCSHistos();
        void InitRecPointsTracker();
        void InitRecPointsTrigger();
        void MakeRawsTracker(AliRawReader* rawReader);
index e382490..513da26 100644 (file)
@@ -34,7 +34,7 @@
 #include "AliMpDEIterator.h"
 #include "AliMpDEManager.h"
 #include "AliMpDetElement.h"
-#include "AliMpHVNamer.h"
+#include "AliMpDCSNamer.h"
 #include "AliMpManuIterator.h"
 #include <Riostream.h>
 #include <TClass.h>
@@ -1133,7 +1133,7 @@ AliMUONTrackerData::GetParts(AliMUONVCalibParam* external,
   
   if ( stationType == AliMp::kStation345 ) 
   {
-    AliMpHVNamer namer;
+    AliMpDCSNamer namer("TRACKER");
     pcbIndex = namer.ManuId2PCBIndex(detElemId,manuId);
   }
   
@@ -1346,7 +1346,7 @@ AliMUONTrackerData::CreatePCBParam(Int_t detElemId, Int_t pcbIndex) const
   
   AliCodeTimerAuto("");
   
-  AliMpHVNamer namer;
+  AliMpDCSNamer namer("TRACKER");
   
   AliMUONVCalibParam* pcb = new AliMUONCalibParamND(Dimension(),
                                                     namer.NumberOfPCBs(detElemId),
index 6d9b7b7..a2515f3 100644 (file)
@@ -30,7 +30,7 @@
 #include "AliMpDDLStore.h"
 #include "AliMpDetElement.h"
 #include "AliMpDEManager.h"
-#include "AliMpHVNamer.h"
+#include "AliMpDCSNamer.h"
 #include <TClass.h>
 #include <TMap.h>
 #include <TObjArray.h>
@@ -167,7 +167,7 @@ AliMUONTrackerOCDBDataMaker::CreateHVStore(TMap& m)
   
   TIter next(&m);
   TObjString* s;
-  AliMpHVNamer hvNamer;
+  AliMpDCSNamer hvNamer("TRACKER");
   
   while ( ( s = static_cast<TObjString*>(next()) ) )
   {
@@ -183,7 +183,7 @@ AliMUONTrackerOCDBDataMaker::CreateHVStore(TMap& m)
     }
     
     Int_t nindex = 1;
-    Int_t hvIndex = hvNamer.HVIndexFromDCSAlias(name.Data());
+    Int_t hvIndex = hvNamer.DCSIndexFromDCSAlias(name.Data());
     
     if ( hvIndex > 0 && detElemId >= 500 ) 
     {
diff --git a/MUON/AliMUONTriggerDCSSubprocessor.cxx b/MUON/AliMUONTriggerDCSSubprocessor.cxx
new file mode 100644 (file)
index 0000000..3d434e3
--- /dev/null
@@ -0,0 +1,158 @@
+/**************************************************************************
+* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
+*                                                                        *
+* Author: The ALICE Off-line Project.                                    *
+* Contributors are mentioned in the code where appropriate.              *
+*                                                                        *
+* Permission to use, copy, modify and distribute this software and its   *
+* documentation strictly for non-commercial purposes is hereby granted   *
+* without fee, provided that the above copyright notice appears in all   *
+* copies and that both the copyright notice and this permission notice   *
+* appear in the supporting documentation. The authors make no claims     *
+* about the suitability of this software for any purpose. It is          *
+* provided "as is" without express or implied warranty.                  *
+**************************************************************************/
+
+// $Id$
+
+//-----------------------------------------------------------------------------
+/// \class AliMUONTriggerDCSSubprocessor
+///
+/// A subprocessor to read Trigger DCS values for one run
+///
+/// It simply creates a copy of the dcsAliasMap w/o information
+/// from the MUON TRG, and dumps this copy into the CDB
+///
+/// \author Diego Stocco, Subatech
+//-----------------------------------------------------------------------------
+
+#include "AliMUONTriggerDCSSubprocessor.h"
+#include "AliMUONPreprocessor.h"
+
+#include "AliMpDEIterator.h"
+#include "AliMpDEManager.h"
+#include "AliMpConstants.h"
+#include "AliMpDCSNamer.h"
+
+#include "AliCDBMetaData.h"
+#include "AliLog.h"
+
+#include "Riostream.h"
+#include "TMap.h"
+#include "TObjString.h"
+
+/// \cond CLASSIMP
+ClassImp(AliMUONTriggerDCSSubprocessor)
+/// \endcond
+
+//_____________________________________________________________________________
+AliMUONTriggerDCSSubprocessor::AliMUONTriggerDCSSubprocessor(AliMUONPreprocessor* master)
+: AliMUONVSubprocessor(master,
+                       "TriggerDCS",
+                       "Get MUON Trigger HV and Current values from DCS")
+{
+  /// ctor
+}
+
+//_____________________________________________________________________________
+AliMUONTriggerDCSSubprocessor::~AliMUONTriggerDCSSubprocessor()
+{
+  /// dtor
+}
+
+//_____________________________________________________________________________
+UInt_t
+AliMUONTriggerDCSSubprocessor::Process(TMap* dcsAliasMap)
+{
+  /// Make another alias map from dcsAliasMap, considering only MUON TRK aliases.
+
+  TMap dcsMap;
+  dcsMap.SetOwner(kTRUE);
+  
+  AliMpDCSNamer dcsMapNamer("TRIGGER");
+
+  AliMpDEIterator deIt;
+
+  deIt.First();
+  
+  TObjArray aliases;
+  aliases.SetOwner(kTRUE);
+  
+  // we first generate a list of expected MTR DCS aliases we'll then look for
+  
+  while ( !deIt.IsDone() )
+  {
+    Int_t detElemId = deIt.CurrentDEId();
+    
+    if ( AliMpDEManager::GetStationType(detElemId) == AliMp::kStationTrigger) {
+
+      for(Int_t iMeas=0; iMeas<AliMpDCSNamer::kNDCSMeas; iMeas++){
+       aliases.Add(new TObjString(dcsMapNamer.DCSChannelName(detElemId, 0, iMeas)));
+      }
+
+    }
+
+    deIt.Next();
+  }
+
+  TIter next(&aliases);
+  TObjString* alias;
+  Bool_t kNoAliases(kTRUE);
+  Int_t aliasNotFound(0);
+  Int_t valueNotFound(0);
+  
+  while ( ( alias = static_cast<TObjString*>(next()) ) ) 
+  {
+    TString aliasName(alias->String());
+    TPair* dcsMapPair = static_cast<TPair*>(dcsAliasMap->FindObject(aliasName.Data()));
+    if (!dcsMapPair)
+    {
+      ++aliasNotFound;
+    }
+    else
+    {
+      kNoAliases = kFALSE;
+      if (!dcsMapPair->Value())
+      {
+        ++valueNotFound;
+      }
+      else
+      {
+       TObjArray* values = static_cast<TObjArray*>(dcsMapPair->Value()->Clone());
+        //FIXME : should insure here that values are only the ones within run
+        //limits (startTime<timestamp<endTime)
+        dcsMap.Add(new TObjString(aliasName.Data()),values);
+      }
+    }
+  }
+  
+  if ( kNoAliases ) 
+  {
+    Master()->Log("ERROR : no DCS values found");
+    return 1;
+  }
+  
+  if ( aliasNotFound ) 
+  {
+    Master()->Log(Form("WARNING %d aliases not found",aliasNotFound));
+  }
+  
+  if ( valueNotFound )
+  {
+    Master()->Log(Form("WARNING %d values not found",valueNotFound));
+  }
+  
+  Master()->Log("INFO Aliases successfully read in");
+  
+  AliCDBMetaData metaData;
+  metaData.SetBeamPeriod(0);
+  metaData.SetResponsible("MUON TRG");
+  metaData.SetComment("Computed by AliMUONTriggerDCSSubprocessor $Id$");
+  
+  Bool_t validToInfinity(kFALSE);
+  
+  Bool_t result = Master()->Store("Calib","TriggerDCS",&dcsMap,&metaData,0,validToInfinity);
+  
+  return ( result != kTRUE); // return 0 if everything is ok
+}
+
diff --git a/MUON/AliMUONTriggerDCSSubprocessor.h b/MUON/AliMUONTriggerDCSSubprocessor.h
new file mode 100644 (file)
index 0000000..8595038
--- /dev/null
@@ -0,0 +1,36 @@
+#ifndef ALIMUONTRIGGERDCSSUBPROCESSOR_H
+#define ALIMUONTRIGGERDCSSUBPROCESSOR_H
+
+/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
+* See cxx source for full Copyright notice                               */
+
+// $Id$
+
+/// \ingroup shuttle
+/// \class AliMUONTriggerDCSSubprocessor
+/// \brief A subprocessor to read TriggerDCS values for one run
+///
+//  Author Laurent Aphecetche
+
+#ifndef ALIMUONVSUBPROCESSOR_H
+#  include "AliMUONVSubprocessor.h"
+#endif
+
+class AliMUONTriggerDCSSubprocessor : public AliMUONVSubprocessor
+{
+public:
+  AliMUONTriggerDCSSubprocessor(AliMUONPreprocessor* master);
+  virtual ~AliMUONTriggerDCSSubprocessor();
+  
+  virtual UInt_t Process(TMap* dcsAliasMap);
+
+private:
+  /// Not implemented
+  AliMUONTriggerDCSSubprocessor(const AliMUONTriggerDCSSubprocessor&);
+  /// Not implemented
+  AliMUONTriggerDCSSubprocessor& operator=(const AliMUONTriggerDCSSubprocessor&);
+  
+  ClassDef(AliMUONTriggerDCSSubprocessor,1) // Shuttle Subprocessor for MUON TRG HV and currents
+};
+
+#endif
index 12c2684..bc55f72 100644 (file)
 ///
 /// MUON base class for converting histos as a function of strip/board/slat number
 /// into display histos showing the detection element position in the 
-/// trigger chamber
+/// trigger chamber.
+///
+/// Input histos can be given as:
+///  - TH2 with x -> board # [1-234]  and   y -> strip # in board [0-15].  Option: kDisplayStrips
+///  - TH1 with x -> board # [1-234]                                       Option: kDisplayBoards
+///  - TH1 with x -> slat #  [0-17]                                        Option: kDisplaySlats
 ///
 /// \author D. Stocco
 
index e231f76..b839b2f 100644 (file)
@@ -19,6 +19,7 @@
 
 #include "AliLog.h"
 #include "AliMUONTriggerSubprocessor.h"
+#include "AliMUONTriggerDCSSubprocessor.h"
 #include "AliShuttleInterface.h"
 #include "Riostream.h"
 
@@ -38,7 +39,8 @@ ClassImp(AliMUONTriggerPreprocessor)
 //_____________________________________________________________________________
 AliMUONTriggerPreprocessor::AliMUONTriggerPreprocessor(AliShuttleInterface* shuttle)
 : AliMUONPreprocessor("MTR",shuttle),
-fTriggerSubprocessor(new AliMUONTriggerSubprocessor(this))
+  fTriggerSubprocessor(new AliMUONTriggerSubprocessor(this)),
+  fTriggerDCSSubprocessor(new AliMUONTriggerDCSSubprocessor(this))
 {
   /// ctor. 
   AddRunType("PHYSICS");
@@ -50,6 +52,7 @@ AliMUONTriggerPreprocessor::~AliMUONTriggerPreprocessor()
 {
   /// dtor
   delete fTriggerSubprocessor;
+  delete fTriggerDCSSubprocessor;
 }
 
 //_____________________________________________________________________________
@@ -65,8 +68,12 @@ AliMUONTriggerPreprocessor::Initialize(Int_t run, UInt_t startTime, UInt_t endTi
   
   TString runType = GetRunType();
   
-  if ( runType == "PHYSICS" ||
-       runType == "CALIBRATION" ) 
+  if ( runType == "PHYSICS" ) 
+  {
+    Add(fTriggerSubprocessor);
+    Add(fTriggerDCSSubprocessor,kTRUE); // uses DCS
+  }
+  else if (runType == "CALIBRATION")
   {
     Add(fTriggerSubprocessor);
   }
index 3ac6b12..0fb2247 100644 (file)
@@ -15,6 +15,7 @@
 #include "AliMUONPreprocessor.h"
 
 class AliMUONTriggerSubprocessor;
+class AliMUONTriggerDCSSubprocessor;
 
 class AliMUONTriggerPreprocessor : public AliMUONPreprocessor
 {
@@ -33,8 +34,9 @@ private:
 
 private:
   AliMUONTriggerSubprocessor* fTriggerSubprocessor; //!< the real worker class
+  AliMUONTriggerDCSSubprocessor* fTriggerDCSSubprocessor; //!< the real worker class for DCS info
   
-  ClassDef(AliMUONTriggerPreprocessor,1) // MUON Trigger Shuttle preprocessor
+  ClassDef(AliMUONTriggerPreprocessor,2) // MUON Trigger Shuttle preprocessor
 };
 
 #endif
index d0d404c..8db1be3 100644 (file)
@@ -90,7 +90,7 @@ set(SRCS ${SRCS}
          mapping/AliMpManuUID.cxx 
          mapping/AliMpPadUID.cxx 
          mapping/AliMpHVUID.cxx 
-         mapping/AliMpHVNamer.cxx 
+         mapping/AliMpDCSNamer.cxx 
          mapping/AliMpSegmentation.cxx 
         mapping/AliMpDetElement.cxx 
         mapping/AliMpDEStore.cxx  
index a2db08b..06e26f6 100644 (file)
@@ -9,6 +9,7 @@ AliMUONHVSubprocessor.cxx
 AliMUONGainSubprocessor.cxx 
 AliMUONTrackerPreprocessor.cxx 
 AliMUONTriggerSubprocessor.cxx 
+AliMUONTriggerDCSSubprocessor.cxx 
 AliMUONTriggerPreprocessor.cxx
 )
 
index 343a54e..39bf64b 100644 (file)
 #pragma link C++ class  AliMpManuUID;
 #pragma link C++ class  AliMpPadUID;
 #pragma link C++ class  AliMpHVUID;
-#pragma link C++ class  AliMpHVNamer;
+#pragma link C++ class  AliMpDCSNamer;
 #pragma link C++ class  AliMpSegmentation+;
 #pragma link C++ class  AliMpDetElement+;
 #pragma link C++ class  AliMpDEStore+;
index e9ea449..21f5999 100644 (file)
@@ -16,6 +16,7 @@
 #pragma link C++ class AliMUONGainSubprocessor+;
 #pragma link C++ class AliMUONGMSSubprocessor+;
 #pragma link C++ class AliMUONTriggerSubprocessor+;
+#pragma link C++ class AliMUONTriggerDCSSubprocessor+;
 #pragma link C++ class AliMUONTriggerPreprocessor+;
 
 #endif
index 6074ec7..1bbeea7 100644 (file)
@@ -44,8 +44,16 @@ MCH       PHYSICS                     read DCS HV values and    AliMUONHVSubproc
                                       
 MCH       CALIBRATION                 read ASCII gain files     AliMUONGainSubprocessor
                                       and put them into OCDB
+
+MTR       CALIBRATION                read date files (masks,   AliMUONTriggerSubprocessor
+                                     crates, and LUT)
+                                     and put them in OCDB           
                                       
-MTR       to be defined               to be defined             to be done
+MTR       PHYSICS                     read date files as in     AliMUONTriggerDCSSubprocessor
+                                     CALIBRATION,
+                                     read DCS HV and currents
+                                     and put them in OCDB
+                                    
 </pre>
 
 
@@ -217,6 +225,22 @@ The matrices of TGeoHMatrix type, with TObject::fUniqueID equal to the geometry
 module Id, are put in a TClonesArray and saved in the Root file with a 
 key "GMSarray".
 
+
+\section shuttle_s7 Trigger DCS
+
+HV and currents DCS values are created in CreateDCSAliasMap() of TestMUONPreprocessor.C
+As done in Tracker HV, you might want to modify this function to create a given set of 
+error conditions in order to test whether the TriggerDCSSubprocessor is reacting 
+properly to those errors.
+
+COMMENT: the trigger subprocessor requires trigger .dat files to be present.
+In order to test only the DCS values when the remaining trigger files are not present, 
+a workaround is put in the TestMUONPreprocessor.C which creates fake date files.
+This results in some "ERROR" flags appearing in the LOG file (for masks and LUT), 
+which are absolutely expected.
+The fake date files are automatically removed at the end of the macro.
+
+
 This chapter is defined in the READMEshuttle.txt file.
 
 */
index fe6a570..6d3319f 100644 (file)
 ///
 /// This macro runs the test preprocessor for MUON.
 /// It uses AliTestShuttle to simulate a full Shuttle process
+/// It requires to have linked the MUON OCDB files in TestShuttle/TestCDB:
+/// <pre>
+/// cd $ALICE_ROOT/SHUTTLE/TestShuttle/TestCDB
+/// mkdir MUON
+/// ln -s $ALICE_ROOT/MUON/Calib MUON/Calib
+/// </pre>
+///
+/// You must load relevant libraries (besides normal MUON ones) before
+/// compiling this macro :
+/// <pre>
+/// gSystem->Load("$ALICE_ROOT/SHUTTLE/TestShuttle/libTestShuttle");
+/// gSystem->Load("libMUONshuttle");
+/// </pre>
 ///
 /// The input data has to be created first by other processes (or is created
 /// here by CreateDCSAliasMap() for tracker HV).
 /// - b) select run type, using shuttle->AddInputRunParameter() (the run type
 ///      dictates which task is really performed by the MUONPreprocessor
 ///
-/// You must load relevant libraries (besides normal MUON ones) before
-/// compiling this macro :
+/// The sourceDirectory is there to "emulate" what the real preprocessor will
+/// find on the FXS, and is assumed to have the following structure :
 /// <pre>
-/// gSystem->Load("$ALICE_ROOT/SHUTTLE/TestShuttle/libTestShuttle");
-/// gSystem->Load("libMUONshuttle.so");
+/// GAINS/
+///    LDC0.gain
+///    LDC1.gain
+///    LDC2.gain
+///    LDC3.gain
+/// GMS/
+///    GMS.root
+/// PEDESTALS/
+///    LDC0.ped
+///    LDC1.ped
+///    LDC2.ped
+///    LDC3.ped
+/// TRIGGER/
+///    ExportedFiles.dat (mandatory)
+///    MtgGlobalCrate-1.dat
+///    MtgLocalLut-1.dat
+///    MtgLocalMask-1.dat
+///    MtgRegionalCrate-1.dat
+/// </pre>
+///
+/// IMPORTANT:
+/// The trigger files have to be present in order for the algorithm to work correctly.
+/// If you want to test the Trigger DCS maps only, but you don't have the .dat trigger files,
+/// you have to create dummy files through :
+/// <pre>
+/// cd sourceDirectory/TRIGGER
+/// echo -e "MtgLocalMask-1.dat\nMtgRegionalCrate-1.dat\nMtgGlobalCrate-1.dat\nMtgLocalLut-1.dat" > ExportedFiles.dat
+/// touch MtgLocalMask-1.dat MtgRegionalCrate-1.dat MtgGlobalCrate-1.dat MtgLocalLut-1.dat
 /// </pre>
 ///
 /// For more information on usage, please see the \ref README_shuttle page.
 ///
-/// \author Laurent Aphecetche, SUBATECH Nantes
+/// \author Laurent Aphecetche, SUBATECH Nantes; \n
+///         Diego Stocco, SUBATECH Nantes
 
 #include "TestMUONPreprocessor.h"
 
@@ -52,7 +92,7 @@
 
 #include "AliMpExMap.h"
 #include "AliMpHelper.h"
-#include "AliMpHVNamer.h"
+#include "AliMpDCSNamer.h"
 #include "AliMpCDB.h"
 
 #include "AliCDBManager.h"
 #include "TRandom.h"
 #endif
 
-void TestMUONPreprocessor(Int_t runNumber=80, const char* runType="CALIBRATION")
+void TestMUONPreprocessor(Int_t runNumber=80, 
+                          const char* runType="CALIBRATION",
+                          const char* sourceDirectory="/afs/cern.ch/user/l/laphecet/public")
 {
   // runType can be :
   //
@@ -79,7 +121,7 @@ void TestMUONPreprocessor(Int_t runNumber=80, const char* runType="CALIBRATION")
   // CALIBRATION -> gains
   // PHYSICS -> HV
   // GMS
-  
+
   // create AliTestShuttle instance
   // The parameters are run, startTime, endTime
   AliTestShuttle* shuttle = new AliTestShuttle(runNumber, 0, 1);
@@ -95,9 +137,9 @@ void TestMUONPreprocessor(Int_t runNumber=80, const char* runType="CALIBRATION")
   
   if ( rt.Contains("PHYSICS") )
   {
-    // Create DCS HV aliases
+    // Create DCS aliases
     TMap* dcsAliasMap = CreateDCSAliasMap(inputCDB, runNumber);
-  
+
     if ( dcsAliasMap ) 
     {
       // now give the alias map to the shuttle
@@ -120,31 +162,26 @@ void TestMUONPreprocessor(Int_t runNumber=80, const char* runType="CALIBRATION")
   // AddInputFile(<system>, <detector>, <id>, <source>, <local-file>)
   // In this example we add 4 files originating from different LDCs but with the same id (PEDESTALS)
 
-//  shuttle->AddInputFile(AliTestShuttle::kDAQ,"MCH","PEDESTALS","LDC0","$ALICE_ROOT/MUON/data/LDC0.ped");
-//  shuttle->AddInputFile(AliTestShuttle::kDAQ,"MCH","PEDESTALS","LDC1","$ALICE_ROOT/MUON/data/LDC1.ped");
-//  shuttle->AddInputFile(AliTestShuttle::kDAQ,"MCH","PEDESTALS","LDC2","$ALICE_ROOT/MUON/data/LDC2.ped");
-//  shuttle->AddInputFile(AliTestShuttle::kDAQ,"MCH","PEDESTALS","LDC3","$ALICE_ROOT/MUON/data/LDC3.ped");
-
-  shuttle->AddInputFile(AliTestShuttle::kDAQ,"MCH","PEDESTALS","LDC0","/afs/cern.ch/user/l/laphecet/public/PEDESTALS/LDC0.ped");
-  shuttle->AddInputFile(AliTestShuttle::kDAQ,"MCH","PEDESTALS","LDC1","/afs/cern.ch/user/l/laphecet/public/PEDESTALS/LDC1.ped");
-  shuttle->AddInputFile(AliTestShuttle::kDAQ,"MCH","PEDESTALS","LDC2","/afs/cern.ch/user/l/laphecet/public/PEDESTALS/LDC2.ped");
-  shuttle->AddInputFile(AliTestShuttle::kDAQ,"MCH","PEDESTALS","LDC3","/afs/cern.ch/user/l/laphecet/public/PEDESTALS/LDC3.ped");
+  shuttle->AddInputFile(AliTestShuttle::kDAQ,"MCH","PEDESTALS","LDC0",Form("%s/PEDESTALS/LDC0.ped",sourceDirectory));
+  shuttle->AddInputFile(AliTestShuttle::kDAQ,"MCH","PEDESTALS","LDC1",Form("%s/PEDESTALS/LDC1.ped",sourceDirectory));
+  shuttle->AddInputFile(AliTestShuttle::kDAQ,"MCH","PEDESTALS","LDC2",Form("%s/PEDESTALS/LDC2.ped",sourceDirectory));
+  shuttle->AddInputFile(AliTestShuttle::kDAQ,"MCH","PEDESTALS","LDC3",Form("%s/PEDESTALS/LDC3.ped",sourceDirectory));
 
-  shuttle->AddInputFile(AliTestShuttle::kDAQ,"MCH","GAINS","LDC0","/afs/cern.ch/user/l/laphecet/public/GAINS/LDC0.gain");
-  shuttle->AddInputFile(AliTestShuttle::kDAQ,"MCH","GAINS","LDC1","/afs/cern.ch/user/l/laphecet/public/GAINS/LDC1.gain");
-  shuttle->AddInputFile(AliTestShuttle::kDAQ,"MCH","GAINS","LDC2","/afs/cern.ch/user/l/laphecet/public/GAINS/LDC2.gain");
-  shuttle->AddInputFile(AliTestShuttle::kDAQ,"MCH","GAINS","LDC3","/afs/cern.ch/user/l/laphecet/public/GAINS/LDC3.gain");
+  shuttle->AddInputFile(AliTestShuttle::kDAQ,"MCH","GAINS","LDC0",Form("%s/GAINS/LDC0.gain",sourceDirectory));
+  shuttle->AddInputFile(AliTestShuttle::kDAQ,"MCH","GAINS","LDC1",Form("%s/GAINS/LDC1.gain",sourceDirectory));
+  shuttle->AddInputFile(AliTestShuttle::kDAQ,"MCH","GAINS","LDC2",Form("%s/GAINS/LDC2.gain",sourceDirectory));
+  shuttle->AddInputFile(AliTestShuttle::kDAQ,"MCH","GAINS","LDC3",Form("%s/GAINS/LDC3.gain",sourceDirectory));
 
   // and GMS file
-  shuttle->AddInputFile(AliTestShuttle::kDCS,"MCH","GMS","GMS","/afs/cern.ch/user/l/laphecet/public/GMS/GMS.root");
+  shuttle->AddInputFile(AliTestShuttle::kDCS,"MCH","GMS","GMS",Form("%s/GMS/GMS.root",sourceDirectory));
 
   // and then the trigger stuff
-  shuttle->AddInputFile(AliTestShuttle::kDAQ,"MTR","LOCAL","LDC0","/afs/cern.ch/user/l/laphecet/public/TRIGGER/MtgLocalMask-1.dat");
-  shuttle->AddInputFile(AliTestShuttle::kDAQ,"MTR","REGIONAL","LDC0","/afs/cern.ch/user/l/laphecet/public/TRIGGER/MtgRegionalCrate-1.dat");
-  shuttle->AddInputFile(AliTestShuttle::kDAQ,"MTR","GLOBAL","LDC0","/afs/cern.ch/user/l/laphecet/public/TRIGGER/MtgGlobalCrate-1.dat");
-  shuttle->AddInputFile(AliTestShuttle::kDAQ,"MTR","LUT","LDC0","/afs/cern.ch/user/l/laphecet/public/TRIGGER/MtgLocalLut-1.dat");
-  shuttle->AddInputFile(AliTestShuttle::kDAQ,"MTR","EXPORTED","LDC0","/afs/cern.ch/user/l/laphecet/public/TRIGGER/ExportedFiles.dat");
-  
+  shuttle->AddInputFile(AliTestShuttle::kDAQ,"MTR","LOCAL","LDC0",Form("%s/TRIGGER/MtgLocalMask-1.dat",sourceDirectory));
+  shuttle->AddInputFile(AliTestShuttle::kDAQ,"MTR","REGIONAL","LDC0",Form("%s/TRIGGER/MtgRegionalCrate-1.dat",sourceDirectory));
+  shuttle->AddInputFile(AliTestShuttle::kDAQ,"MTR","GLOBAL","LDC0",Form("%s/TRIGGER/MtgGlobalCrate-1.dat",sourceDirectory));
+  shuttle->AddInputFile(AliTestShuttle::kDAQ,"MTR","LUT","LDC0",Form("%s/TRIGGER/MtgLocalLut-1.dat",sourceDirectory));
+  shuttle->AddInputFile(AliTestShuttle::kDAQ,"MTR","EXPORTED","LDC0",Form("%s/TRIGGER/ExportedFiles.dat",sourceDirectory));
+
   // The shuttle can read run parameters stored in the DAQ run logbook.
   // To test it, we must provide the run parameters manually. They will be retrieved in the preprocessor
   // using GetRunParameter function.
@@ -163,7 +200,7 @@ void TestMUONPreprocessor(Int_t runNumber=80, const char* runType="CALIBRATION")
 
 TMap* CreateDCSAliasMap(const char* inputCDB, Int_t runNumber)
 {
-  /// Creates a DCS structure for MUON Tracker HV
+  /// Creates a DCS structure for MUON Tracker HV and Trigger DCS and Currents
   ///
   /// The structure is the following:
   ///   TMap (key --> value)
@@ -200,49 +237,70 @@ TMap* CreateDCSAliasMap(const char* inputCDB, Int_t runNumber)
   aliasMap->SetOwner(kTRUE);
   
   TRandom random(0);
+
+  const Char_t* detName[2] = { "TRACKER", "TRIGGER" };
+
+  for(Int_t idet=0; idet<2; idet++){
+
+    TString sDetName(detName[idet]);
+    sDetName.ToUpper();
   
-  AliMpHVNamer hvNamer;
+    AliMpDCSNamer dcsNamer(detName[idet]);
   
-  TObjArray* aliases = hvNamer.GenerateAliases();
+    TObjArray* aliases = dcsNamer.GenerateAliases();
   
-  for ( Int_t i = 0; i < aliases->GetEntries(); ++i ) 
-  {
-    TObjString* alias = static_cast<TObjString*>(aliases->At(i));
-    TString& aliasName = alias->String();
-    if ( aliasName.Contains("sw") ) 
+    for ( Int_t i = 0; i < aliases->GetEntries(); ++i ) 
     {
-      // HV Switch (St345 only)
-      TObjArray* valueSet = new TObjArray;
-      valueSet->SetOwner(kTRUE);
-      Bool_t value = kTRUE;
+      TObjString* alias = static_cast<TObjString*>(aliases->At(i));
+      TString& aliasName = alias->String();
+      if ( aliasName.Contains("sw") && sDetName.Contains("TRACKER")) 
+      {
+       // HV Switch (St345 only)
+       TObjArray* valueSet = new TObjArray;
+       valueSet->SetOwner(kTRUE);
+       Bool_t value = kTRUE;
 //      Float_t r = random.Uniform();
 //      if ( r < 0.007 ) value = kFALSE;      
 //      if ( aliasName.Contains("DE513sw2") ) value = kFALSE;
       
-      for ( UInt_t timeStamp = 0; timeStamp < 60*3; timeStamp += 60 )
-      {
-        AliDCSValue* dcsValue = new AliDCSValue(value,timeStamp);
-        valueSet->Add(dcsValue);
+       for ( UInt_t timeStamp = 0; timeStamp < 60*3; timeStamp += 60 )
+       {
+         AliDCSValue* dcsValue = new AliDCSValue(value,timeStamp);
+         valueSet->Add(dcsValue);
+       }
+       aliasMap->Add(new TObjString(*alias),valueSet);
       }
-      aliasMap->Add(new TObjString(*alias),valueSet);
-    }
-    else
-    {
-      TObjArray* valueSet = new TObjArray;
-      valueSet->SetOwner(kTRUE);
-      for ( UInt_t timeStamp = 0; timeStamp < 60*15; timeStamp += 120 )
+      else
       {
-        Float_t value = random.Gaus(1750,62.5);
-        if ( aliasName == "MchHvLvLeft/Chamber00Left/Quad2Sect1.actual.vMon") value = 500;
-        AliDCSValue* dcsValue = new AliDCSValue(value,timeStamp);
-        valueSet->Add(dcsValue);
+       TObjArray* valueSet = new TObjArray;
+       valueSet->SetOwner(kTRUE);
+       for ( UInt_t timeStamp = 0; timeStamp < 60*15; timeStamp += 120 )
+       {
+         Float_t value = 0;
+         if(sDetName.Contains("TRACKER")){
+           value = random.Gaus(1750,62.5);
+           if ( aliasName == "MchHvLvLeft/Chamber00Left/Quad2Sect1.actual.vMon") value = 500;
+         }
+         else if(aliasName.Contains("imon")){
+           value = random.Gaus(0.4,0.02);
+         }
+         else {
+           value = random.Gaus(8000,100);
+         }
+       
+         AliDCSValue* dcsValue = new AliDCSValue(value,timeStamp);
+         valueSet->Add(dcsValue);
+       }
+       if ( aliasName == "MchHvLvLeft/Chamber04Left/Slat06.actual.vMon" ) continue;
+       if ( aliasName == "MTR_INSIDE_MT22_RPC3_HV.vmon" ) continue;
+       aliasMap->Add(new TObjString(*alias),valueSet);
       }
-      if ( aliasName == "MchHvLvLeft/Chamber04Left/Slat06.actual.vMon" ) continue;
-      aliasMap->Add(new TObjString(*alias),valueSet);
-    }
-  }
+    } // loop on aliases
+
+    delete aliases;
+  } // loop on detectors (tracker and trigger)
   
-  delete aliases;
+
     
   AliMpCDB::UnloadAll();
   
index a9a076d..725135f 100644 (file)
@@ -90,7 +90,7 @@ SRCS +=  \
          mapping/AliMpManuUID.cxx \
          mapping/AliMpPadUID.cxx \
          mapping/AliMpHVUID.cxx \
-         mapping/AliMpHVNamer.cxx \
+         mapping/AliMpDCSNamer.cxx \
          mapping/AliMpSegmentation.cxx \
         mapping/AliMpDetElement.cxx \
         mapping/AliMpDEStore.cxx  \
index ec30de3..f69ed8b 100644 (file)
@@ -10,6 +10,7 @@ AliMUONHVSubprocessor.cxx \
 AliMUONGainSubprocessor.cxx \
 AliMUONTrackerPreprocessor.cxx \
 AliMUONTriggerSubprocessor.cxx \
+AliMUONTriggerDCSSubprocessor.cxx \
 AliMUONTriggerPreprocessor.cxx
 
 HDRS:= $(SRCS:.cxx=.h)
similarity index 50%
rename from MUON/mapping/AliMpHVNamer.cxx
rename to MUON/mapping/AliMpDCSNamer.cxx
index 0e9e93b..b374e28 100644 (file)
@@ -15,7 +15,7 @@
 
 // $Id$
 
-#include "AliMpHVNamer.h"
+#include "AliMpDCSNamer.h"
 
 #include "AliCodeTimer.h"
 #include "AliLog.h"
@@ -30,6 +30,7 @@
 #include "AliMpSegmentation.h"
 #include "AliMpSlat.h"
 #include "AliMpSlatSegmentation.h"
+#include "AliMpConstants.h"
 #include <Riostream.h>
 #include <TMap.h>
 #include <TObjArray.h>
 #include <TSystem.h>
 
 //-----------------------------------------------------------------------------
-/// \class AliMpHVNamer
+/// \class AliMpDCSNamer
 /// 
-/// A utility class to manage HV DCS aliases names, in particular the
+/// A utility class to manage DCS aliases names, in particular the
 /// two conventions used to number the detection elements within a detector.
 ///
-/// \author: Laurent Aphecetche, Subatech
+/// \author: Laurent Aphecetche and Diego Stocco, Subatech
 //-----------------------------------------------------------------------------
 
 /// \cond CLASSIMP
-ClassImp(AliMpHVNamer)
+ClassImp(AliMpDCSNamer)
 /// \endcond
 
-const char* AliMpHVNamer::fgHVChannelSt345Pattern[] = 
+const char* AliMpDCSNamer::fgkDCSChannelSt345Pattern[] = 
 { "MchHvLvLeft/Chamber%02dLeft/Slat%02d.actual.vMon",
   "MchHvLvRight/Chamber%02dRight/Slat%02d.actual.vMon" 
 };
 
-const char* AliMpHVNamer::fgHVChannelSt12Pattern[] = 
+const char* AliMpDCSNamer::fgkDCSChannelSt12Pattern[] = 
 {
   "MchHvLvLeft/Chamber%02dLeft/Quad%dSect%d.actual.vMon",
   "MchHvLvRight/Chamber%02dRight/Quad%dSect%d.actual.vMon",
 };
 
-const char* AliMpHVNamer::fgHVSwitchSt345Pattern = "MchDE%04dsw%d.inValue";
+const char* AliMpDCSNamer::fgkDCSSideTrackerName[] = { "Left", "Right" };
+
+
+const char* AliMpDCSNamer::fgkDCSSwitchSt345Pattern = "MchDE%04dsw%d.inValue";
+
+const char* AliMpDCSNamer::fgkDCSChannelTriggerPattern[] = {"MTR_%3sSIDE_MT%2i_RPC%i_HV.%4s", "MTR_%2sSIDE_MT%2i_RPC%i_HV.%4s"};
+const char* AliMpDCSNamer::fgkDCSSideTriggerName[] = { "OUT", "IN" };
+const char* AliMpDCSNamer::fgkDCSMeasureName[] = { "imon", "vmon" };
+
+const char* AliMpDCSNamer::fgkDetectorName[] = { "TRACKER", "TRIGGER" };
+
+//_____________________________________________________________________________
+AliMpDCSNamer::AliMpDCSNamer():
+fDetector(-1)
+{
+  SetDetector("TRACKER");
+  /// default ctor 
+}
 
 //_____________________________________________________________________________
-AliMpHVNamer::AliMpHVNamer()
+AliMpDCSNamer::AliMpDCSNamer(const char* detName):
+fDetector(-1)
 {
- /// default ctor 
+  /// ctor taking the detector name as argument (either trigger or tracker)
+  SetDetector(detName);
 }
 
 //_____________________________________________________________________________
-AliMpHVNamer::~AliMpHVNamer()
+AliMpDCSNamer::~AliMpDCSNamer()
 {
   /// dtor
 }
 
 //_____________________________________________________________________________
+Bool_t AliMpDCSNamer::SetDetector(const char* detName)
+{
+  /// Set the detector type
+  /// \param detName = tracker, trigger
+
+  TString sDetName(detName);
+  Bool_t isOk(kTRUE);
+  sDetName.ToUpper();
+  if(sDetName.Contains(fgkDetectorName[kTrackerDet]))
+    fDetector = kTrackerDet;
+  else if(sDetName.Contains(fgkDetectorName[kTriggerDet]))
+    fDetector = kTriggerDet;
+  else {
+    AliWarning("Detector name must be either tracker or trigger. Default tracker selected");
+    isOk = kFALSE;
+  }
+  return isOk;
+}
+
+
+//_____________________________________________________________________________
 void 
-AliMpHVNamer::AliasesAsLdif(const char* ldiffile) const
+AliMpDCSNamer::AliasesAsLdif(const char* ldiffile) const
 {
 /// Export the aliases in LDIF format
 
@@ -89,14 +130,16 @@ AliMpHVNamer::AliasesAsLdif(const char* ldiffile) const
   TObjString* s;
 
   // Some header. host name and port probably not up to date.
-  out << "#MCH config" << endl
-    << "dn: det=MCH,o=alice,dc=cern,dc=ch" << endl
-    << "objectClass: AliShuttleDetector" << endl
-    << "det: MCH" << endl
-    << "StrictRunOrder: 1" << endl
-    << "responsible: aphecetc@in2p3.fr" << endl
-    << "DCSHost: aldcs053.cern.ch" << endl
-    << "DCSPort: 4242" <<endl;
+  TString detName = (fDetector == kTriggerDet) ? "MTR" : "MCH";
+
+  out << "#" << detName.Data() << " config" << endl
+      << "dn: det=" << detName.Data() <<",o=alice,dc=cern,dc=ch" << endl
+      << "objectClass: AliShuttleDetector" << endl
+      << "det: " << detName.Data() << endl
+      << "StrictRunOrder: 1" << endl
+      << "responsible: aphecetc@in2p3.fr" << endl
+      << "DCSHost: aldcs053.cern.ch" << endl
+      << "DCSPort: 4242" <<endl;
   
   while ( ( s = (TObjString*)(next()) ) )
   {
@@ -110,7 +153,7 @@ AliMpHVNamer::AliasesAsLdif(const char* ldiffile) const
 
 //_____________________________________________________________________________
 TObjArray*
-AliMpHVNamer::CompactAliases() const
+AliMpDCSNamer::CompactAliases() const
 {
   /// Generate a compact list of aliases, for Shuttle test
   /// This one is completely hand-made, in contrast with GenerateAliases()
@@ -118,86 +161,128 @@ AliMpHVNamer::CompactAliases() const
 
   TObjArray* a = new TObjArray;
   a->SetOwner(kTRUE);
+
+  switch(fDetector){
+  case kTrackerDet:
+    // St 12 (DCS Channels)
+    a->Add(new TObjString("MchHvLvRight/Chamber[00..03]Right/Quad0Sect[0..2].actual.vMon"));
+    a->Add(new TObjString("MchHvLvLeft/Chamber[00..03]Left/Quad1Sect[0..2].actual.vMon"));
+    a->Add(new TObjString("MchHvLvLeft/Chamber[00..03]Left/Quad2Sect[0..2].actual.vMon"));
+    a->Add(new TObjString("MchHvLvRight/Chamber[00..03]Right/Quad3Sect[0..2].actual.vMon"));
   
-  // St 12 (HV Channels)
-  a->Add(new TObjString("MchHvLvRight/Chamber[00..03]Right/Quad0Sect[0..2].actual.vMon"));
-  a->Add(new TObjString("MchHvLvLeft/Chamber[00..03]Left/Quad1Sect[0..2].actual.vMon"));
-  a->Add(new TObjString("MchHvLvLeft/Chamber[00..03]Left/Quad2Sect[0..2].actual.vMon"));
-  a->Add(new TObjString("MchHvLvRight/Chamber[00..03]Right/Quad3Sect[0..2].actual.vMon"));
-  
-  // St345 (HV Channels)
+    // St345 (DCS Channels)
   
-  a->Add(new TObjString("MchHvLvRight/Chamber[04..09]Right/Slat[00..08].actual.vMon"));
-  a->Add(new TObjString("MchHvLvLeft/Chamber[04..09]Left/Slat[00..08].actual.vMon"));
+    a->Add(new TObjString("MchHvLvRight/Chamber[04..09]Right/Slat[00..08].actual.vMon"));
+    a->Add(new TObjString("MchHvLvLeft/Chamber[04..09]Left/Slat[00..08].actual.vMon"));
 
-  a->Add(new TObjString("MchHvLvRight/Chamber[06..09]Right/Slat[09..12].actual.vMon"));
-  a->Add(new TObjString("MchHvLvLeft/Chamber[06..09]Left/Slat[09..12].actual.vMon"));
+    a->Add(new TObjString("MchHvLvRight/Chamber[06..09]Right/Slat[09..12].actual.vMon"));
+    a->Add(new TObjString("MchHvLvLeft/Chamber[06..09]Left/Slat[09..12].actual.vMon"));
+    break;
+    
+  case kTriggerDet:
+    a->Add(new TObjString("MTR_OUTSIDE_MT[11..12]Right/RPC[1..9]_HV.imon"));
+    a->Add(new TObjString("MTR_OUTSIDE_MT[21..22]Right/RPC[1..9]_HV.imon"));
+    a->Add(new TObjString("MTR_INSIDE_MT[11..12]Right/RPC[1..9]_HV.imon"));
+    a->Add(new TObjString("MTR_INSIDE_MT[21..22]Right/RPC[1..9]_HV.imon"));
+
+    a->Add(new TObjString("MTR_OUTSIDE_MT[11..12]Right/RPC[1..9]_HV.vmon"));
+    a->Add(new TObjString("MTR_OUTSIDE_MT[21..22]Right/RPC[1..9]_HV.vmon"));
+    a->Add(new TObjString("MTR_INSIDE_MT[11..12]Right/RPC[1..9]_HV.vmon"));
+    a->Add(new TObjString("MTR_INSIDE_MT[21..22]Right/RPC[1..9]_HV.vmon"));
+  }
+  
 
-  // St345 (HV Switches)
-  AliMpDEIterator it;
+  if(fDetector == kTrackerDet){
+    // St345 (DCS Switches)
+    AliMpDEIterator it;
   
-  it.First();
+    it.First();
   
-  while (!it.IsDone())
-  {
-    Int_t detElemId = it.CurrentDEId();
-    if ( AliMpDEManager::GetStationType(detElemId) == AliMp::kStation345 )
+    while (!it.IsDone())
     {
-          a->Add(new TObjString(Form("MchDE%04dsw[0..%d].inValue",detElemId,NumberOfPCBs(detElemId)-1)));
-     }
-    it.Next();
+      Int_t detElemId = it.CurrentDEId();
+      if ( AliMpDEManager::GetStationType(detElemId) == AliMp::kStation345 )
+      {
+       a->Add(new TObjString(Form("MchDE%04dsw[0..%d].inValue",detElemId,NumberOfPCBs(detElemId)-1)));
+      }
+      it.Next();
+    }
   }
+  
   return a;
 }
 
 //_____________________________________________________________________________
 Int_t 
-AliMpHVNamer::DCS2DE(Int_t chamberId, Int_t side, Int_t dcsNumber) const
+AliMpDCSNamer::DCS2DE(Int_t chId, Int_t side, Int_t dcsNumber) const
 {
-  /// Convert DCS "slat number" (old convention) to DE (new) convention.
+  /// Convert DCS Tracker "slat number" (old convention) to DE (new) convention.
   ///
   /// \param chamberId : chamber number (starting at 0)
   /// \param side : 0 for Left, 1 for Right
-  /// \param dcsNumber : slat number in DCS HV convention
+  /// \param dcsNumber : slat number in DCS convention
   ///
   /// note that dcsNumber should be >=0 and < number of DEs/2 in chamber
 
-  Int_t nofDE = AliMpDEManager::GetNofDEInChamber(chamberId);
+  Int_t de(-1);
+  Int_t chamberId = chId;
+
+  if(fDetector == kTrackerDet){ // Tracker
+
+    Int_t nofDE = AliMpDEManager::GetNofDEInChamber(chamberId);
   
-  Int_t half = nofDE/2;
+    Int_t half = nofDE/2;
   
-  dcsNumber = half - dcsNumber;
+    dcsNumber = half - dcsNumber;
   
-  Int_t quarter = nofDE/4;
-  Int_t threeQuarter = half + quarter;
+    Int_t quarter = nofDE/4;
+    Int_t threeQuarter = half + quarter;
   
-  Int_t de(-1);
-  
-  if ( side == 0 ) // left
-  {
-    de = threeQuarter + 1 - dcsNumber;
+    if ( side == 0 ) // left
+    {
+      de = threeQuarter + 1 - dcsNumber;
+    }
+    else if ( side == 1 ) // right
+    {
+      if ( dcsNumber <= quarter )
+      {
+       de = dcsNumber + threeQuarter;
+      }
+      else
+      {
+       de = dcsNumber - quarter - 1;
+      }
+    }
   }
-  else if ( side == 1 ) // right
-  {
-    if ( dcsNumber <= quarter )
+  else { // Trigger
+
+    if ( chId < 19 ) chamberId = chId - 1;
+    else chamberId = chId - 9;
+
+    Int_t nofDE = AliMpDEManager::GetNofDEInChamber(chamberId);
+
+    if ( side == 0 ) // left -> Outside
     {
-      de = dcsNumber + threeQuarter;
+      de = 14 - dcsNumber;
     }
-    else
+    else if ( side == 1 ) // right -> Inside
     {
-      de = dcsNumber - quarter - 1;
+      de = (13 + dcsNumber) % nofDE;
     }
   }
   
   return (chamberId+1)*100 + de;
 }
 
+
 //_____________________________________________________________________________
 Int_t
-AliMpHVNamer::DetElemId2DCS(Int_t detElemId, Int_t& side) const
+AliMpDCSNamer::DetElemId2DCS(Int_t detElemId, Int_t& side, Int_t &chId) const
 {
   /// Convert DE to DCS "slat number"
   /// @see DCS2DE
+
+  CheckConsistency(detElemId);
   
   Int_t chamberId = AliMpDEManager::GetChamberId(detElemId);
   if ( chamberId < 0 ) 
@@ -261,34 +346,59 @@ AliMpHVNamer::DetElemId2DCS(Int_t detElemId, Int_t& side) const
       dcsNumber = half-dcsNumber;
     }
       break;
+    case AliMp::kStationTrigger:
+    {
+      if (chamberId < AliMpConstants::NofChambers()-2)
+       chId = chamberId + 1;
+      else chId = 23 + chamberId - AliMpConstants::NofChambers();
+
+      Int_t nofDE = AliMpDEManager::GetNofDEInChamber(chamberId);
+
+      if ( dcsNumber >=5 && dcsNumber <= 13 ) {
+       side = 0;
+       dcsNumber = 14 - dcsNumber;
+      }
+      else {
+       side = 1;
+       dcsNumber = (5 + dcsNumber) % nofDE;
+      }
+      AliDebug(10, Form("detElemId %i  -> MT%i_side%i_L%i", detElemId, chId, side, dcsNumber));
+    }
+      break;
     default:
       break;
   }
+
   return dcsNumber;
 }
 
+
 //_____________________________________________________________________________
 const char* 
-AliMpHVNamer::DCSHVChannelName(Int_t detElemId, Int_t sector) const
+  AliMpDCSNamer::DCSChannelName(Int_t detElemId, Int_t sector, Int_t dcsMeasure) const
 {
-  /// Return the alias name of the HV Channel for a given HV area 
+  /// 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
+  /// \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);
-  Int_t dcsNumber = DetElemId2DCS(detElemId,side);
-                                  
+  Int_t side(-1), chId(-1);
+  Int_t dcsNumber = DetElemId2DCS(detElemId,side,chId);
+
   switch (AliMpDEManager::GetStationType(detElemId))
   {
     case AliMp::kStation1:
     case AliMp::kStation2:
-      return Form(fgHVChannelSt12Pattern[side],chamberId,dcsNumber,sector);
+      return Form(fgkDCSChannelSt12Pattern[side],chamberId,dcsNumber,sector);
       break;
     case AliMp::kStation345:
-      return Form(fgHVChannelSt345Pattern[side],chamberId,dcsNumber);
+      return Form(fgkDCSChannelSt345Pattern[side],chamberId,dcsNumber);
+      break;
+    case AliMp::kStationTrigger:
+      return Form(fgkDCSChannelTriggerPattern[side],fgkDCSSideTriggerName[side],chId,dcsNumber,fgkDCSMeasureName[dcsMeasure]);
       break;
     default:
       return 0x0;
@@ -298,21 +408,21 @@ AliMpHVNamer::DCSHVChannelName(Int_t detElemId, Int_t sector) const
 
 //_____________________________________________________________________________
 const char* 
-AliMpHVNamer::DCSHVSwitchName(Int_t detElemId, Int_t pcbNumber) const
+AliMpDCSNamer::DCSSwitchName(Int_t detElemId, Int_t pcbNumber) const
 {
-  /// Return the alias name of the HV Switch for a given PCB 
+  /// Return the alias name of the DCS Switch for a given PCB 
   /// within a slat of St345
   
   if (AliMpDEManager::GetStationType(detElemId) == AliMp::kStation345)
   {
-    return Form(fgHVSwitchSt345Pattern,detElemId,pcbNumber);
+    return Form(fgkDCSSwitchSt345Pattern,detElemId,pcbNumber);
   }
   return 0x0;
 }
 
 //_____________________________________________________________________________
 Int_t 
-AliMpHVNamer::HVIndexFromDCSAlias(const char* dcsAlias) const
+AliMpDCSNamer::DCSIndexFromDCSAlias(const char* dcsAlias) const
 {
   /// Converts the dcs alias to a hv index 
   ///
@@ -341,7 +451,7 @@ AliMpHVNamer::HVIndexFromDCSAlias(const char* dcsAlias) const
   else
   {
     /// it's a switch
-    sscanf(sDcsAlias.Data(),fgHVSwitchSt345Pattern,&de,&sw);
+    sscanf(sDcsAlias.Data(),fgkDCSSwitchSt345Pattern,&de,&sw);
     return sw;
   }
   
@@ -351,7 +461,7 @@ AliMpHVNamer::HVIndexFromDCSAlias(const char* dcsAlias) const
   
   if ( sDcsAlias.Contains("Quad") )
   {
-    sscanf(sDcsAlias.Data(),fgHVChannelSt12Pattern[side],&n1,&n3,&n4);    
+    sscanf(sDcsAlias.Data(),fgkDCSChannelSt12Pattern[side],&n1,&n3,&n4);    
     return n4;
   }
   
@@ -360,52 +470,59 @@ AliMpHVNamer::HVIndexFromDCSAlias(const char* dcsAlias) const
 
 //_____________________________________________________________________________
 Int_t 
-AliMpHVNamer::DetElemIdFromDCSAlias(const char* dcsAlias) const
+AliMpDCSNamer::DetElemIdFromDCSAlias(const char* dcsAlias) const
 {
   /// Converts the dcs alias to a detection element identifier
   ///
-  /// dcsAlias has one of the following 2 forms :
+  /// dcsAlias has one of the following forms :
   ///
   /// MchHvLv[Left|Right]/Chamber##[Left|Right]/Chamber##[Left|Right]Slat##.actual.vMon
   ///
   /// MchHvLv[Left|Right]/Chamber##[Left|Right]/Chamber##[Left|Right]Quad#Sect#.actual.vMon
+  ///
+  /// MTR_Side[OUTSIDE|INSIDE]_MTChamber##_RPC#_HV_Type[imon|vmon]
   
   AliDebug(1,Form("dcsAlias=%s",dcsAlias));
   
   TString sDcsAlias(dcsAlias);
   
   int side(-1);
-  
-  if ( sDcsAlias.Contains("Left") )
-  {
-    side = 0;
-  }
-  else if ( sDcsAlias.Contains("Right") )
-  {
-    side = 1;
-  }
-  else
-  {
-    return -2;
+
+  const char** sideName = (fDetector == kTriggerDet) ? fgkDCSSideTriggerName : fgkDCSSideTrackerName;
+
+  for(Int_t iside=0; iside<2; iside++){
+    if ( sDcsAlias.Contains(sideName[iside]) ) {
+      side = iside;
+      break;
+    }
   }
+  if(side<0) return -2;
   
   int n1(-1);
   int n3(-1);
   int n4(-1);
+  char type[10];
+  char cside[4];
   int detElemId(-1);
   
   if ( sDcsAlias.Contains("Slat") )
   {
-    sscanf(sDcsAlias.Data(),fgHVChannelSt345Pattern[side],&n1,&n3);
+    sscanf(sDcsAlias.Data(),fgkDCSChannelSt345Pattern[side],&n1,&n3);
     detElemId = DCS2DE(n1,side,n3);
     AliDebug(1,Form("Slat side=%d n1=%d n3=%d de=%d",side,n1,n3,detElemId));
   }
   else if ( sDcsAlias.Contains("Quad") )
   {
-    sscanf(sDcsAlias.Data(),fgHVChannelSt12Pattern[side],&n1,&n3,&n4);    
+    sscanf(sDcsAlias.Data(),fgkDCSChannelSt12Pattern[side],&n1,&n3,&n4);    
     detElemId = 100*(n1+1) + n3;
     AliDebug(1,Form("Quad side=%d n1=%d n3=%d n4=%d de=%d",side,n1,n3,n4,detElemId));
   }
+  else if ( sDcsAlias.Contains("MT") )
+  {
+    sscanf(sDcsAlias.Data(),fgkDCSChannelTriggerPattern[side],cside,&n1,&n3,type);
+    detElemId = DCS2DE(n1,side,n3);
+    AliDebug(1,Form("Slat side=%d n1=%d n3=%d de=%d",side,n1,n3,detElemId));
+  }
   else
   {
     return -3;
@@ -421,12 +538,33 @@ AliMpHVNamer::DetElemIdFromDCSAlias(const char* dcsAlias) const
 }
 
 //_____________________________________________________________________________
+Int_t AliMpDCSNamer::DCSvariableFromDCSAlias(const char* dcsAlias) const
+{
+  /// Get DCS variable from an alias (trigger)
+  
+  TString sDcsAlias(dcsAlias);
+
+  Int_t dcsMeasurement = -1;
+
+  for(Int_t iMeas=0; iMeas<kNDCSMeas; iMeas++){
+    if ( sDcsAlias.Contains(fgkDCSMeasureName[iMeas]) ) {
+      dcsMeasurement = iMeas;
+      break;
+    }
+  }
+
+  return dcsMeasurement;
+}
+
+
+//_____________________________________________________________________________
 TObjArray*
-AliMpHVNamer::GenerateAliases() const
+AliMpDCSNamer::GenerateAliases() const
 {
   /// Generate DCS alias names, for MUON Tracker High Voltage system.
+  /// or for MUON Trigger HV and current system.
   ///
-  /// We first generate aliases of HV channels :
+  /// We first generate aliases of DCS channels :
   ///
   /// St 1 ch  1 : 12 channels
   ///      ch  2 : 12 channels 
@@ -439,48 +577,72 @@ AliMpHVNamer::GenerateAliases() const
   /// St 5 ch  9 : 26 channels
   ///      ch 10 : 26 channels
   ///
-  /// then aliases of HV switches (only for St345) : 1 switch per PCB.
+  /// then aliases of DCS switches (only for St345) : 1 switch per PCB.
   ///
   /// Returns a TObjArray of TObjString(=alias name)
   
   TObjArray* aliases = new TObjArray;
   aliases->SetOwner(kTRUE);
+
+  Int_t nMeasures = (fDetector == kTriggerDet) ? kNDCSMeas : 1;
   
-  AliMpDEIterator it;
+  for(Int_t iMeas=0; iMeas<nMeasures; iMeas++){
+
+    AliMpDEIterator it;
   
-  it.First();
+    it.First();
   
-  while (!it.IsDone())
-  {
-    Int_t detElemId = it.CurrentDEId();
-    switch ( AliMpDEManager::GetStationType(detElemId) )
+    while (!it.IsDone())
     {
-      case AliMp::kStation1:
-      case AliMp::kStation2:
-        for ( int sector = 0; sector < 3; ++sector)
-        {
-          aliases->Add(new TObjString(DCSHVChannelName(detElemId,sector)));
-        }
-        break;
-      case AliMp::kStation345:
-        aliases->Add(new TObjString(DCSHVChannelName(detElemId)));
-        for ( Int_t i = 0; i < NumberOfPCBs(detElemId); ++i )
-        {
-          aliases->Add(new TObjString(DCSHVSwitchName(detElemId,i)));
-        }
-        break;
-      default:
-        break;
-    }
-    it.Next();
-  }
-  
+      Int_t detElemId = it.CurrentDEId();
+      switch (fDetector){
+      case kTrackerDet:
+      {
+       switch ( AliMpDEManager::GetStationType(detElemId) )
+       {
+       case AliMp::kStation1:
+       case AliMp::kStation2:
+         for ( int sector = 0; sector < 3; ++sector)
+         {
+           aliases->Add(new TObjString(DCSChannelName(detElemId,sector)));
+         }
+         break;
+       case AliMp::kStation345:
+         aliases->Add(new TObjString(DCSChannelName(detElemId)));
+         for ( Int_t i = 0; i < NumberOfPCBs(detElemId); ++i )
+         {
+           aliases->Add(new TObjString(DCSSwitchName(detElemId,i)));
+         }
+         break;
+       default:
+         break;
+       }
+      }
+      break;
+      case kTriggerDet:
+      {
+       switch ( AliMpDEManager::GetStationType(detElemId) )
+       {
+       case AliMp::kStationTrigger:
+         AliDebug(10,Form("Current DetElemId %i",detElemId));
+         aliases->Add(new TObjString(DCSChannelName(detElemId,0,iMeas)));
+         break;
+       default:
+         break;
+       }
+      }
+      break;
+      }
+      it.Next();
+    } // loop on detElemId
+  } // Loop on measurement type
+
   return aliases;
 }
 
 //_____________________________________________________________________________
 Int_t 
-AliMpHVNamer::ManuId2Index(Int_t detElemId, Int_t manuId) const
+AliMpDCSNamer::ManuId2Index(Int_t detElemId, Int_t manuId) const
 {
   /// Convert (de,manu) to hv index, depending on the station
   
@@ -498,7 +660,7 @@ AliMpHVNamer::ManuId2Index(Int_t detElemId, Int_t manuId) const
 
 //_____________________________________________________________________________
 Int_t 
-AliMpHVNamer::ManuId2PCBIndex(Int_t detElemId, Int_t manuId) const
+AliMpDCSNamer::ManuId2PCBIndex(Int_t detElemId, Int_t manuId) const
 {
   /// Returns the index of PCB (within a St345 slat) for a given manu number.
   /// Returns -1 if (detElemId,manuId) is incorrect
@@ -516,9 +678,9 @@ AliMpHVNamer::ManuId2PCBIndex(Int_t detElemId, Int_t manuId) const
 
 //_____________________________________________________________________________
 Int_t 
-AliMpHVNamer::ManuId2Sector(Int_t detElemId, Int_t manuId) const
+AliMpDCSNamer::ManuId2Sector(Int_t detElemId, Int_t manuId) const
 {
-  /// Return the HV-sector number (within a St12 quadrant) for a given manu number.
+  /// Return the DCS-sector number (within a St12 quadrant) for a given manu number.
   
   AliCodeTimerAuto("")
   
@@ -559,7 +721,7 @@ AliMpHVNamer::ManuId2Sector(Int_t detElemId, Int_t manuId) const
 
 //_____________________________________________________________________________
 Int_t 
-AliMpHVNamer::NumberOfPCBs(Int_t detElemId) const
+AliMpDCSNamer::NumberOfPCBs(Int_t detElemId) const
 {
   /// Returns the number of PCB in a given detection element
   /// Only works for St345
@@ -577,3 +739,34 @@ AliMpHVNamer::NumberOfPCBs(Int_t detElemId) const
     return slat->GetSize();
   }
 }
+
+//_____________________________________________________________________________
+Bool_t AliMpDCSNamer::CheckConsistency(Int_t detElemId) const
+{
+  //
+  /// Check that the required detElemId either belongs to tracker or trigger
+  /// consistently with the initial definition of the namer
+  //
+
+  Bool_t isConsistent(kFALSE);
+  TString requestInfo;
+  switch(AliMpDEManager::GetStationType(detElemId))
+  {
+  case AliMp::kStation1:
+  case AliMp::kStation2:
+  case AliMp::kStation345:
+    if (fDetector == kTrackerDet) isConsistent = kTRUE;
+    requestInfo = "TRACKER";
+    break;
+  case AliMp::kStationTrigger:
+    if (fDetector == kTriggerDet) isConsistent = kTRUE;
+    requestInfo = "TRIGGER";
+    break;
+  default:
+    break;
+  }
+
+  if(!isConsistent) AliWarning(Form("Requesting information for %s station but class initialized for %s",requestInfo.Data(), fgkDetectorName[fDetector]));
+
+  return isConsistent;
+}
diff --git a/MUON/mapping/AliMpDCSNamer.h b/MUON/mapping/AliMpDCSNamer.h
new file mode 100644 (file)
index 0000000..fa6545d
--- /dev/null
@@ -0,0 +1,97 @@
+#ifndef ALIMPDCSNAMER_H
+#define ALIMPDCSNAMER_H
+
+/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
+* See cxx source for full Copyright notice                               */
+
+// $Id$
+
+/// \ingroup management
+/// \class AliMpDCSNamer
+/// \brief Collection of methods usefull to DCS handling for MUON TRK and TRG
+/// 
+//  Author Laurent Aphecetche and Diego Stocco, Subatech
+
+#ifndef ROOT_TObject
+#  include "TObject.h"
+#endif
+
+class TObjArray;
+
+class AliMpDCSNamer : public TObject
+{
+public:
+  AliMpDCSNamer();
+  AliMpDCSNamer(const char* detName);
+  
+  virtual ~AliMpDCSNamer();
+
+  Bool_t SetDetector(const char* detName);
+  
+  const char* DCSChannelName(Int_t detElemId, Int_t sector=0, Int_t DCSvariable=0) const;
+  
+  const char* DCSSwitchName(Int_t detElemId, Int_t pcbNumber) const;
+
+  Int_t DCS2DE(Int_t chamberId, Int_t side, Int_t dcsNumber) const;
+  
+  Int_t DetElemId2DCS(Int_t detElemId, Int_t& side, Int_t& chId) const;
+    
+  Int_t DCSIndexFromDCSAlias(const char* dcsAlias) const;
+  
+  Int_t DetElemIdFromDCSAlias(const char* dcsAlias) const;
+
+  Int_t DCSvariableFromDCSAlias(const char* dcsAlias) const;
+  
+  Int_t ManuId2Index(Int_t detElemId, Int_t manuId) const;
+  
+  /// Returns the index of PCB (within a St345 slat) for a given manu number.
+  Int_t ManuId2PCBIndex(Int_t detElemId, Int_t manuId) const;
+  
+  /// Return the HV-sector number (within a St12 quadrant) for a given manu number.
+  Int_t ManuId2Sector(Int_t detElemId, Int_t manuId) const;
+  
+  Int_t NumberOfPCBs(Int_t detElemId) const;
+
+  TObjArray* GenerateAliases() const;
+  TObjArray* CompactAliases() const;
+  void AliasesAsLdif(const char* ldiffile) const;
+
+  enum 
+  {
+    kDCSHV,    ///< High Voltage
+    kDCSI,     ///< Currents
+    kNDCSMeas  ///< Number of measured quantities
+  };
+
+  enum 
+  {
+    kTrackerDet, ///< Namer for tracker
+    kTriggerDet  ///< Namer for trigger
+  };
+  
+  
+private:
+  /// Not implemented
+  AliMpDCSNamer(const AliMpDCSNamer& right);
+  /// Not implemented
+  AliMpDCSNamer&  operator = (const AliMpDCSNamer& right);
+
+  Bool_t CheckConsistency(Int_t detElemId) const;
+    
+  static const char* fgkDCSChannelSt345Pattern[]; ///< DCS Tracker Channel name template
+  static const char* fgkDCSChannelSt12Pattern[]; ///< DCS Tracker Channel name template
+  static const char* fgkDCSSwitchSt345Pattern; ///< DCS Tracker Switch name template
+  static const char* fgkDCSSideTrackerName[]; ///< DCS Tracker Name of the side written in DCS
+
+  static const char* fgkDCSChannelTriggerPattern[]; ///< DCS Trigger Channel name template
+  static const char* fgkDCSSideTriggerName[]; ///< DCS Trigger Name of the side written in DCS
+  static const char* fgkDCSMeasureName[]; ///< DCS Trigger Name of the measure (HV or current) written in DCS
+
+  static const char* fgkDetectorName[]; ///< Name of detector (Tracker or Trigger)
+
+  Int_t fDetector; ///< Detector type (either tracker or trigger)
+  
+  ClassDef(AliMpDCSNamer,0) // Utility class for coding/decoding DCS aliases
+};
+
+#endif
index 48dbc15..dc70011 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"
@@ -301,7 +301,7 @@ AliMpDetElement::AddManu(Int_t manuId)
 
   fNofChannels += n;
   
-  AliMpHVNamer hvNamer;
+  AliMpDCSNamer hvNamer("TRACKER");
   
   Int_t index = hvNamer.ManuId2Index(fId,manuId);
                             
diff --git a/MUON/mapping/AliMpHVNamer.h b/MUON/mapping/AliMpHVNamer.h
deleted file mode 100644 (file)
index 815e79c..0000000
+++ /dev/null
@@ -1,66 +0,0 @@
-#ifndef ALIMPHVNAMER_H
-#define ALIMPHVNAMER_H
-
-/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
-* See cxx source for full Copyright notice                               */
-
-// $Id$
-
-/// \ingroup management
-/// \class AliMpHVNamer
-/// \brief Collection of methods usefull to HV handling for MUON TRK
-/// 
-//  Author Laurent Aphecetche, Subatech
-
-#ifndef ROOT_TObject
-#  include "TObject.h"
-#endif
-
-class TObjArray;
-
-class AliMpHVNamer : public TObject
-{
-public:
-  AliMpHVNamer();
-  virtual ~AliMpHVNamer();
-  
-  const char* DCSHVChannelName(Int_t detElemId, Int_t sector=0) const;
-  
-  const char* DCSHVSwitchName(Int_t detElemId, Int_t pcbNumber) const;
-
-  Int_t DCS2DE(Int_t chamberId, Int_t side, Int_t dcsNumber) const;
-  
-  Int_t DetElemId2DCS(Int_t detElemId, Int_t& side) const;
-    
-  Int_t HVIndexFromDCSAlias(const char* dcsAlias) const;
-  
-  Int_t DetElemIdFromDCSAlias(const char* dcsAlias) const;
-  
-  Int_t ManuId2Index(Int_t detElemId, Int_t manuId) const;
-  
-  /// Returns the index of PCB (within a St345 slat) for a given manu number.
-  Int_t ManuId2PCBIndex(Int_t detElemId, Int_t manuId) const;
-  
-  /// Return the HV-sector number (within a St12 quadrant) for a given manu number.
-  Int_t ManuId2Sector(Int_t detElemId, Int_t manuId) const;
-  
-  Int_t NumberOfPCBs(Int_t detElemId) const;
-
-  TObjArray* GenerateAliases() const;
-  TObjArray* CompactAliases() const;
-  void AliasesAsLdif(const char* ldiffile) const;
-  
-private:
-  /// Not implemented
-  AliMpHVNamer(const AliMpHVNamer& right);
-  /// Not implemented
-  AliMpHVNamer&  operator = (const AliMpHVNamer& right);
-    
-  static const char* fgHVChannelSt345Pattern[]; ///< HV Channel name template
-  static const char* fgHVChannelSt12Pattern[]; ///< HV Channel name template
-  static const char* fgHVSwitchSt345Pattern; ///< HV Switch name template
-  
-  ClassDef(AliMpHVNamer,0) // Utility class for coding/decoding DCS HV aliases
-};
-
-#endif