]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
Using common loading methods for CDB entries that take care of missing subversion...
authorrichterm <richterm@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 7 Jun 2011 05:49:33 +0000 (05:49 +0000)
committerrichterm <richterm@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 7 Jun 2011 05:49:33 +0000 (05:49 +0000)
HLT/MUON/AliHLTMUONProcessor.cxx

index 7f7c2d5c89195a4b4ab1f0358d7815058f6c494b..adf22d0ace4b6aae83ef0fd800a27c656da1c477 100644 (file)
@@ -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);