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 const> 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 { return result_type(*m_v, item, m_update); }
187 
188  private:
190  bool m_update;
191  };
192 
193  typedef boost::transform_iterator<IterHelp, const_IdIter> const_iterator;
194  typedef std::pair<const_iterator, const_iterator> Range;
195 
196  /* fill the lastest inserted DetSet
197  */
198  class FastFiller {
199  public:
204 
205  // here just to make the compiler happy
207  assert(false);
208  static DetSetVector<T>::Item d;
209  return d;
210  }
211 
212  FastFiller(DetSetVector<T>& iv, id_type id, bool isaveEmpty = false)
213  : m_v(iv), m_item(m_v.ready() ? m_v.push_back(id) : dummy()), m_saveEmpty(isaveEmpty) {
214  if (m_v.onDemand())
216  }
217 
218  FastFiller(DetSetVector<T>& iv, typename DetSetVector<T>::Item& it, bool isaveEmpty = false)
219  : m_v(iv), m_item(it), m_saveEmpty(isaveEmpty) {
220  if (m_v.onDemand())
222  if (m_v.ready())
223  m_item.offset = int(m_v.m_data.size());
224  }
226  if (!m_saveEmpty && m_item.size == 0) {
227  m_v.pop_back(m_item.id);
228  }
229  assert(m_v.m_filling == true);
230  m_v.m_filling = false;
231  }
232 
233  void abort() {
234  m_v.pop_back(m_item.id);
235  m_saveEmpty = true; // avoid mess in destructor
236  }
237 
238  void checkCapacityExausted() const {
239  if (m_v.onDemand() && m_v.m_data.size() == m_v.m_data.capacity())
241  }
242 
244  if (m_v.onDemand() && m_v.m_data.size() + s > m_v.m_data.capacity())
246  }
247 
249  if (m_item.offset + s <= m_v.m_data.capacity())
250  return;
251  if (m_v.onDemand())
253  m_v.m_data.reserve(m_item.offset + s);
254  }
255 
258  m_v.m_data.resize(m_item.offset + s);
259  m_v.m_dataSize = m_v.m_data.size();
260  m_item.size = s;
261  }
262 
263  id_type id() const { return m_item.id; }
264  size_type size() const { return m_item.size; }
265  bool empty() const { return m_item.size == 0; }
266 
267  data_type& operator[](size_type i) { return m_v.m_data[m_item.offset + i]; }
268  DataIter begin() { return m_v.m_data.begin() + m_item.offset; }
269  DataIter end() { return begin() + size(); }
270 
271  template <typename... Args>
272  void emplace_back(Args&&... args) {
274  m_v.m_data.emplace_back(args...);
275  ++m_v.m_dataSize;
276  m_item.size++;
277  }
278 
279  void push_back(data_type const& d) {
281  m_v.m_data.push_back(d);
282  ++m_v.m_dataSize;
283  m_item.size++;
284  }
285 
288  m_v.m_data.push_back(std::move(d));
289  ++m_v.m_dataSize;
290  m_item.size++;
291  }
292 
293  data_type& back() { return m_v.m_data.back(); }
294 
295  private:
296  //for testing
297  friend class ::TestDetSet;
298 
302  };
303 
304  /* fill on demand a given DetSet
305  */
306  class TSFastFiller {
307  public:
312 
313  // here just to make the compiler happy
314  static DetSetVector<T>::Item const& dummy() {
315  assert(false);
316  static DetSetVector<T>::Item const d;
317  return d;
318  }
319  // this constructor is not supposed to be used in Concurrent mode
321  assert(m_v.m_filling == true);
322  m_v.m_filling = false;
323  }
324 
327  bool expected = false;
328  while (!m_v.m_filling.compare_exchange_weak(expected, true)) {
329  expected = false;
330  nanosleep(nullptr, nullptr);
331  }
332  int offset = m_v.m_data.size();
333  if (m_v.onDemand() && full()) {
334  m_v.m_filling = false;
336  }
337  std::move(m_lv.begin(), m_lv.end(), std::back_inserter(m_v.m_data));
338  m_item.size = m_lv.size();
339  m_item.offset = offset;
340 
341  m_v.m_dataSize = m_v.m_data.size();
342  assert(m_v.m_filling == true);
343  m_v.m_filling = false;
344  }
345 
346  bool full() const {
347  int offset = m_v.m_dataSize;
348  return m_v.m_data.capacity() < offset + m_lv.size();
349  }
350 
351  void abort() { m_lv.clear(); }
352 
353  void reserve(size_type s) { m_lv.reserve(s); }
354 
355  void resize(size_type s) { m_lv.resize(s); }
356 
357  id_type id() const { return m_item.id; }
358  size_type size() const { return m_lv.size(); }
359  bool empty() const { return m_lv.empty(); }
360 
362  DataIter begin() { return m_lv.begin(); }
363  DataIter end() { return m_lv.end(); }
364 
365  template <typename... Args>
366  void emplace_back(Args&&... args) {
367  m_lv.emplace_back(args...);
368  }
369 
370  void push_back(data_type const& d) { m_lv.push_back(d); }
371  void push_back(data_type&& d) { m_lv.push_back(std::move(d)); }
372 
373  data_type& back() { return m_lv.back(); }
374 
375  private:
376  //for testing
377  friend class ::TestDetSet;
378 
379  std::vector<T> m_lv;
381  typename DetSetVector<T>::Item const& m_item;
382  };
383 
384  friend class FastFiller;
385  friend class TSFastFiller;
386  friend class edmNew::DetSet<T>;
387 
389  public:
391  using second_argument_type = unsigned int;
392  using result_type = const T*;
393 
395  bool expected = false;
396  while (!iContainer.m_filling.compare_exchange_weak(expected, true, std::memory_order_acq_rel)) {
397  expected = false;
398  nanosleep(nullptr, nullptr);
399  }
400  result_type item = &(iContainer.m_data[iIndex]);
401  assert(iContainer.m_filling == true);
402  iContainer.m_filling = false;
403  return item;
404  }
405  };
406  friend class FindForDetSetVector;
407 
408  explicit DetSetVector(int isubdet = 0) : m_subdetId(isubdet) {}
409 
410  DetSetVector(std::shared_ptr<dslv::LazyGetter<T>> iGetter, const std::vector<det_id_type>& iDets, int isubdet = 0);
411 
413  // delete content if T is pointer...
414  }
415 
416  // default or delete is the same...
417  DetSetVector& operator=(const DetSetVector&) = delete;
418  // Implement copy constructor because of a (possibly temporary)
419  // need in heterogeneous framework prototyping. In general this
420  // class is still supposed to be non-copyable, so to prevent
421  // accidental copying the assignment operator is left deleted.
422  DetSetVector(const DetSetVector&) = default;
423  DetSetVector(DetSetVector&&) = default;
424  DetSetVector& operator=(DetSetVector&&) = default;
425 
426  bool onDemand() const { return static_cast<bool>(m_getter); }
427 
428  void swap(DetSetVector& rh) {
430  std::swap(m_subdetId, rh.m_subdetId);
431  std::swap(m_ids, rh.m_ids);
432  std::swap(m_data, rh.m_data);
433  }
434 
435  void swap(IdContainer& iic, DataContainer& idc) {
436  std::swap(m_ids, iic);
437  std::swap(m_data, idc);
438  }
439 
440  void reserve(size_t isize, size_t dsize) {
441  m_ids.reserve(isize);
442  m_data.reserve(dsize);
443  }
444 
445  void shrink_to_fit() {
446  clean();
447  m_ids.shrink_to_fit();
448  m_data.shrink_to_fit();
449  }
450 
451  void resize(size_t isize, size_t dsize) {
452  m_ids.resize(isize);
453  m_data.resize(dsize);
454  m_dataSize = m_data.size();
455  }
456 
457  void clean() {
458  m_ids.erase(std::remove_if(m_ids.begin(), m_ids.end(), [](Item const& m) { return 0 == m.size; }), m_ids.end());
459  }
460 
461  // FIXME not sure what the best way to add one cell to cont
462  DetSet insert(id_type iid, data_type const* idata, size_type isize) {
463  Item& item = addItem(iid, isize);
464  m_data.resize(m_data.size() + isize);
465  std::copy(idata, idata + isize, m_data.begin() + item.offset);
466  m_dataSize = m_data.size();
467  return DetSet(*this, item, false);
468  }
469  //make space for it
471  Item& item = addItem(iid, isize);
472  m_data.resize(m_data.size() + isize);
473  m_dataSize = m_data.size();
474  return DetSet(*this, item, false);
475  }
476 
477  // to be used with a FastFiller
478  Item& push_back(id_type iid) { return addItem(iid, 0); }
479 
480  // remove last entry (usually only if empty...)
481  void pop_back(id_type iid) {
482  const_IdIter p = findItem(iid);
483  if (p == m_ids.end())
484  return; //bha!
485  // sanity checks... (shall we throw or assert?)
486  if ((*p).isValid() && (*p).size > 0 && m_data.size() == (*p).offset + (*p).size) {
487  m_data.resize((*p).offset);
488  m_dataSize = m_data.size();
489  }
490  m_ids.erase(m_ids.begin() + (p - m_ids.begin()));
491  }
492 
493  private:
494  Item& addItem(id_type iid, size_type isize) {
495  Item it(iid, size_type(m_data.size()), isize);
496  IdIter p = std::lower_bound(m_ids.begin(), m_ids.end(), it);
497  if (p != m_ids.end() && !(it < *p))
499  return *m_ids.insert(p, std::move(it));
500  }
501 
502  public:
503  //---------------------------------------------------------
504 
505  bool exists(id_type i) const { return findItem(i) != m_ids.end(); }
506 
507  bool isValid(id_type i) const {
509  return p != m_ids.end() && (*p).isValid();
510  }
511 
512  /*
513  DetSet operator[](id_type i) {
514  const_IdIter p = findItem(i);
515  if (p==m_ids.end()) what???
516  return DetSet(*this,p-m_ids.begin());
517  }
518  */
519 
522  if (p == m_ids.end())
524  return DetSet(*this, *p, true);
525  }
526 
527  // slow interface
528  // const_iterator find(id_type i, bool update=true) const {
529  const_iterator find(id_type i, bool update = false) const {
531  return (p == m_ids.end()) ? end() : boost::make_transform_iterator(p, IterHelp(*this, update));
532  }
533 
534  // slow interface
536  std::pair<const_IdIter, const_IdIter> p = std::equal_range(m_ids.begin(), m_ids.end(), Item(i));
537  return (p.first != p.second) ? p.first : m_ids.end();
538  }
539 
540  // const_iterator begin(bool update=true) const {
541  const_iterator begin(bool update = false) const {
542  return boost::make_transform_iterator(m_ids.begin(), IterHelp(*this, update));
543  }
544 
545  // const_iterator end(bool update=true) const {
546  const_iterator end(bool update = false) const {
547  return boost::make_transform_iterator(m_ids.end(), IterHelp(*this, update));
548  }
549 
550  // return an iterator range (implemented here to avoid dereference of detset)
551  template <typename CMP>
552  // Range equal_range(id_type i, CMP cmp, bool update=true) const {
553  Range equal_range(id_type i, CMP cmp, bool update = false) const {
554  std::pair<const_IdIter, const_IdIter> p = std::equal_range(m_ids.begin(), m_ids.end(), i, cmp);
555  return Range(boost::make_transform_iterator(p.first, IterHelp(*this, update)),
556  boost::make_transform_iterator(p.second, IterHelp(*this, update)));
557  }
558 
559  int subdetId() const { return m_subdetId; }
560 
561  bool empty() const { return m_ids.empty(); }
562 
563  size_type dataSize() const { return onDemand() ? size_type(m_dataSize) : size_type(m_data.size()); }
564 
565  size_type size() const { return m_ids.size(); }
566 
567  //FIXME fast interfaces, not consistent with associative nature of container....
568 
569  data_type operator()(size_t cell, size_t frame) const { return m_data[m_ids[cell].offset + frame]; }
570 
571  data_type const* data(size_t cell) const { return &m_data[m_ids[cell].offset]; }
572 
573  size_type detsetSize(size_t cell) const { return m_ids[cell].size; }
574 
575  id_type id(size_t cell) const { return m_ids[cell].id; }
576 
577  Item const& item(size_t cell) const { return m_ids[cell]; }
578 
579  //------------------------------
580 
581  IdContainer const& ids() const { return m_ids; }
582  DataContainer const& data() const { return m_data; }
583 
584  //Used by ROOT storage
586 
587  private:
588  //for testing
589  friend class ::TestDetSet;
590 
591  void update(Item const& item) const;
592 
593  // subdetector id (as returned by DetId::subdetId())
595 
596  // Workaround for ROOT 6 bug.
597  // ROOT6 has a problem with this IdContainer typedef
598  //IdContainer m_ids;
601  };
602 
603  namespace dslv {
604  template <typename T>
605  class LazyGetter {
606  public:
607  virtual ~LazyGetter() {}
608  virtual void fill(typename DetSetVector<T>::TSFastFiller&) const = 0;
609  };
610  } // namespace dslv
611 
612  template <typename T>
613  inline DetSetVector<T>::DetSetVector(std::shared_ptr<Getter> iGetter,
614  const std::vector<det_id_type>& iDets,
615  int isubdet)
616  : m_subdetId(isubdet) {
617  m_getter = iGetter;
618 
619  m_ids.reserve(iDets.size());
620  det_id_type sanityCheck = 0;
621  for (std::vector<det_id_type>::const_iterator itDetId = iDets.begin(), itDetIdEnd = iDets.end();
622  itDetId != itDetIdEnd;
623  ++itDetId) {
624  assert(sanityCheck < *itDetId && "vector of det_id_type was not ordered");
625  sanityCheck = *itDetId;
626  m_ids.push_back(*itDetId);
627  }
628  }
629 
630  template <typename T>
631  inline void DetSetVector<T>::update(const Item& item) const {
632  // no m_getter or already updated
633  if (!m_getter) {
634  assert(item.isValid());
635  return;
636  }
637  if (item.initialize()) {
638  assert(item.initializing());
639  {
640  TSFastFiller ff(*this, item);
641  static_cast<Getter const*>(m_getter.get())->fill(ff);
642  }
643  assert(item.isValid());
644  }
645  }
646 
647  template <typename T>
648  inline void DetSet<T>::set(DetSetVector<T> const& icont, typename Container::Item const& item, bool update) {
649  // if an item is being updated we wait
650  if (update)
651  icont.update(item);
652  while (item.initializing())
653  nanosleep(nullptr, nullptr);
654  m_data = &icont.data();
655  m_id = item.id;
656  m_offset = item.offset;
657  m_size = item.size;
658  }
659 } // namespace edmNew
660 
662 #include <type_traits>
663 
664 //specialize behavior of edm::Ref to get access to the 'Det'
665 namespace edm {
666  /* Reference to an item inside a new DetSetVector ... */
667  namespace refhelper {
668  template <typename T>
669  struct FindTrait<typename edmNew::DetSetVector<T>, T> {
671  };
672  } // namespace refhelper
673  /* ... as there was one for the original DetSetVector*/
674 
675  /* Probably this one is not that useful .... */
676  namespace refhelper {
677  template <typename T>
680  using second_argument_type = unsigned int;
682 
684  return &(iContainer[iIndex]);
685  }
686  };
687 
688  template <typename T>
691  };
692  } // namespace refhelper
693  /* ... implementation is provided, just in case it's needed */
694 } // namespace edm
695 
696 namespace edmNew {
697  //helper function to make it easier to create a edm::Ref to a new DSV
698  template <class HandleT>
699  // inline
701  const HandleT& iHandle, typename HandleT::element_type::value_type::const_iterator itIter) {
702  static_assert(std::is_same<typename HandleT::element_type,
704  "Handle and DetSetVector do not have compatible types.");
705  auto index = itIter - &iHandle->data().front();
707  iHandle.id(), &(*itIter), index);
708  }
709 } // namespace edmNew
710 
712 
713 namespace edm {
714  template <typename T>
716  public:
717  typedef T value_type;
718 
719  static size_t size(const edmNew::DetSetVector<T>* iContainer) { return iContainer->dataSize(); }
720  static unsigned int indexFor(const value_type* iElement, const edmNew::DetSetVector<T>* iContainer) {
721  return iElement - &(iContainer->data().front());
722  }
723  };
724 } // namespace edm
725 
726 // Thinning support
728 namespace edm::detail {
729  template <typename T>
732  };
733 } // namespace edm::detail
734 namespace edmNew {
735  template <typename T, typename Selector>
738  unsigned int& iIndex,
742  for (auto iter = detset.begin(), end = detset.end(); iter != end; ++iter, ++iIndex) {
744  }
745  if (detset.begin() != detset.end()) {
746  // need to decrease the global index by one because the outer loop will increase it
747  --iIndex;
748  }
749  }
750 } // namespace edmNew
751 
752 #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)
std::shared_ptr< void const > m_getter
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)
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_)
friend class TSFastFiller
assert(be >=bs)
DetSetVectorTrans(const DetSetVectorTrans &rh)
id_type detId() const
Definition: DetSetNew.h:63
DetSetVectorTrans & operator=(const DetSetVectorTrans &)=delete
DetSetVector< T > const & m_v
void swap(Association< C > &lhs, Association< C > &rhs)
Definition: Association.h:112
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)
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
friend class FindForDetSetVector
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:53
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
Definition: output.py:1
edmNew::DetSet< T > DetSet
std::pair< const_IdIter, const_DataIter > const_IterPair
FastFiller(DetSetVector< T > &iv, typename DetSetVector< T >::Item &it, bool isaveEmpty=false)
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
result_type operator()(Item const &item) const
iterator begin()
Definition: DetSetNew.h:51