CMS 3D CMS Logo

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

#include <FilterValueMapWrapper.h>

Inheritance diagram for edm::FilterValueMapWrapper< T, C >:
edm::stream::EDProducer<>

Public Member Functions

 FilterValueMapWrapper (const edm::ParameterSet &cfg)
 default contructor. Declares the output (type "C") and the filter (of type T, operates on C::value_type) More...
 
void produce (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...
 
 ~FilterValueMapWrapper () override
 default destructor More...
 
- Public Member Functions inherited from edm::stream::EDProducer<>
 EDProducer ()=default
 
bool hasAbilityToProduceInLumis () const final
 
bool hasAbilityToProduceInRuns () const final
 

Public Attributes

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

Protected Attributes

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::EDProducer<>
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
 

Detailed Description

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

Definition at line 18 of file FilterValueMapWrapper.h.

Constructor & Destructor Documentation

template<class T , class C >
edm::FilterValueMapWrapper< T, C >::FilterValueMapWrapper ( 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 26 of file FilterValueMapWrapper.h.

References edm::FilterValueMapWrapper< T, C >::filter_, and edm::ParameterSet::getParameter().

26  : src_( consumes<C>(cfg.getParameter<edm::InputTag>("src")))
27  {
28  filter_ = boost::shared_ptr<T>( new T(cfg.getParameter<edm::ParameterSet>("filterParams")) );
29  produces<edm::ValueMap<int>>();
30  }
T getParameter(std::string const &) const
edm::EDGetTokenT< C > src_
InputTag of the input source.
boost::shared_ptr< T > filter_
shared pointer to analysis class of type BasicAnalyzer
long double T
template<class T , class C >
edm::FilterValueMapWrapper< T, C >::~FilterValueMapWrapper ( )
inlineoverride

default destructor

Definition at line 32 of file FilterValueMapWrapper.h.

32 {}

Member Function Documentation

template<class T , class C >
void edm::FilterValueMapWrapper< T, C >::produce ( 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 34 of file FilterValueMapWrapper.h.

References edm::helper::Filler< Map >::fill(), objects.autophobj::filler, edm::FilterValueMapWrapper< T, C >::filter_, mps_fire::i, edm::helper::Filler< Map >::insert(), eostools::move(), connectstrParser::o, and edm::FilterValueMapWrapper< T, C >::src_.

34  {
35  // create a collection of the objects to put into the event
36  auto objsToPut = std::make_unique<C>();
37  // get the handle to the objects in the event.
38  edm::Handle<C> h_c;
39  event.getByToken( src_, h_c );
40  std::vector<int> bitOut;
41  // loop through and add passing value_types to the output vector
42  for ( typename C::const_iterator ibegin = h_c->begin(), iend = h_c->end(), i = ibegin; i != iend; ++i ){
43  bitOut.push_back((*filter_)(*i));
44  }
45  std::unique_ptr<edm::ValueMap<int>> o(new edm::ValueMap<int>());
47  filler.insert(h_c,bitOut.begin(),bitOut.end());
48  filler.fill();
49  event.put(std::move(o));
50  }
edm::EDGetTokenT< C > src_
InputTag of the input source.
boost::shared_ptr< T > filter_
shared pointer to analysis class of type BasicAnalyzer
def move(src, dest)
Definition: eostools.py:511

Member Data Documentation

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

Definition at line 23 of file FilterValueMapWrapper.h.

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

shared pointer to analysis class of type BasicAnalyzer

Definition at line 56 of file FilterValueMapWrapper.h.

Referenced by edm::FilterValueMapWrapper< T, C >::FilterValueMapWrapper(), and edm::FilterValueMapWrapper< T, C >::produce().

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

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

Definition at line 22 of file FilterValueMapWrapper.h.

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

InputTag of the input source.

Definition at line 54 of file FilterValueMapWrapper.h.

Referenced by edm::FilterValueMapWrapper< T, C >::produce().