Flexible pt range for the efficiency histogramming
[u/mrichter/AliRoot.git] / MUON / AliMUONTrackerConditionDataMaker.cxx
index 167c95b..64ccdb0 100644 (file)
@@ -40,6 +40,7 @@ ClassImp(AliMUONTrackerConditionDataMaker)
 #include "AliMUONDigitCalibrator.h"
 #include "AliMUONPadStatusMaker.h"
 #include "AliMUONPadStatusMapMaker.h"
+#include "AliMUONRejectList.h"
 #include "AliMUONTrackerData.h"
 #include "AliMUONTrackerIO.h"
 #include "AliMpArrayI.h"
@@ -79,16 +80,44 @@ fIsOwnerOfData(kTRUE)
        
        AliCDBManager::Instance()->SetDefaultStorage(ocdbPath);
 
-  Int_t startOfValidity;
-  AliMUONVStore* store = CreateStore(runNumber,ocdbPath,type,startOfValidity);
-  AliDebug(1,Form("runNumber=%d ocdbPath=%s type=%s startOfValidity=%d store=%p",
-                  runNumber,ocdbPath,type,startOfValidity,store));
-  if ( store )
+  TString stype(type);
+  stype.ToUpper();
+  
+  if ( stype == "REJECTLIST" ) 
   {
-    fData = CreateData(type,*store,startOfValidity);
-  }  
+    
+    Int_t startOfValidity(0);
+    
+    AliMUONRejectList* rl = AliMUONCalibrationData::CreateRejectList(runNumber,&startOfValidity);    
 
-  delete store;
+    if (rl)
+    {
+      fData = new AliMUONTrackerData(Form("RL%d",startOfValidity),"RejectList",*rl);
+    }
+    
+    delete rl;
+  }
+  else
+  {
+    Int_t startOfValidity;
+    AliMUONVStore* store = CreateStore(runNumber,ocdbPath,type,startOfValidity);
+    AliDebug(1,Form("runNumber=%d ocdbPath=%s type=%s startOfValidity=%d store=%p",
+                    runNumber,ocdbPath,type,startOfValidity,store));
+    if ( store )
+    {
+      fData = CreateData(type,*store,startOfValidity);
+    }
+    delete store;
+  }
+
+  if ( fData )
+  {
+    TString name(fData->GetName());
+    name += "(";
+    name += ocdbPath;
+    name += ")";
+    fData->SetName(name);
+  }
   
   AliCDBManager::Instance()->SetDefaultStorage(storage);
 }
@@ -277,7 +306,7 @@ AliMUONTrackerConditionDataMaker::CreateHVStore(TMap& m)
       
       if ( nPCBs ) 
       {
-        TString switchName(hvNamer.DCSSwitchName(detElemId,i));
+        TString switchName(hvNamer.DCSSwitchAliasName(detElemId,i));
 
         TPair* p = static_cast<TPair*>(m.FindObject(switchName.Data()));
         TObjArray* a = static_cast<TObjArray*>(p->Value());
@@ -461,6 +490,7 @@ AliMUONTrackerConditionDataMaker::CreateStore(Int_t runNumber,
     if ( ocdb ) 
     {
       store = AliMUONCalibrationData::CreateOccupancyMap(runNumber,&startOfValidity);
+      if (store) store = static_cast<AliMUONVStore*>(store->Clone());
     }
     else
     {