CMS 3D CMS Logo

ObjectCountEventSelector.h
Go to the documentation of this file.
1 #ifndef CommonTools_UtilAlgos_ObjectCountEventSelector_h
2 #define CommonTools_UtilAlgos_ObjectCountEventSelector_h
3 
24 
25 template<typename C,
26  typename S = AnySelector,
27  typename N = MinNumberSelector,
28  typename CS = typename helper::CollectionFilterTrait<C, S, N>::type>
30 {
31  public:
34  srcToken_( iC.consumes<C>(cfg.template getParameter<edm::InputTag>( "src" ) ) ),
35  select_( reco::modules::make<S>( cfg, iC ) ),
36  sizeSelect_( reco::modules::make<N>( cfg, iC ) ) {
37  }
38 
40  desc.add<edm::InputTag>("src", edm::InputTag());
41  reco::modules::fillPSetDescription<S>(desc);
42  reco::modules::fillPSetDescription<N>(desc);
43  }
44 
45  bool operator()(edm::Event& evt, const edm::EventSetup&) const override {
47  evt.getByToken( srcToken_, source );
48  return CS::filter( * source, select_, sizeSelect_ );
49  }
50 
51  private:
54 
57 
60 };
61 
62 #endif
63 
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:519
ObjectCountEventSelector(const edm::ParameterSet &cfg, edm::ConsumesCollector &&iC)
constructor
S make(const edm::ParameterSet &cfg)
def template(fileName, svg, replaceme="REPLACEME")
Definition: svgfig.py:520
ParameterDescriptionBase * add(U const &iLabel, T const &value)
bool operator()(edm::Event &evt, const edm::EventSetup &) const override
#define N
Definition: blowfish.cc:9
N sizeSelect_
minimum number of entries in a collection
fixed size matrix
HLT enums.
static std::string const source
Definition: EdmProvDump.cc:43
edm::EDGetTokenT< C > srcToken_
source collection label
static void fillPSetDescription(edm::ParameterSetDescription &desc)