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