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