CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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 public:
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 
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 {
45  evt.getByToken(srcToken_, source);
46  return CS::filter(*source, select_, sizeSelect_);
47  }
48 
49 private:
52 
55 
58 };
59 
60 #endif
tuple cfg
Definition: looper.py:296
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:539
ObjectCountEventSelector(const edm::ParameterSet &cfg, edm::ConsumesCollector &&iC)
constructor
S make(const edm::ParameterSet &cfg)
ParameterDescriptionBase * add(U const &iLabel, T const &value)
#define N
Definition: blowfish.cc:9
N sizeSelect_
minimum number of entries in a collection
bool operator()(edm::Event &evt, const edm::EventSetup &) const override
static std::string const source
Definition: EdmProvDump.cc:46
def template
Definition: svgfig.py:521
edm::EDGetTokenT< C > srcToken_
source collection label
static void fillPSetDescription(edm::ParameterSetDescription &desc)