CMS 3D CMS Logo

Functions
ComparisonHelper Namespace Reference

Functions

template<class InputIterator1 , class InputIterator2 , class OutputIterator , class Compare >
OutputIterator zip (InputIterator1 first1, InputIterator1 last1, InputIterator2 first2, InputIterator2 last2, OutputIterator result, Compare comp)
 

Function Documentation

◆ zip()

template<class InputIterator1 , class InputIterator2 , class OutputIterator , class Compare >
OutputIterator ComparisonHelper::zip ( InputIterator1  first1,
InputIterator1  last1,
InputIterator2  first2,
InputIterator2  last2,
OutputIterator  result,
Compare  comp 
)

Definition at line 41 of file L1TStage2CaloLayer1.h.

References AlCaHLTBitMon_QueryRunRegistry::comp, and mps_fire::result.

Referenced by TPTask::_process(), and L1TStage2CaloLayer1::dqmAnalyze().

46  {
47  typedef typename InputIterator1::value_type dummy1;
48  typedef typename InputIterator2::value_type dummy2;
49  while (first1 != last1 || first2 != last2) {
50  if (first1 == last1) {
51  while (first2 != last2) {
52  *result = std::make_pair(dummy1{first2->id()}, *first2);
53  ++first2;
54  ++result;
55  }
56  return result;
57  }
58  if (first2 == last2) {
59  while (first1 != last1) {
60  *result = std::make_pair(*first1, dummy2{first1->id()});
61  ++first1;
62  ++result;
63  }
64  return result;
65  }
66  if (comp(*first1, *first2)) {
67  *result = std::make_pair(*first1, dummy2{first1->id()});
68  ++first1;
69  } else if (comp(*first2, *first1)) {
70  *result = std::make_pair(dummy1{first2->id()}, *first2);
71  ++first2;
72  } else {
73  *result = std::make_pair(*first1, *first2);
74  ++first1;
75  ++first2;
76  }
77  ++result;
78  }
79  return result;
80  }