CMS 3D CMS Logo

List of all members | Public Member Functions | Static Public Member Functions | Private Attributes
ObjectCountEventSelector< C, S, N, CS > Class Template Reference

#include <ObjectCountEventSelector.h>

Inheritance diagram for ObjectCountEventSelector< C, S, N, CS >:
EventSelectorBase

Public Member Functions

 ObjectCountEventSelector (const edm::ParameterSet &cfg, edm::ConsumesCollector &&iC)
 constructor More...
 
bool operator() (edm::Event &evt, const edm::EventSetup &) const override
 
- Public Member Functions inherited from EventSelectorBase
 EventSelectorBase ()
 
virtual ~EventSelectorBase ()
 

Static Public Member Functions

static void fillPSetDescription (edm::ParameterSetDescription &desc)
 

Private Attributes

S select_
 object filter More...
 
N sizeSelect_
 minimum number of entries in a collection More...
 
edm::EDGetTokenT< C > srcToken_
 source collection label More...
 

Detailed Description

template<typename C, typename S = AnySelector, typename N = MinNumberSelector, typename CS = typename helper::CollectionFilterTrait<C, S, N>::type>
class ObjectCountEventSelector< C, S, N, CS >

Selects an event if a collection has at least N entries

Author
Luca Lista, INFN
Version
Revision
1.2
Id
ObjectCountEventSelector.h,v 1.2 2010/02/20 20:55:24 wmtan Exp

Definition at line 29 of file ObjectCountEventSelector.h.

Constructor & Destructor Documentation

template<typename C , typename S = AnySelector, typename N = MinNumberSelector, typename CS = typename helper::CollectionFilterTrait<C, S, N>::type>
ObjectCountEventSelector< C, S, N, CS >::ObjectCountEventSelector ( const edm::ParameterSet cfg,
edm::ConsumesCollector &&  iC 
)
inlineexplicit

constructor

Definition at line 33 of file ObjectCountEventSelector.h.

33  :
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  }
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
N sizeSelect_
minimum number of entries in a collection
edm::EDGetTokenT< C > srcToken_
source collection label

Member Function Documentation

template<typename C , typename S = AnySelector, typename N = MinNumberSelector, typename CS = typename helper::CollectionFilterTrait<C, S, N>::type>
static void ObjectCountEventSelector< C, S, N, CS >::fillPSetDescription ( edm::ParameterSetDescription desc)
inlinestatic

Definition at line 39 of file ObjectCountEventSelector.h.

References edm::ParameterSetDescription::add().

39  {
40  desc.add<edm::InputTag>("src", edm::InputTag());
41  reco::modules::fillPSetDescription<S>(desc);
42  reco::modules::fillPSetDescription<N>(desc);
43  }
ParameterDescriptionBase * add(U const &iLabel, T const &value)
template<typename C , typename S = AnySelector, typename N = MinNumberSelector, typename CS = typename helper::CollectionFilterTrait<C, S, N>::type>
bool ObjectCountEventSelector< C, S, N, CS >::operator() ( edm::Event evt,
const edm::EventSetup  
) const
inlineoverridevirtual

Implements EventSelectorBase.

Definition at line 45 of file ObjectCountEventSelector.h.

References ALCARECOTkAlBeamHalo_cff::filter, edm::Event::getByToken(), ObjectCountEventSelector< C, S, N, CS >::select_, ObjectCountEventSelector< C, S, N, CS >::sizeSelect_, source, and ObjectCountEventSelector< C, S, N, CS >::srcToken_.

45  {
47  evt.getByToken( srcToken_, source );
48  return CS::filter( * source, select_, sizeSelect_ );
49  }
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:517
N sizeSelect_
minimum number of entries in a collection
static std::string const source
Definition: EdmProvDump.cc:47
edm::EDGetTokenT< C > srcToken_
source collection label

Member Data Documentation

template<typename C , typename S = AnySelector, typename N = MinNumberSelector, typename CS = typename helper::CollectionFilterTrait<C, S, N>::type>
S ObjectCountEventSelector< C, S, N, CS >::select_
private

object filter

Definition at line 56 of file ObjectCountEventSelector.h.

Referenced by ObjectCountEventSelector< C, S, N, CS >::operator()().

template<typename C , typename S = AnySelector, typename N = MinNumberSelector, typename CS = typename helper::CollectionFilterTrait<C, S, N>::type>
N ObjectCountEventSelector< C, S, N, CS >::sizeSelect_
private

minimum number of entries in a collection

Definition at line 59 of file ObjectCountEventSelector.h.

Referenced by ObjectCountEventSelector< C, S, N, CS >::operator()().

template<typename C , typename S = AnySelector, typename N = MinNumberSelector, typename CS = typename helper::CollectionFilterTrait<C, S, N>::type>
edm::EDGetTokenT<C> ObjectCountEventSelector< C, S, N, CS >::srcToken_
private

source collection label

Definition at line 53 of file ObjectCountEventSelector.h.

Referenced by ObjectCountEventSelector< C, S, N, CS >::operator()().