CMS 3D CMS Logo

DetSetVectorNew.h
Go to the documentation of this file.
1 #ifndef DataFormats_Common_DetSetVectorNew_h
2 #define DataFormats_Common_DetSetVectorNew_h
3 
7 
8 #include <boost/iterator/transform_iterator.hpp>
11 
12 #include <atomic>
13 #include <memory>
14 #include <vector>
15 #include <cassert>
16 
17 #include <algorithm>
18 #include <functional>
19 #include <iterator>
20 #include <utility>
21 
22 class TestDetSet;
23 
24 namespace edm {
25  namespace refhelper {
26  template <typename T>
28  }
29 } // namespace edm
30 
31 //FIXME remove New when ready
32 namespace edmNew {
33  typedef uint32_t det_id_type;
34 
36  CapacityExaustedException() : cms::Exception("Capacity exausted in DetSetVectorNew") {}
37  };
38 
39  namespace dslv {
40  template <typename T>
41  class LazyGetter;
42 
43  }
44 
45  /* transient component of DetSetVector
46  * for pure conviniency of dictionary declaration
47  */
48  namespace dstvdetails {
49 
50  void errorFilling();
51  void notSafe();
52  void errorIdExists(det_id_type iid);
53  void throw_range(det_id_type iid);
54 
56  typedef unsigned int size_type; // for persistency
57  typedef unsigned int id_type;
58 
61 
63  : // can't be default because of atomics
64  m_filling(false) {
65  // better no one is filling...
66  assert(rh.m_filling == false);
67  m_getter = rh.m_getter;
68  m_dataSize.store(rh.m_dataSize.load());
69  }
70 
72  : // can't be default because of atomics
73  m_filling(false) {
74  // better no one is filling...
75  assert(rh.m_filling == false);
76  m_getter = std::move(rh.m_getter);
77  m_dataSize.store(rh.m_dataSize.exchange(m_dataSize.load()));
78  }
79  DetSetVectorTrans& operator=(DetSetVectorTrans&& rh) { // can't be default because of atomics
80  // better no one is filling...
81  assert(m_filling == false);
82  assert(rh.m_filling == false);
83  m_getter = std::move(rh.m_getter);
84  m_dataSize.store(rh.m_dataSize.exchange(m_dataSize.load()));
85  return *this;
86  }
87  mutable std::atomic<bool> m_filling;
88  std::shared_ptr<void> m_getter;
89  mutable std::atomic<size_type> m_dataSize;
90 
91  void swap(DetSetVectorTrans& rh) {
92  // better no one is filling...
93  assert(m_filling == false);
94  assert(rh.m_filling == false);
95  // std::swap(m_filling,rh.m_filling);
97  m_dataSize.store(rh.m_dataSize.exchange(m_dataSize.load()));
98  }
99 
100  struct Item {
101  Item(id_type i = 0, int io = -1, size_type is = 0) : id(i), offset(io), size(is) {}
102 
103  Item(Item const& rh) noexcept : id(rh.id), offset(int(rh.offset)), size(rh.size) {}
104  Item& operator=(Item const& rh) noexcept {
105  id = rh.id;
106  offset = int(rh.offset);
107  size = rh.size;
108  return *this;
109  }
110  Item(Item&& rh) noexcept : id(rh.id), offset(int(rh.offset)), size(rh.size) {}
111  Item& operator=(Item&& rh) noexcept {
112  id = rh.id;
113  offset = int(rh.offset);
114  size = rh.size;
115  return *this;
116  }
117 
119  mutable std::atomic<int> offset;
120  bool initialize() const {
121  int expected = -1;
122  return offset.compare_exchange_strong(expected, -2);
123  }
125 
126  bool uninitialized() const { return (-1) == offset; }
127  bool initializing() const { return (-2) == offset; }
128  bool isValid() const { return offset >= 0; }
129  bool operator<(Item const& rh) const { return id < rh.id; }
130  operator id_type() const { return id; }
131  };
132 
133  bool ready() const {
134  bool expected = false;
135  if (!m_filling.compare_exchange_strong(expected, true))
136  errorFilling();
137  return true;
138  }
139  };
140 
142  } // namespace dstvdetails
143 
154  template <typename T>
155  class DetSetVector : private dstvdetails::DetSetVectorTrans {
156  public:
158  typedef Trans::Item Item;
159  typedef unsigned int size_type; // for persistency
160  typedef unsigned int id_type;
161  typedef T data_type;
165  // FIXME not sure make sense....
167  typedef id_type key_type;
168 
169  typedef std::vector<Item> IdContainer;
170  typedef std::vector<data_type> DataContainer;
171  typedef typename IdContainer::iterator IdIter;
172  typedef typename std::vector<data_type>::iterator DataIter;
173  typedef std::pair<IdIter, DataIter> IterPair;
174  typedef typename IdContainer::const_iterator const_IdIter;
175  typedef typename std::vector<data_type>::const_iterator const_DataIter;
176  typedef std::pair<const_IdIter, const_DataIter> const_IterPair;
177 
179 
180  struct IterHelp {
182  // IterHelp() : v(0),update(true){}
183  IterHelp() : m_v(nullptr), m_update(false) {}
184  IterHelp(DetSetVector<T> const& iv, bool iup) : m_v(&iv), m_update(iup) {}
185 
186  result_type& operator()(Item const& item) const {
188  return m_detset;
189  }
190 
191  private:
194  bool m_update;
195  };
196 
197  typedef boost::transform_iterator<IterHelp, const_IdIter> const_iterator;
198  typedef std::pair<const_iterator, const_iterator> Range;
199 
200  /* fill the lastest inserted DetSet
201  */
202  class FastFiller {
203  public:
208 
209  // here just to make the compiler happy
211  assert(false);
212  static DetSetVector<T>::Item d;
213  return d;
214  }
215 
216  FastFiller(DetSetVector<T>& iv, id_type id, bool isaveEmpty = false)
217  : m_v(iv), m_item(m_v.ready() ? m_v.push_back(id) : dummy()), m_saveEmpty(isaveEmpty) {
218  if (m_v.onDemand())
220  }
221 
222  FastFiller(DetSetVector<T>& iv, typename DetSetVector<T>::Item& it, bool isaveEmpty = false)
223  : m_v(iv), m_item(it), m_saveEmpty(isaveEmpty) {
224  if (m_v.onDemand())
226  if (m_v.ready())
227  m_item.offset = int(m_v.m_data.size());
228  }
230  if (!m_saveEmpty && m_item.size == 0) {
231  m_v.pop_back(m_item.id);
232  }
233  assert(m_v.m_filling == true);
234  m_v.m_filling = false;
235  }
236 
237  void abort() {
238  m_v.pop_back(m_item.id);
239  m_saveEmpty = true; // avoid mess in destructor
240  }
241 
242  void checkCapacityExausted() const {
243  if (m_v.onDemand() && m_v.m_data.size() == m_v.m_data.capacity())
245  }
246 
248  if (m_v.onDemand() && m_v.m_data.size() + s > m_v.m_data.capacity())
250  }
251 
253  if (m_item.offset + s <= m_v.m_data.capacity())
254  return;
255  if (m_v.onDemand())
257  m_v.m_data.reserve(m_item.offset + s);
258  }
259 
262  m_v.m_data.resize(m_item.offset + s);
263  m_v.m_dataSize = m_v.m_data.size();
264  m_item.size = s;
265  }
266 
267  id_type id() const { return m_item.id; }
268  size_type size() const { return m_item.size; }
269  bool empty() const { return m_item.size == 0; }
270 
271  data_type& operator[](size_type i) { return m_v.m_data[m_item.offset + i]; }
272  DataIter begin() { return m_v.m_data.begin() + m_item.offset; }
273  DataIter end() { return begin() + size(); }
274 
275  template <typename... Args>
276  void emplace_back(Args&&... args) {
278  m_v.m_data.emplace_back(args...);
279  ++m_v.m_dataSize;
280  m_item.size++;
281  }
282 
283  void push_back(data_type const& d) {
285  m_v.m_data.push_back(d);
286  ++m_v.m_dataSize;
287  m_item.size++;
288  }
289 
292  m_v.m_data.push_back(std::move(d));
293  ++m_v.m_dataSize;
294  m_item.size++;
295  }
296 
297  data_type& back() { return m_v.m_data.back(); }
298 
299  private:
300  //for testing
301  friend class ::TestDetSet;
302 
306  };
307 
308  /* fill on demand a given DetSet
309  */
310  class TSFastFiller {
311  public:
316 
317  // here just to make the compiler happy
318  static DetSetVector<T>::Item const& dummy() {
319  assert(false);
320  static DetSetVector<T>::Item const d;
321  return d;
322  }
323  // this constructor is not supposed to be used in Concurrent mode
325  assert(m_v.m_filling == true);
326  m_v.m_filling = false;
327  }
328 
329  TSFastFiller(DetSetVector<T> const& iv, typename DetSetVector<T>::Item const& it) : m_v(iv), m_item(it) {}
331  bool expected = false;
332  while (!m_v.m_filling.compare_exchange_weak(expected, true)) {
333  expected = false;
334  nanosleep(nullptr, nullptr);
335  }
336  int offset = m_v.m_data.size();
337  if (m_v.onDemand() && full()) {
338  m_v.m_filling = false;
340  }
341  std::move(m_lv.begin(), m_lv.end(), std::back_inserter(m_v.m_data));
342  m_item.size = m_lv.size();
343  m_item.offset = offset;
344 
345  m_v.m_dataSize = m_v.m_data.size();
346  assert(m_v.m_filling == true);
347  m_v.m_filling = false;
348  }
349 
350  bool full() const {
351  int offset = m_v.m_dataSize;
352  return m_v.m_data.capacity() < offset + m_lv.size();
353  }
354 
355  void abort() { m_lv.clear(); }
356 
357  void reserve(size_type s) { m_lv.reserve(s); }
358 
359  void resize(size_type s) { m_lv.resize(s); }
360 
361  id_type id() const { return m_item.id; }
362  size_type size() const { return m_lv.size(); }
363  bool empty() const { return m_lv.empty(); }
364 
366  DataIter begin() { return m_lv.begin(); }
367  DataIter end() { return m_lv.end(); }
368 
369  template <typename... Args>
370  void emplace_back(Args&&... args) {
371  m_lv.emplace_back(args...);
372  }
373 
374  void push_back(data_type const& d) { m_lv.push_back(d); }
375  void push_back(data_type&& d) { m_lv.push_back(std::move(d)); }
376 
377  data_type& back() { return m_lv.back(); }
378 
379  private:
380  //for testing
381  friend class ::TestDetSet;
382 
383  std::vector<T> m_lv;
385  typename DetSetVector<T>::Item const& m_item;
386  };
387 
388  friend class FastFiller;
389  friend class TSFastFiller;
390  friend class edmNew::DetSet<T>;
391 
393  public:
395  using second_argument_type = unsigned int;
396  using result_type = const T*;
397 
399  bool expected = false;
400  while (!iContainer.m_filling.compare_exchange_weak(expected, true, std::memory_order_acq_rel)) {
401  expected = false;
402  nanosleep(nullptr, nullptr);
403  }
404  result_type item = &(iContainer.m_data[iIndex]);
405  assert(iContainer.m_filling == true);
406  iContainer.m_filling = false;
407  return item;
408  }
409  };
410  friend class FindForDetSetVector;
411 
412  explicit DetSetVector(int isubdet = 0) : m_subdetId(isubdet) {}
413 
414  DetSetVector(std::shared_ptr<dslv::LazyGetter<T>> iGetter, const std::vector<det_id_type>& iDets, int isubdet = 0);
415 
417  // delete content if T is pointer...
418  }
419 
420  // default or delete is the same...
421  DetSetVector& operator=(const DetSetVector&) = delete;
422  // Implement copy constructor because of a (possibly temporary)
423  // need in heterogeneous framework prototyping. In general this
424  // class is still supposed to be non-copyable, so to prevent
425  // accidental copying the assignment operator is left deleted.
426  DetSetVector(const DetSetVector&) = default;
427  DetSetVector(DetSetVector&&) = default;
428  DetSetVector& operator=(DetSetVector&&) = default;
429 
430  bool onDemand() const { return static_cast<bool>(m_getter); }
431 
432  void swap(DetSetVector& rh) {
434  std::swap(m_subdetId, rh.m_subdetId);
435  std::swap(m_ids, rh.m_ids);
436  std::swap(m_data, rh.m_data);
437  }
438 
439  void swap(IdContainer& iic, DataContainer& idc) {
440  std::swap(m_ids, iic);
441  std::swap(m_data, idc);
442  }
443 
444  void reserve(size_t isize, size_t dsize) {
445  m_ids.reserve(isize);
446  m_data.reserve(dsize);
447  }
448 
449  void shrink_to_fit() {
450  clean();
451  m_ids.shrink_to_fit();
452  m_data.shrink_to_fit();
453  }
454 
455  void resize(size_t isize, size_t dsize) {
456  m_ids.resize(isize);
457  m_data.resize(dsize);
458  m_dataSize = m_data.size();
459  }
460 
461  void clean() {
462  m_ids.erase(std::remove_if(m_ids.begin(), m_ids.end(), [](Item const& m) { return 0 == m.size; }), m_ids.end());
463  }
464 
465  // FIXME not sure what the best way to add one cell to cont
466  DetSet insert(id_type iid, data_type const* idata, size_type isize) {
467  Item& item = addItem(iid, isize);
468  m_data.resize(m_data.size() + isize);
469  std::copy(idata, idata + isize, m_data.begin() + item.offset);
470  m_dataSize = m_data.size();
471  return DetSet(*this, item, false);
472  }
473  //make space for it
475  Item& item = addItem(iid, isize);
476  m_data.resize(m_data.size() + isize);
477  m_dataSize = m_data.size();
478  return DetSet(*this, item, false);
479  }
480 
481  // to be used with a FastFiller
482  Item& push_back(id_type iid) { return addItem(iid, 0); }
483 
484  // remove last entry (usually only if empty...)
485  void pop_back(id_type iid) {
486  const_IdIter p = findItem(iid);
487  if (p == m_ids.end())
488  return; //bha!
489  // sanity checks... (shall we throw or assert?)
490  if ((*p).isValid() && (*p).size > 0 && m_data.size() == (*p).offset + (*p).size) {
491  m_data.resize((*p).offset);
492  m_dataSize = m_data.size();
493  }
494  m_ids.erase(m_ids.begin() + (p - m_ids.begin()));
495  }
496 
497  private:
498  Item& addItem(id_type iid, size_type isize) {
499  Item it(iid, size_type(m_data.size()), isize);
500  IdIter p = std::lower_bound(m_ids.begin(), m_ids.end(), it);
501  if (p != m_ids.end() && !(it < *p))
503  return *m_ids.insert(p, std::move(it));
504  }
505 
506  public:
507  //---------------------------------------------------------
508 
509  bool exists(id_type i) const { return findItem(i) != m_ids.end(); }
510 
511  bool isValid(id_type i) const {
513  return p != m_ids.end() && (*p).isValid();
514  }
515 
516  /*
517  DetSet operator[](id_type i) {
518  const_IdIter p = findItem(i);
519  if (p==m_ids.end()) what???
520  return DetSet(*this,p-m_ids.begin());
521  }
522  */
523 
526  if (p == m_ids.end())
528  return DetSet(*this, *p, true);
529  }
530 
531  // slow interface
532  // const_iterator find(id_type i, bool update=true) const {
533  const_iterator find(id_type i, bool update = false) const {
535  return (p == m_ids.end()) ? end() : boost::make_transform_iterator(p, IterHelp(*this, update));
536  }
537 
538  // slow interface
540  std::pair<const_IdIter, const_IdIter> p = std::equal_range(m_ids.begin(), m_ids.end(), Item(i));
541  return (p.first != p.second) ? p.first : m_ids.end();
542  }
543 
544  // const_iterator begin(bool update=true) const {
545  const_iterator begin(bool update = false) const {
546  return boost::make_transform_iterator(m_ids.begin(), IterHelp(*this, update));
547  }
548 
549  // const_iterator end(bool update=true) const {
550  const_iterator end(bool update = false) const {
551  return boost::make_transform_iterator(m_ids.end(), IterHelp(*this, update));
552  }
553 
554  // return an iterator range (implemented here to avoid dereference of detset)
555  template <typename CMP>
556  // Range equal_range(id_type i, CMP cmp, bool update=true) const {
557  Range equal_range(id_type i, CMP cmp, bool update = false) const {
558  std::pair<const_IdIter, const_IdIter> p = std::equal_range(m_ids.begin(), m_ids.end(), i, cmp);
559  return Range(boost::make_transform_iterator(p.first, IterHelp(*this, update)),
560  boost::make_transform_iterator(p.second, IterHelp(*this, update)));
561  }
562 
563  int subdetId() const { return m_subdetId; }
564 
565  bool empty() const { return m_ids.empty(); }
566 
567  size_type dataSize() const { return onDemand() ? size_type(m_dataSize) : size_type(m_data.size()); }
568 
569  size_type size() const { return m_ids.size(); }
570 
571  //FIXME fast interfaces, not consistent with associative nature of container....
572 
573  data_type operator()(size_t cell, size_t frame) const { return m_data[m_ids[cell].offset + frame]; }
574 
575  data_type const* data(size_t cell) const { return &m_data[m_ids[cell].offset]; }
576 
577  size_type detsetSize(size_t cell) const { return m_ids[cell].size; }
578 
579  id_type id(size_t cell) const { return m_ids[cell].id; }
580 
581  Item const& item(size_t cell) const { return m_ids[cell]; }
582 
583  //------------------------------
584 
585  IdContainer const& ids() const { return m_ids; }
586  DataContainer const& data() const { return m_data; }
587 
588  //Used by ROOT storage
590 
591  private:
592  //for testing
593  friend class ::TestDetSet;
594 
595  void update(Item const& item) const;
596 
597  // subdetector id (as returned by DetId::subdetId())
599 
600  // Workaround for ROOT 6 bug.
601  // ROOT6 has a problem with this IdContainer typedef
602  //IdContainer m_ids;
605  };
606 
607  namespace dslv {
608  template <typename T>
609  class LazyGetter {
610  public:
611  virtual ~LazyGetter() {}
612  virtual void fill(typename DetSetVector<T>::TSFastFiller&) = 0;
613  };
614  } // namespace dslv
615 
616  template <typename T>
617  inline DetSetVector<T>::DetSetVector(std::shared_ptr<Getter> iGetter,
618  const std::vector<det_id_type>& iDets,
619  int isubdet)
620  : m_subdetId(isubdet) {
621  m_getter = iGetter;
622 
623  m_ids.reserve(iDets.size());
624  det_id_type sanityCheck = 0;
625  for (std::vector<det_id_type>::const_iterator itDetId = iDets.begin(), itDetIdEnd = iDets.end();
626  itDetId != itDetIdEnd;
627  ++itDetId) {
628  assert(sanityCheck < *itDetId && "vector of det_id_type was not ordered");
629  sanityCheck = *itDetId;
630  m_ids.push_back(*itDetId);
631  }
632  }
633 
634  template <typename T>
635  inline void DetSetVector<T>::update(const Item& item) const {
636  // no m_getter or already updated
637  if (!m_getter) {
638  assert(item.isValid());
639  return;
640  }
641  if (item.initialize()) {
642  assert(item.initializing());
643  {
644  TSFastFiller ff(*this, item);
645  static_cast<Getter*>(m_getter.get())->fill(ff);
646  }
647  assert(item.isValid());
648  }
649  }
650 
651  template <typename T>
652  inline void DetSet<T>::set(DetSetVector<T> const& icont, typename Container::Item const& item, bool update) {
653  // if an item is being updated we wait
654  if (update)
655  icont.update(item);
656  while (item.initializing())
657  nanosleep(nullptr, nullptr);
658  m_data = &icont.data();
659  m_id = item.id;
660  m_offset = item.offset;
661  m_size = item.size;
662  }
663 } // namespace edmNew
664 
666 #include <type_traits>
667 
668 //specialize behavior of edm::Ref to get access to the 'Det'
669 namespace edm {
670  /* Reference to an item inside a new DetSetVector ... */
671  namespace refhelper {
672  template <typename T>
673  struct FindTrait<typename edmNew::DetSetVector<T>, T> {
675  };
676  } // namespace refhelper
677  /* ... as there was one for the original DetSetVector*/
678 
679  /* Probably this one is not that useful .... */
680  namespace refhelper {
681  template <typename T>
684  using second_argument_type = unsigned int;
686 
688  return &(iContainer[iIndex]);
689  }
690  };
691 
692  template <typename T>
695  };
696  } // namespace refhelper
697  /* ... implementation is provided, just in case it's needed */
698 } // namespace edm
699 
700 namespace edmNew {
701  //helper function to make it easier to create a edm::Ref to a new DSV
702  template <class HandleT>
703  // inline
705  const HandleT& iHandle, typename HandleT::element_type::value_type::const_iterator itIter) {
706  static_assert(std::is_same<typename HandleT::element_type,
708  "Handle and DetSetVector do not have compatible types.");
709  auto index = itIter - &iHandle->data().front();
711  iHandle.id(), &(*itIter), index);
712  }
713 } // namespace edmNew
714 
716 
717 namespace edm {
718  template <typename T>
720  public:
721  typedef T value_type;
722 
723  static size_t size(const edmNew::DetSetVector<T>* iContainer) { return iContainer->dataSize(); }
724  static unsigned int indexFor(const value_type* iElement, const edmNew::DetSetVector<T>* iContainer) {
725  return iElement - &(iContainer->data().front());
726  }
727  };
728 } // namespace edm
729 
730 // Thinning support
732 namespace edm::detail {
733  template <typename T>
736  };
737 } // namespace edm::detail
738 namespace edmNew {
739  template <typename T, typename Selector>
741  Selector& selector,
742  unsigned int& iIndex,
746  for (auto iter = detset.begin(), end = detset.end(); iter != end; ++iter, ++iIndex) {
747  edm::detail::fillCollectionForThinning(*iter, selector, iIndex, ff, association);
748  }
749  if (detset.begin() != detset.end()) {
750  // need to decrease the global index by one because the outer loop will increase it
751  --iIndex;
752  }
753  }
754 } // namespace edmNew
755 
756 #endif
Item & operator=(Item const &rh) noexcept
edm::Ref< typename HandleT::element_type, typename HandleT::element_type::value_type::value_type > makeRefTo(const HandleT &iHandle, typename HandleT::element_type::value_type::const_iterator itIter)
static unsigned int indexFor(const value_type *iElement, const edmNew::DetSetVector< T > *iContainer)
size_type dataSize() const
void swap(DetSetVectorTrans &rh)
void push_back(data_type const &d)
data_type operator()(size_t cell, size_t frame) const
static DetSetVector< T >::Item & dummy()
DetSetVector< T >::id_type id_type
result_type operator()(first_argument_type iContainer, second_argument_type iIndex)
int32_t *__restrict__ iv
std::vector< data_type > DataContainer
std::pair< const_iterator, const_iterator > Range
Item & push_back(id_type iid)
std::vector< Trans::Item > m_ids
void fillCollectionForThinning(Item const &item, Selector &selector, unsigned int iIndex, Collection &output, ThinnedAssociation &association)
IdContainer::iterator IdIter
unsigned int det_id_type
Definition: DetSetNew.h:10
void set(Container const &icont, typename Container::Item const &item, bool update=true)
edmNew::DetSetVector< T >::FindForDetSetVector value
data_type const * data(size_t cell) const
std::vector< data_type >::const_iterator const_DataIter
const_IdIter findItem(id_type i) const
void swap(DetSetVector &rh)
void throw_range(det_id_type iid)
DetSetVector(int isubdet=0)
TSFastFiller(DetSetVector< T > const &iv, typename DetSetVector< T >::Item const &it)
void pop_back(id_type iid)
#define CMS_CLASS_VERSION(_version_)
assert(be >=bs)
DetSetVectorTrans(const DetSetVectorTrans &rh)
id_type detId() const
Definition: DetSetNew.h:66
DetSetVectorTrans & operator=(const DetSetVectorTrans &)=delete
DetSetVector< T > const & m_v
void swap(Association< C > &lhs, Association< C > &rhs)
Definition: Association.h:117
DetSetVector< T > const * m_v
const_iterator end(bool update=false) const
dstvdetails::DetSetVectorTrans Trans
bool isValid(id_type i) const
void emplace_back(Args &&... args)
DataContainer const & data() const
IterHelp(DetSetVector< T > const &iv, bool iup)
std::tuple< layerClusterToCaloParticle, caloParticleToLayerCluster > association
Item & addItem(id_type iid, size_type isize)
typename edmNew::DetSetVector< T >::data_type type
DetSet operator[](id_type i) const
DetSetVector & operator=(const DetSetVector &)=delete
DetSetVector< T >::data_type value_type
size_type detsetSize(size_t cell) const
static DetSetVector< T >::Item const & dummy()
DetSetVectorTrans & operator=(DetSetVectorTrans &&rh)
void swap(edm::DataFrameContainer &lhs, edm::DataFrameContainer &rhs)
DetSetVector< T >::Item & m_item
void push_back(data_type const &d)
FastFiller(DetSetVector< T > &iv, id_type id, bool isaveEmpty=false)
#define CMS_THREAD_GUARD(_var_)
DetSetVector< T >::size_type size_type
id_type id(size_t cell) const
Item(id_type i=0, int io=-1, size_type is=0)
DetSetVector< T >::Item const & m_item
void swap(IdContainer &iic, DataContainer &idc)
Definition: value.py:1
Functor that operates on <T>
Definition: Selector.h:22
DetSetVector< T >::id_type key_type
static size_t size(const edmNew::DetSetVector< T > *iContainer)
void resize(size_t isize, size_t dsize)
d
Definition: ztail.py:151
TSFastFiller(DetSetVector< T > &iv, id_type id)
DetSet insert(id_type iid, data_type const *idata, size_type isize)
std::pair< IdIter, DataIter > IterPair
bool exists(id_type i) const
Namespace of DDCMS conversion namespace.
std::vector< Item > IdContainer
boost::transform_iterator< IterHelp, const_IdIter > const_iterator
dslv::LazyGetter< T > Getter
const_iterator begin(bool update=false) const
DetSetVector< T >::id_type key_type
void errorIdExists(det_id_type iid)
size_type size() const
result_type operator()(first_argument_type iContainer, second_argument_type iIndex)
Item const & item(size_t cell) const
void reserve(size_t isize, size_t dsize)
void checkCapacityExausted(size_type s) const
data_type & operator[](size_type i)
void update(Item const &item) const
std::vector< data_type >::iterator DataIter
IdContainer const & ids() const
DetSet insert(id_type iid, size_type isize)
HLT enums.
iterator end()
Definition: DetSetNew.h:56
const_iterator find(id_type i, bool update=false) const
void emplace_back(Args &&... args)
#define update(a, b)
std::atomic< size_type > m_dataSize
IdContainer::const_iterator const_IdIter
edmNew::DetSet< T > DetSet
std::pair< const_IdIter, const_DataIter > const_IterPair
FastFiller(DetSetVector< T > &iv, typename DetSetVector< T >::Item &it, bool isaveEmpty=false)
result_type & operator()(Item const &item) const
void fillCollectionForThinning(edmNew::DetSet< T > const &detset, Selector &selector, unsigned int &iIndex, edmNew::DetSetVector< T > &output, edm::ThinnedAssociation &association)
data_type & operator[](size_type i)
edm::refhelper::FindForNewDetSetVector< data_type > RefFinder
DetSetVectorTrans(DetSetVectorTrans &&rh)
long double T
DetSetVector< T >::size_type size_type
DetSetVector< T >::id_type id_type
DetSetVector< T >::data_type value_type
def move(src, dest)
Definition: eostools.py:511
Range equal_range(id_type i, CMP cmp, bool update=false) const
iterator begin()
Definition: DetSetNew.h:54