TString uri(GetURI());
uri.Remove(TString::kTrailing, '/');
TObjArray * osArr = uri.Tokenize('/');
- TObjString* mcdata_os = dynamic_cast<TObjString*>(osArr->At(osArr->GetEntries()-2));
+ TObjString* mcdata_os = dynamic_cast<TObjString*>(osArr->At(osArr->GetEntries()-3));
+ TObjString* yeartype_os = 0;
TString mcdata = mcdata_os->GetString();
- TObjString* yeartype_os = dynamic_cast<TObjString*>(osArr->At(osArr->GetEntries()-1));
+ if( mcdata == TString("data")) {
+ yeartype_os = dynamic_cast<TObjString*>(osArr->At(osArr->GetEntries()-2));
+ } else {
+ mcdata_os = dynamic_cast<TObjString*>(osArr->At(osArr->GetEntries()-2));
+ yeartype_os = dynamic_cast<TObjString*>(osArr->At(osArr->GetEntries()-1));
+ }
+ mcdata = mcdata_os->GetString();
TString yeartype = yeartype_os->GetString();
command += mcdata;
command += '/';
}
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);
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 {
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;
}
//_____________________________________________________________________________
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,