From: rgrosso Date: Wed, 19 Feb 2014 16:11:52 +0000 (+0100) Subject: Take into account different MC/raw Uri structure X-Git-Url: http://git.uio.no/git/?a=commitdiff_plain;h=7ab8651a148f5cae1bb04ac005a1022085eb09d4;p=u%2Fmrichter%2FAliRoot.git Take into account different MC/raw Uri structure --- diff --git a/STEER/CDB/AliCDBLocal.cxx b/STEER/CDB/AliCDBLocal.cxx index 107c17232d1..683ac1f072c 100644 --- a/STEER/CDB/AliCDBLocal.cxx +++ b/STEER/CDB/AliCDBLocal.cxx @@ -938,9 +938,16 @@ void AliCDBLocal::QueryValidCVMFSFiles(TString& cvmfsOcdbTag) { TString uri(GetURI()); uri.Remove(TString::kTrailing, '/'); TObjArray * osArr = uri.Tokenize('/'); - TObjString* mcdata_os = dynamic_cast(osArr->At(osArr->GetEntries()-2)); + TObjString* mcdata_os = dynamic_cast(osArr->At(osArr->GetEntries()-3)); + TObjString* yeartype_os = 0; TString mcdata = mcdata_os->GetString(); - TObjString* yeartype_os = dynamic_cast(osArr->At(osArr->GetEntries()-1)); + if( mcdata == TString("data")) { + yeartype_os = dynamic_cast(osArr->At(osArr->GetEntries()-2)); + } else { + mcdata_os = dynamic_cast(osArr->At(osArr->GetEntries()-2)); + yeartype_os = dynamic_cast(osArr->At(osArr->GetEntries()-1)); + } + mcdata = mcdata_os->GetString(); TString yeartype = yeartype_os->GetString(); command += mcdata; command += '/'; @@ -975,8 +982,16 @@ void AliCDBLocal::QueryValidCVMFSFiles(TString& cvmfsOcdbTag) { } TString filepath; while (filepath.ReadLine(*file)) { + // skip line in case it is not a root file path + if(! filepath.EndsWith(".root")) { + continue; + } //extract three-level path and basename TObjArray *tokens = filepath.Tokenize('/'); + if (tokens->GetEntries() < 5) { + AliError(Form("\"%s\" is not a valid cvmfs path for an OCDB object", filepath.Data())); + continue; + } TObjString *baseNameOstr = (TObjString*) tokens->At(tokens->GetEntries()-1); TString baseName(baseNameOstr->String()); TObjString *l0oStr = (TObjString*) tokens->At(tokens->GetEntries()-4); diff --git a/STEER/CDB/AliCDBManager.cxx b/STEER/CDB/AliCDBManager.cxx index 1573fee288d..f1377456c1c 100644 --- a/STEER/CDB/AliCDBManager.cxx +++ b/STEER/CDB/AliCDBManager.cxx @@ -429,7 +429,7 @@ void AliCDBManager::AlienToCvmfsUri(TString& uriString) const { TString mcFolder = entryValue(re_MCFolder); if ( !rawFolder.IsNull() ){ entryValue.Replace(0, 6, "/cvmfs/alice.cern.ch/calibration"); - entryValue.Replace(entryValue.Length()-4, entryValue.Length(), ""); + //entryValue.Replace(entryValue.Length()-4, entryValue.Length(), ""); } else if ( !mcFolder.IsNull() ){ entryValue.Replace(0,36,"/cvmfs/alice.cern.ch/calibration/MC"); } else { @@ -502,18 +502,14 @@ AliCDBStorage* AliCDBManager::GetStorage(const AliCDBParam* param) { if(fRun >= 0) { if( aStorage->GetType() == "alien" || aStorage->GetType() == "local" ) aStorage->QueryCDB(fRun); - //} else { - // AliDebug(2, - // "Skipping query for valid files, it is used only in grid..."); - //} - } + } return aStorage; + } } -} -AliError(Form("Failed to activate requested storage! Check URI: %s", param->GetURI().Data())); + AliError(Form("Failed to activate requested storage! Check URI: %s", param->GetURI().Data())); -return NULL; + return NULL; } //_____________________________________________________________________________ @@ -1658,7 +1654,7 @@ void AliCDBManager::QueryCDB() { if(aPar) { AliDebug(2,Form("Querying specific storage %s",aCalibType->GetName())); AliCDBStorage *aStorage = GetStorage(aPar); - if(aStorage->GetType() == "alien"){ + if(aStorage->GetType() == "alien" || aStorage->GetType() == "local"){ aStorage->QueryCDB(fRun,aCalibType->GetName()); } else { AliDebug(2,