]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - MUON/AliMUONCalibrationData.cxx
Reading PMT gains from an external file
[u/mrichter/AliRoot.git] / MUON / AliMUONCalibrationData.cxx
index 3f63f3231aa130f1a8a8f99caee819c2813326ab..93654ed6fe65bd17f600d67ba97b4d7b349ad9d9 100644 (file)
@@ -24,7 +24,6 @@
 #include "AliLog.h"
 #include "AliMpDCSNamer.h"
 #include "AliMpIntPair.h"
-#include "AliMUONConstants.h"
 #include "AliMUONGlobalCrateConfig.h"
 #include "AliMUONRegionalTriggerConfig.h"
 #include "AliMUONRejectList.h"
@@ -422,7 +421,7 @@ Bool_t AliMUONCalibrationData::PatchHVValues(TObjArray& values,
   
   TString hvCase("OTHER");
   int dummy(0),a(-1),b(-1);
-  char r[80];
+  char r[81];
   Int_t nvalues = values.GetSize();  
   Int_t* indices = new Int_t[nvalues];
   memset(indices,0,nvalues*sizeof(Int_t));
@@ -569,6 +568,8 @@ AliMUONCalibrationData::CreateHV(Int_t runNumber,
   /// Create a new HV map from the OCDB for a given run
   TMap* hvMap = dynamic_cast<TMap*>(CreateObject(runNumber,"MUON/Calib/HV",startOfValidity));
 
+  if (!hvMap) return 0x0;
+  
   if (patched)
   {
     TIter next(hvMap);
@@ -614,7 +615,7 @@ AliMUONCalibrationData::CreateHV(Int_t runNumber,
     Int_t a(0),b(0),c(0),d(0),e(0),f(0),g(0),h(0),u(0),z(0);
     TIter next(messages);
     TObjString* msg;
-    char hvCase;
+    char hvCase('u');
     
     while ( ( msg = static_cast<TObjString*>(next()) ) )
     {
@@ -622,7 +623,7 @@ AliMUONCalibrationData::CreateHV(Int_t runNumber,
       
       if ( i >= 0 )
       {
-        sscanf(msg->String()(i,msg->String().Length()-i).Data(),"CASE:%c",&hvCase);
+        sscanf(msg->String()(i,msg->String().Length()-i).Data(),"CASE:%10c",&hvCase);
       }
 
       switch (hvCase)
@@ -695,6 +696,10 @@ AliMUONCalibrationData::CreateObject(Int_t runNumber, const char* path, Int_t* s
       entry->SetOwner(kFALSE);
       delete entry;      
     }
+//    else
+//    {
+//      entry->SetOwner(kTRUE); //FIXME : this should be done but is causing problems with RecoParams at the end of the reco : investigate why...
+//    }
     return object;
   }
        else