Main Page
Namespaces
Classes
Package Documentation
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/Utilities/interface/InputTag.h
"
20
#include "
CommonTools/UtilAlgos/interface/ParameterAdapter.h
"
21
#include "
CommonTools/UtilAlgos/interface/CollectionFilterTrait.h
"
22
#include "
CommonTools/UtilAlgos/interface/EventSelectorBase.h
"
23
24
template
<
typename
C
,
25
typename
S
=
AnySelector
,
26
typename
N
=
MinNumberSelector
,
27
typename
CS =
typename
helper::CollectionFilterTrait<C, S, N>::type
>
28
class
ObjectCountEventSelector
:
public
EventSelectorBase
29
{
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
38
bool
operator()
(
edm::Event
& evt,
const
edm::EventSetup
&)
const override
{
39
edm::Handle<C>
source
;
40
evt.
getByToken
(
srcToken_
, source );
41
return
CS::filter
( * source,
select_
,
sizeSelect_
);
42
}
43
44
private
:
46
edm::EDGetTokenT<C>
srcToken_
;
47
49
S
select_
;
50
52
N
sizeSelect_
;
53
};
54
55
#endif
56
helper::CollectionFilter
Definition:
CollectionFilterTrait.h:14
edm::Event::getByToken
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition:
Event.h:508
Event.h
ObjectCountEventSelector::ObjectCountEventSelector
ObjectCountEventSelector(const edm::ParameterSet &cfg, edm::ConsumesCollector &&iC)
constructor
Definition:
ObjectCountEventSelector.h:32
edm::Handle
Definition:
AssociativeIterator.h:47
reco::modules::make
S make(const edm::ParameterSet &cfg)
Definition:
ParameterAdapter.h:24
MinNumberSelector
Definition:
MinNumberSelector.h:10
EventSelectorBase
Definition:
EventSelectorBase.h:20
ObjectCountEventSelector
Definition:
ObjectCountEventSelector.h:28
edm::EDGetTokenT< C >
ParameterSet.h
patCaloMETCorrections_cff.C
C
Definition:
patCaloMETCorrections_cff.py:45
ObjectCountEventSelector::select_
S select_
object filter
Definition:
ObjectCountEventSelector.h:49
svgfig.template
def template(fileName, svg, replaceme="REPLACEME")
Definition:
svgfig.py:520
edm::EventSetup
Definition:
EventSetup.h:44
looper.cfg
cfg
Definition:
looper.py:293
ObjectCountEventSelector::operator()
bool operator()(edm::Event &evt, const edm::EventSetup &) const override
Definition:
ObjectCountEventSelector.h:38
N
#define N
Definition:
blowfish.cc:9
ObjectCountEventSelector::sizeSelect_
N sizeSelect_
minimum number of entries in a collection
Definition:
ObjectCountEventSelector.h:52
ALCARECOTkAlBeamHalo_cff.filter
filter
Definition:
ALCARECOTkAlBeamHalo_cff.py:27
S
double S(const TLorentzVector &, const TLorentzVector &)
Definition:
Particle.cc:99
EventSelectorBase.h
CollectionFilterTrait.h
AnySelector
Definition:
AnySelector.h:10
reco
fixed size matrix
Definition:
AlignmentAlgorithmBase.h:43
edm
HLT enums.
Definition:
AlignableModifier.h:17
InputTag.h
ParameterAdapter.h
edm::ParameterSet
Definition:
ParameterSet.h:36
edm::Event
Definition:
Event.h:69
ConsumesCollector.h
source
static std::string const source
Definition:
EdmProvDump.cc:43
ObjectCountEventSelector::srcToken_
edm::EDGetTokenT< C > srcToken_
source collection label
Definition:
ObjectCountEventSelector.h:46
edm::ConsumesCollector
Definition:
ConsumesCollector.h:39
modules
Definition:
ZHLTMatchFilter.cc:17
Generated for CMSSW Reference Manual by
1.8.11