CMS 3D CMS Logo

SingleElementCollectionSelector< InputCollection, Selector, OutputCollection, StoreContainer, RefAdder > Class Template Reference

selects a subset of a collection based on single element selection done via functor More...

#include <PhysicsTools/UtilAlgos/interface/SingleElementCollectionSelector.h>

List of all members.

Public Types

typedef InputCollection collection
typedef container::const_iterator const_iterator
typedef StoreContainer container
typedef Selector selector

Public Member Functions

const_iterator begin () const
const_iterator end () const
void select (const edm::Handle< InputCollection > &c, const edm::Event &, const edm::EventSetup &)
 SingleElementCollectionSelector (const edm::ParameterSet &cfg)

Private Attributes

RefAdder addRef_
selector select_
container selected_

Friends

class reco::modules::SingleElementCollectionSelectorEventSetupInit< SingleElementCollectionSelector >


Detailed Description

template<typename InputCollection, typename Selector, typename OutputCollection = typename ::helper::SelectedOutputCollectionTrait<InputCollection>::type, typename StoreContainer = typename ::helper::StoreContainerTrait<OutputCollection>::type, typename RefAdder = typename ::helper::SelectionAdderTrait<InputCollection, StoreContainer>::type>
class SingleElementCollectionSelector< InputCollection, Selector, OutputCollection, StoreContainer, RefAdder >

selects a subset of a collection based on single element selection done via functor

Author:
Luca Lista, INFN
Version:
Revision
1.13

Id
SingleElementCollectionSelector.h,v 1.13 2008/02/04 10:44:27 llista Exp

Definition at line 27 of file SingleElementCollectionSelector.h.


Member Typedef Documentation

template<typename InputCollection, typename Selector, typename OutputCollection = typename ::helper::SelectedOutputCollectionTrait<InputCollection>::type, typename StoreContainer = typename ::helper::StoreContainerTrait<OutputCollection>::type, typename RefAdder = typename ::helper::SelectionAdderTrait<InputCollection, StoreContainer>::type>
typedef InputCollection SingleElementCollectionSelector< InputCollection, Selector, OutputCollection, StoreContainer, RefAdder >::collection

Definition at line 28 of file SingleElementCollectionSelector.h.

template<typename InputCollection, typename Selector, typename OutputCollection = typename ::helper::SelectedOutputCollectionTrait<InputCollection>::type, typename StoreContainer = typename ::helper::StoreContainerTrait<OutputCollection>::type, typename RefAdder = typename ::helper::SelectionAdderTrait<InputCollection, StoreContainer>::type>
typedef container::const_iterator SingleElementCollectionSelector< InputCollection, Selector, OutputCollection, StoreContainer, RefAdder >::const_iterator

Definition at line 31 of file SingleElementCollectionSelector.h.

template<typename InputCollection, typename Selector, typename OutputCollection = typename ::helper::SelectedOutputCollectionTrait<InputCollection>::type, typename StoreContainer = typename ::helper::StoreContainerTrait<OutputCollection>::type, typename RefAdder = typename ::helper::SelectionAdderTrait<InputCollection, StoreContainer>::type>
typedef StoreContainer SingleElementCollectionSelector< InputCollection, Selector, OutputCollection, StoreContainer, RefAdder >::container

Definition at line 29 of file SingleElementCollectionSelector.h.

template<typename InputCollection, typename Selector, typename OutputCollection = typename ::helper::SelectedOutputCollectionTrait<InputCollection>::type, typename StoreContainer = typename ::helper::StoreContainerTrait<OutputCollection>::type, typename RefAdder = typename ::helper::SelectionAdderTrait<InputCollection, StoreContainer>::type>
typedef Selector SingleElementCollectionSelector< InputCollection, Selector, OutputCollection, StoreContainer, RefAdder >::selector

Definition at line 30 of file SingleElementCollectionSelector.h.


Constructor & Destructor Documentation

template<typename InputCollection, typename Selector, typename OutputCollection = typename ::helper::SelectedOutputCollectionTrait<InputCollection>::type, typename StoreContainer = typename ::helper::StoreContainerTrait<OutputCollection>::type, typename RefAdder = typename ::helper::SelectionAdderTrait<InputCollection, StoreContainer>::type>
SingleElementCollectionSelector< InputCollection, Selector, OutputCollection, StoreContainer, RefAdder >::SingleElementCollectionSelector ( const edm::ParameterSet cfg  )  [inline]

Definition at line 32 of file SingleElementCollectionSelector.h.

00032                                                                : 
00033     select_(reco::modules::make<Selector>(cfg)) { }


Member Function Documentation

template<typename InputCollection, typename Selector, typename OutputCollection = typename ::helper::SelectedOutputCollectionTrait<InputCollection>::type, typename StoreContainer = typename ::helper::StoreContainerTrait<OutputCollection>::type, typename RefAdder = typename ::helper::SelectionAdderTrait<InputCollection, StoreContainer>::type>
const_iterator SingleElementCollectionSelector< InputCollection, Selector, OutputCollection, StoreContainer, RefAdder >::begin ( void   )  const [inline]

Definition at line 34 of file SingleElementCollectionSelector.h.

00034 { return selected_.begin(); }

template<typename InputCollection, typename Selector, typename OutputCollection = typename ::helper::SelectedOutputCollectionTrait<InputCollection>::type, typename StoreContainer = typename ::helper::StoreContainerTrait<OutputCollection>::type, typename RefAdder = typename ::helper::SelectionAdderTrait<InputCollection, StoreContainer>::type>
const_iterator SingleElementCollectionSelector< InputCollection, Selector, OutputCollection, StoreContainer, RefAdder >::end ( void   )  const [inline]

Definition at line 35 of file SingleElementCollectionSelector.h.

00035 { return selected_.end(); }

template<typename InputCollection, typename Selector, typename OutputCollection = typename ::helper::SelectedOutputCollectionTrait<InputCollection>::type, typename StoreContainer = typename ::helper::StoreContainerTrait<OutputCollection>::type, typename RefAdder = typename ::helper::SelectionAdderTrait<InputCollection, StoreContainer>::type>
void SingleElementCollectionSelector< InputCollection, Selector, OutputCollection, StoreContainer, RefAdder >::select ( const edm::Handle< InputCollection > &  c,
const edm::Event ,
const edm::EventSetup  
) [inline]

Definition at line 36 of file SingleElementCollectionSelector.h.

00036                                                                                             {
00037     selected_.clear();    
00038     for(size_t idx = 0; idx < c->size(); ++ idx) {
00039       if(select_((*c)[idx])) 
00040         addRef_(selected_, c, idx);
00041     }
00042   }


Friends And Related Function Documentation

template<typename InputCollection, typename Selector, typename OutputCollection = typename ::helper::SelectedOutputCollectionTrait<InputCollection>::type, typename StoreContainer = typename ::helper::StoreContainerTrait<OutputCollection>::type, typename RefAdder = typename ::helper::SelectionAdderTrait<InputCollection, StoreContainer>::type>
friend class reco::modules::SingleElementCollectionSelectorEventSetupInit< SingleElementCollectionSelector > [friend]

Definition at line 47 of file SingleElementCollectionSelector.h.


Member Data Documentation

template<typename InputCollection, typename Selector, typename OutputCollection = typename ::helper::SelectedOutputCollectionTrait<InputCollection>::type, typename StoreContainer = typename ::helper::StoreContainerTrait<OutputCollection>::type, typename RefAdder = typename ::helper::SelectionAdderTrait<InputCollection, StoreContainer>::type>
RefAdder SingleElementCollectionSelector< InputCollection, Selector, OutputCollection, StoreContainer, RefAdder >::addRef_ [private]

Definition at line 46 of file SingleElementCollectionSelector.h.

Referenced by SingleElementCollectionSelector< std::vector< IndexedCandidate >, Selector, std::vector< ProtoJet >, StoreContainer, RefAdder >::select().

template<typename InputCollection, typename Selector, typename OutputCollection = typename ::helper::SelectedOutputCollectionTrait<InputCollection>::type, typename StoreContainer = typename ::helper::StoreContainerTrait<OutputCollection>::type, typename RefAdder = typename ::helper::SelectionAdderTrait<InputCollection, StoreContainer>::type>
selector SingleElementCollectionSelector< InputCollection, Selector, OutputCollection, StoreContainer, RefAdder >::select_ [private]

Definition at line 45 of file SingleElementCollectionSelector.h.

Referenced by SingleElementCollectionSelector< std::vector< IndexedCandidate >, Selector, std::vector< ProtoJet >, StoreContainer, RefAdder >::select().

template<typename InputCollection, typename Selector, typename OutputCollection = typename ::helper::SelectedOutputCollectionTrait<InputCollection>::type, typename StoreContainer = typename ::helper::StoreContainerTrait<OutputCollection>::type, typename RefAdder = typename ::helper::SelectionAdderTrait<InputCollection, StoreContainer>::type>
container SingleElementCollectionSelector< InputCollection, Selector, OutputCollection, StoreContainer, RefAdder >::selected_ [private]

Definition at line 44 of file SingleElementCollectionSelector.h.

Referenced by SingleElementCollectionSelector< std::vector< IndexedCandidate >, Selector, std::vector< ProtoJet >, StoreContainer, RefAdder >::begin(), SingleElementCollectionSelector< std::vector< IndexedCandidate >, Selector, std::vector< ProtoJet >, StoreContainer, RefAdder >::end(), and SingleElementCollectionSelector< std::vector< IndexedCandidate >, Selector, std::vector< ProtoJet >, StoreContainer, RefAdder >::select().


The documentation for this class was generated from the following file:
Generated on Tue Jun 9 18:31:45 2009 for CMSSW by  doxygen 1.5.4