CMS 3D CMS Logo

List of all members | Public Member Functions | Public Attributes | Protected Attributes
edm::FilterObjectWrapper< T, C > Class Template Reference

#include <EDFilterObjectWrapper.h>

Inheritance diagram for edm::FilterObjectWrapper< T, C >:
edm::stream::EDFilter<> edm::stream::EDFilterBase edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Public Member Functions

bool filter (edm::Event &event, const edm::EventSetup &eventSetup) override
 everything which has to be done during the event loop. NOTE: We can't use the eventSetup in FWLite so ignore it More...
 
 FilterObjectWrapper (const edm::ParameterSet &cfg)
 default contructor. Declares the output (type "C") and the filter (of type T, operates on C::value_type) More...
 
 ~FilterObjectWrapper () override
 default destructor More...
 
- Public Member Functions inherited from edm::stream::EDFilter<>
 EDFilter ()=default
 
bool hasAbilityToProduceInLumis () const final
 
bool hasAbilityToProduceInRuns () const final
 
- Public Member Functions inherited from edm::stream::EDFilterBase
 EDFilterBase ()
 
ModuleDescription const & moduleDescription () const
 
 ~EDFilterBase () override
 
- Public Member Functions inherited from edm::ProducerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
std::vector< edm::ProductResolverIndex > const & indiciesForPutProducts (BranchType iBranchType) const
 
 ProducerBase ()
 
std::vector< edm::ProductResolverIndex > const & putTokenIndexToProductResolverIndex () const
 
void registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &)
 
std::function< void(BranchDescription const &)> registrationCallback () const
 used by the fwk to register list of products More...
 
void resolvePutIndicies (BranchType iBranchType, ModuleToResolverIndicies const &iIndicies, std::string const &moduleLabel)
 
 ~ProducerBase () noexcept(false) override
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
void convertCurrentProcessAlias (std::string const &processName)
 Convert "@currentProcess" in InputTag process names to the actual current process name. More...
 
 EDConsumerBase ()
 
 EDConsumerBase (EDConsumerBase const &)=delete
 
 EDConsumerBase (EDConsumerBase &&)=default
 
ESProxyIndex const * esGetTokenIndices (edm::Transition iTrans) const
 
ProductResolverIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
std::vector< ProductResolverIndexAndSkipBit > const & itemsToGetFrom (BranchType iType) const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesWhoseProductsAreConsumed (std::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
bool registeredToConsume (ProductResolverIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
ProductResolverIndexAndSkipBit uncheckedIndexFrom (EDGetToken) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
void updateLookup (eventsetup::ESRecordsToProxyIndices const &)
 
virtual ~EDConsumerBase () noexcept(false)
 

Public Attributes

C::const_iterator const_iterator
 
C::iterator iterator
 some convenient typedefs. Recall that C is a container class. More...
 

Protected Attributes

bool doFilter_
 whether or not to filter based on size More...
 
boost::shared_ptr< Tfilter_
 shared pointer to analysis class of type BasicAnalyzer More...
 
edm::EDGetTokenT< C > src_
 InputTag of the input source. More...
 

Additional Inherited Members

- Public Types inherited from edm::stream::EDFilter<>
typedef CacheContexts< T... > CacheTypes
 
typedef CacheTypes::GlobalCache GlobalCache
 
typedef AbilityChecker< T... > HasAbility
 
typedef CacheTypes::LuminosityBlockCache LuminosityBlockCache
 
typedef LuminosityBlockContextT< LuminosityBlockCache, RunCache, GlobalCacheLuminosityBlockContext
 
typedef CacheTypes::LuminosityBlockSummaryCache LuminosityBlockSummaryCache
 
typedef CacheTypes::RunCache RunCache
 
typedef RunContextT< RunCache, GlobalCacheRunContext
 
typedef CacheTypes::RunSummaryCache RunSummaryCache
 
- Public Types inherited from edm::stream::EDFilterBase
typedef EDFilterAdaptorBase ModuleType
 
- Public Types inherited from edm::ProducerBase
using ModuleToResolverIndicies = std::unordered_multimap< std::string, std::tuple< edm::TypeID const *, const char *, edm::ProductResolverIndex >>
 
typedef ProductRegistryHelper::TypeLabelList TypeLabelList
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- Static Public Member Functions inherited from edm::stream::EDFilterBase
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 
- Protected Member Functions inherited from edm::EDConsumerBase
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken consumes (TypeToGet const &id, edm::InputTag const &tag)
 
ConsumesCollector consumesCollector ()
 Use a ConsumesCollector to gather consumes information from helper functions. More...
 
template<typename ProductType , BranchType B = InEvent>
void consumesMany ()
 
void consumesMany (const TypeToGet &id)
 
template<BranchType B>
void consumesMany (const TypeToGet &id)
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes ()
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes (ESInputTag const &tag)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 

Detailed Description

template<class T, class C>
class edm::FilterObjectWrapper< T, C >

Definition at line 49 of file EDFilterObjectWrapper.h.

Constructor & Destructor Documentation

template<class T , class C >
edm::FilterObjectWrapper< T, C >::FilterObjectWrapper ( const edm::ParameterSet cfg)
inline

default contructor. Declares the output (type "C") and the filter (of type T, operates on C::value_type)

Definition at line 57 of file EDFilterObjectWrapper.h.

References edm::FilterObjectWrapper< T, C >::doFilter_, edm::ParameterSet::exists(), edm::FilterObjectWrapper< T, C >::filter_, and edm::ParameterSet::getParameter().

57  : src_( consumes<C>(cfg.getParameter<edm::InputTag>("src")))
58  {
59  filter_ = boost::shared_ptr<T>( new T(cfg.getParameter<edm::ParameterSet>("filterParams")) );
60  if ( cfg.exists("filter") ) {
61  doFilter_ = cfg.getParameter<bool>("filter");
62  } else {
63  doFilter_ = false;
64  }
65  produces<C>();
66  }
bool doFilter_
whether or not to filter based on size
T getParameter(std::string const &) const
boost::shared_ptr< T > filter_
shared pointer to analysis class of type BasicAnalyzer
bool exists(std::string const &parameterName) const
checks if a parameter exists
edm::EDGetTokenT< C > src_
InputTag of the input source.
long double T
template<class T , class C >
edm::FilterObjectWrapper< T, C >::~FilterObjectWrapper ( )
inlineoverride

default destructor

Definition at line 68 of file EDFilterObjectWrapper.h.

68 {}

Member Function Documentation

template<class T , class C >
bool edm::FilterObjectWrapper< T, C >::filter ( edm::Event event,
const edm::EventSetup eventSetup 
)
inlineoverride

everything which has to be done during the event loop. NOTE: We can't use the eventSetup in FWLite so ignore it

Definition at line 70 of file EDFilterObjectWrapper.h.

References edm::FilterObjectWrapper< T, C >::doFilter_, edm::FilterObjectWrapper< T, C >::filter_, mps_fire::i, eostools::move(), and edm::FilterObjectWrapper< T, C >::src_.

70  {
71  // create a collection of the objects to put into the event
72  auto objsToPut = std::make_unique<C>();
73  // get the handle to the objects in the event.
74  edm::Handle<C> h_c;
75  event.getByToken( src_, h_c );
76  // loop through and add passing value_types to the output vector
77  for ( typename C::const_iterator ibegin = h_c->begin(), iend = h_c->end(), i = ibegin; i != iend; ++i ){
78  if ( (*filter_)(*i) ){
79  objsToPut->push_back( *i );
80  }
81  }
82  // put objs in the event
83  bool pass = !objsToPut->empty();
84  event.put(std::move(objsToPut));
85  if ( doFilter_ )
86  return pass;
87  else
88  return true;
89  }
bool doFilter_
whether or not to filter based on size
boost::shared_ptr< T > filter_
shared pointer to analysis class of type BasicAnalyzer
edm::EDGetTokenT< C > src_
InputTag of the input source.
def move(src, dest)
Definition: eostools.py:511

Member Data Documentation

template<class T , class C >
C::const_iterator edm::FilterObjectWrapper< T, C >::const_iterator

Definition at line 54 of file EDFilterObjectWrapper.h.

template<class T , class C >
bool edm::FilterObjectWrapper< T, C >::doFilter_
protected

whether or not to filter based on size

Definition at line 97 of file EDFilterObjectWrapper.h.

Referenced by edm::FilterObjectWrapper< T, C >::filter(), and edm::FilterObjectWrapper< T, C >::FilterObjectWrapper().

template<class T , class C >
boost::shared_ptr<T> edm::FilterObjectWrapper< T, C >::filter_
protected

shared pointer to analysis class of type BasicAnalyzer

Definition at line 95 of file EDFilterObjectWrapper.h.

Referenced by edm::FilterObjectWrapper< T, C >::filter(), and edm::FilterObjectWrapper< T, C >::FilterObjectWrapper().

template<class T , class C >
C::iterator edm::FilterObjectWrapper< T, C >::iterator

some convenient typedefs. Recall that C is a container class.

Definition at line 53 of file EDFilterObjectWrapper.h.

template<class T , class C >
edm::EDGetTokenT<C> edm::FilterObjectWrapper< T, C >::src_
protected

InputTag of the input source.

Definition at line 93 of file EDFilterObjectWrapper.h.

Referenced by edm::FilterObjectWrapper< T, C >::filter().