Skip to content

Commit

Permalink
[RelVal] Fix to really skip unreadable objects
Browse files Browse the repository at this point in the history
* e.g. missing dictionary in case of QC files that have been constructed
  with older SW tags
  • Loading branch information
Benedikt Volkel committed Mar 13, 2024
1 parent 93ba6ee commit 6bd08d4
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion RelVal/utils/ExtractAndFlatten.C
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ void ExtractAndFlattenDirectory(TDirectory* inDir, TDirectory* outDir, std::vect
ExtractTree(tree, outDir, collectNames, basedOnTree, currentPrefix);
} else {
if (!WriteObject(obj, outDir, collectNames, currentPrefix)) {
std::cerr << "Cannot handle object " << obj->GetName() << " which is of class " << key->GetClassName() << "\n";
std::cerr << "Cannot handle object of class " << key->GetClassName() << "\n";
}
}
}
Expand Down Expand Up @@ -261,6 +261,10 @@ void adjustName(TObject* o)
// decide which concrete function to call to write the given object
bool WriteObject(TObject* o, TDirectory* outDir, std::vector<std::string>& collectNames, std::string const& currentPrefix)
{
if (!o) {
std::cerr << "WARNING: Cannot process object, nullptr received.\n";
return false;
}
if (auto monObj = dynamic_cast<o2::quality_control::core::MonitorObject*>(o)) {
return WriteObject(monObj->getObject(), outDir, collectNames, currentPrefix);
}
Expand Down

0 comments on commit 6bd08d4

Please sign in to comment.