]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - MUON/AliMUONHVSubprocessor.cxx
Small correction for shifts in SSD (M. Van Leeuwen)
[u/mrichter/AliRoot.git] / MUON / AliMUONHVSubprocessor.cxx
index 0821c8569c703269c28b8800152fbe8c0835145c..b782e5ff69ad91ecf55cf75c5101872f6661ffa2 100644 (file)
@@ -13,7 +13,9 @@
 * provided "as is" without express or implied warranty.                  *
 **************************************************************************/
 
-/// $Id$
+// $Id$
+
+//-----------------------------------------------------------------------------
 /// \class AliMUONHVSubprocessor
 ///
 /// A subprocessor to read HV values for one run
 /// It simply creates a copy of the dcsAliasMap w/o information
 /// from the MUON TRK, and dumps this copy into the CDB
 ///
-// Author: Laurent Aphecetche, Subatech
+/// \author Laurent Aphecetche, Subatech
+//-----------------------------------------------------------------------------
 
 #include "AliMUONHVSubprocessor.h"
-#include "AliMUONHVNamer.h"
 #include "AliMUONPreprocessor.h"
 
 #include "AliMpDEIterator.h"
 #include "AliMpDEManager.h"
+#include "AliMpHVNamer.h"
 
 #include "AliCDBMetaData.h"
 #include "AliLog.h"
@@ -56,15 +59,6 @@ AliMUONHVSubprocessor::~AliMUONHVSubprocessor()
   /// dtor
 }
 
-//_____________________________________________________________________________
-void 
-AliMUONHVSubprocessor::Initialize(Int_t run, 
-                                  UInt_t startTime, UInt_t endTime)
-{
-  /// Initialisation for a given run
-  AliDebug(1,Form("run %d startTime %ld endtime %ld",run,startTime,endTime));
-}
-
 //_____________________________________________________________________________
 UInt_t
 AliMUONHVSubprocessor::Process(TMap* dcsAliasMap)
@@ -74,7 +68,7 @@ AliMUONHVSubprocessor::Process(TMap* dcsAliasMap)
   TMap hv;
   hv.SetOwner(kTRUE);
   
-  AliMUONHVNamer hvNamer;
+  AliMpHVNamer hvNamer;
 
   AliMpDEIterator deIt;
 
@@ -118,6 +112,9 @@ AliMUONHVSubprocessor::Process(TMap* dcsAliasMap)
 
   TIter next(&aliases);
   TObjString* alias;
+  Bool_t kNoAliases(kTRUE);
+  Int_t aliasNotFound(0);
+  Int_t valueNotFound(0);
   
   while ( ( alias = static_cast<TObjString*>(next()) ) ) 
   {
@@ -125,14 +122,15 @@ AliMUONHVSubprocessor::Process(TMap* dcsAliasMap)
     TPair* hvPair = static_cast<TPair*>(dcsAliasMap->FindObject(aliasName.Data()));
     if (!hvPair)
     {
-      Master()->Log(Form("Did not find expected alias (%s)",aliasName.Data()));
+      ++aliasNotFound;
     }
     else
     {
-      TObjArray* values = static_cast<TObjArray*>(hvPair->Value());
+      kNoAliases = kFALSE;
+      TObjArray* values = static_cast<TObjArray*>(hvPair->Value()->Clone());
       if (!values)
       {
-        Master()->Log(Form("Could not get values for alias (%s)",aliasName.Data()));
+        ++valueNotFound;
       }
       else
       {
@@ -143,7 +141,23 @@ AliMUONHVSubprocessor::Process(TMap* dcsAliasMap)
     }
   }
   
-  Master()->Log("Aliases successfully read in");
+  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);
@@ -152,8 +166,8 @@ AliMUONHVSubprocessor::Process(TMap* dcsAliasMap)
   
   Bool_t validToInfinity(kFALSE);
   
-  UInt_t result = Master()->Store("Calib","HV",&hv,&metaData,0,validToInfinity);
+  Bool_t result = Master()->Store("Calib","HV",&hv,&metaData,0,validToInfinity);
   
-  return result;
+  return ( result != kTRUE); // return 0 if everything is ok
 }