Main Page
Namespaces
Classes
Package Documentation
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Properties
Friends
Macros
Pages
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
namespace
reco
{
20
namespace
modules
{
21
template
<
typename
S>
struct
SingleElementCollectionSelectorEventSetupInit
;
22
}
23
}
24
template
<
typename
InputCollection
,
typename
Selector
,
25
typename
OutputCollection =
typename ::helper::SelectedOutputCollectionTrait<InputCollection>::type
,
26
typename
StoreContainer =
typename ::helper::StoreContainerTrait<OutputCollection>::type
,
27
typename
RefAdder =
typename ::helper::SelectionAdderTrait<InputCollection, StoreContainer>::type
>
28
struct
SingleElementCollectionSelector
{
29
typedef
InputCollection
collection
;
30
typedef
StoreContainer
container
;
31
typedef
Selector
selector
;
32
typedef
typename
container::const_iterator
const_iterator
;
33
SingleElementCollectionSelector
(
const
edm::ParameterSet
&
cfg
,
edm::ConsumesCollector
&& iC) :
34
select_
(
reco
::
modules
::
make
<
Selector
>(cfg, iC)) { }
35
const_iterator
begin
()
const
{
return
selected_
.begin(); }
36
const_iterator
end
()
const
{
return
selected_
.end(); }
37
void
select
(
const
edm::Handle<InputCollection>
&
c
,
const
edm::Event
&,
const
edm::EventSetup
&) {
38
selected_
.clear();
39
for
(
size_t
idx = 0; idx < c->size(); ++ idx) {
40
if
(
select_
((*c)[idx]))
41
addRef_
(
selected_
, c, idx);
42
}
43
}
44
private
:
45
container
selected_
;
46
selector
select_
;
47
RefAdder
addRef_
;
48
friend
struct
reco::modules::SingleElementCollectionSelectorEventSetupInit
<
SingleElementCollectionSelector
>;
49
};
50
51
#include "
CommonTools/UtilAlgos/interface/EventSetupInitTrait.h
"
52
53
namespace
reco
{
54
namespace
modules
{
55
template
<
typename
S>
56
struct
SingleElementCollectionSelectorEventSetupInit {
57
static
void
init
(
S
&
s
,
const
edm::Event
&
ev
,
const
edm::EventSetup
& es) {
58
typedef
typename
EventSetupInit<typename S::selector>::type
ESI;
59
ESI::init(s.select_, ev, es);
60
}
61
};
62
63
template
<
typename
I,
typename
S,
typename
O,
typename
C,
typename
R>
64
struct
EventSetupInit
<
SingleElementCollectionSelector
<
I
,
S
, O,
C
,
R
> > {
65
typedef
SingleElementCollectionSelectorEventSetupInit<SingleElementCollectionSelector<I, S, O, C, R>
>
type
;
66
};
67
}
68
}
69
70
#endif
71
type
type
Definition:
HCALResponse.h:21
SingleElementCollectionSelector::end
const_iterator end() const
Definition:
SingleElementCollectionSelector.h:36
SingleElementCollectionSelector::collection
InputCollection collection
Definition:
SingleElementCollectionSelector.h:29
SelectionAdderTrait.h
looper.cfg
tuple cfg
Definition:
looper.py:293
SingleElementCollectionSelector::selector
Selector selector
Definition:
SingleElementCollectionSelector.h:31
SingleElementCollectionSelector::const_iterator
container::const_iterator const_iterator
Definition:
SingleElementCollectionSelector.h:32
SingleElementCollectionSelector::begin
const_iterator begin() const
Definition:
SingleElementCollectionSelector.h:35
edmConvertToStreamModule.modules
list modules
Definition:
edmConvertToStreamModule.py:120
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
funct::C
C
Definition:
Factorize.h:141
dt_dqm_sourceclient_common_cff.reco
tuple reco
Definition:
dt_dqm_sourceclient_common_cff.py:107
EnergyCorrector.c
tuple c
Definition:
EnergyCorrector.py:43
SingleElementCollectionSelector::selected_
container selected_
Definition:
SingleElementCollectionSelector.h:45
SingleElementCollectionSelector::container
StoreContainer container
Definition:
SingleElementCollectionSelector.h:30
HLT_Fake1_cff.InputCollection
tuple InputCollection
Definition:
HLT_Fake1_cff.py:69
reco::modules::SingleElementCollectionSelectorEventSetupInit
Definition:
SingleElementCollectionSelector.h:21
reco::modules::NoEventSetupInit
take no action (default)
Definition:
EventSetupInitTrait.h:19
dttmaxenums::R
Definition:
DTTMax.h:28
reco::modules::SingleElementCollectionSelectorEventSetupInit::init
static void init(S &s, const edm::Event &ev, const edm::EventSetup &es)
Definition:
SingleElementCollectionSelector.h:57
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
SingleElementCollectionSelector
Definition:
SingleElementCollectionSelector.h:28
SingleElementCollectionSelector::SingleElementCollectionSelector
SingleElementCollectionSelector(const edm::ParameterSet &cfg, edm::ConsumesCollector &&iC)
Definition:
SingleElementCollectionSelector.h:33
SingleElementCollectionSelector::select_
selector select_
Definition:
SingleElementCollectionSelector.h:46
SingleElementCollectionSelector::addRef_
RefAdder addRef_
Definition:
SingleElementCollectionSelector.h:47
reco::Selector
Definition:
Expressions.h:20
reco::modules::EventSetupInit
Definition:
EventSetupInitTrait.h:35
alignCSCRings.s
list s
Definition:
alignCSCRings.py:91
reco::modules::EventSetupInit< SingleElementCollectionSelector< I, S, O, C, R > >::type
SingleElementCollectionSelectorEventSetupInit< SingleElementCollectionSelector< I, S, O, C, R > > type
Definition:
SingleElementCollectionSelector.h:65
S
double S(const TLorentzVector &, const TLorentzVector &)
Definition:
Particle.cc:99
StoreContainerTrait.h
SingleElementCollectionSelector::select
void select(const edm::Handle< InputCollection > &c, const edm::Event &, const edm::EventSetup &)
Definition:
SingleElementCollectionSelector.h:37
ParameterAdapter.h
edm::ParameterSet
Definition:
ParameterSet.h:36
edm::Event
Definition:
Event.h:66
ConsumesCollector.h
EventSetupInitTrait.h
edm::ConsumesCollector
Definition:
ConsumesCollector.h:39
Generated for CMSSW Reference Manual by
1.8.5