DataFormats
Common
interface
DetSet2RangeMap.h
Go to the documentation of this file.
1
#ifndef DataFormats_Common_DetSet2RangeMap_h
2
#define DataFormats_Common_DetSet2RangeMap_h
3
4
#include "
DataFormats/Common/interface/DetSetVectorNew.h
"
5
#include "
DataFormats/Common/interface/RangeMap.h
"
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
{
17
ToRM
(
edm::RangeMap
<
det_id_type
,
edm::OwnVector<B>
>& irm) :
rm
(&irm) {}
18
edm::RangeMap<det_id_type, edm::OwnVector<B>
>*
rm
;
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>
32
void
copy
(
DetSetVector<T>
const
& dstv,
edm::RangeMap
<
det_id_type
,
edm::OwnVector<B>
>&
rm
) {
33
dstvdetails::ToRM<B>
torm(
rm
);
34
std::for_each(dstv.
begin
(), dstv.
end
(), torm);
35
}
36
37
}
// namespace edmNew
38
39
#endif // DataFormats_Common_DetSet2RangeMap_h
edmNew::dstvdetails::ToRM::ToRM
ToRM(edm::RangeMap< det_id_type, edm::OwnVector< B > > &irm)
Definition:
DetSet2RangeMap.h:17
edmNew::dstvdetails::ToRM::operator()
void operator()(edmNew::DetSet< T > const &ds)
Definition:
DetSet2RangeMap.h:20
edmNew::DetSetVector::begin
const_iterator begin(bool update=false) const
Definition:
DetSetVectorNew.h:572
RangeMap.h
edm::RangeMap::put
void put(ID id, CI begin, CI end)
insert an object range with specified identifier
Definition:
RangeMap.h:111
edmNew
Definition:
DetSet2RangeMap.h:11
edmNew::DetSet::end
iterator end()
Definition:
DetSetNew.h:56
edmNew::det_id_type
unsigned int det_id_type
Definition:
DetSetNew.h:10
edmNew::DetSet
Definition:
DetSetNew.h:22
submit.rm
rm
Definition:
submit.py:77
edm::RangeMap
Definition:
RangeMap.h:32
edmNew::DetSet::id
id_type id() const
Definition:
DetSetNew.h:64
edmNew::DetSet::begin
iterator begin()
Definition:
DetSetNew.h:54
edmNew::dstvdetails::ToRM
Definition:
DetSet2RangeMap.h:16
edmNew::dstvdetails::ToRM::rm
edm::RangeMap< det_id_type, edm::OwnVector< B > > * rm
Definition:
DetSet2RangeMap.h:18
edmNew::copy
void copy(DetSetVector< T > const &dstv, edm::RangeMap< det_id_type, edm::OwnVector< B > > &rm)
Definition:
DetSet2RangeMap.h:32
edmNew::DetSetVector
Definition:
DetSetNew.h:13
edmNew::DetSetVector::end
const_iterator end(bool update=false) const
Definition:
DetSetVectorNew.h:577
DetSetVectorNew.h
edmNew::DetSet::empty
bool empty() const
Definition:
DetSetNew.h:70
edm::OwnVector< B >
Generated for CMSSW Reference Manual by
1.8.16