Skip to content

Commit

Permalink
switch MOs in MonitorObjectCollection when run number is higher on new
Browse files Browse the repository at this point in the history
  • Loading branch information
Michal Tichák committed Sep 30, 2024
1 parent a419b03 commit 04ab0c4
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions Framework/src/MonitorObjectCollection.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ void MonitorObjectCollection::merge(mergers::MergeInterface* const other)
throw std::runtime_error("The other object is not a MonitorObjectCollection");
}

bool reportedMismatchingRunNumbers = false;
auto otherIterator = otherCollection->MakeIterator();
while (auto otherObject = otherIterator->Next()) {
auto otherObjectName = otherObject->GetName();
Expand All @@ -46,16 +45,19 @@ void MonitorObjectCollection::merge(mergers::MergeInterface* const other)
if (!otherMO || !targetMO) {
throw std::runtime_error("The target object or the other object could not be casted to MonitorObject.");
}
if (!reportedMismatchingRunNumbers && targetMO->getActivity().mId != otherMO->getActivity().mId) {

if (otherMO->getActivity().mId > targetMO->getActivity().mId) {
ILOG(Error, Ops) << "The run number of the input object '" << otherMO->GetName() << "' ("
<< otherMO->getActivity().mId << ") "
<< "does not match the run number of the target object '"
<< "is higher than the one of the target object '"
<< targetMO->GetName() << "' (" << targetMO->getActivity().mId
<< "). Trying to continue, but THIS SHOULD BE IMMEDIATELY ADDRESSED IN PRODUCTION. "
<< "QC objects from other setups are reaching this one. Will not report more mismatches in this collection."
<< "). I am switching these objects, but THIS SHOULD BE IMMEDIATELY ADDRESSED IN PRODUCTION. "
<< "QC objects from other setups are reaching this one."
<< ENDM;
reportedMismatchingRunNumbers = true;
otherMO->Copy(*targetMO);
continue;
}

// That might be another collection or a concrete object to be merged, we walk on the collection recursively.
algorithm::merge(targetMO->getObject(), otherMO->getObject());
if (otherMO->getValidity().isValid()) {
Expand Down

0 comments on commit 04ab0c4

Please sign in to comment.