CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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

virtual 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...
 
virtual ~FilterObjectWrapper ()
 default destructor More...
 
- Public Member Functions inherited from edm::stream::EDFilter<>
 EDFilter ()=default
 
- Public Member Functions inherited from edm::stream::EDFilterBase
 EDFilterBase ()
 
ModuleDescription const & moduleDescription () const
 
virtual ~EDFilterBase ()
 
- Public Member Functions inherited from edm::ProducerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
 ProducerBase ()
 
void registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &)
 
std::function< void(BranchDescription
const &)> 
registrationCallback () const
 used by the fwk to register list of products More...
 
virtual ~ProducerBase ()
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
 EDConsumerBase ()
 
ProductHolderIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
std::vector
< ProductHolderIndexAndSkipBit >
const & 
itemsToGetFromEvent () const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesDependentUpon (const std::string &iProcessName, std::vector< const char * > &oModuleLabels) const
 
void modulesWhoseProductsAreConsumed (std::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
bool registeredToConsume (ProductHolderIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void updateLookup (BranchType iBranchType, ProductHolderIndexHelper const &)
 
virtual ~EDConsumerBase ()
 

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, GlobalCache
LuminosityBlockContext
 
typedef
CacheTypes::LuminosityBlockSummaryCache 
LuminosityBlockSummaryCache
 
typedef CacheTypes::RunCache RunCache
 
typedef RunContextT< RunCache,
GlobalCache
RunContext
 
typedef CacheTypes::RunSummaryCache RunSummaryCache
 
- Public Types inherited from edm::stream::EDFilterBase
typedef EDFilterAdaptorBase ModuleType
 
- Public Types inherited from edm::ProducerBase
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 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_, edm::ParameterSet::getParameter(), and produces< C >().

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
produces< C >()
template<class T , class C >
virtual edm::FilterObjectWrapper< T, C >::~FilterObjectWrapper ( )
inlinevirtual

default destructor

Definition at line 68 of file EDFilterObjectWrapper.h.

68 {}

Member Function Documentation

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

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

Implements edm::stream::EDFilterBase.

Definition at line 70 of file EDFilterObjectWrapper.h.

References funct::C, edm::FilterObjectWrapper< T, C >::doFilter_, edm::FilterObjectWrapper< T, C >::filter_, i, and edm::FilterObjectWrapper< T, C >::src_.

70  {
71  // create a collection of the objects to put into the event
72  std::auto_ptr<C> objsToPut( new 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->size() > 0;
84  event.put(objsToPut);
85  if ( doFilter_ )
86  return pass;
87  else
88  return true;
89  }
bool doFilter_
whether or not to filter based on size
int i
Definition: DBlmapReader.cc:9
boost::shared_ptr< T > filter_
shared pointer to analysis class of type BasicAnalyzer
edm::EDGetTokenT< C > src_
InputTag of the input source.

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().