Main Page
Namespaces
Classes
Package Documentation
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Properties
Friends
Macros
Pages
CommonTools
UtilAlgos
interface
ObjectPairCollectionSelector.h
Go to the documentation of this file.
1
#ifndef RecoAlgos_ObjectPairCollectionSelector_h
2
#define RecoAlgos_ObjectPairCollectionSelector_h
3
16
#include "
FWCore/Framework/interface/ConsumesCollector.h
"
17
#include "
FWCore/ParameterSet/interface/ParameterSet.h
"
18
#include "
CommonTools/UtilAlgos/interface/SelectionAdderTrait.h
"
19
#include "
CommonTools/UtilAlgos/interface/ParameterAdapter.h
"
20
#include <vector>
21
22
namespace
edm {
class
Event
; }
23
24
template
<
typename
InputCollection
,
typename
Selector
,
25
typename
StoreContainer = std::vector<const typename InputCollection::value_type *>,
26
typename
RefAdder =
typename
helper::SelectionAdderTrait<InputCollection, StoreContainer>::type
>
27
class
ObjectPairCollectionSelector
{
28
public
:
29
typedef
InputCollection
collection
;
30
31
private
:
32
typedef
const
typename
InputCollection::value_type
*
reference
;
33
typedef
StoreContainer
container
;
34
typedef
typename
container::const_iterator
const_iterator
;
35
36
public
:
37
ObjectPairCollectionSelector
(
const
edm::ParameterSet
&
cfg
,
edm::ConsumesCollector
&& iC) :
38
select_
(
reco
::
modules
::
make
<
Selector
>(cfg)) { }
39
const_iterator
begin
()
const
{
return
selected_
.begin(); }
40
const_iterator
end
()
const
{
return
selected_
.end(); }
41
void
select
(
const
edm::Handle<InputCollection>
&
c
,
const
edm::Event
&,
const
edm::EventSetup
&) {
42
unsigned
int
s
= c->size();
43
std::vector<bool>
v
(s,
false
);
44
for
(
unsigned
int
i
= 0;
i
<
s
; ++
i
)
45
for
(
unsigned
int
j
=
i
+ 1;
j
<
s
; ++
j
) {
46
if
(
select_
((*c)[
i
], (*c)[
j
]))
47
v[
i
] = v[
j
] =
true
;
48
}
49
selected_
.clear();
50
for
(
unsigned
int
i
= 0;
i
<
s
; ++
i
)
51
if
(v[
i
])
52
addRef_
(
selected_
, c, i);
53
}
54
55
private
:
56
Selector
select_
;
57
StoreContainer
selected_
;
58
RefAdder
addRef_
;
59
};
60
61
#endif
62
ObjectPairCollectionSelector::selected_
StoreContainer selected_
Definition:
ObjectPairCollectionSelector.h:57
ObjectPairCollectionSelector
Definition:
ObjectPairCollectionSelector.h:27
i
int i
Definition:
DBlmapReader.cc:9
SelectionAdderTrait.h
looper.cfg
tuple cfg
Definition:
looper.py:293
edmConvertToStreamModule.modules
list modules
Definition:
edmConvertToStreamModule.py:120
ObjectPairCollectionSelector::container
StoreContainer container
Definition:
ObjectPairCollectionSelector.h:33
edm::Handle
Definition:
AssociativeIterator.h:47
reco::modules::make
S make(const edm::ParameterSet &cfg)
Definition:
ParameterAdapter.h:24
findQualityFiles.v
v
Definition:
findQualityFiles.py:177
dt_dqm_sourceclient_common_cff.reco
tuple reco
Definition:
dt_dqm_sourceclient_common_cff.py:107
ObjectPairCollectionSelector::select_
Selector select_
Definition:
ObjectPairCollectionSelector.h:56
EnergyCorrector.c
tuple c
Definition:
EnergyCorrector.py:43
ObjectPairCollectionSelector::reference
const InputCollection::value_type * reference
Definition:
ObjectPairCollectionSelector.h:32
Event
Definition:
Event.h:16
ParameterSet.h
HLT_Fake1_cff.InputCollection
tuple InputCollection
Definition:
HLT_Fake1_cff.py:68
reco::JetExtendedAssociation::value_type
Container::value_type value_type
Definition:
JetExtendedAssociation.h:30
ObjectPairCollectionSelector::end
const_iterator end() const
Definition:
ObjectPairCollectionSelector.h:40
j
int j
Definition:
DBlmapReader.cc:9
edm::EventSetup
Definition:
EventSetup.h:45
Selector
Functor that operates on <T>
Definition:
Selector.h:24
ObjectPairCollectionSelector::addRef_
RefAdder addRef_
Definition:
ObjectPairCollectionSelector.h:58
ObjectPairCollectionSelector::collection
InputCollection collection
Definition:
ObjectPairCollectionSelector.h:29
alignCSCRings.s
list s
Definition:
alignCSCRings.py:91
helper::SelectionAdderTrait
Definition:
SelectionAdderTrait.h:81
ParameterAdapter.h
edm::ParameterSet
Definition:
ParameterSet.h:36
edm::Event
Definition:
Event.h:65
ConsumesCollector.h
ObjectPairCollectionSelector::begin
const_iterator begin() const
Definition:
ObjectPairCollectionSelector.h:39
ObjectPairCollectionSelector::select
void select(const edm::Handle< InputCollection > &c, const edm::Event &, const edm::EventSetup &)
Definition:
ObjectPairCollectionSelector.h:41
ObjectPairCollectionSelector::ObjectPairCollectionSelector
ObjectPairCollectionSelector(const edm::ParameterSet &cfg, edm::ConsumesCollector &&iC)
Definition:
ObjectPairCollectionSelector.h:37
edm::ConsumesCollector
Definition:
ConsumesCollector.h:39
ObjectPairCollectionSelector::const_iterator
container::const_iterator const_iterator
Definition:
ObjectPairCollectionSelector.h:34
Generated for CMSSW Reference Manual by
1.8.5