CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Types | Private Member Functions | Private Attributes
edm::GenericSelectorByValueMap< T, C > Class Template Reference

#include <GenericSelectorByValueMap.h>

Inheritance diagram for edm::GenericSelectorByValueMap< T, C >:
edm::EDProducer edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Public Member Functions

 GenericSelectorByValueMap (edm::ParameterSet const &config)
 
- Public Member Functions inherited from edm::EDProducer
 EDProducer ()
 
ModuleDescription const & moduleDescription () const
 
virtual ~EDProducer ()
 
- Public Member Functions inherited from edm::ProducerBase
 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
 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
 
bool registeredToConsume (ProductHolderIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void updateLookup (BranchType iBranchType, ProductHolderIndexHelper const &)
 
virtual ~EDConsumerBase ()
 

Private Types

typedef T candidate_type
 
typedef details::template
CompatibleConfigurationType
< selection_type >::type 
cut_type
 
typedef C selection_type
 

Private Member Functions

void produce (edm::Event &event, edm::EventSetup const &setup)
 

Private Attributes

cut_type m_cut
 
edm::EDGetTokenT< edm::View
< candidate_type > > 
token_electrons
 
edm::EDGetTokenT
< edm::ValueMap
< selection_type > > 
token_selection
 

Additional Inherited Members

- Public Types inherited from edm::EDProducer
typedef EDProducer ModuleType
 
- Public Types inherited from edm::ProducerBase
typedef
ProductRegistryHelper::TypeLabelList 
TypeLabelList
 
- Static Public Member Functions inherited from edm::EDProducer
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 
- Protected Member Functions inherited from edm::ProducerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
- 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<typename T, typename C>
class edm::GenericSelectorByValueMap< T, C >

Definition at line 38 of file GenericSelectorByValueMap.h.

Member Typedef Documentation

template<typename T , typename C >
typedef T edm::GenericSelectorByValueMap< T, C >::candidate_type
private

Definition at line 43 of file GenericSelectorByValueMap.h.

template<typename T , typename C >
typedef details::template CompatibleConfigurationType<selection_type>::type edm::GenericSelectorByValueMap< T, C >::cut_type
private

Definition at line 45 of file GenericSelectorByValueMap.h.

template<typename T , typename C >
typedef C edm::GenericSelectorByValueMap< T, C >::selection_type
private

Definition at line 44 of file GenericSelectorByValueMap.h.

Constructor & Destructor Documentation

template<typename T , typename C >
GenericSelectorByValueMap::GenericSelectorByValueMap ( edm::ParameterSet const &  config)
explicit

Definition at line 72 of file GenericSelectorByValueMap.h.

72  :
75  m_cut(config.getParameter<cut_type>("cut"))
76 {
77  // register the product
78  produces<edm::RefToBaseVector<candidate_type> >();
79 }
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
edm::EDGetTokenT< edm::ValueMap< selection_type > > token_selection
details::template CompatibleConfigurationType< selection_type >::type cut_type
edm::EDGetTokenT< edm::View< candidate_type > > token_electrons

Member Function Documentation

template<typename T , typename C >
void GenericSelectorByValueMap::produce ( edm::Event event,
edm::EventSetup const &  setup 
)
privatevirtual

Implements edm::EDProducer.

Definition at line 84 of file GenericSelectorByValueMap.h.

References HI_PhotonSkim_cff::electrons, i, edm::View< T >::refAt(), and edm::View< T >::size().

85 {
86  std::auto_ptr<edm::RefToBaseVector<candidate_type> > candidates(new edm::RefToBaseVector<candidate_type>());
87 
88  // read the collection of GsfElectrons from the Event
90  event.getByToken(token_electrons, h_electrons);
91  edm::View<candidate_type> const & electrons = * h_electrons;
92 
93  // read the selection map from the Event
95  event.getByToken(token_selection, h_selection);
96  edm::ValueMap<selection_type> const & selectionMap = * h_selection;
97 
98  for (unsigned int i = 0; i < electrons.size(); ++i) {
99  edm::RefToBase<candidate_type> ptr = electrons.refAt(i);
100  if (selectionMap[ptr] > m_cut)
101  candidates->push_back(ptr);
102  }
103 
104  // put the product in the event
105  event.put(candidates);
106 }
int i
Definition: DBlmapReader.cc:9
RefToBase< value_type > refAt(size_type i) const
edm::EDGetTokenT< edm::ValueMap< selection_type > > token_selection
size_type size() const
edm::EDGetTokenT< edm::View< candidate_type > > token_electrons

Member Data Documentation

template<typename T , typename C >
cut_type edm::GenericSelectorByValueMap< T, C >::m_cut
private

Definition at line 52 of file GenericSelectorByValueMap.h.

template<typename T , typename C >
edm::EDGetTokenT<edm::View<candidate_type> > edm::GenericSelectorByValueMap< T, C >::token_electrons
private

Definition at line 49 of file GenericSelectorByValueMap.h.

template<typename T , typename C >
edm::EDGetTokenT<edm::ValueMap<selection_type> > edm::GenericSelectorByValueMap< T, C >::token_selection
private

Definition at line 50 of file GenericSelectorByValueMap.h.