Main Page
Namespaces
Classes
Package Documentation
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
SelectionAdderTrait.h
mps_fire.i
i
Definition:
mps_fire.py:156
ObjectPairCollectionSelector::container
StoreContainer container
Definition:
ObjectPairCollectionSelector.h:33
alignCSCRings.s
s
Definition:
alignCSCRings.py:91
EnergyCorrector.c
c
Definition:
EnergyCorrector.py:43
edm::Handle
Definition:
AssociativeIterator.h:47
reco::modules::make
S make(const edm::ParameterSet &cfg)
Definition:
ParameterAdapter.h:24
HiRegionalRecoMuon_cff.InputCollection
InputCollection
Definition:
HiRegionalRecoMuon_cff.py:20
findQualityFiles.v
v
Definition:
findQualityFiles.py:177
ObjectPairCollectionSelector::select_
Selector select_
Definition:
ObjectPairCollectionSelector.h:56
ObjectPairCollectionSelector::reference
const InputCollection::value_type * reference
Definition:
ObjectPairCollectionSelector.h:32
ParameterSet.h
reco::JetExtendedAssociation::value_type
Container::value_type value_type
Definition:
JetExtendedAssociation.h:30
ObjectPairCollectionSelector::end
const_iterator end() const
Definition:
ObjectPairCollectionSelector.h:40
ALCARECOPromptCalibProdSiPixelAli0T_cff.Selector
Selector
Definition:
ALCARECOPromptCalibProdSiPixelAli0T_cff.py:81
edm::EventSetup
Definition:
EventSetup.h:45
Selector
Functor that operates on <T>
Definition:
Selector.h:24
looper.cfg
cfg
Definition:
looper.py:293
ObjectPairCollectionSelector::addRef_
RefAdder addRef_
Definition:
ObjectPairCollectionSelector.h:58
ObjectPairCollectionSelector::collection
InputCollection collection
Definition:
ObjectPairCollectionSelector.h:29
Event
reco
fixed size matrix
Definition:
AlignmentAlgorithmBase.h:43
edm
HLT enums.
Definition:
AlignableModifier.h:17
helper::SelectionAdderTrait
Definition:
SelectionAdderTrait.h:81
ParameterAdapter.h
edm::ParameterSet
Definition:
ParameterSet.h:36
edm::Event
Definition:
Event.h:66
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
modules
Definition:
ZHLTMatchFilter.cc:17
Generated for CMSSW Reference Manual by
1.8.11