CommonTools
UtilAlgos
interface
ObjectCountEventSelector.h
Go to the documentation of this file.
1
#ifndef CommonTools_UtilAlgos_ObjectCountEventSelector_h
2
#define CommonTools_UtilAlgos_ObjectCountEventSelector_h
3
16
#include "
FWCore/Framework/interface/Event.h
"
17
#include "
FWCore/Framework/interface/ConsumesCollector.h
"
18
#include "
FWCore/ParameterSet/interface/ParameterSet.h
"
19
#include "
FWCore/ParameterSet/interface/ParameterSetDescription.h
"
20
#include "
FWCore/Utilities/interface/InputTag.h
"
21
#include "
CommonTools/UtilAlgos/interface/ParameterAdapter.h
"
22
#include "
CommonTools/UtilAlgos/interface/CollectionFilterTrait.h
"
23
#include "
CommonTools/UtilAlgos/interface/EventSelectorBase.h
"
24
25
template
<
typename
C
,
26
typename
S
=
AnySelector
,
27
typename
N
=
MinNumberSelector
,
28
typename
CS =
typename
helper::CollectionFilterTrait<C, S, N>::type
>
29
class
ObjectCountEventSelector
:
public
EventSelectorBase
{
30
public
:
32
explicit
ObjectCountEventSelector
(
const
edm::ParameterSet
&
cfg
,
edm::ConsumesCollector
&& iC)
33
:
srcToken_
(iC.consumes<
C
>(
cfg
.
template
getParameter<
edm
::
InputTag
>(
"src"
))),
34
select_
(
reco
::
modules
::
make
<
S
>(
cfg
, iC)),
35
sizeSelect_
(
reco
::
modules
::
make
<
N
>(
cfg
, iC)) {}
36
37
static
void
fillPSetDescription
(
edm::ParameterSetDescription
&
desc
) {
38
desc
.add<
edm::InputTag
>(
"src"
,
edm::InputTag
());
39
reco::modules::fillPSetDescription<S>(
desc
);
40
reco::modules::fillPSetDescription<N>(
desc
);
41
}
42
43
bool
operator()
(
edm::Event
& evt,
const
edm::EventSetup
&)
const override
{
44
edm::Handle<C>
source
;
45
evt.
getByToken
(
srcToken_
,
source
);
46
return
CS::filter
(*
source
,
select_
,
sizeSelect_
);
47
}
48
49
private
:
51
edm::EDGetTokenT<C>
srcToken_
;
52
54
S
select_
;
55
57
N
sizeSelect_
;
58
};
59
60
#endif
ObjectCountEventSelector::select_
S select_
object filter
Definition:
ObjectCountEventSelector.h:54
AnySelector
Definition:
AnySelector.h:10
modules
Definition:
ZHLTMatchFilter.cc:17
edm::EDGetTokenT< C >
edm
HLT enums.
Definition:
AlignableModifier.h:19
HLT_FULL_cff.InputTag
InputTag
Definition:
HLT_FULL_cff.py:89353
edm::ParameterSetDescription
Definition:
ParameterSetDescription.h:52
ObjectCountEventSelector::ObjectCountEventSelector
ObjectCountEventSelector(const edm::ParameterSet &cfg, edm::ConsumesCollector &&iC)
constructor
Definition:
ObjectCountEventSelector.h:32
reco
fixed size matrix
Definition:
AlignmentAlgorithmBase.h:45
edm::Handle
Definition:
AssociativeIterator.h:50
source
static const std::string source
Definition:
EdmProvDump.cc:47
N
#define N
Definition:
blowfish.cc:9
ObjectCountEventSelector
Definition:
ObjectCountEventSelector.h:29
edm::Event::getByToken
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition:
Event.h:531
ParameterSetDescription.h
ALCARECOTkAlBeamHalo_cff.filter
filter
Definition:
ALCARECOTkAlBeamHalo_cff.py:27
CollectionFilterTrait.h
edm::ParameterSet
Definition:
ParameterSet.h:47
helper::CollectionFilterTrait
Definition:
CollectionFilterTrait.h:47
Event.h
ObjectCountEventSelector::fillPSetDescription
static void fillPSetDescription(edm::ParameterSetDescription &desc)
Definition:
ObjectCountEventSelector.h:37
ObjectCountEventSelector::sizeSelect_
N sizeSelect_
minimum number of entries in a collection
Definition:
ObjectCountEventSelector.h:57
edm::EventSetup
Definition:
EventSetup.h:57
svgfig.template
def template(fileName, svg, replaceme="REPLACEME")
Definition:
svgfig.py:521
ObjectCountEventSelector::srcToken_
edm::EDGetTokenT< C > srcToken_
source collection label
Definition:
ObjectCountEventSelector.h:51
reco::modules::make
S make(const edm::ParameterSet &cfg)
Definition:
ParameterAdapter.h:21
InputTag.h
looper.cfg
cfg
Definition:
looper.py:297
MinNumberSelector
Definition:
MinNumberSelector.h:10
submitPVResolutionJobs.desc
string desc
Definition:
submitPVResolutionJobs.py:251
gen::C
C
Definition:
PomwigHadronizer.cc:78
EventSelectorBase.h
ObjectCountEventSelector::operator()
bool operator()(edm::Event &evt, const edm::EventSetup &) const override
Definition:
ObjectCountEventSelector.h:43
S
Definition:
CSCDBL1TPParametersExtended.h:16
ParameterAdapter.h
ConsumesCollector.h
ParameterSet.h
edm::Event
Definition:
Event.h:73
edm::InputTag
Definition:
InputTag.h:15
edm::ConsumesCollector
Definition:
ConsumesCollector.h:45
EventSelectorBase
Definition:
EventSelectorBase.h:20
Generated for CMSSW Reference Manual by
1.8.16