CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
DetSetVectorNew.h
Go to the documentation of this file.
1 #ifndef DataFormats_Common_DetSetVectorNew_h
2 #define DataFormats_Common_DetSetVectorNew_h
3 
7 
8 
9 #include <boost/iterator_adaptors.hpp>
10 #include <boost/iterator/transform_iterator.hpp>
11 #include <boost/iterator/counting_iterator.hpp>
12 #include <boost/any.hpp>
13 #include <memory>
16 
17 #if !defined(__ROOTCLING__)
18 #define DSVN_USE_ATOMIC
19 // #warning using atomic
20 #endif
21 
22 #include <atomic>
23 #include <thread>
24 #include <memory>
25 
26 #include<vector>
27 #include <cassert>
28 
29 class TestDetSet;
30 
31 namespace edm { namespace refhelper { template<typename T> struct FindForNewDetSetVector; } }
32 
33 //FIXME remove New when ready
34 namespace edmNew {
35  typedef uint32_t det_id_type;
36 
37  struct CapacityExaustedException : public cms::Exception { CapacityExaustedException(): cms::Exception("Capacity exausted in DetSetVectorNew"){} };
38 
39  namespace dslv {
40  template< typename T> class LazyGetter;
41 
42  }
43 
44  /* transient component of DetSetVector
45  * for pure conviniency of dictionary declaration
46  */
47  namespace dstvdetails {
48 
49  void errorFilling();
50  void notSafe();
51  void errorIdExists(det_id_type iid);
52  void throw_range(det_id_type iid);
53 
57  DetSetVectorTrans(const DetSetVectorTrans&) = delete;
60  mutable std::atomic<bool> m_filling;
62 
63 
64  void swap(DetSetVectorTrans& rh) {
65  // better no one is filling...
66  assert(m_filling==false); assert(rh.m_filling==false);
67  // std::swap(m_filling,rh.m_filling);
69  }
70 
71  typedef unsigned int size_type; // for persistency
72  typedef unsigned int id_type;
73 
74  struct Item {
75 
76  Item(id_type i=0, int io=-1, size_type is=0) : id(i), offset(io), size(is){}
77 
78  Item(Item const & rh) noexcept :
79  id(rh.id),offset(int(rh.offset)),size(rh.size) {
80  }
81  Item & operator=(Item const & rh) noexcept {
82  id=rh.id;offset=int(rh.offset);size=rh.size; return *this;
83  }
84  Item(Item&& rh) noexcept :
85  id(std::move(rh.id)),offset(int(rh.offset)),size(std::move(rh.size)) {
86  }
88  id=std::move(rh.id);offset=int(rh.offset);size=std::move(rh.size); return *this;
89  }
90 
92 #ifdef DSVN_USE_ATOMIC
93  mutable std::atomic<int> offset;
94  bool initialize() const {
95  int expected = -1;
96  return offset.compare_exchange_strong(expected,-2);
97  }
98 #else
99  mutable int offset;
100 #endif
101  CMS_THREAD_GUARD("offset") mutable size_type size;
102 
103  bool uninitialized() const { return (-1)==offset;}
104  bool initializing() const { return (-2)==offset;}
105  bool isValid() const { return offset>=0;}
106  bool operator<(Item const &rh) const { return id<rh.id;}
107  operator id_type() const { return id;}
108  };
109 
110 #ifdef DSVN_USE_ATOMIC
111  bool ready() const {
112  bool expected=false;
113  if (!m_filling.compare_exchange_strong(expected,true)) errorFilling();
114  return true;
115  }
116 #else
117  bool ready() const {return true;}
118 #endif
119 
120  };
121 
123  }
124 
135  template<typename T>
136  class DetSetVector : private dstvdetails::DetSetVectorTrans {
137  public:
139  typedef Trans::Item Item;
140  typedef unsigned int size_type; // for persistency
141  typedef unsigned int id_type;
142  typedef T data_type;
146  // FIXME not sure make sense....
148  typedef id_type key_type;
149 
150 
151  typedef std::vector<Item> IdContainer;
152  typedef std::vector<data_type> DataContainer;
153  typedef typename IdContainer::iterator IdIter;
154  typedef typename std::vector<data_type>::iterator DataIter;
155  typedef std::pair<IdIter,DataIter> IterPair;
156  typedef typename IdContainer::const_iterator const_IdIter;
157  typedef typename std::vector<data_type>::const_iterator const_DataIter;
158  typedef std::pair<const_IdIter,const_DataIter> const_IterPair;
159 
161 
162  struct IterHelp {
164  // IterHelp() : v(0),update(true){}
166  IterHelp(DetSetVector<T> const & iv, bool iup) : m_v(&iv), m_update(iup){}
167 
168  result_type & operator()(Item const& item) const {
169  m_detset.set(*m_v,item,m_update);
170  return m_detset;
171  }
172  private:
175  bool m_update;
176  };
177 
178  typedef boost::transform_iterator<IterHelp,const_IdIter> const_iterator;
179  typedef std::pair<const_iterator,const_iterator> Range;
180 
181  /* fill the lastest inserted DetSet
182  */
183  class FastFiller {
184  public:
189 
190  // here just to make the compiler happy
192  assert(false);
193  static DetSetVector<T>::Item d; return d;
194  }
195  FastFiller(DetSetVector<T> & iv, id_type id, bool isaveEmpty=false) :
196  m_v(iv), m_item(m_v.ready()? m_v.push_back(id): dummy()),m_saveEmpty(isaveEmpty) {
197  if (m_v.onDemand()) dstvdetails::notSafe();
198  }
199 
200  FastFiller(DetSetVector<T> & iv, typename DetSetVector<T>::Item & it, bool isaveEmpty=false) :
201  m_v(iv), m_item(it), m_saveEmpty(isaveEmpty) {
202  if (m_v.onDemand()) dstvdetails::notSafe();
203  if(m_v.ready()) m_item.offset = int(m_v.m_data.size());
204 
205  }
207  if (!m_saveEmpty && m_item.size==0) {
208  m_v.pop_back(m_item.id);
209  }
210  assert(m_v.m_filling==true);
211  m_v.m_filling=false;
212 
213  }
214 
215 
216  void abort() {
217  m_v.pop_back(m_item.id);
218  m_saveEmpty=true; // avoid mess in destructor
219  }
220 
221  void checkCapacityExausted() const {
222  if (m_v.onDemand() && m_v.m_data.size()==m_v.m_data.capacity()) dstvdetails::throwCapacityExausted();
223  }
224 
226  if (m_v.onDemand() && m_v.m_data.size()+s>m_v.m_data.capacity()) dstvdetails::throwCapacityExausted();
227  }
228 
229 
231  if (m_item.offset+s <= m_v.m_data.capacity()) return;
232  if (m_v.onDemand()) dstvdetails::throwCapacityExausted();
233  m_v.m_data.reserve(m_item.offset+s);
234  }
235 
236 
239  m_v.m_data.resize(m_item.offset+s);
240  m_item.size=s;
241  }
242 
243  id_type id() const { return m_item.id;}
244  size_type size() const { return m_item.size;}
245  bool empty() const { return m_item.size==0;}
246 
248  return m_v.m_data[m_item.offset+i];
249  }
250  DataIter begin() { return m_v.m_data.begin()+ m_item.offset;}
251  DataIter end() { return begin()+size();}
252 
253  void push_back(data_type const & d) {
255  m_v.m_data.push_back(d);
256  m_item.size++;
257  }
258  void push_back(data_type && d) {
260  m_v.m_data.push_back(std::move(d));
261  m_item.size++;
262  }
263 
264  data_type & back() { return m_v.m_data.back();}
265 
266  private:
267  //for testing
268  friend class ::TestDetSet;
269 
273  };
274 
275  /* fill on demand a given DetSet
276  */
277  class TSFastFiller {
278  public:
283 
284 #ifdef DSVN_USE_ATOMIC
285  // here just to make the compiler happy
286  static DetSetVector<T>::Item const& dummy() {
287  assert(false);
288  static DetSetVector<T>::Item const d; return d;
289  }
290  // this constructor is not supposed to be used in Concurrent mode
292  m_v(iv), m_item(m_v.ready()? iv.push_back(id): dummy()) { assert(m_v.m_filling==true); m_v.m_filling = false;}
293 
294  TSFastFiller(DetSetVector<T> const& iv, typename DetSetVector<T>::Item const& it) :
295  m_v(iv), m_item(it) {
296 
297  }
299  bool expected=false;
300  while (!m_v.m_filling.compare_exchange_weak(expected,true)) { expected=false; nanosleep(0,0);}
301  int offset = m_v.m_data.size();
302  if (m_v.onDemand() && m_v.m_data.capacity()<offset+m_lv.size()) {
303  m_v.m_filling = false;
305  }
306  std::move(m_lv.begin(), m_lv.end(), std::back_inserter(m_v.m_data));
307  m_item.size=m_lv.size();
308  m_item.offset = offset;
309 
310  assert(m_v.m_filling==true);
311  m_v.m_filling = false;
312  }
313 
314 #endif
315 
316  void abort() {
317  m_lv.clear();
318  }
319 
321  m_lv.reserve(s);
322  }
323 
325  m_lv.resize(s);
326  }
327 
328  id_type id() const { return m_item.id;}
329  size_type size() const { return m_lv.size();}
330  bool empty() const { return m_lv.empty();}
331 
333  return m_lv[i];
334  }
335  DataIter begin() { return m_lv.begin();}
336  DataIter end() { return m_lv.end();}
337 
338  void push_back(data_type const & d) {
339  m_lv.push_back(d);
340  }
341  void push_back(data_type && d) {
342  m_lv.push_back(std::move(d));
343  }
344 
345  data_type & back() { return m_lv.back();}
346 
347  private:
348  //for testing
349  friend class ::TestDetSet;
350 
351  std::vector<T> m_lv;
353  typename DetSetVector<T>::Item const& m_item;
354  };
355 
356 
357 
358  friend class FastFiller;
359  friend class TSFastFiller;
360  friend class edmNew::DetSet<T>;
361 
362  class FindForDetSetVector : public std::binary_function<const edmNew::DetSetVector<T>&, unsigned int, const T*> {
363  public:
364  typedef FindForDetSetVector self;
365  typename self::result_type operator()(typename self::first_argument_type iContainer, typename self::second_argument_type iIndex)
366 #ifdef DSVN_USE_ATOMIC
367  {
368  bool expected=false;
369  while (!iContainer.m_filling.compare_exchange_weak(expected,true,std::memory_order_acq_rel)) { expected=false; nanosleep(0,0);}
370  typename self::result_type item = &(iContainer.m_data[iIndex]);
371  assert(iContainer.m_filling==true);
372  iContainer.m_filling = false;
373  return item;
374  }
375 #else
376  ;
377 #endif
378  };
379  friend class FindForDetSetVector;
380 
381  explicit DetSetVector(int isubdet=0) :
382  m_subdetId(isubdet) {}
383 
384  DetSetVector(std::shared_ptr<dslv::LazyGetter<T> > iGetter, const std::vector<det_id_type>& iDets,
385  int isubdet=0);
386 
387 
389  // delete content if T is pointer...
390  }
391 
392  // default or delete is the same...
393  DetSetVector& operator=(const DetSetVector&) = delete;
394  DetSetVector(const DetSetVector&) = delete;
395  DetSetVector(DetSetVector&&) = default;
396  DetSetVector& operator=(DetSetVector&&) = default;
397 
398  bool onDemand() const { return !m_getter.empty();}
399 
400 
401 
402  void swap(DetSetVector & rh) {
404  std::swap(m_subdetId,rh.m_subdetId);
405  std::swap(m_ids,rh.m_ids);
406  std::swap(m_data,rh.m_data);
407  }
408 
409  void swap(IdContainer & iic, DataContainer & idc) {
410  std::swap(m_ids,iic);
411  std::swap(m_data,idc);
412  }
413 
414  void reserve(size_t isize, size_t dsize) {
415  m_ids.reserve(isize);
416  m_data.reserve(dsize);
417  }
418 
419  void shrink_to_fit() {
420  clean();
421  m_ids.shrink_to_fit();
422  m_data.shrink_to_fit();
423  }
424 
425  void resize(size_t isize, size_t dsize) {
426  m_ids.resize(isize);
427  m_data.resize(dsize);
428  }
429 
430  void clean() {
431  m_ids.erase(std::remove_if(m_ids.begin(),m_ids.end(),[](Item const& m){ return 0==m.size;}),m_ids.end());
432  }
433 
434  // FIXME not sure what the best way to add one cell to cont
435  DetSet insert(id_type iid, data_type const * idata, size_type isize) {
436  Item & item = addItem(iid,isize);
437  m_data.resize(m_data.size()+isize);
438  std::copy(idata,idata+isize,m_data.begin()+item.offset);
439  return DetSet(*this,item,false);
440  }
441  //make space for it
443  Item & item = addItem(iid,isize);
444  m_data.resize(m_data.size()+isize);
445  return DetSet(*this,item,false);
446  }
447 
448  // to be used with a FastFiller
450  return addItem(iid,0);
451  }
452 
453  // remove last entry (usually only if empty...)
454  void pop_back(id_type iid) {
455  const_IdIter p = findItem(iid);
456  if (p==m_ids.end()) return; //bha!
457  // sanity checks... (shall we throw or assert?)
458  if ( (*p).isValid() && (*p).size>0 &&
459  m_data.size()==(*p).offset+(*p).size)
460  m_data.resize((*p).offset);
461  m_ids.erase(m_ids.begin()+(p-m_ids.begin()));
462  }
463 
464  private:
465 
466  Item & addItem(id_type iid, size_type isize) {
467  Item it(iid,size_type(m_data.size()),isize);
468  IdIter p = std::lower_bound(m_ids.begin(),
469  m_ids.end(),
470  it);
471  if (p!=m_ids.end() && !(it<*p)) dstvdetails::errorIdExists(iid);
472  return *m_ids.insert(p,std::move(it));
473  }
474 
475 
476 
477  public:
478 
479 
480  //---------------------------------------------------------
481 
482  bool exists(id_type i) const {
483  return findItem(i)!=m_ids.end();
484  }
485 
486  bool isValid(id_type i) const {
487  const_IdIter p = findItem(i);
488  return p!=m_ids.end() && (*p).isValid();
489  }
490 
491  /*
492  DetSet operator[](id_type i) {
493  const_IdIter p = findItem(i);
494  if (p==m_ids.end()) what???
495  return DetSet(*this,p-m_ids.begin());
496  }
497  */
498 
499 
501  const_IdIter p = findItem(i);
502  if (p==m_ids.end()) dstvdetails::throw_range(i);
503  return DetSet(*this,*p,true);
504  }
505 
506  // slow interface
507  // const_iterator find(id_type i, bool update=true) const {
508  const_iterator find(id_type i, bool update=false) const {
509  const_IdIter p = findItem(i);
510  return (p==m_ids.end()) ? end() :
511  boost::make_transform_iterator(p,
512  IterHelp(*this,update));
513  }
514 
515  // slow interface
517  std::pair<const_IdIter,const_IdIter> p =
518  std::equal_range(m_ids.begin(),m_ids.end(),Item(i));
519  return (p.first!=p.second) ? p.first : m_ids.end();
520  }
521 
522  // const_iterator begin(bool update=true) const {
523  const_iterator begin(bool update=false) const {
524  return boost::make_transform_iterator(m_ids.begin(),
525  IterHelp(*this,update));
526  }
527 
528  // const_iterator end(bool update=true) const {
529  const_iterator end(bool update=false) const {
530  return boost::make_transform_iterator(m_ids.end(),
531  IterHelp(*this,update));
532  }
533 
534 
535  // return an iterator range (implemented here to avoid dereference of detset)
536  template<typename CMP>
537  // Range equal_range(id_type i, CMP cmp, bool update=true) const {
538  Range equal_range(id_type i, CMP cmp, bool update=false) const {
539  std::pair<const_IdIter,const_IdIter> p =
540  std::equal_range(m_ids.begin(),m_ids.end(),i,cmp);
541  return Range(boost::make_transform_iterator(p.first,IterHelp(*this,update)),
542  boost::make_transform_iterator(p.second,IterHelp(*this,update))
543  );
544  }
545 
546  int subdetId() const { return m_subdetId; }
547 
548  bool empty() const { return m_ids.empty();}
549 
550 
551  size_type dataSize() const { return m_data.size(); }
552 
553  size_type size() const { return m_ids.size();}
554 
555  //FIXME fast interfaces, not consistent with associative nature of container....
556 
557  data_type operator()(size_t cell, size_t frame) const {
558  return m_data[m_ids[cell].offset+frame];
559  }
560 
561  data_type const * data(size_t cell) const {
562  return &m_data[m_ids[cell].offset];
563  }
564 
565  size_type detsetSize(size_t cell) const { return m_ids[cell].size; }
566 
567  id_type id(size_t cell) const {
568  return m_ids[cell].id;
569  }
570 
571  Item const & item(size_t cell) const {
572  return m_ids[cell];
573  }
574 
575  //------------------------------
576 
577  IdContainer const & ids() const { return m_ids;}
578  DataContainer const & data() const { return m_data;}
579 
580 
581  //Used by ROOT storage
583 
584  private:
585  //for testing
586  friend class ::TestDetSet;
587 
588  void update(Item const & item) const;
589 
590  // subdetector id (as returned by DetId::subdetId())
592 
593  // Workaround for ROOT 6 bug.
594  // ROOT6 has a problem with this IdContainer typedef
595  //IdContainer m_ids;
596  std::vector<Trans::Item> m_ids;
598 
599  };
600 
601  namespace dslv {
602  template< typename T>
603  class LazyGetter {
604  public:
605  virtual ~LazyGetter() {}
606  virtual void fill(typename DetSetVector<T>::TSFastFiller&) = 0;
607  };
608  }
609 
610 
611  template<typename T>
612  inline DetSetVector<T>::DetSetVector(std::shared_ptr<Getter> iGetter,
613  const std::vector<det_id_type>& iDets,
614  int isubdet):
615  m_subdetId(isubdet) {
616  m_getter=iGetter;
617 
618  m_ids.reserve(iDets.size());
619  det_id_type sanityCheck = 0;
620  for(std::vector<det_id_type>::const_iterator itDetId = iDets.begin(), itDetIdEnd = iDets.end();
621  itDetId != itDetIdEnd;
622  ++itDetId) {
623  assert(sanityCheck < *itDetId && "vector of det_id_type was not ordered");
624  sanityCheck = *itDetId;
625  m_ids.push_back(*itDetId);
626  }
627  }
628 
629 #ifdef DSVN_USE_ATOMIC
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.empty()) { assert(item.isValid()); return;}
634  if (item.initialize() ){
635  assert(item.initializing());
636  {
637  TSFastFiller ff(*this,item);
638  (*boost::any_cast<std::shared_ptr<Getter> >(&m_getter))->fill(ff);
639  }
640  assert(item.isValid());
641  }
642  }
643 #endif
644 
645 
646 #ifdef DSVN_USE_ATOMIC
647  template<typename T>
648  inline void DetSet<T>::set(DetSetVector<T> const & icont,
649  typename Container::Item const & item, bool update) {
650  // if an item is being updated we wait
651  if (update) icont.update(item);
652  while(item.initializing()) nanosleep(0,0);
653  m_data=&icont.data();
654  m_id=item.id;
655  m_offset = item.offset;
656  m_size=item.size;
657  }
658 #endif
659 }
660 
662 #include <boost/mpl/assert.hpp>
663 #include <boost/type_traits/is_same.hpp>
664 
665 //specialize behavior of edm::Ref to get access to the 'Det'
666 namespace edm {
667  /* Reference to an item inside a new DetSetVector ... */
668  namespace refhelper {
669  template<typename T>
670  struct FindTrait<typename edmNew::DetSetVector<T>,T> {
672  };
673  }
674  /* ... as there was one for the original DetSetVector*/
675 
676  /* Probably this one is not that useful .... */
677  namespace refhelper {
678  template<typename T>
679  struct FindSetForNewDetSetVector : public std::binary_function<const edmNew::DetSetVector<T>&, unsigned int, edmNew::DetSet<T> > {
681  typename self::result_type operator()(typename self::first_argument_type iContainer, typename self::second_argument_type iIndex) {
682  return &(iContainer[iIndex]);
683  }
684  };
685 
686  template<typename T>
687  struct FindTrait<edmNew::DetSetVector<T>, edmNew::DetSet<T> > {
689  };
690  }
691  /* ... implementation is provided, just in case it's needed */
692 }
693 
694 namespace edmNew {
695  //helper function to make it easier to create a edm::Ref to a new DSV
696  template<class HandleT>
697  // inline
699  makeRefTo(const HandleT& iHandle,
700  typename HandleT::element_type::value_type::const_iterator itIter) {
701  BOOST_MPL_ASSERT((boost::is_same<typename HandleT::element_type, DetSetVector<typename HandleT::element_type::value_type::value_type> >));
702  auto index = itIter - &iHandle->data().front();
703  return edm::Ref<typename HandleT::element_type,
705  (iHandle.id(), &(*itIter), index);
706  }
707 }
708 
709 
710 
712 
713 namespace edm {
714  template<typename T>
715  class ContainerMaskTraits<edmNew::DetSetVector<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 }
725 
726 #ifdef DSVN_USE_ATOMIC
727 #undef DSVN_USE_ATOMIC
728 #endif
729 
730 #endif
731 
void swap(ora::Record &rh, ora::Record &lh)
Definition: Record.h:70
bool isValid(id_type i) const
DataContainer const & data() const
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)
int i
Definition: DBlmapReader.cc:9
void swap(DetSetVectorTrans &rh)
void push_back(data_type const &d)
void update(Item const &item) const
boost::transform_iterator< IterHelp, const_IdIter > const_iterator
const_iterator end(bool update=false) const
static DetSetVector< T >::Item & dummy()
size_type dataSize() const
string fill
Definition: lumiContext.py:319
DetSetVector< T >::id_type id_type
Range equal_range(id_type i, CMP cmp, bool update=false) const
std::vector< data_type > DataContainer
Item & push_back(id_type iid)
const_IdIter findItem(id_type i) const
std::vector< Trans::Item > m_ids
bool any(const std::vector< T > &v, const T &what)
Definition: ECalSD.cc:34
IdContainer::iterator IdIter
unsigned int det_id_type
Definition: DetSetNew.h:10
void checkCapacityExausted(size_type s) const
void set(Container const &icont, typename Container::Item const &item, bool update=true)
assert(m_qm.get())
edmNew::DetSetVector< T >::FindForDetSetVector value
#define noexcept
std::vector< data_type >::const_iterator const_DataIter
void swap(DetSetVector &rh)
void throw_range(det_id_type iid)
std::pair< const_IdIter, const_DataIter > const_IterPair
DetSetVector(int isubdet=0)
std::pair< const_iterator, const_iterator > Range
TSFastFiller(DetSetVector< T > const &iv, typename DetSetVector< T >::Item const &it)
void pop_back(id_type iid)
#define CMS_CLASS_VERSION(_version_)
Definition: classes.h:31
friend class TSFastFiller
id_type id(size_t cell) const
DetSetVectorTrans & operator=(const DetSetVectorTrans &)=delete
DetSetVector< T > const & m_v
DetSetVector< T > const * m_v
dstvdetails::DetSetVectorTrans Trans
self::result_type operator()(typename self::first_argument_type iContainer, typename self::second_argument_type iIndex)
tuple d
Definition: ztail.py:151
Item const & item(size_t cell) const
bool onDemand() const
IterHelp(DetSetVector< T > const &iv, bool iup)
Item & addItem(id_type iid, size_type isize)
DetSetVector & operator=(const DetSetVector &)=delete
DetSetVector< T >::data_type value_type
static DetSetVector< T >::Item const & dummy()
void swap(edm::DataFrameContainer &lhs, edm::DataFrameContainer &rhs)
DetSetVector< T >::Item & m_item
bool exists(id_type i) const
void push_back(data_type const &d)
IdContainer const & ids() const
def move
Definition: eostools.py:510
data_type const * data(size_t cell) const
FastFiller(DetSetVector< T > &iv, id_type id, bool isaveEmpty=false)
#define CMS_THREAD_GUARD(_var_)
DetSetVector< T >::size_type size_type
Item(id_type i=0, int io=-1, size_type is=0)
DetSetVector< T >::Item const & m_item
void swap(IdContainer &iic, DataContainer &idc)
DetSetVector< T >::id_type key_type
static size_t size(const edmNew::DetSetVector< T > *iContainer)
void resize(size_t isize, size_t dsize)
TSFastFiller(DetSetVector< T > &iv, id_type id)
size_type detsetSize(size_t cell) const
DetSet insert(id_type iid, data_type const *idata, size_type isize)
m_id("(unknown)")
std::vector< Item > IdContainer
friend class FindForDetSetVector
dslv::LazyGetter< T > Getter
DetSetVector< T >::id_type key_type
void errorIdExists(det_id_type iid)
void reserve(size_t isize, size_t dsize)
data_type & operator[](size_type i)
std::vector< data_type >::iterator DataIter
string const
Definition: compareJSON.py:14
result_type & operator()(Item const &item) const
const_iterator find(id_type i, bool update=false) const
DetSet insert(id_type iid, size_type isize)
size_type size() const
#define update(a, b)
std::pair< IdIter, DataIter > IterPair
IdContainer::const_iterator const_IdIter
data_type operator()(size_t cell, size_t frame) const
self::result_type operator()(typename self::first_argument_type iContainer, typename self::second_argument_type iIndex)
edmNew::DetSet< T > DetSet
volatile std::atomic< bool > shutdown_flag false
FastFiller(DetSetVector< T > &iv, typename DetSetVector< T >::Item &it, bool isaveEmpty=false)
data_type & operator[](size_type i)
edm::refhelper::FindForNewDetSetVector< data_type > RefFinder
long double T
DetSetVector< T >::size_type size_type
DetSetVector< T >::id_type id_type
DetSet operator[](id_type i) const
DetSetVector< T >::data_type value_type
const_iterator begin(bool update=false) const