Main Page
Namespaces
Classes
Package Documentation
CommonTools
UtilAlgos
interface
SingleElementCollectionRefSelector.h
Go to the documentation of this file.
1
#ifndef RecoAlgos_SingleElementCollectionRefSelector_h
2
#define RecoAlgos_SingleElementCollectionRefSelector_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
#include "
DataFormats/Common/interface/View.h
"
21
22
namespace
reco
{
23
namespace
modules
{
24
template
<
typename
S>
struct
SingleElementCollectionRefSelectorEventSetupInit
;
25
}
26
}
27
namespace
edm
{
28
class
Event
;
29
class
EventSetup
;
30
}
31
32
template
<
typename
InputType
,
typename
Selector
,
33
typename
OutputCollection = typename ::helper::SelectedOutputCollectionTrait<edm::View<InputType> >
::type
,
34
typename
StoreContainer =
typename ::helper::StoreContainerTrait<OutputCollection>::type
,
35
typename
RefAdder = typename ::helper::SelectionAdderTrait<edm::View<InputType>, StoreContainer>
::type
>
36
struct
SingleElementCollectionRefSelector
{
37
typedef
edm::View<InputType>
InputCollection
;
38
typedef
InputCollection
collection
;
39
typedef
StoreContainer
container
;
40
typedef
Selector
selector
;
41
typedef
typename
container::const_iterator
const_iterator
;
42
SingleElementCollectionRefSelector
(
const
edm::ParameterSet
&
cfg
,
edm::ConsumesCollector
&& iC) :
43
select_(
reco
::
modules
::
make
<
Selector
>(cfg, iC)) { }
44
const_iterator
begin
()
const
{
return
selected_.begin(); }
45
const_iterator
end
()
const
{
return
selected_.end(); }
46
void
select
(
const
edm::Handle<InputCollection>
&
c
,
const
edm::Event
&,
const
edm::EventSetup
&) {
47
selected_.clear();
48
for
(
size_t
idx
= 0;
idx
< c->size(); ++
idx
) {
49
if
(select_(c->refAt(
idx
))) addRef_(selected_, c,
idx
);
50
}
51
}
52
private
:
53
container
selected_
;
54
selector
select_
;
55
RefAdder
addRef_
;
56
friend
class
reco::modules::SingleElementCollectionRefSelectorEventSetupInit
<
SingleElementCollectionRefSelector
>;
57
};
58
59
#include "
CommonTools/UtilAlgos/interface/EventSetupInitTrait.h
"
60
61
namespace
reco
{
62
namespace
modules
{
63
template
<
typename
S>
64
struct
SingleElementCollectionRefSelectorEventSetupInit {
65
static
void
init
(
S
&
s
,
const
edm::Event
&
ev
,
const
edm::EventSetup
& es) {
66
typedef
typename
EventSetupInit<typename S::selector>::type
ESI;
67
ESI::init
(s.select_, ev, es);
68
}
69
};
70
71
template
<
typename
I,
typename
S,
typename
O,
typename
C,
typename
R>
72
struct
EventSetupInit
<SingleElementCollectionRefSelector<
I
,
S
, O,
C
,
R
> > {
73
typedef
SingleElementCollectionRefSelectorEventSetupInit<SingleElementCollectionRefSelector<I, S, O, C, R>
>
type
;
74
};
75
}
76
}
77
78
#endif
79
type
type
Definition:
HCALResponse.h:21
reco::modules::EventSetupInit< SingleElementCollectionRefSelector< I, S, O, C, R > >::type
SingleElementCollectionRefSelectorEventSetupInit< SingleElementCollectionRefSelector< I, S, O, C, R > > type
Definition:
SingleElementCollectionRefSelector.h:73
StGenEvtProducer_cfi.init
init
Definition:
StGenEvtProducer_cfi.py:9
SingleElementCollectionRefSelector
Definition:
SingleElementCollectionRefSelector.h:36
SelectionAdderTrait.h
edm::InputType
InputType
Definition:
InputType.h:5
SelectedOutputCollectionTrait.h
SingleElementCollectionRefSelector::addRef_
RefAdder addRef_
Definition:
SingleElementCollectionRefSelector.h:55
SingleElementCollectionRefSelector::collection
InputCollection collection
Definition:
SingleElementCollectionRefSelector.h:38
SingleElementCollectionRefSelector::select_
selector select_
Definition:
SingleElementCollectionRefSelector.h:54
alignCSCRings.s
s
Definition:
alignCSCRings.py:91
EnergyCorrector.c
c
Definition:
EnergyCorrector.py:43
edm::Handle
Definition:
AssociativeIterator.h:47
SingleElementCollectionRefSelector::container
StoreContainer container
Definition:
SingleElementCollectionRefSelector.h:39
reco::modules::make
S make(const edm::ParameterSet &cfg)
Definition:
ParameterAdapter.h:24
ev
bool ev
Definition:
Hydjet2Hadronizer.cc:95
SingleElementCollectionRefSelector::InputCollection
edm::View< InputType > InputCollection
Definition:
SingleElementCollectionRefSelector.h:37
EventSetup
edm::View
Definition:
CaloClusterFwd.h:14
reco::modules::NoEventSetupInit
take no action (default)
Definition:
EventSetupInitTrait.h:19
reco::modules::SingleElementCollectionRefSelectorEventSetupInit
Definition:
SingleElementCollectionRefSelector.h:24
SingleElementCollectionRefSelector::begin
const_iterator begin() const
Definition:
SingleElementCollectionRefSelector.h:44
dttmaxenums::R
Definition:
DTTMax.h:28
patCaloMETCorrections_cff.C
C
Definition:
patCaloMETCorrections_cff.py:45
ALCARECOPromptCalibProdSiPixelAli0T_cff.Selector
Selector
Definition:
ALCARECOPromptCalibProdSiPixelAli0T_cff.py:81
SingleElementCollectionRefSelector::select
void select(const edm::Handle< InputCollection > &c, const edm::Event &, const edm::EventSetup &)
Definition:
SingleElementCollectionRefSelector.h:46
View.h
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
SingleElementCollectionRefSelector::end
const_iterator end() const
Definition:
SingleElementCollectionRefSelector.h:45
SingleElementCollectionRefSelector::SingleElementCollectionRefSelector
SingleElementCollectionRefSelector(const edm::ParameterSet &cfg, edm::ConsumesCollector &&iC)
Definition:
SingleElementCollectionRefSelector.h:42
training_settings.idx
idx
Definition:
training_settings.py:16
reco::modules::EventSetupInit
Definition:
EventSetupInitTrait.h:35
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
SingleElementCollectionRefSelector::selected_
container selected_
Definition:
SingleElementCollectionRefSelector.h:53
ParameterAdapter.h
edm::ParameterSet
Definition:
ParameterSet.h:36
SingleElementCollectionRefSelector::const_iterator
container::const_iterator const_iterator
Definition:
SingleElementCollectionRefSelector.h:41
edm::Event
Definition:
Event.h:66
SingleElementCollectionRefSelector::selector
Selector selector
Definition:
SingleElementCollectionRefSelector.h:40
ConsumesCollector.h
reco::modules::SingleElementCollectionRefSelectorEventSetupInit::init
static void init(S &s, const edm::Event &ev, const edm::EventSetup &es)
Definition:
SingleElementCollectionRefSelector.h:65
EventSetupInitTrait.h
edm::ConsumesCollector
Definition:
ConsumesCollector.h:39
modules
Definition:
ZHLTMatchFilter.cc:17
Generated for CMSSW Reference Manual by
1.8.11