CMS 3D CMS Logo

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 ()
 
SerialTaskQueueglobalLuminosityBlocksQueue ()
 
SerialTaskQueueglobalRunsQueue ()
 
ModuleDescription const & moduleDescription () const
 
 ~EDProducer () override
 
- Public Member Functions inherited from edm::ProducerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
std::vector< edm::ProductResolverIndex > const & indiciesForPutProducts (BranchType iBranchType) const
 
 ProducerBase ()
 
std::vector< edm::ProductResolverIndex > const & putTokenIndexToProductResolverIndex () const
 
std::vector< bool > const & recordProvenanceList () const
 
void registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &)
 
std::function< void(BranchDescription const &)> registrationCallback () const
 used by the fwk to register list of products More...
 
void resolvePutIndicies (BranchType iBranchType, ModuleToResolverIndicies const &iIndicies, std::string const &moduleLabel)
 
TypeLabelList const & typeLabelList () const
 used by the fwk to register the list of products of this module More...
 
 ~ProducerBase () noexcept(false) override
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
void convertCurrentProcessAlias (std::string const &processName)
 Convert "@currentProcess" in InputTag process names to the actual current process name. More...
 
 EDConsumerBase ()
 
 EDConsumerBase (EDConsumerBase &&)=default
 
 EDConsumerBase (EDConsumerBase const &)=delete
 
ESProxyIndex const * esGetTokenIndices (edm::Transition iTrans) const
 
ProductResolverIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
std::vector< ProductResolverIndexAndSkipBit > const & itemsToGetFrom (BranchType iType) const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesWhoseProductsAreConsumed (std::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
bool registeredToConsume (ProductResolverIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
ProductResolverIndexAndSkipBit uncheckedIndexFrom (EDGetToken) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
void updateLookup (eventsetup::ESRecordsToProxyIndices const &)
 
virtual ~EDConsumerBase () noexcept(false)
 

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) override
 

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
using ModuleToResolverIndicies = std::unordered_multimap< std::string, std::tuple< edm::TypeID const *, const char *, edm::ProductResolverIndex > >
 
typedef ProductRegistryHelper::TypeLabelList TypeLabelList
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- Static Public Member Functions inherited from edm::EDProducer
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 
static bool wantsGlobalLuminosityBlocks ()
 
static bool wantsGlobalRuns ()
 
static bool wantsStreamLuminosityBlocks ()
 
static bool wantsStreamRuns ()
 
- Protected Member Functions inherited from edm::ProducerBase
template<class ProductType >
BranchAliasSetterT< ProductType > produces ()
 declare what type of product will make and with which optional label More...
 
template<typename ProductType , BranchType B>
BranchAliasSetterT< ProductType > produces ()
 
template<typename ProductType , Transition B>
BranchAliasSetterT< ProductType > produces ()
 
BranchAliasSetter produces (const TypeID &id, std::string instanceName=std::string(), bool recordProvenance=true)
 
template<BranchType B>
BranchAliasSetter produces (const TypeID &id, std::string instanceName=std::string(), bool recordProvenance=true)
 
template<Transition B>
BranchAliasSetter produces (const TypeID &id, std::string instanceName=std::string(), bool recordProvenance=true)
 
template<typename ProductType , Transition B>
BranchAliasSetterT< ProductType > produces (std::string instanceName)
 
template<class ProductType >
BranchAliasSetterT< ProductType > produces (std::string instanceName)
 
template<typename ProductType , BranchType B>
BranchAliasSetterT< ProductType > produces (std::string instanceName)
 
ProducesCollector producesCollector ()
 
- Protected Member Functions inherited from edm::EDConsumerBase
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (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 ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes ()
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes (ESInputTag const &tag)
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (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

◆ candidate_type

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

Definition at line 43 of file GenericSelectorByValueMap.h.

◆ cut_type

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.

◆ selection_type

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

◆ GenericSelectorByValueMap()

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

Definition at line 72 of file GenericSelectorByValueMap.h.

75  m_cut(config.getParameter<cut_type>("cut")) {
76  // register the product
77  produces<edm::RefToBaseVector<candidate_type>>();
78  }

Member Function Documentation

◆ produce()

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

Implements edm::EDProducer.

Definition at line 83 of file GenericSelectorByValueMap.h.

83  {
84  auto candidates = std::make_unique<edm::RefToBaseVector<candidate_type>>();
85 
86  // read the collection of GsfElectrons from the Event
88  event.getByToken(token_electrons, h_electrons);
89  edm::View<candidate_type> const& electrons = *h_electrons;
90 
91  // read the selection map from the Event
93  event.getByToken(token_selection, h_selection);
94  edm::ValueMap<selection_type> const& selectionMap = *h_selection;
95 
96  for (unsigned int i = 0; i < electrons.size(); ++i) {
98  if (selectionMap[ptr] > m_cut)
99  candidates->push_back(ptr);
100  }
101 
102  // put the product in the event
103  event.put(std::move(candidates));
104  }

References HLT_2018_cff::candidates, pwdgSkimBPark_cfi::electrons, mps_fire::i, and eostools::move().

Member Data Documentation

◆ m_cut

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

Definition at line 52 of file GenericSelectorByValueMap.h.

◆ token_electrons

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.

◆ token_selection

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.

mps_fire.i
i
Definition: mps_fire.py:355
edm::GenericSelectorByValueMap::m_cut
cut_type m_cut
Definition: GenericSelectorByValueMap.h:52
edm::GenericSelectorByValueMap::token_electrons
edm::EDGetTokenT< edm::View< candidate_type > > token_electrons
Definition: GenericSelectorByValueMap.h:49
edm::Handle
Definition: AssociativeIterator.h:50
config
Definition: config.py:1
edm::View
Definition: CaloClusterFwd.h:14
edm::GenericSelectorByValueMap::cut_type
details::template CompatibleConfigurationType< selection_type >::type cut_type
Definition: GenericSelectorByValueMap.h:45
edm::GenericSelectorByValueMap::token_selection
edm::EDGetTokenT< edm::ValueMap< selection_type > > token_selection
Definition: GenericSelectorByValueMap.h:50
eostools.move
def move(src, dest)
Definition: eostools.py:511
pwdgSkimBPark_cfi.electrons
electrons
Definition: pwdgSkimBPark_cfi.py:6
HLT_2018_cff.candidates
candidates
Definition: HLT_2018_cff.py:53513
edm::ValueMap
Definition: ValueMap.h:107
edm::RefToBase
Definition: AssociativeIterator.h:54
edm::EDConsumerBase::consumes
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
Definition: EDConsumerBase.h:126
edm::InputTag
Definition: InputTag.h:15