CommonTools
UtilAlgos
interface
SingleElementCollectionSelectorPlusEvent.h
Go to the documentation of this file.
1
#ifndef RecoAlgos_SingleElementCollectionSelectorPlusEvent_h
2
#define RecoAlgos_SingleElementCollectionSelectorPlusEvent_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
edm
{
22
class
Event
;
23
class
EventSetup
;
24
}
// namespace edm
25
26
template
<
typename
InputCollection
,
27
typename
Selector
,
28
typename
OutputCollection
=
typename
helper::SelectedOutputCollectionTrait<InputCollection>::type
,
29
typename
StoreContainer =
typename
helper::StoreContainerTrait<OutputCollection>::type
,
30
typename
RefAdder =
typename
helper::SelectionAdderTrait<InputCollection, StoreContainer>::type
>
31
struct
SingleElementCollectionSelectorPlusEvent
{
32
typedef
InputCollection
collection
;
33
typedef
StoreContainer
container
;
34
typedef
typename
container::const_iterator
const_iterator
;
35
SingleElementCollectionSelectorPlusEvent
(
const
edm::ParameterSet
&
cfg
,
edm::ConsumesCollector
&&iC)
36
:
select_
(
reco
::
modules
::
make
<
Selector
>(
cfg
, iC)) {}
37
const_iterator
begin
()
const
{
return
selected_
.begin(); }
38
const_iterator
end
()
const
{
return
selected_
.end(); }
39
void
select
(
const
edm::Handle<InputCollection>
&
c
,
const
edm::Event
&
ev
,
const
edm::EventSetup
&) {
40
selected_
.clear();
41
for
(
size_t
idx
= 0;
idx
<
c
->size(); ++
idx
) {
42
if
(
select_
(
edm::Ref<InputCollection>
(
c
,
idx
),
ev
))
//(*c)[idx]
43
addRef_
(
selected_
,
c
,
idx
);
44
}
45
}
46
47
private
:
48
StoreContainer
selected_
;
49
Selector
select_
;
50
RefAdder
addRef_
;
51
};
52
53
#endif
Selector
Functor that operates on <T>
Definition:
Selector.h:22
SingleElementCollectionSelectorPlusEvent::select
void select(const edm::Handle< InputCollection > &c, const edm::Event &ev, const edm::EventSetup &)
Definition:
SingleElementCollectionSelectorPlusEvent.h:39
SelectionAdderTrait.h
SingleElementCollectionSelectorPlusEvent::begin
const_iterator begin() const
Definition:
SingleElementCollectionSelectorPlusEvent.h:37
StoreContainerTrait.h
helper::SelectionAdderTrait
Definition:
SelectionAdderTrait.h:80
helper::StoreContainerTrait
Definition:
StoreContainerTrait.h:14
modules
Definition:
MuonCleanerBySegments.cc:35
edm
HLT enums.
Definition:
AlignableModifier.h:19
SingleElementCollectionSelectorPlusEvent::container
StoreContainer container
Definition:
SingleElementCollectionSelectorPlusEvent.h:33
reco
fixed size matrix
Definition:
AlignmentAlgorithmBase.h:46
SelectedOutputCollectionTrait.h
edm::Handle
Definition:
AssociativeIterator.h:50
edm::Ref
Definition:
AssociativeIterator.h:58
heavyIonCSV_trainingSettings.idx
idx
Definition:
heavyIonCSV_trainingSettings.py:5
SingleElementCollectionSelectorPlusEvent::const_iterator
container::const_iterator const_iterator
Definition:
SingleElementCollectionSelectorPlusEvent.h:34
Event
SingleElementCollectionSelectorPlusEvent::end
const_iterator end() const
Definition:
SingleElementCollectionSelectorPlusEvent.h:38
edm::ParameterSet
Definition:
ParameterSet.h:47
helper::SelectedOutputCollectionTrait
Definition:
SelectedOutputCollectionTrait.h:18
edm::EventSetup
Definition:
EventSetup.h:58
SingleElementCollectionSelectorPlusEvent::SingleElementCollectionSelectorPlusEvent
SingleElementCollectionSelectorPlusEvent(const edm::ParameterSet &cfg, edm::ConsumesCollector &&iC)
Definition:
SingleElementCollectionSelectorPlusEvent.h:35
reco::modules::make
S make(const edm::ParameterSet &cfg)
Definition:
ParameterAdapter.h:21
looper.cfg
cfg
Definition:
looper.py:296
ALCARECOPromptCalibProdSiPixelAli0T_cff.Selector
Selector
Definition:
ALCARECOPromptCalibProdSiPixelAli0T_cff.py:81
ev
bool ev
Definition:
Hydjet2Hadronizer.cc:97
SingleElementCollectionSelectorPlusEvent::select_
Selector select_
Definition:
SingleElementCollectionSelectorPlusEvent.h:49
SimL1EmulatorRepack_GT2_cff.InputCollection
InputCollection
Definition:
SimL1EmulatorRepack_GT2_cff.py:16
SingleElementCollectionSelectorPlusEvent::collection
InputCollection collection
Definition:
SingleElementCollectionSelectorPlusEvent.h:32
ParameterAdapter.h
ConsumesCollector.h
EventSetup
c
auto & c
Definition:
CAHitNtupletGeneratorKernelsImpl.h:56
SingleElementCollectionSelectorPlusEvent
Definition:
SingleElementCollectionSelectorPlusEvent.h:31
edm::Event
Definition:
Event.h:73
HLTTauReferences_cfi.OutputCollection
OutputCollection
Definition:
HLTTauReferences_cfi.py:92
SingleElementCollectionSelectorPlusEvent::selected_
StoreContainer selected_
Definition:
SingleElementCollectionSelectorPlusEvent.h:48
edm::ConsumesCollector
Definition:
ConsumesCollector.h:45
SingleElementCollectionSelectorPlusEvent::addRef_
RefAdder addRef_
Definition:
SingleElementCollectionSelectorPlusEvent.h:50
Generated for CMSSW Reference Manual by
1.8.16