]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
Adding code to make sure we fetch the latest version of a CDB object.
authoraszostak <aszostak@f7af4fe6-9843-0410-8265-dc069ae4e863>
Sat, 2 Aug 2008 12:51:02 +0000 (12:51 +0000)
committeraszostak <aszostak@f7af4fe6-9843-0410-8265-dc069ae4e863>
Sat, 2 Aug 2008 12:51:02 +0000 (12:51 +0000)
HLT/MUON/AliHLTMUONProcessor.cxx

index 46675005998e1b0abf79863c004ed292f471a83c..26dc91991cc129c267a337c0eade9378b60df5b4 100644 (file)
@@ -151,7 +151,16 @@ int AliHLTMUONProcessor::FetchTMapFromCDB(const char* pathToEntry, TMap*& map) c
        
        assert(AliCDBManager::Instance() != NULL);
        
-       AliCDBEntry* entry = AliCDBManager::Instance()->Get(pathToEntry);
+       AliCDBStorage* store = AliCDBManager::Instance()->GetDefaultStorage();
+       if (store == NULL)
+       {
+               HLTError("Could not get the the default storage for the CDB.");
+               return -EIO;
+       }
+
+       Int_t version = store->GetLatestVersion(pathToEntry, GetRunNo());
+       Int_t subVersion = store->GetLatestSubVersion(pathToEntry, GetRunNo(), version);
+       AliCDBEntry* entry = AliCDBManager::Instance()->Get(pathToEntry, GetRunNo(), version, subVersion);
        if (entry == NULL)
        {
                HLTError("Could not get the CDB entry for \"%s\".", pathToEntry);
@@ -414,9 +423,18 @@ int AliHLTMUONProcessor::LoadRecoParamsFromCDB(AliMUONRecoParam*& params) const
        ///      which is compatible with the HLT framework, is returned.
        
        assert(AliCDBManager::Instance() != NULL);
-       
+
+       AliCDBStorage* store = AliCDBManager::Instance()->GetDefaultStorage();
+       if (store == NULL)
+       {
+               HLTError("Could not get the the default storage for the CDB.");
+               return -EIO;
+       }
+
        const char* pathToEntry = "MUON/Calib/RecoParam";
-       AliCDBEntry* entry = AliCDBManager::Instance()->Get(pathToEntry);
+       Int_t version = store->GetLatestVersion(pathToEntry, GetRunNo());
+       Int_t subVersion = store->GetLatestSubVersion(pathToEntry, GetRunNo(), version);
+       AliCDBEntry* entry = AliCDBManager::Instance()->Get(pathToEntry, GetRunNo(), version, subVersion);
        if (entry == NULL)
        {
                HLTError("Could not get the CDB entry for \"%s\".", pathToEntry);