@@ -33,7 +33,6 @@ void MonitorObjectCollection::merge(mergers::MergeInterface* const other)
3333 throw std::runtime_error (" The other object is not a MonitorObjectCollection" );
3434 }
3535
36- bool reportedMismatchingRunNumbers = false ;
3736 auto otherIterator = otherCollection->MakeIterator ();
3837 while (auto otherObject = otherIterator->Next ()) {
3938 auto otherObjectName = otherObject->GetName ();
@@ -46,16 +45,19 @@ void MonitorObjectCollection::merge(mergers::MergeInterface* const other)
4645 if (!otherMO || !targetMO) {
4746 throw std::runtime_error (" The target object or the other object could not be casted to MonitorObject." );
4847 }
49- if (!reportedMismatchingRunNumbers && targetMO->getActivity ().mId != otherMO->getActivity ().mId ) {
48+
49+ if (otherMO->getActivity ().mId > targetMO->getActivity ().mId ) {
5050 ILOG (Error, Ops) << " The run number of the input object '" << otherMO->GetName () << " ' ("
5151 << otherMO->getActivity ().mId << " ) "
52- << " does not match the run number of the target object '"
52+ << " is higher than the one of the target object '"
5353 << targetMO->GetName () << " ' (" << targetMO->getActivity ().mId
54- << " ). Trying to continue , but THIS SHOULD BE IMMEDIATELY ADDRESSED IN PRODUCTION. "
55- << " QC objects from other setups are reaching this one. Will not report more mismatches in this collection. "
54+ << " ). I am switching these objects , but THIS SHOULD BE IMMEDIATELY ADDRESSED IN PRODUCTION. "
55+ << " QC objects from other setups are reaching this one."
5656 << ENDM;
57- reportedMismatchingRunNumbers = true ;
57+ otherMO->Copy (*targetMO);
58+ continue ;
5859 }
60+
5961 // That might be another collection or a concrete object to be merged, we walk on the collection recursively.
6062 algorithm::merge (targetMO->getObject (), otherMO->getObject ());
6163 if (otherMO->getValidity ().isValid ()) {
0 commit comments