CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
ObjectCountEventSelector.h
Go to the documentation of this file.
1 #ifndef CommonTools_UtilAlgos_ObjectCountEventSelector_h
2 #define CommonTools_UtilAlgos_ObjectCountEventSelector_h
3 
23 
24 template<typename C,
25  typename S = AnySelector,
26  typename N = MinNumberSelector,
27  typename CS = typename helper::CollectionFilterTrait<C, S, N>::type>
29 {
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  }
37 
38  bool operator()(edm::Event& evt, const edm::EventSetup&) {
40  evt.getByToken( srcToken_, source );
41  return CS::filter( * source, select_, sizeSelect_ );
42  }
43 
44  private:
47 
50 
53 };
54 
55 #endif
56 
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:434
ObjectCountEventSelector(const edm::ParameterSet &cfg, edm::ConsumesCollector &&iC)
constructor
S make(const edm::ParameterSet &cfg)
bool operator()(edm::Event &evt, const edm::EventSetup &)
#define N
Definition: blowfish.cc:9
N sizeSelect_
minimum number of entries in a collection
double S(const TLorentzVector &, const TLorentzVector &)
Definition: Particle.cc:99
static std::string const source
Definition: EdmProvDump.cc:43
def template
Definition: svgfig.py:520
edm::EDGetTokenT< C > srcToken_
source collection label