#include <GenericSelectorByValueMap.h>
Public Member Functions | |
GenericSelectorByValueMap (edm::ParameterSet const &config) | |
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::InputTag | m_electrons |
edm::InputTag | m_selection |
Definition at line 36 of file GenericSelectorByValueMap.h.
typedef T edm::GenericSelectorByValueMap< T, C >::candidate_type [private] |
Definition at line 41 of file GenericSelectorByValueMap.h.
typedef details::template CompatibleConfigurationType<selection_type>::type edm::GenericSelectorByValueMap< T, C >::cut_type [private] |
Definition at line 43 of file GenericSelectorByValueMap.h.
typedef C edm::GenericSelectorByValueMap< T, C >::selection_type [private] |
Definition at line 42 of file GenericSelectorByValueMap.h.
GenericSelectorByValueMap::GenericSelectorByValueMap | ( | edm::ParameterSet const & | config | ) | [explicit] |
Definition at line 72 of file GenericSelectorByValueMap.h.
: m_electrons(config.getParameter<edm::InputTag>("input")), m_selection(config.getParameter<edm::InputTag>("selection")), m_cut(config.getParameter<cut_type>("cut")) { // register the product produces<edm::RefToBaseVector<candidate_type> >(); }
void GenericSelectorByValueMap::produce | ( | edm::Event & | event, |
edm::EventSetup const & | setup | ||
) | [private, virtual] |
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().
{ std::auto_ptr<edm::RefToBaseVector<candidate_type> > candidates(new edm::RefToBaseVector<candidate_type>()); // read the collection of GsfElectrons from the Event edm::Handle<edm::View<candidate_type> > h_electrons; event.getByLabel(m_electrons, h_electrons); edm::View<candidate_type> const & electrons = * h_electrons; // read the selection map from the Event edm::Handle<edm::ValueMap<selection_type> > h_selection; event.getByLabel(m_selection, h_selection); edm::ValueMap<selection_type> const & selectionMap = * h_selection; for (unsigned int i = 0; i < electrons.size(); ++i) { edm::RefToBase<candidate_type> ptr = electrons.refAt(i); if (selectionMap[ptr] > m_cut) candidates->push_back(ptr); } // put the product in the event event.put(candidates); }
cut_type edm::GenericSelectorByValueMap< T, C >::m_cut [private] |
Definition at line 50 of file GenericSelectorByValueMap.h.
edm::InputTag edm::GenericSelectorByValueMap< T, C >::m_electrons [private] |
Definition at line 47 of file GenericSelectorByValueMap.h.
edm::InputTag edm::GenericSelectorByValueMap< T, C >::m_selection [private] |
Definition at line 48 of file GenericSelectorByValueMap.h.