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(std::move(rh.id)), offset(int(rh.offset)), size(std::move(rh.size)) {}
111  Item& operator=(Item&& rh) noexcept {
112  id = std::move(rh.id);
113  offset = int(rh.offset);
114  size = std::move(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  FastFiller(DetSetVector<T>& iv, id_type id, bool isaveEmpty = false)
216  : m_v(iv), m_item(m_v.ready() ? m_v.push_back(id) : dummy()), m_saveEmpty(isaveEmpty) {
217  if (m_v.onDemand())
219  }
220 
221  FastFiller(DetSetVector<T>& iv, typename DetSetVector<T>::Item& it, bool isaveEmpty = false)
222  : m_v(iv), m_item(it), m_saveEmpty(isaveEmpty) {
223  if (m_v.onDemand())
225  if (m_v.ready())
226  m_item.offset = int(m_v.m_data.size());
227  }
229  if (!m_saveEmpty && m_item.size == 0) {
230  m_v.pop_back(m_item.id);
231  }
232  assert(m_v.m_filling == true);
233  m_v.m_filling = false;
234  }
235 
236  void abort() {
237  m_v.pop_back(m_item.id);
238  m_saveEmpty = true; // avoid mess in destructor
239  }
240 
241  void checkCapacityExausted() const {
242  if (m_v.onDemand() && m_v.m_data.size() == m_v.m_data.capacity())
244  }
245 
247  if (m_v.onDemand() && m_v.m_data.size() + s > m_v.m_data.capacity())
249  }
250 
252  if (m_item.offset + s <= m_v.m_data.capacity())
253  return;
254  if (m_v.onDemand())
256  m_v.m_data.reserve(m_item.offset + s);
257  }
258 
261  m_v.m_data.resize(m_item.offset + s);
262  m_v.m_dataSize = m_v.m_data.size();
263  m_item.size = s;
264  }
265 
266  id_type id() const { return m_item.id; }
267  size_type size() const { return m_item.size; }
268  bool empty() const { return m_item.size == 0; }
269 
270  data_type& operator[](size_type i) { return m_v.m_data[m_item.offset + i]; }
271  DataIter begin() { return m_v.m_data.begin() + m_item.offset; }
272  DataIter end() { return begin() + size(); }
273 
274  void push_back(data_type const& d) {
276  m_v.m_data.push_back(d);
277  ++m_v.m_dataSize;
278  m_item.size++;
279  }
282  m_v.m_data.push_back(std::move(d));
283  ++m_v.m_dataSize;
284  m_item.size++;
285  }
286 
287  data_type& back() { return m_v.m_data.back(); }
288 
289  private:
290  //for testing
291  friend class ::TestDetSet;
292 
296  };
297 
298  /* fill on demand a given DetSet
299  */
300  class TSFastFiller {
301  public:
306 
307  // here just to make the compiler happy
308  static DetSetVector<T>::Item const& dummy() {
309  assert(false);
310  static DetSetVector<T>::Item const d;
311  return d;
312  }
313  // this constructor is not supposed to be used in Concurrent mode
315  assert(m_v.m_filling == true);
316  m_v.m_filling = false;
317  }
318 
319  TSFastFiller(DetSetVector<T> const& iv, typename DetSetVector<T>::Item const& it) : m_v(iv), m_item(it) {}
321  bool expected = false;
322  while (!m_v.m_filling.compare_exchange_weak(expected, true)) {
323  expected = false;
324  nanosleep(nullptr, nullptr);
325  }
326  int offset = m_v.m_data.size();
327  if (m_v.onDemand() && full()) {
328  m_v.m_filling = false;
330  }
331  std::move(m_lv.begin(), m_lv.end(), std::back_inserter(m_v.m_data));
332  m_item.size = m_lv.size();
333  m_item.offset = offset;
334 
335  m_v.m_dataSize = m_v.m_data.size();
336  assert(m_v.m_filling == true);
337  m_v.m_filling = false;
338  }
339 
340  bool full() const {
341  int offset = m_v.m_dataSize;
342  return m_v.m_data.capacity() < offset + m_lv.size();
343  }
344 
345  void abort() { m_lv.clear(); }
346 
347  void reserve(size_type s) { m_lv.reserve(s); }
348 
349  void resize(size_type s) { m_lv.resize(s); }
350 
351  id_type id() const { return m_item.id; }
352  size_type size() const { return m_lv.size(); }
353  bool empty() const { return m_lv.empty(); }
354 
356  DataIter begin() { return m_lv.begin(); }
357  DataIter end() { return m_lv.end(); }
358 
359  void push_back(data_type const& d) { m_lv.push_back(d); }
360  void push_back(data_type&& d) { m_lv.push_back(std::move(d)); }
361 
362  data_type& back() { return m_lv.back(); }
363 
364  private:
365  //for testing
366  friend class ::TestDetSet;
367 
368  std::vector<T> m_lv;
370  typename DetSetVector<T>::Item const& m_item;
371  };
372 
373  friend class FastFiller;
374  friend class TSFastFiller;
375  friend class edmNew::DetSet<T>;
376 
378  public:
380  using second_argument_type = unsigned int;
381  using result_type = const T*;
382 
384  bool expected = false;
385  while (!iContainer.m_filling.compare_exchange_weak(expected, true, std::memory_order_acq_rel)) {
386  expected = false;
387  nanosleep(nullptr, nullptr);
388  }
389  result_type item = &(iContainer.m_data[iIndex]);
390  assert(iContainer.m_filling == true);
391  iContainer.m_filling = false;
392  return item;
393  }
394  };
395  friend class FindForDetSetVector;
396 
397  explicit DetSetVector(int isubdet = 0) : m_subdetId(isubdet) {}
398 
399  DetSetVector(std::shared_ptr<dslv::LazyGetter<T>> iGetter, const std::vector<det_id_type>& iDets, int isubdet = 0);
400 
402  // delete content if T is pointer...
403  }
404 
405  // default or delete is the same...
406  DetSetVector& operator=(const DetSetVector&) = delete;
407  // Implement copy constructor because of a (possibly temporary)
408  // need in heterogeneous framework prototyping. In general this
409  // class is still supposed to be non-copyable, so to prevent
410  // accidental copying the assignment operator is left deleted.
411  DetSetVector(const DetSetVector&) = default;
412  DetSetVector(DetSetVector&&) = default;
413  DetSetVector& operator=(DetSetVector&&) = default;
414 
415  bool onDemand() const { return static_cast<bool>(m_getter); }
416 
417  void swap(DetSetVector& rh) {
419  std::swap(m_subdetId, rh.m_subdetId);
420  std::swap(m_ids, rh.m_ids);
421  std::swap(m_data, rh.m_data);
422  }
423 
424  void swap(IdContainer& iic, DataContainer& idc) {
425  std::swap(m_ids, iic);
426  std::swap(m_data, idc);
427  }
428 
429  void reserve(size_t isize, size_t dsize) {
430  m_ids.reserve(isize);
431  m_data.reserve(dsize);
432  }
433 
434  void shrink_to_fit() {
435  clean();
436  m_ids.shrink_to_fit();
437  m_data.shrink_to_fit();
438  }
439 
440  void resize(size_t isize, size_t dsize) {
441  m_ids.resize(isize);
442  m_data.resize(dsize);
443  m_dataSize = m_data.size();
444  }
445 
446  void clean() {
447  m_ids.erase(std::remove_if(m_ids.begin(), m_ids.end(), [](Item const& m) { return 0 == m.size; }), m_ids.end());
448  }
449 
450  // FIXME not sure what the best way to add one cell to cont
451  DetSet insert(id_type iid, data_type const* idata, size_type isize) {
452  Item& item = addItem(iid, isize);
453  m_data.resize(m_data.size() + isize);
454  std::copy(idata, idata + isize, m_data.begin() + item.offset);
455  m_dataSize = m_data.size();
456  return DetSet(*this, item, false);
457  }
458  //make space for it
460  Item& item = addItem(iid, isize);
461  m_data.resize(m_data.size() + isize);
462  m_dataSize = m_data.size();
463  return DetSet(*this, item, false);
464  }
465 
466  // to be used with a FastFiller
467  Item& push_back(id_type iid) { return addItem(iid, 0); }
468 
469  // remove last entry (usually only if empty...)
470  void pop_back(id_type iid) {
471  const_IdIter p = findItem(iid);
472  if (p == m_ids.end())
473  return; //bha!
474  // sanity checks... (shall we throw or assert?)
475  if ((*p).isValid() && (*p).size > 0 && m_data.size() == (*p).offset + (*p).size) {
476  m_data.resize((*p).offset);
477  m_dataSize = m_data.size();
478  }
479  m_ids.erase(m_ids.begin() + (p - m_ids.begin()));
480  }
481 
482  private:
483  Item& addItem(id_type iid, size_type isize) {
484  Item it(iid, size_type(m_data.size()), isize);
485  IdIter p = std::lower_bound(m_ids.begin(), m_ids.end(), it);
486  if (p != m_ids.end() && !(it < *p))
488  return *m_ids.insert(p, std::move(it));
489  }
490 
491  public:
492  //---------------------------------------------------------
493 
494  bool exists(id_type i) const { return findItem(i) != m_ids.end(); }
495 
496  bool isValid(id_type i) const {
498  return p != m_ids.end() && (*p).isValid();
499  }
500 
501  /*
502  DetSet operator[](id_type i) {
503  const_IdIter p = findItem(i);
504  if (p==m_ids.end()) what???
505  return DetSet(*this,p-m_ids.begin());
506  }
507  */
508 
511  if (p == m_ids.end())
513  return DetSet(*this, *p, true);
514  }
515 
516  // slow interface
517  // const_iterator find(id_type i, bool update=true) const {
518  const_iterator find(id_type i, bool update = false) const {
520  return (p == m_ids.end()) ? end() : boost::make_transform_iterator(p, IterHelp(*this, update));
521  }
522 
523  // slow interface
525  std::pair<const_IdIter, const_IdIter> p = std::equal_range(m_ids.begin(), m_ids.end(), Item(i));
526  return (p.first != p.second) ? p.first : m_ids.end();
527  }
528 
529  // const_iterator begin(bool update=true) const {
530  const_iterator begin(bool update = false) const {
531  return boost::make_transform_iterator(m_ids.begin(), IterHelp(*this, update));
532  }
533 
534  // const_iterator end(bool update=true) const {
535  const_iterator end(bool update = false) const {
536  return boost::make_transform_iterator(m_ids.end(), IterHelp(*this, update));
537  }
538 
539  // return an iterator range (implemented here to avoid dereference of detset)
540  template <typename CMP>
541  // Range equal_range(id_type i, CMP cmp, bool update=true) const {
542  Range equal_range(id_type i, CMP cmp, bool update = false) const {
543  std::pair<const_IdIter, const_IdIter> p = std::equal_range(m_ids.begin(), m_ids.end(), i, cmp);
544  return Range(boost::make_transform_iterator(p.first, IterHelp(*this, update)),
545  boost::make_transform_iterator(p.second, IterHelp(*this, update)));
546  }
547 
548  int subdetId() const { return m_subdetId; }
549 
550  bool empty() const { return m_ids.empty(); }
551 
552  size_type dataSize() const { return onDemand() ? size_type(m_dataSize) : size_type(m_data.size()); }
553 
554  size_type size() const { return m_ids.size(); }
555 
556  //FIXME fast interfaces, not consistent with associative nature of container....
557 
558  data_type operator()(size_t cell, size_t frame) const { return m_data[m_ids[cell].offset + frame]; }
559 
560  data_type const* data(size_t cell) const { return &m_data[m_ids[cell].offset]; }
561 
562  size_type detsetSize(size_t cell) const { return m_ids[cell].size; }
563 
564  id_type id(size_t cell) const { return m_ids[cell].id; }
565 
566  Item const& item(size_t cell) const { return m_ids[cell]; }
567 
568  //------------------------------
569 
570  IdContainer const& ids() const { return m_ids; }
571  DataContainer const& data() const { return m_data; }
572 
573  //Used by ROOT storage
575 
576  private:
577  //for testing
578  friend class ::TestDetSet;
579 
580  void update(Item const& item) const;
581 
582  // subdetector id (as returned by DetId::subdetId())
584 
585  // Workaround for ROOT 6 bug.
586  // ROOT6 has a problem with this IdContainer typedef
587  //IdContainer m_ids;
590  };
591 
592  namespace dslv {
593  template <typename T>
594  class LazyGetter {
595  public:
596  virtual ~LazyGetter() {}
597  virtual void fill(typename DetSetVector<T>::TSFastFiller&) = 0;
598  };
599  } // namespace dslv
600 
601  template <typename T>
602  inline DetSetVector<T>::DetSetVector(std::shared_ptr<Getter> iGetter,
603  const std::vector<det_id_type>& iDets,
604  int isubdet)
605  : m_subdetId(isubdet) {
606  m_getter = iGetter;
607 
608  m_ids.reserve(iDets.size());
609  det_id_type sanityCheck = 0;
610  for (std::vector<det_id_type>::const_iterator itDetId = iDets.begin(), itDetIdEnd = iDets.end();
611  itDetId != itDetIdEnd;
612  ++itDetId) {
613  assert(sanityCheck < *itDetId && "vector of det_id_type was not ordered");
614  sanityCheck = *itDetId;
615  m_ids.push_back(*itDetId);
616  }
617  }
618 
619  template <typename T>
620  inline void DetSetVector<T>::update(const Item& item) const {
621  // no m_getter or already updated
622  if (!m_getter) {
623  assert(item.isValid());
624  return;
625  }
626  if (item.initialize()) {
627  assert(item.initializing());
628  {
629  TSFastFiller ff(*this, item);
630  static_cast<Getter*>(m_getter.get())->fill(ff);
631  }
632  assert(item.isValid());
633  }
634  }
635 
636  template <typename T>
637  inline void DetSet<T>::set(DetSetVector<T> const& icont, typename Container::Item const& item, bool update) {
638  // if an item is being updated we wait
639  if (update)
640  icont.update(item);
641  while (item.initializing())
642  nanosleep(nullptr, nullptr);
643  m_data = &icont.data();
644  m_id = item.id;
645  m_offset = item.offset;
646  m_size = item.size;
647  }
648 } // namespace edmNew
649 
651 #include <type_traits>
652 
653 //specialize behavior of edm::Ref to get access to the 'Det'
654 namespace edm {
655  /* Reference to an item inside a new DetSetVector ... */
656  namespace refhelper {
657  template <typename T>
658  struct FindTrait<typename edmNew::DetSetVector<T>, T> {
660  };
661  } // namespace refhelper
662  /* ... as there was one for the original DetSetVector*/
663 
664  /* Probably this one is not that useful .... */
665  namespace refhelper {
666  template <typename T>
669  using second_argument_type = unsigned int;
671 
673  return &(iContainer[iIndex]);
674  }
675  };
676 
677  template <typename T>
680  };
681  } // namespace refhelper
682  /* ... implementation is provided, just in case it's needed */
683 } // namespace edm
684 
685 namespace edmNew {
686  //helper function to make it easier to create a edm::Ref to a new DSV
687  template <class HandleT>
688  // inline
690  const HandleT& iHandle, typename HandleT::element_type::value_type::const_iterator itIter) {
691  static_assert(std::is_same<typename HandleT::element_type,
693  "Handle and DetSetVector do not have compatible types.");
694  auto index = itIter - &iHandle->data().front();
696  iHandle.id(), &(*itIter), index);
697  }
698 } // namespace edmNew
699 
701 
702 namespace edm {
703  template <typename T>
705  public:
706  typedef T value_type;
707 
708  static size_t size(const edmNew::DetSetVector<T>* iContainer) { return iContainer->dataSize(); }
709  static unsigned int indexFor(const value_type* iElement, const edmNew::DetSetVector<T>* iContainer) {
710  return iElement - &(iContainer->data().front());
711  }
712  };
713 } // namespace edm
714 
715 // Thinning support
717 namespace edm::detail {
718  template <typename T>
721  };
722 } // namespace edm::detail
723 namespace edmNew {
724  template <typename T, typename Selector>
726  Selector& selector,
727  unsigned int& iIndex,
731  for (auto iter = detset.begin(), end = detset.end(); iter != end; ++iter, ++iIndex) {
732  edm::detail::fillCollectionForThinning(*iter, selector, iIndex, ff, association);
733  }
734  if (detset.begin() != detset.end()) {
735  // need to decrease the global index by one because the outer loop will increase it
736  --iIndex;
737  }
738  }
739 } // namespace edmNew
740 
741 #endif
edmNew::DetSetVector::swap
void swap(IdContainer &iic, DataContainer &idc)
Definition: DetSetVectorNew.h:424
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:236
edmNew::dstvdetails::DetSetVectorTrans::Item::initializing
bool initializing() const
Definition: DetSetVectorNew.h:127
edmNew::dstvdetails::DetSetVectorTrans::Item::isValid
bool isValid() const
Definition: DetSetVectorNew.h:128
Selector
Functor that operates on <T>
Definition: Selector.h:22
edmNew::DetSetVector::resize
void resize(size_t isize, size_t dsize)
Definition: DetSetVectorNew.h:440
edmNew::DetSetVector::TSFastFiller::key_type
DetSetVector< T >::id_type key_type
Definition: DetSetVectorNew.h:303
mps_fire.i
i
Definition: mps_fire.py:428
edm::detail
Definition: DetSetVector.h:67
edmNew::DetSetVector::TSFastFiller::push_back
void push_back(data_type const &d)
Definition: DetSetVectorNew.h:359
edm::refhelper::FindSetForNewDetSetVector::operator()
result_type operator()(first_argument_type iContainer, second_argument_type iIndex)
Definition: DetSetVectorNew.h:672
edmNew::DetSetVector::exists
bool exists(id_type i) const
Definition: DetSetVectorNew.h:494
funct::false
false
Definition: Factorize.h:29
edmNew::DetSetVector::id
id_type id(size_t cell) const
Definition: DetSetVectorNew.h:564
filterCSVwithJSON.copy
copy
Definition: filterCSVwithJSON.py:36
edmNew::DetSetVector::TSFastFiller::m_item
DetSetVector< T >::Item const & m_item
Definition: DetSetVectorNew.h:370
edmNew::DetSetVector::FastFiller::FastFiller
FastFiller(DetSetVector< T > &iv, typename DetSetVector< T >::Item &it, bool isaveEmpty=false)
Definition: DetSetVectorNew.h:221
edmNew::DetSetVector::FastFiller::begin
DataIter begin()
Definition: DetSetVectorNew.h:271
edmNew::dslv::LazyGetter::~LazyGetter
virtual ~LazyGetter()
Definition: DetSetVectorNew.h:596
edmNew::DetSetVector::FastFiller::back
data_type & back()
Definition: DetSetVectorNew.h:287
convertSQLitetoXML_cfg.output
output
Definition: convertSQLitetoXML_cfg.py:72
edmNew::DetSetVector::Item
Trans::Item Item
Definition: DetSetVectorNew.h:158
edmNew::dstvdetails::DetSetVectorTrans::Item::size
size_type size
Definition: DetSetVectorNew.h:124
edmNew::DetSetVector::size
size_type size() const
Definition: DetSetVectorNew.h:554
edmNew::DetSetVector::data_type
T data_type
Definition: DetSetVectorNew.h:161
edmNew::DetSetVector::FastFiller::size_type
DetSetVector< T >::size_type size_type
Definition: DetSetVectorNew.h:207
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:451
edmNew::DetSetVector::TSFastFiller::size_type
DetSetVector< T >::size_type size_type
Definition: DetSetVectorNew.h:305
AlCaHLTBitMon_ParallelJobs.p
p
Definition: AlCaHLTBitMon_ParallelJobs.py:153
gpuVertexFinder::iv
int32_t *__restrict__ iv
Definition: gpuClusterTracksDBSCAN.h:42
edmNew::DetSetVector::IterPair
std::pair< IdIter, DataIter > IterPair
Definition: DetSetVectorNew.h:173
edmNew::DetSetVector::reserve
void reserve(size_t isize, size_t dsize)
Definition: DetSetVectorNew.h:429
edm::swap
void swap(Association< C > &lhs, Association< C > &rhs)
Definition: Association.h:117
edmNew::DetSetVector::IdContainer
std::vector< Item > IdContainer
Definition: DetSetVectorNew.h:169
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:689
edmNew::DetSetVector::update
void update(Item const &item) const
Definition: DetSetVectorNew.h:620
edmNew::DetSetVector::DataIter
std::vector< data_type >::iterator DataIter
Definition: DetSetVectorNew.h:172
edmNew::fillCollectionForThinning
void fillCollectionForThinning(edmNew::DetSet< T > const &detset, Selector &selector, unsigned int &iIndex, edmNew::DetSetVector< T > &output, edm::ThinnedAssociation &association)
Definition: DetSetVectorNew.h:725
edmNew::dstvdetails::DetSetVectorTrans::DetSetVectorTrans
DetSetVectorTrans(const DetSetVectorTrans &rh)
Definition: DetSetVectorNew.h:62
edmNew::DetSetVector::TSFastFiller
Definition: DetSetVectorNew.h:300
edmNew::DetSetVector::const_iterator
boost::transform_iterator< IterHelp, const_IdIter > const_iterator
Definition: DetSetVectorNew.h:197
edmNew::DetSetVector::FastFiller::~FastFiller
~FastFiller()
Definition: DetSetVectorNew.h:228
edm::ThinnedAssociation
Definition: ThinnedAssociation.h:15
edmNew::DetSetVector::Getter
dslv::LazyGetter< T > Getter
Definition: DetSetVectorNew.h:164
cms::cuda::assert
assert(be >=bs)
edmNew::CapacityExaustedException
Definition: DetSetVectorNew.h:35
edm::ContainerMaskTraits< edmNew::DetSetVector< T > >::indexFor
static unsigned int indexFor(const value_type *iElement, const edmNew::DetSetVector< T > *iContainer)
Definition: DetSetVectorNew.h:709
edmNew::DetSetVector::begin
const_iterator begin(bool update=false) const
Definition: DetSetVectorNew.h:530
edm::detail::fillCollectionForThinning
void fillCollectionForThinning(Item const &item, Selector &selector, unsigned int iIndex, Collection &output, ThinnedAssociation &association)
Definition: ThinningProducer.h:43
edmNew::dslv::LazyGetter
Definition: DetSetVectorNew.h:41
edmNew::DetSetVector::insert
DetSet insert(id_type iid, size_type isize)
Definition: DetSetVectorNew.h:459
edmNew::DetSetVector::value_type
DetSet value_type
Definition: DetSetVectorNew.h:166
edmNew::DetSetVector::FastFiller::id_type
DetSetVector< T >::id_type id_type
Definition: DetSetVectorNew.h:206
edmNew::dstvdetails::throwCapacityExausted
void throwCapacityExausted()
Definition: DetSetVectorNew.h:141
edmNew::DetSetVector::TSFastFiller::operator[]
data_type & operator[](size_type i)
Definition: DetSetVectorNew.h:355
edmNew::DetSetVector::FastFiller::push_back
void push_back(data_type const &d)
Definition: DetSetVectorNew.h:274
edmNew::DetSetVector::item
Item const & item(size_t cell) const
Definition: DetSetVectorNew.h:566
edmNew::DetSetVector::clean
void clean()
Definition: DetSetVectorNew.h:446
edmNew::DetSetVector::TSFastFiller::TSFastFiller
TSFastFiller(DetSetVector< T > &iv, id_type id)
Definition: DetSetVectorNew.h:314
ContainerMaskTraits.h
edmNew::dstvdetails::DetSetVectorTrans
Definition: DetSetVectorNew.h:55
watchdog.const
const
Definition: watchdog.py:83
edmNew::DetSetVector::FastFiller::dummy
static DetSetVector< T >::Item & dummy()
Definition: DetSetVectorNew.h:210
edmNew::DetSetVector::TSFastFiller::~TSFastFiller
~TSFastFiller()
Definition: DetSetVectorNew.h:320
edmNew::DetSetVector::IterHelp::IterHelp
IterHelp(DetSetVector< T > const &iv, bool iup)
Definition: DetSetVectorNew.h:184
edmNew::dstvdetails::DetSetVectorTrans::swap
void swap(DetSetVectorTrans &rh)
Definition: DetSetVectorNew.h:91
edmNew::DetSetVector::FastFiller::value_type
DetSetVector< T >::data_type value_type
Definition: DetSetVectorNew.h:204
edmNew::DetSetVector::ids
IdContainer const & ids() const
Definition: DetSetVectorNew.h:570
edmNew::DetSetVector::IterHelp::m_v
DetSetVector< T > const * m_v
Definition: DetSetVectorNew.h:192
edmNew::DetSetVector::const_IdIter
IdContainer::const_iterator const_IdIter
Definition: DetSetVectorNew.h:174
edmNew
Definition: DetSet2RangeMap.h:11
edmNew::DetSetVector::IterHelp::IterHelp
IterHelp()
Definition: DetSetVectorNew.h:183
edm::Ref
Definition: AssociativeIterator.h:58
edmNew::dstvdetails::DetSetVectorTrans::Item
Definition: DetSetVectorNew.h:100
edmNew::dstvdetails::DetSetVectorTrans::Item::id
id_type id
Definition: DetSetVectorNew.h:118
edmNew::DetSetVector::DetSet
edmNew::DetSet< T > DetSet
Definition: DetSetVectorNew.h:163
edmNew::dstvdetails::DetSetVectorTrans::Item::operator=
Item & operator=(Item &&rh) noexcept
Definition: DetSetVectorNew.h:111
edmNew::DetSetVector::FastFiller::resize
void resize(size_type s)
Definition: DetSetVectorNew.h:259
edmNew::DetSetVector::TSFastFiller::begin
DataIter begin()
Definition: DetSetVectorNew.h:356
edmNew::DetSet::end
iterator end()
Definition: DetSetNew.h:56
edmNew::DetSetVector::FastFiller::push_back
void push_back(data_type &&d)
Definition: DetSetVectorNew.h:280
edmNew::DetSetVector::FastFiller::empty
bool empty() const
Definition: DetSetVectorNew.h:268
alignCSCRings.s
s
Definition: alignCSCRings.py:92
edmNew::DetSetVector::find
const_iterator find(id_type i, bool update=false) const
Definition: DetSetVectorNew.h:518
edmNew::DetSetVector::FastFiller::checkCapacityExausted
void checkCapacityExausted() const
Definition: DetSetVectorNew.h:241
edmNew::dstvdetails::notSafe
void notSafe()
Definition: DetSetVectorNew.cc:11
edmNew::DetSetVector::FindForDetSetVector::result_type
const T * result_type
Definition: DetSetVectorNew.h:381
edm::refhelper::FindTrait< edmNew::DetSetVector< T >, edmNew::DetSet< T > >::value
FindSetForNewDetSetVector< T > value
Definition: DetSetVectorNew.h:679
edmNew::DetSetVector::RefFinder
edm::refhelper::FindForNewDetSetVector< data_type > RefFinder
Definition: DetSetVectorNew.h:178
edmNew::dstvdetails::DetSetVectorTrans::Item::offset
std::atomic< int > offset
Definition: DetSetVectorNew.h:119
edmNew::DetSetVector::FastFiller::m_v
DetSetVector< T > & m_v
Definition: DetSetVectorNew.h:293
edmNew::DetSetVector::FastFiller::key_type
DetSetVector< T >::id_type key_type
Definition: DetSetVectorNew.h:205
std::swap
void swap(edm::DataFrameContainer &lhs, edm::DataFrameContainer &rhs)
Definition: DataFrameContainer.h:209
edm::detail::ElementType
Definition: fillCollectionForThinning.h:16
edmNew::DetSetVector::subdetId
int subdetId() const
Definition: DetSetVectorNew.h:548
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:383
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:181
edmNew::dstvdetails::DetSetVectorTrans::operator=
DetSetVectorTrans & operator=(DetSetVectorTrans &&rh)
Definition: DetSetVectorNew.h:79
mps_fire.end
end
Definition: mps_fire.py:242
edmNew::DetSetVector::const_IterPair
std::pair< const_IdIter, const_DataIter > const_IterPair
Definition: DetSetVectorNew.h:176
edmNew::DetSetVector::TSFastFiller::value_type
DetSetVector< T >::data_type value_type
Definition: DetSetVectorNew.h:302
edmNew::dstvdetails::DetSetVectorTrans::DetSetVectorTrans
DetSetVectorTrans()
Definition: DetSetVectorNew.h:59
edm::ContainerMaskTraits< edmNew::DetSetVector< T > >::size
static size_t size(const edmNew::DetSetVector< T > *iContainer)
Definition: DetSetVectorNew.h:708
edmNew::DetSet
Definition: DetSetNew.h:22
fillCollectionForThinning.h
edmNew::DetSetVector::size_type
unsigned int size_type
Definition: DetSetVectorNew.h:159
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:434
edm::refhelper::FindSetForNewDetSetVector::second_argument_type
unsigned int second_argument_type
Definition: DetSetVectorNew.h:669
edm::refhelper::FindSetForNewDetSetVector
Definition: DetSetVectorNew.h:667
edmNew::DetSetVector::TSFastFiller::size
size_type size() const
Definition: DetSetVectorNew.h:352
edmNew::dstvdetails::DetSetVectorTrans::Item::operator=
Item & operator=(Item const &rh) noexcept
Definition: DetSetVectorNew.h:104
edmNew::DetSetVector::dataSize
size_type dataSize() const
Definition: DetSetVectorNew.h:552
edmNew::DetSetVector::FindForDetSetVector::second_argument_type
unsigned int second_argument_type
Definition: DetSetVectorNew.h:380
edmNew::DetSetVector::IterHelp
Definition: DetSetVectorNew.h:180
edmNew::DetSetVector::operator()
data_type operator()(size_t cell, size_t frame) const
Definition: DetSetVectorNew.h:558
edmNew::DetSetVector::~DetSetVector
~DetSetVector()
Definition: DetSetVectorNew.h:401
edmNew::DetSetVector::equal_range
Range equal_range(id_type i, CMP cmp, bool update=false) const
Definition: DetSetVectorNew.h:542
edmNew::DetSetVector::key_type
id_type key_type
Definition: DetSetVectorNew.h:167
ntuplemaker.fill
fill
Definition: ntuplemaker.py:304
pfDeepBoostedJetPreprocessParams_cfi.lower_bound
lower_bound
Definition: pfDeepBoostedJetPreprocessParams_cfi.py:15
edmNew::dstvdetails::DetSetVectorTrans::Item::operator<
bool operator<(Item const &rh) const
Definition: DetSetVectorNew.h:129
edmNew::DetSetVector::id_type
unsigned int id_type
Definition: DetSetVectorNew.h:160
edm::refhelper::FindTrait< typename edmNew::DetSetVector< T >, T >::value
edmNew::DetSetVector< T >::FindForDetSetVector value
Definition: DetSetVectorNew.h:659
edmNew::DetSetVector::TSFastFiller::reserve
void reserve(size_type s)
Definition: DetSetVectorNew.h:347
edmNew::DetSetVector::FastFiller::checkCapacityExausted
void checkCapacityExausted(size_type s) const
Definition: DetSetVectorNew.h:246
edmNew::DetSetVector::TSFastFiller::abort
void abort()
Definition: DetSetVectorNew.h:345
edmNew::DetSetVector::TSFastFiller::full
bool full() const
Definition: DetSetVectorNew.h:340
edmNew::DetSetVector::TSFastFiller::back
data_type & back()
Definition: DetSetVectorNew.h:362
edmNew::DetSetVector::TSFastFiller::end
DataIter end()
Definition: DetSetVectorNew.h:357
edmNew::DetSetVector::empty
bool empty() const
Definition: DetSetVectorNew.h:550
Exception
edmNew::DetSetVector::push_back
Item & push_back(id_type iid)
Definition: DetSetVectorNew.h:467
thread_safety_macros.h
edmNew::CapacityExaustedException::CapacityExaustedException
CapacityExaustedException()
Definition: DetSetVectorNew.h:36
edmNew::DetSetVector::TSFastFiller::m_lv
std::vector< T > m_lv
Definition: DetSetVectorNew.h:368
edmNew::DetSetVector::TSFastFiller::id_type
DetSetVector< T >::id_type id_type
Definition: DetSetVectorNew.h:304
createfilelist.int
int
Definition: createfilelist.py:10
edm::ContainerMaskTraits< edmNew::DetSetVector< T > >::value_type
T value_type
Definition: DetSetVectorNew.h:706
edmNew::DetSetVector::FastFiller::m_item
DetSetVector< T >::Item & m_item
Definition: DetSetVectorNew.h:294
value
Definition: value.py:1
trackerHitRTTI::vector
Definition: trackerHitRTTI.h:21
edmNew::dstvdetails::DetSetVectorTrans::operator=
DetSetVectorTrans & operator=(const DetSetVectorTrans &)=delete
edmNew::dstvdetails::DetSetVectorTrans::size_type
unsigned int size_type
Definition: DetSetVectorNew.h:56
edmNew::DetSet::begin
iterator begin()
Definition: DetSetNew.h:54
B2GTnPMonitor_cfi.item
item
Definition: B2GTnPMonitor_cfi.py:147
edmNew::DetSetVector::DataContainer
std::vector< data_type > DataContainer
Definition: DetSetVectorNew.h:170
edmNew::DetSetVector::Range
std::pair< const_iterator, const_iterator > Range
Definition: DetSetVectorNew.h:198
edmNew::DetSetVector::swap
void swap(DetSetVector &rh)
Definition: DetSetVectorNew.h:417
edmNew::DetSetVector::const_DataIter
std::vector< data_type >::const_iterator const_DataIter
Definition: DetSetVectorNew.h:175
edmNew::dstvdetails::DetSetVectorTrans::DetSetVectorTrans
DetSetVectorTrans(DetSetVectorTrans &&rh)
Definition: DetSetVectorNew.h:71
edmNew::DetSetVector::m_ids
std::vector< Trans::Item > m_ids
Definition: DetSetVectorNew.h:588
edmNew::DetSetVector::TSFastFiller::push_back
void push_back(data_type &&d)
Definition: DetSetVectorNew.h:360
edmNew::dstvdetails::DetSetVectorTrans::m_filling
std::atomic< bool > m_filling
Definition: DetSetVectorNew.h:87
edmNew::dstvdetails::DetSetVectorTrans::ready
bool ready() const
Definition: DetSetVectorNew.h:133
edmNew::DetSetVector::DetSetVector
DetSetVector(int isubdet=0)
Definition: DetSetVectorNew.h:397
edmNew::DetSetVector::IdIter
IdContainer::iterator IdIter
Definition: DetSetVectorNew.h:171
edmNew::dstvdetails::DetSetVectorTrans::Item::initialize
bool initialize() const
Definition: DetSetVectorNew.h:120
edm::refhelper::FindForNewDetSetVector
Definition: DetSetVectorNew.h:27
edmNew::DetSetVector::FastFiller::FastFiller
FastFiller(DetSetVector< T > &iv, id_type id, bool isaveEmpty=false)
Definition: DetSetVectorNew.h:215
edmNew::DetSetVector::FastFiller::size
size_type size() const
Definition: DetSetVectorNew.h:267
edmNew::DetSet::set
void set(Container const &icont, typename Container::Item const &item, bool update=true)
Definition: DetSetVectorNew.h:637
edmNew::dstvdetails::DetSetVectorTrans::Item::Item
Item(Item &&rh) noexcept
Definition: DetSetVectorNew.h:110
edmNew::DetSetVector
Definition: DetSetNew.h:13
edmNew::dstvdetails::DetSetVectorTrans::Item::uninitialized
bool uninitialized() const
Definition: DetSetVectorNew.h:126
edmNew::DetSetVector::pop_back
void pop_back(id_type iid)
Definition: DetSetVectorNew.h:470
edmNew::DetSetVector::TSFastFiller::m_v
DetSetVector< T > const & m_v
Definition: DetSetVectorNew.h:369
edmNew::dstvdetails::DetSetVectorTrans::id_type
unsigned int id_type
Definition: DetSetVectorNew.h:57
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:270
hgcal::association
std::tuple< layerClusterToCaloParticle, caloParticleToLayerCluster > association
Definition: LayerClusterAssociatorByEnergyScoreImpl.h:44
edmNew::DetSetVector::data
data_type const * data(size_t cell) const
Definition: DetSetVectorNew.h:560
edmNew::DetSetVector::findItem
const_IdIter findItem(id_type i) const
Definition: DetSetVectorNew.h:524
edmNew::DetSet::detId
id_type detId() const
Definition: DetSetNew.h:66
edmNew::dstvdetails::DetSetVectorTrans::Item::Item
Item(Item const &rh) noexcept
Definition: DetSetVectorNew.h:103
fileCollector.cmp
cmp
Definition: fileCollector.py:125
T
long double T
Definition: Basic3DVectorLD.h:48
edm::detail::ElementType< edmNew::DetSetVector< T > >::type
typename edmNew::DetSetVector< T >::data_type type
Definition: DetSetVectorNew.h:720
edmNew::DetSetVector::end
const_iterator end(bool update=false) const
Definition: DetSetVectorNew.h:535
edmNew::DetSetVector::m_data
DataContainer m_data
Definition: DetSetVectorNew.h:589
edmNew::DetSetVector::FindForDetSetVector
Definition: DetSetVectorNew.h:377
amptDefault_cfi.frame
frame
Definition: amptDefault_cfi.py:12
edmNew::DetSetVector::m_subdetId
int m_subdetId
Definition: DetSetVectorNew.h:583
edmNew::DetSetVector::TSFastFiller::resize
void resize(size_type s)
Definition: DetSetVectorNew.h:349
edm::refhelper::FindTrait
Definition: RefTraits.h:41
edmNew::DetSetVector::FastFiller::end
DataIter end()
Definition: DetSetVectorNew.h:272
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:319
DetSetNew.h
edmNew::DetSetVector::FastFiller::id
id_type id() const
Definition: DetSetVectorNew.h:266
edmNew::dstvdetails::DetSetVectorTrans::m_getter
std::shared_ptr< void > m_getter
Definition: DetSetVectorNew.h:88
edmNew::DetSetVector::FastFiller
Definition: DetSetVectorNew.h:202
ztail.d
d
Definition: ztail.py:151
edmNew::DetSetVector::TSFastFiller::dummy
static DetSetVector< T >::Item const & dummy()
Definition: DetSetVectorNew.h:308
cms::Exception
Definition: Exception.h:70
edmNew::DetSetVector::TSFastFiller::id
id_type id() const
Definition: DetSetVectorNew.h:351
edmNew::DetSetVector::IterHelp::m_update
bool m_update
Definition: DetSetVectorNew.h:194
traits.h
edmNew::DetSetVector::operator[]
DetSet operator[](id_type i) const
Definition: DetSetVectorNew.h:509
edmNew::DetSetVector::FastFiller::reserve
void reserve(size_type s)
Definition: DetSetVectorNew.h:251
edmNew::DetSetVector::addItem
Item & addItem(id_type iid, size_type isize)
Definition: DetSetVectorNew.h:483
edmNew::DetSetVector::detsetSize
size_type detsetSize(size_t cell) const
Definition: DetSetVectorNew.h:562
dummy
Definition: DummySelector.h:38
edmNew::DetSetVector::Trans
dstvdetails::DetSetVectorTrans Trans
Definition: DetSetVectorNew.h:157
edmNew::DetSetVector::isValid
bool isValid(id_type i) const
Definition: DetSetVectorNew.h:496
hltrates_dqm_sourceclient-live_cfg.offset
offset
Definition: hltrates_dqm_sourceclient-live_cfg.py:82
CMS_THREAD_GUARD
#define CMS_THREAD_GUARD(_var_)
Definition: thread_safety_macros.h:6
edmNew::DetSetVector::onDemand
bool onDemand() const
Definition: DetSetVectorNew.h:415
edmNew::DetSetVector::data
DataContainer const & data() const
Definition: DetSetVectorNew.h:571
edmNew::DetSetVector::FastFiller::m_saveEmpty
bool m_saveEmpty
Definition: DetSetVectorNew.h:295
edmNew::dstvdetails::DetSetVectorTrans::Item::Item
Item(id_type i=0, int io=-1, size_type is=0)
Definition: DetSetVectorNew.h:101
edmNew::DetSetVector::TSFastFiller::empty
bool empty() const
Definition: DetSetVectorNew.h:353
edmNew::DetSetVector::IterHelp::m_detset
result_type m_detset
Definition: DetSetVectorNew.h:193
edmNew::DetSetVector::IterHelp::operator()
result_type & operator()(Item const &item) const
Definition: DetSetVectorNew.h:186
edmNew::dstvdetails::DetSetVectorTrans::m_dataSize
std::atomic< size_type > m_dataSize
Definition: DetSetVectorNew.h:89
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