CMS 3D CMS Logo

DetSet2RangeMap.h
Go to the documentation of this file.
1 #ifndef DataFormats_Common_DetSet2RangeMap_h
2 #define DataFormats_Common_DetSet2RangeMap_h
3 
6 // #include "DataFormats/Common/interface/DetSetAlgorithm.h"
7 
8 #include <algorithm>
9 
10 //FIXME remove New when ready
11 namespace edmNew {
12 
13  namespace dstvdetails {
14  // copy from DS to RM
15  template <typename B>
16  struct ToRM {
19  template <typename T>
20  void operator()(edmNew::DetSet<T> const& ds) {
21  // make it easy
22  // std::vector<T const *> v(ds.size());
23  //std::transform(ds.begin(),ds.end(),v.begin(),dstvdetails::Pointer());
24  if (!ds.empty())
25  rm->put(ds.id(), ds.begin(), ds.end());
26  }
27  };
28  } // namespace dstvdetails
29 
30  // copy from DSTV to RangeMap
31  template <typename T, typename B>
34  std::for_each(dstv.begin(), dstv.end(), torm);
35  }
36 
37 } // namespace edmNew
38 
39 #endif // DataFormats_Common_DetSet2RangeMap_h
def rm(path, rec=False)
Definition: eostools.py:363
id_type id() const
Definition: DetSetNew.h:61
unsigned int det_id_type
Definition: DetSetNew.h:10
bool empty() const
Definition: DetSetNew.h:67
const_iterator end(bool update=false) const
void copy(DetSetVector< T > const &dstv, edm::RangeMap< det_id_type, edm::OwnVector< B > > &rm)
void operator()(edmNew::DetSet< T > const &ds)
void put(ID id, CI begin, CI end)
insert an object range with specified identifier
Definition: RangeMap.h:111
edm::RangeMap< det_id_type, edm::OwnVector< B > > * rm
const_iterator begin(bool update=false) const
ToRM(edm::RangeMap< det_id_type, edm::OwnVector< B > > &irm)
iterator end()
Definition: DetSetNew.h:53
iterator begin()
Definition: DetSetNew.h:51