55 std::cout <<
"IOVPayloadContainer::merge - after lowerbound" << std::endl;
58 std::cout <<
"IOVPayloadContainer::merge - begin range "
63 std::cout <<
"IOVPayloadContainer::merge - it range "
67 std::cout <<
"IOVPayloadContainer::merge - attrList range "
81 if (
debug) std::cout <<
"IOVPayloadContainer::merge - not begin " << std::endl;
83 if ((*itPrev)->isSameButMinRange(*attrListColl)) {
90 const IOVTime startPrev = (*itPrev)->minRange().start();
91 const IOVTime stopPrev = (*itPrev)->minRange().stop();
94 IOVTime start = (startPrev < startNew) ? startPrev : startNew;
95 IOVTime stop = (stopPrev > stopNew) ? stopPrev : stopNew;
96 (*itPrev)->resetMinRange();
97 (*itPrev)->addNewStart(
start);
98 (*itPrev)->addNewStop(
stop);
100 if (
debug) std::cout <<
"IOVPayloadContainer::merge - isSameButMinRange " << (*itPrev)->minRange() << std::endl;
106 if (
debug) std::cout <<
"IOVPayloadContainer::merge - isSameButMinRange, subsequent start/stop "
107 << (*it)->minRange().start() <<
" " << (*it)->minRange().stop()
110 if ((*it)->minRange().stop() <=
stop) {
113 delete oldAttrListColl;
118 if (
debug) std::cout <<
"IOVPayloadContainer::merge - isSameButMinRange, remove payload "
127 else if ((*it)->minRange().start() <
stop) {
129 const IOVTime oldStop = (*it)->minRange().stop();
130 (*it)->resetMinRange();
131 (*it)->addNewStart(
stop);
132 (*it)->addNewStop(oldStop);
134 if (
debug) std::cout <<
"IOVPayloadContainer::merge - isSameButMinRange, truncate start/stop "
135 << (*it)->minRange().start() <<
" " << (*it)->minRange().stop()
146 if (
debug) std::cout <<
"IOVPayloadContainer::merge - is NOT SameButMinRange - check stop " << (*itPrev)->minRange() << std::endl;
148 if (attrListColl->
minRange().
start() < (*itPrev)->minRange().stop()) {
158 if (
debug) std::cout <<
"IOVPayloadContainer::merge - attrListColl falls within prev IOV range: "
168 if (
debug) std::cout <<
"IOVPayloadContainer::merge - duplicated previous and insert "
179 if (
debug) std::cout <<
"IOVPayloadContainer::merge - reset prev stop "
185 bool checkOverlap =
false;
189 if ( (**
it) == (*attrListColl) ) {
191 if (
debug) std::cout <<
"IOVPayloadContainer::merge - duplicate - reject new one " << std::endl;
199 if (
debug) std::cout <<
"IOVPayloadContainer::merge - isSameButMinRange - ignoreIOVs: " << (*it)->isSameButMinRange(*attrListColl,
true) << std::endl;
201 if ((*it)->isSameButMinRange(*attrListColl,
true)) {
209 if ((*it)->minRange().start() == attrListColl->
minRange().
start() &&
210 (*it)->minRange().stop() < attrListColl->
minRange().
stop()) {
217 (*it) = attrListColl;
220 if (
debug) std::cout <<
"IOVPayloadContainer::merge - isSameButMinRange with later stop -> replace " << (*it)->minRange() << std::endl;
226 if (
debug) std::cout <<
"IOVPayloadContainer::merge - isSameButMinRange, subsequent start/stop "
227 << (*it)->minRange().start() <<
" " << (*it)->minRange().stop()
230 if ((*it)->minRange().stop() <=
stop) {
233 delete oldAttrListColl;
239 if (
debug) std::cout <<
"IOVPayloadContainer::merge - isSameButMinRange, remove payload "
247 else if ((*it)->minRange().start() <
stop) {
249 const IOVTime oldStop = (*it)->minRange().stop();
250 (*it)->resetMinRange();
251 (*it)->addNewStart(
stop);
252 (*it)->addNewStop(oldStop);
254 if (
debug) std::cout <<
"IOVPayloadContainer::merge - isSameButMinRange, truncate start/stop "
255 << (*it)->minRange().start() <<
" " << (*it)->minRange().stop()
265 else if ((*it)->minRange().start() == attrListColl->
minRange().
start() &&
266 (*it)->minRange().stop() > attrListColl->
minRange().
stop()) {
268 if (
debug) std::cout <<
"IOVPayloadContainer::merge - isSameButMinRange, new stop is earlier - reject "
269 << (*it)->minRange().start() <<
" " << (*it)->minRange().stop()
290 if (
debug) std::cout <<
"IOVPayloadContainer::merge - checkOverlap, new start/stop "
291 << newStart <<
" " << newStop
300 bool isAtMax =
false;
305 if (
debug) std::cout <<
"IOVPayloadContainer::merge - new stop at max " << std::endl;
307 if (newStart == (*it)->minRange().start()) {
311 newStop = (*it)->minRange().stop();
314 if (
debug) std::cout <<
"IOVPayloadContainer::merge - set new stop to old stop " << std::endl;
321 newStop = (*it)->minRange().start();
324 if (
debug) std::cout <<
"IOVPayloadContainer::merge - set new stop to old start " << std::endl;
331 if (
it !=
m_payloadVec.begin() && newStart < (*it)->minRange().start()) {
333 if (
debug) std::cout <<
"IOVPayloadContainer::merge - move back "
339 if (
debug) std::cout <<
"IOVPayloadContainer::merge - checkOverlap, current start/stop "
340 << (*itStart)->minRange().start() <<
" " << (*itStart)->minRange().stop()
345 if ((*itStart)->minRange().start() < newStart && newStart < (*itStart)->minRange().stop() ) {
347 const IOVTime oldStart = (*itStart)->minRange().start();
348 (*itStart)->resetMinRange();
349 (*itStart)->addNewStart(oldStart);
350 (*itStart)->addNewStop(newStart);
352 if (
debug) std::cout <<
"IOVPayloadContainer::merge - reset old stop "
353 << (*itStart)->minRange().start() <<
" " << (*itStart)->minRange().stop()
362 if (
debug) std::cout <<
"IOVPayloadContainer::merge - insert payload "
371 if (
debug) std::cout <<
"IOVPayloadContainer::merge - checkOverlap, subsequent start/stop "
372 << (*it)->minRange().start() <<
" " << (*it)->minRange().stop()
375 if ((*it)->minRange().stop() <= newStop) {
378 delete oldAttrListColl;
381 if (
debug) std::cout <<
"IOVPayloadContainer::merge - remove payload "
389 else if ((*it)->minRange().start() < newStop) {
391 const IOVTime oldStop = (*it)->minRange().stop();
392 (*it)->resetMinRange();
393 (*it)->addNewStart(newStop);
394 (*it)->addNewStop(oldStop);
396 if (
debug) std::cout <<
"IOVPayloadContainer::merge - checkOverlap, truncate start/stop "
397 << (*it)->minRange().start() <<
" " << (*it)->minRange().stop()
408 if (
debug) std::cout <<
"IOVPayloadContainer::merge - no overlap, add in attrListColl " << std::endl;