Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 6 additions & 22 deletions Framework/src/CcdbDatabase.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -334,23 +334,11 @@ std::shared_ptr<o2::quality_control::core::MonitorObject> CcdbDatabase::retrieve
ILOG(Debug, Devel) << "Version of object is " << objectVersion << ENDM;

std::shared_ptr<MonitorObject> mo;
if (objectVersion == Version("0.0.0") || objectVersion < Version("0.25")) {
ILOG(Debug, Devel) << "Version of object " << fullPath << " is < 0.25" << ENDM;
// The object is either in a TFile or is a blob but it was stored with storeAsTFile as a full MO
mo.reset(dynamic_cast<MonitorObject*>(obj));
if (mo == nullptr) {
ILOG(Error, Devel) << "Could not cast the object " << fullPath << " to MonitorObject (objectVersion: " << objectVersion << ")" << ENDM;
return nullptr;
}
} else {
// Version >= 0.25 -> the object is stored directly unencapsulated
ILOG(Debug, Devel) << "Version of object " << fullPath << " is >= 0.25" << ENDM;
mo = make_shared<MonitorObject>(obj, headers[metadata_keys::qcTaskName], headers[metadata_keys::qcTaskClass], headers[metadata_keys::qcDetectorCode]);
// TODO should we remove the headers we know are general such as ETag and qc_task_name ?
mo->addMetadata(headers);
// we could just copy the argument here, but this would not cover cases where the activity in headers has more non-default fields
mo->setActivity(activity_helpers::asActivity(headers, activity.mProvenance));
}
mo = make_shared<MonitorObject>(obj, headers[metadata_keys::qcTaskName], headers[metadata_keys::qcTaskClass], headers[metadata_keys::qcDetectorCode]);
// TODO should we remove the headers we know are general such as ETag and qc_task_name ?
mo->addMetadata(headers);
// we could just copy the argument here, but this would not cover cases where the activity in headers has more non-default fields
mo->setActivity(activity_helpers::asActivity(headers, activity.mProvenance));
mo->setIsOwner(true);
return mo;
}
Expand Down Expand Up @@ -392,11 +380,7 @@ std::string CcdbDatabase::retrieveJson(std::string path, long timestamp, const s

// Convert object to JSON string
TObject* toConvert = nullptr;
if (tobj->IsA() == MonitorObject::Class()) { // a full MO -> pre-v0.25
std::shared_ptr<MonitorObject> mo(dynamic_cast<MonitorObject*>(tobj));
toConvert = mo->getObject();
mo->setIsOwner(false);
} else if (tobj->IsA() == QualityObject::Class()) {
if (tobj->IsA() == QualityObject::Class()) {
toConvert = dynamic_cast<QualityObject*>(tobj);
} else { // something else but a TObject
toConvert = tobj;
Expand Down
Loading