Main Page
Namespaces
Classes
Package Documentation
CommonTools
UtilAlgos
interface
SingleElementCollectionSelector.h
Go to the documentation of this file.
1
#ifndef RecoAlgos_SingleElementCollectionSelector_h
2
#define RecoAlgos_SingleElementCollectionSelector_h
3
15
#include "
FWCore/Framework/interface/ConsumesCollector.h
"
16
#include "
CommonTools/UtilAlgos/interface/SelectionAdderTrait.h
"
17
#include "
CommonTools/UtilAlgos/interface/StoreContainerTrait.h
"
18
#include "
CommonTools/UtilAlgos/interface/ParameterAdapter.h
"
19
#include "
CommonTools/UtilAlgos/interface/SelectedOutputCollectionTrait.h
"
20
21
namespace
reco
{
22
namespace
modules
{
23
template
<
typename
S>
struct
SingleElementCollectionSelectorEventSetupInit
;
24
}
25
}
26
namespace
edm
{
27
class
Event
;
28
class
EventSetup
;
29
}
30
31
template
<
typename
InputCollection
,
typename
Selector
,
32
typename
OutputCollection =
typename ::helper::SelectedOutputCollectionTrait<InputCollection>::type
,
33
typename
StoreContainer =
typename ::helper::StoreContainerTrait<OutputCollection>::type
,
34
typename
RefAdder =
typename ::helper::SelectionAdderTrait<InputCollection, StoreContainer>::type
>
35
struct
SingleElementCollectionSelector
{
36
typedef
InputCollection
collection
;
37
typedef
StoreContainer
container
;
38
typedef
Selector
selector
;
39
typedef
typename
container::const_iterator
const_iterator
;
40
SingleElementCollectionSelector
(
const
edm::ParameterSet
&
cfg
,
edm::ConsumesCollector
&& iC) :
41
select_(
reco
::
modules
::
make
<
Selector
>(cfg, iC)) { }
42
const_iterator
begin
()
const
{
return
selected_.begin(); }
43
const_iterator
end
()
const
{
return
selected_.end(); }
44
void
select
(
const
edm::Handle<InputCollection>
&
c
,
const
edm::Event
&,
const
edm::EventSetup
&) {
45
selected_.clear();
46
for
(
size_t
idx
= 0;
idx
< c->size(); ++
idx
) {
47
if
(select_((*c)[
idx
]))
48
addRef_(selected_, c, idx);
49
}
50
}
51
private
:
52
container
selected_
;
53
selector
select_
;
54
RefAdder
addRef_
;
55
friend
struct
reco::modules::SingleElementCollectionSelectorEventSetupInit
<
SingleElementCollectionSelector
>;
56
};
57
58
#include "
CommonTools/UtilAlgos/interface/EventSetupInitTrait.h
"
59
60
namespace
reco
{
61
namespace
modules
{
62
template
<
typename
S>
63
struct
SingleElementCollectionSelectorEventSetupInit {
64
static
void
init
(
S
&
s
,
const
edm::Event
&
ev
,
const
edm::EventSetup
& es) {
65
typedef
typename
EventSetupInit<typename S::selector>::type
ESI;
66
ESI::init
(s.select_, ev, es);
67
}
68
};
69
70
template
<
typename
I,
typename
S,
typename
O,
typename
C,
typename
R>
71
struct
EventSetupInit
<SingleElementCollectionSelector<
I
,
S
, O,
C
,
R
> > {
72
typedef
SingleElementCollectionSelectorEventSetupInit<SingleElementCollectionSelector<I, S, O, C, R>
>
type
;
73
};
74
}
75
}
76
77
#endif
78
type
type
Definition:
HCALResponse.h:21
SingleElementCollectionSelector::end
const_iterator end() const
Definition:
SingleElementCollectionSelector.h:43
StGenEvtProducer_cfi.init
init
Definition:
StGenEvtProducer_cfi.py:9
SingleElementCollectionSelector::collection
InputCollection collection
Definition:
SingleElementCollectionSelector.h:36
SelectionAdderTrait.h
SelectedOutputCollectionTrait.h
SingleElementCollectionSelector::selector
Selector selector
Definition:
SingleElementCollectionSelector.h:38
SingleElementCollectionSelector::const_iterator
container::const_iterator const_iterator
Definition:
SingleElementCollectionSelector.h:39
SingleElementCollectionSelector::begin
const_iterator begin() const
Definition:
SingleElementCollectionSelector.h:42
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
ev
bool ev
Definition:
Hydjet2Hadronizer.cc:95
HiRegionalRecoMuon_cff.InputCollection
InputCollection
Definition:
HiRegionalRecoMuon_cff.py:20
SingleElementCollectionSelector::selected_
container selected_
Definition:
SingleElementCollectionSelector.h:52
SingleElementCollectionSelector::container
StoreContainer container
Definition:
SingleElementCollectionSelector.h:37
reco::modules::SingleElementCollectionSelectorEventSetupInit
Definition:
SingleElementCollectionSelector.h:23
EventSetup
reco::modules::NoEventSetupInit
take no action (default)
Definition:
EventSetupInitTrait.h:19
dttmaxenums::R
Definition:
DTTMax.h:28
patCaloMETCorrections_cff.C
C
Definition:
patCaloMETCorrections_cff.py:45
ALCARECOPromptCalibProdSiPixelAli0T_cff.Selector
Selector
Definition:
ALCARECOPromptCalibProdSiPixelAli0T_cff.py:81
reco::modules::SingleElementCollectionSelectorEventSetupInit::init
static void init(S &s, const edm::Event &ev, const edm::EventSetup &es)
Definition:
SingleElementCollectionSelector.h:64
Exhume::I
const std::complex< double > I
Definition:
I.h:8
edm::EventSetup
Definition:
EventSetup.h:45
Selector
Functor that operates on <T>
Definition:
Selector.h:24
looper.cfg
cfg
Definition:
looper.py:293
SingleElementCollectionSelector
Definition:
SingleElementCollectionSelector.h:35
SingleElementCollectionSelector::SingleElementCollectionSelector
SingleElementCollectionSelector(const edm::ParameterSet &cfg, edm::ConsumesCollector &&iC)
Definition:
SingleElementCollectionSelector.h:40
SingleElementCollectionSelector::select_
selector select_
Definition:
SingleElementCollectionSelector.h:53
SingleElementCollectionSelector::addRef_
RefAdder addRef_
Definition:
SingleElementCollectionSelector.h:54
training_settings.idx
idx
Definition:
training_settings.py:16
reco::modules::EventSetupInit
Definition:
EventSetupInitTrait.h:35
reco::modules::EventSetupInit< SingleElementCollectionSelector< I, S, O, C, R > >::type
SingleElementCollectionSelectorEventSetupInit< SingleElementCollectionSelector< I, S, O, C, R > > type
Definition:
SingleElementCollectionSelector.h:72
S
double S(const TLorentzVector &, const TLorentzVector &)
Definition:
Particle.cc:99
Event
reco
fixed size matrix
Definition:
AlignmentAlgorithmBase.h:43
edm
HLT enums.
Definition:
AlignableModifier.h:17
StoreContainerTrait.h
SingleElementCollectionSelector::select
void select(const edm::Handle< InputCollection > &c, const edm::Event &, const edm::EventSetup &)
Definition:
SingleElementCollectionSelector.h:44
ParameterAdapter.h
edm::ParameterSet
Definition:
ParameterSet.h:36
edm::Event
Definition:
Event.h:66
ConsumesCollector.h
EventSetupInitTrait.h
edm::ConsumesCollector
Definition:
ConsumesCollector.h:39
modules
Definition:
ZHLTMatchFilter.cc:17
Generated for CMSSW Reference Manual by
1.8.11