//_____________________________________________________________________________
Bool_t AliCDBId::IsValid() const {
// validity check
-
+
if (!(fPath.IsValid() && fRunRange.IsValid())) {
return kFALSE;
}
return !(!HasVersion() && HasSubVersion());
}
+//___________________________________________________________________________
+Bool_t AliCDBId::IsEqual(const TObject* obj) const {
+// check if this id is equal to other id (compares path, run range, versions)
+
+ if (this == obj) {
+ return kTRUE;
+ }
+
+ if (AliCDBId::Class() != obj->IsA()) {
+ return kFALSE;
+ }
+ AliCDBId* other = (AliCDBId*) obj;
+ return fPath.GetPath() == other->GetPath() && fRunRange.IsEqual(&other->GetAliCDBRunRange()) &&
+ fVersion == other->GetVersion() && fSubVersion == other->GetSubVersion();
+}
+
//_____________________________________________________________________________
TString AliCDBId::ToString() const {
// returns a string of Id data
- TString result;
- result += "path \"";
- result += GetPath();
- result += "\"; run range [";
- result += GetFirstRun();
- result += ",";
- result += GetLastRun();
- result += "]; version v";
- result += GetVersion();
- result += "_s";
- result += GetSubVersion();
-
- return result;
+ TString result = Form("path: \"%s\"; run range: [%d,%d]",
+ GetPath().Data(), GetFirstRun(), GetLastRun());
+
+ if(GetVersion() >= 0) result += Form("; version: v%d", GetVersion());
+ if(GetSubVersion() >= 0) result += Form("_s%d", GetSubVersion());
+ return result;
}