CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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()) rm->put(ds.id(), ds.begin(), ds.end());
25  }
26  };
27  }
28 
29  // copy from DSTV to RangeMap
30  template<typename T, typename B>
31  void copy(DetSetVector<T> const& dstv,
34  std::for_each(dstv.begin(), dstv.end(), torm);
35  }
36 
37 }
38 
39 #endif // DataFormats_Common_DetSet2RangeMap_h
unsigned int det_id_type
Definition: DetSetNew.h:10
void copy(DetSetVector< T > const &dstv, edm::RangeMap< det_id_type, edm::OwnVector< B > > &rm)
string rm
Definition: submit.py:76
bool empty() const
Definition: DetSetNew.h:89
void operator()(edmNew::DetSet< T > const &ds)
edm::RangeMap< det_id_type, edm::OwnVector< B > > * rm
ToRM(edm::RangeMap< det_id_type, edm::OwnVector< B > > &irm)
const_iterator end(bool update=true) const
iterator end()
Definition: DetSetNew.h:70
id_type id() const
Definition: DetSetNew.h:80
const_iterator begin(bool update=true) const
iterator begin()
Definition: DetSetNew.h:67