From: richterm Date: Tue, 7 Jun 2011 05:35:02 +0000 (+0000) Subject: reverting r50024, to be committed separately in order to disentangle modules X-Git-Url: http://git.uio.no/git/?p=u%2Fmrichter%2FAliRoot.git;a=commitdiff_plain;h=849cbdb089ffa78b31504704e027345f13513ca6 reverting r50024, to be committed separately in order to disentangle modules --- diff --git a/HLT/BASE/AliHLTComponent.cxx b/HLT/BASE/AliHLTComponent.cxx index d5d5a1bc33e..046b6d405df 100644 --- a/HLT/BASE/AliHLTComponent.cxx +++ b/HLT/BASE/AliHLTComponent.cxx @@ -581,7 +581,7 @@ int AliHLTComponent::ConfigureFromCDBTObjString(const char* entries, const char* return iResult; } -TObject* AliHLTComponent::LoadAndExtractOCDBObject(const char* path, int version, int subVersion, const char* key) const +TObject* AliHLTComponent::LoadAndExtractOCDBObject(const char* path, int version, int subVersion, const char* key) { // see header file for function documentation AliCDBEntry* pEntry=AliHLTMisc::Instance().LoadOCDBEntry(path, GetRunNo(), version, subVersion); diff --git a/HLT/BASE/AliHLTComponent.h b/HLT/BASE/AliHLTComponent.h index ba19213caba..f8c8a4f6892 100644 --- a/HLT/BASE/AliHLTComponent.h +++ b/HLT/BASE/AliHLTComponent.h @@ -1112,9 +1112,9 @@ class AliHLTComponent : public AliHLTLogging { * @param subVersion subversion of the entry * @param key key of the object within TMap */ - TObject* LoadAndExtractOCDBObject(const char* path, int version = -1, int subVersion = -1, const char* key=NULL) const; + TObject* LoadAndExtractOCDBObject(const char* path, int version = -1, int subVersion = -1, const char* key=NULL); - TObject* LoadAndExtractOCDBObject(const char* path, const char* key) const { + TObject* LoadAndExtractOCDBObject(const char* path, const char* key) { return LoadAndExtractOCDBObject(path, -1, -1, key); } diff --git a/HLT/MUON/AliHLTMUONProcessor.cxx b/HLT/MUON/AliHLTMUONProcessor.cxx index adf22d0ace4..7f7c2d5c891 100644 --- a/HLT/MUON/AliHLTMUONProcessor.cxx +++ b/HLT/MUON/AliHLTMUONProcessor.cxx @@ -339,7 +339,31 @@ 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. - TObject* obj = LoadAndExtractOCDBObject(pathToEntry); + 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(); if (obj == NULL) { HLTError("Configuration object for \"%s\" is missing.", pathToEntry); @@ -682,8 +706,32 @@ 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"; - TObject* obj = LoadAndExtractOCDBObject(pathToEntry); + 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(); if (obj == NULL) { HLTError("Reconstruction parameters object for \"%s\" is missing.", pathToEntry);