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 
22 
23 template<typename C,
24  typename S = AnySelector,
25  typename N = MinNumberSelector,
26  typename CS = typename helper::CollectionFilterTrait<C, S, N>::type>
28 {
29  public:
31  explicit ObjectCountEventSelector( const edm::ParameterSet & cfg ) :
32  src_( cfg.template getParameter<edm::InputTag>( "src" ) ),
33  select_( reco::modules::make<S>( cfg ) ),
34  sizeSelect_( reco::modules::make<N>( cfg ) ) {
35  }
36 
37  bool operator()(edm::Event& evt, const edm::EventSetup&) {
39  evt.getByLabel( src_, source );
40  return CS::filter( * source, select_, sizeSelect_ );
41  }
42 
43  private:
46 
49 
52 };
53 
54 #endif
55 
S make(const edm::ParameterSet &cfg)
ObjectCountEventSelector(const edm::ParameterSet &cfg)
constructor
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:361
bool operator()(edm::Event &evt, const edm::EventSetup &)
#define N
Definition: blowfish.cc:9
N sizeSelect_
minimum number of entries in a collection
edm::InputTag src_
source collection label
def template
Definition: svgfig.py:520