Adding HV currents to the MUON/Calib/OCDB object
authorlaphecet <laphecet@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 7 Nov 2012 22:06:24 +0000 (22:06 +0000)
committerlaphecet <laphecet@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 7 Nov 2012 22:06:24 +0000 (22:06 +0000)
MUON/AliMUONCalibrationData.cxx
MUON/AliMUONHVSubprocessor.cxx
MUON/AliMUONHVSubprocessor.h
MUON/AliMUONTrackerPreprocessor.cxx
MUON/TestMUONPreprocessor.C
MUON/mapping/AliMpDCSNamer.cxx

index b4f8462..9517a3a 100644 (file)
@@ -644,7 +644,9 @@ AliMUONCalibrationData::CreateHV(Int_t runNumber,
       TString name(hvChannelName->String());
       
       if ( name.Contains("sw") ) continue; // skip switches
-      
+
+      if ( name.Contains("iMon") ) continue; // skip HV currents
+
       TPair* hvPair = static_cast<TPair*>(hvMap->FindObject(name.Data()));
       TObjArray* values = static_cast<TObjArray*>(hvPair->Value());
       if (!values)
index 89205e3..8890304 100644 (file)
@@ -45,10 +45,10 @@ ClassImp(AliMUONHVSubprocessor)
 /// \endcond
 
 //_____________________________________________________________________________
-AliMUONHVSubprocessor::AliMUONHVSubprocessor(AliMUONPreprocessor* master)
+AliMUONHVSubprocessor::AliMUONHVSubprocessor(AliMUONPreprocessor* master, Bool_t includeHVcurrents)
 : AliMUONVSubprocessor(master,
                        "HV",
-                       "Get MUON Tracker HV values from DCS")
+                       "Get MUON Tracker HV values from DCS"), fIncludeHVCurrents(includeHVcurrents)
 {
   /// ctor
 }
@@ -90,12 +90,20 @@ AliMUONHVSubprocessor::Process(TMap* dcsAliasMap)
         for ( int i = 0; i <3; ++i)
         {
           aliases.Add(new TObjString(hvNamer.DCSAliasName(detElemId,i)));
+          if ( fIncludeHVCurrents )
+          {
+            aliases.Add(new TObjString(hvNamer.DCSAliasName(detElemId,i,AliMpDCSNamer::kDCSI)));
+          }
         }
       }
       break;
       case AliMp::kStation345:
       {
         aliases.Add(new TObjString(hvNamer.DCSAliasName(detElemId)));
+        if ( fIncludeHVCurrents )
+        {
+          aliases.Add(new TObjString(hvNamer.DCSAliasName(detElemId,0,AliMpDCSNamer::kDCSI)));
+        }
         for ( int i = 0; i < hvNamer.NumberOfPCBs(detElemId); ++i)
         {
           aliases.Add(new TObjString(hvNamer.DCSSwitchAliasName(detElemId,i)));
@@ -133,8 +141,7 @@ AliMUONHVSubprocessor::Process(TMap* dcsAliasMap)
       }
       else
       {
-       RemoveValuesOutsideRun(values);
-
+        RemoveValuesOutsideRun(values);
         hv.Add(new TObjString(aliasName.Data()),values);
       }
     }
index 3cd3205..20fb098 100644 (file)
 class AliMUONHVSubprocessor : public AliMUONVSubprocessor
 {
 public:
-  AliMUONHVSubprocessor(AliMUONPreprocessor* master);
+  AliMUONHVSubprocessor(AliMUONPreprocessor* master, Bool_t includeHVcurrents=kFALSE);
   virtual ~AliMUONHVSubprocessor();
   
   virtual UInt_t Process(TMap* dcsAliasMap);
 
+  Bool_t IncludeHVCurrent() const { return fIncludeHVCurrents; }
+  
 private:
   /// Not implemented
   AliMUONHVSubprocessor(const AliMUONHVSubprocessor&);
   /// Not implemented
   AliMUONHVSubprocessor& operator=(const AliMUONHVSubprocessor&);
   
-  ClassDef(AliMUONHVSubprocessor,1) // Shuttle Subprocessor for MUON TRK HV
+  Bool_t fIncludeHVCurrents; // whether or not to transfer also HV current (in addition to HV voltages)
+  
+  ClassDef(AliMUONHVSubprocessor,2) // Shuttle Subprocessor for MUON TRK HV
 };
 
 #endif
index 2dfd082..0b18b2c 100644 (file)
@@ -48,7 +48,7 @@ AliMUONTrackerPreprocessor::AliMUONTrackerPreprocessor(AliShuttleInterface* shut
 : AliMUONPreprocessor("MCH",shuttle),
 fPedestalSubprocessor(new AliMUONPedestalSubprocessor(this)),
 fGMSSubprocessor(new AliMUONGMSSubprocessor(this)),    
-fHVSubprocessor(new AliMUONHVSubprocessor(this)),
+fHVSubprocessor(new AliMUONHVSubprocessor(this,kTRUE)),
 fGainSubprocessor(new AliMUONGainSubprocessor(this)),
 fOccupancySubprocessor(new AliMUONOccupancySubprocessor(this))
 {
@@ -106,6 +106,10 @@ AliMUONTrackerPreprocessor::Initialize(Int_t run, UInt_t startTime, UInt_t endTi
     Add(fHVSubprocessor,useDCS); // to be called only for physics runs
     Add(fOccupancySubprocessor);
     Log("INFO-Will run HV subprocessor");
+    if ( fHVSubprocessor->IncludeHVCurrent() )
+    {
+      Log("INFO-HV subprocessor will store HV currents in addition to the voltages");
+    }
     Log("INFO-Will run Occupancy subprocessor");
   }
   else
index 340879a..77638ef 100644 (file)
@@ -41,7 +41,7 @@
 /// correctly :
 ///
 /// <pre>
-/// cd $ALICE_ROOT/OCDB/SHUTTLE/TestShuttle/TestCDB
+/// cd $ALICE_ROOT/SHUTTLE/TestShuttle/TestCDB
 /// mkdir -p MUON/Calib
 /// cd MUON/Calib
 /// ln -si $ALICE_ROOT/OCDB/MUON/Calib/MappingData .
@@ -50,7 +50,7 @@
 /// and Align/Baseline if you'd like to test GMS subprocessor :
 ///
 /// <pre>
-/// cd $ALICE_ROOT/OCDB/SHUTTLE/TestShuttle/TestCDB
+/// cd $ALICE_ROOT/SHUTTLE/TestShuttle/TestCDB
 /// mkdir -p MUON/Align
 /// cd MUON/Align
 /// ln -si $ALICE_ROOT/OCDB/MUON/Align/Baseline .
@@ -165,8 +165,7 @@ void TestMUONPreprocessor(Int_t runNumber=80,
 
   AliTestShuttle* shuttle = new AliTestShuttle(runNumber, 0, 1);
   
-  const char* inputCDB = "local://$ALICE_ROOT/OCDB/SHUTTLE/TestShuttle/TestCDB";
-  //const char* inputCDB = "alien://folder=/alice/testdata/2008/TS08a/OCDB";
+  const char* inputCDB = "local://$ALICE_ROOT/SHUTTLE/TestShuttle/TestCDB";
   
   AliTestShuttle::SetMainCDB(inputCDB);
   AliTestShuttle::SetMainRefStorage("local://$ALICE_ROOT/OCDB/SHUTTLE/TestShuttle/TestReference");
@@ -177,8 +176,6 @@ void TestMUONPreprocessor(Int_t runNumber=80,
   if ( rt.Contains("PHYSICS") )
   {
     // Create DCS aliases
-    UInt_t startTime, endTime;
-    
     TMap* dcsAliasMap = CreateDCSAliasMap(inputCDB, runNumber);
 
     if ( dcsAliasMap ) 
@@ -394,8 +391,16 @@ TMap* CreateDCSAliasMap(const char* inputCDB, Int_t runNumber)
         {
           Float_t value = 0;
           if(sDetName.Contains("TRACKER")){
-            value = random.Gaus(1750,62.5);
-            if ( aliasName == "MchHvLvLeft/Chamber00Left/Quad2Sect1.actual.vMon") value = 500;
+            if ( aliasName.Contains("vMon"))
+            {
+              value = random.Gaus(1750,62.5);
+              if ( aliasName == "MchHvLvLeft/Chamber00Left/Quad2Sect1.actual.vMon") value = 500;
+            }
+            else
+            {
+              value = random.Gaus(10,2);
+              if ( aliasName == "MchHvLvLeft/Chamber00Left/Quad2Sect1.actual.iMon") value = 50;
+            }
           }
           else if(aliasName.Contains("iMon")){
             value = random.Gaus(2.,0.4);
index 3d06fec..172cc86 100644 (file)
@@ -725,59 +725,61 @@ AliMpDCSNamer::GenerateAliases() const
   
   TObjArray* aliases = new TObjArray;
   aliases->SetOwner(kTRUE);
-
+  
   Int_t nMeasures = (fDetector == kTriggerDet) ? kNDCSMeas : 1;
   
   for(Int_t iMeas=0; iMeas<nMeasures; iMeas++){
-
+    
     AliMpDEIterator it;
-  
+    
     it.First();
-  
+    
     while (!it.IsDone())
     {
       Int_t detElemId = it.CurrentDEId();
       switch (fDetector){
-      case kTrackerDet:
-      {
-       switch ( AliMpDEManager::GetStationType(detElemId) )
-       {
-       case AliMp::kStation12:
-         for ( int sector = 0; sector < 3; ++sector)
-         {
-           aliases->Add(new TObjString(DCSAliasName(detElemId,sector)));
-         }
-         break;
-       case AliMp::kStation345:
-         aliases->Add(new TObjString(DCSAliasName(detElemId)));
-         for ( Int_t i = 0; i < NumberOfPCBs(detElemId); ++i )
-         {
-           aliases->Add(new TObjString(DCSSwitchAliasName(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(DCSAliasName(detElemId,0,iMeas)));
-         break;
-       default:
-         break;
-       }
-      }
-      break;
+        case kTrackerDet:
+        {
+          switch ( AliMpDEManager::GetStationType(detElemId) )
+          {
+            case AliMp::kStation12:
+              for ( int sector = 0; sector < 3; ++sector)
+              {
+                aliases->Add(new TObjString(DCSAliasName(detElemId,sector)));
+                aliases->Add(new TObjString(DCSAliasName(detElemId,sector,AliMpDCSNamer::kDCSI)));
+              }
+              break;
+            case AliMp::kStation345:
+              aliases->Add(new TObjString(DCSAliasName(detElemId)));
+              aliases->Add(new TObjString(DCSAliasName(detElemId,0,AliMpDCSNamer::kDCSI)));
+              for ( Int_t i = 0; i < NumberOfPCBs(detElemId); ++i )
+              {
+                aliases->Add(new TObjString(DCSSwitchAliasName(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(DCSAliasName(detElemId,0,iMeas)));
+              break;
+            default:
+              break;
+          }
+        }
+          break;
       }
       it.Next();
     } // loop on detElemId
   } // Loop on measurement type
-
+  
   return aliases;
 }