From 8e2ad47aa513aef2507e3bd6aa7964215a538533 Mon Sep 17 00:00:00 2001 From: richterm Date: Tue, 7 Jun 2011 05:49:33 +0000 Subject: [PATCH] Using common loading methods for CDB entries that take care of missing subversion on Grid OCDB. --- HLT/MUON/AliHLTMUONProcessor.cxx | 52 ++------------------------------ 1 file changed, 2 insertions(+), 50 deletions(-) diff --git a/HLT/MUON/AliHLTMUONProcessor.cxx b/HLT/MUON/AliHLTMUONProcessor.cxx index 7f7c2d5c891..adf22d0ace4 100644 --- a/HLT/MUON/AliHLTMUONProcessor.cxx +++ b/HLT/MUON/AliHLTMUONProcessor.cxx @@ -339,31 +339,7 @@ int AliHLTMUONProcessor::FetchTMapFromCDB(const char* pathToEntry, TMap*& map) c /// \return Zero if the object could be found. Otherwise an error code, /// 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; - } - - Int_t version = store->GetLatestVersion(pathToEntry, GetRunNo()); - Int_t subVersion = store->GetLatestSubVersion(pathToEntry, GetRunNo(), version); - AliCDBId* entryId = AliCDBManager::Instance()->GetId(pathToEntry, GetRunNo(), version, subVersion); - if (entryId == NULL) - { - HLTError("Could not find the CDB entry for \"%s\".", pathToEntry); - return -ENOENT; - } - AliCDBEntry* entry = AliCDBManager::Instance()->Get(*entryId); - if (entry == NULL) - { - HLTError("Could not fetch the CDB entry for \"%s\".", pathToEntry); - return -EIO; - } - - TObject* obj = entry->GetObject(); + TObject* obj = LoadAndExtractOCDBObject(pathToEntry); if (obj == NULL) { HLTError("Configuration object for \"%s\" is missing.", pathToEntry); @@ -706,32 +682,8 @@ int AliHLTMUONProcessor::LoadRecoParamsFromCDB(AliMUONRecoParam*& params) const /// \return Zero if the object could be found. Otherwise an error code, /// 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"; - Int_t version = store->GetLatestVersion(pathToEntry, GetRunNo()); - Int_t subVersion = store->GetLatestSubVersion(pathToEntry, GetRunNo(), version); - AliCDBId* entryId = AliCDBManager::Instance()->GetId(pathToEntry, GetRunNo(), version, subVersion); - if (entryId == NULL) - { - HLTError("Could not find the CDB entry for \"%s\".", pathToEntry); - return -ENOENT; - } - AliCDBEntry* entry = AliCDBManager::Instance()->Get(*entryId); - if (entry == NULL) - { - HLTError("Could not fetch the CDB entry for \"%s\".", pathToEntry); - return -EIO; - } - - TObject* obj = entry->GetObject(); + TObject* obj = LoadAndExtractOCDBObject(pathToEntry); if (obj == NULL) { HLTError("Reconstruction parameters object for \"%s\" is missing.", pathToEntry); -- 2.39.3