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 Attributes
ElectronIDExternalProducerRemapper Class Reference

#include <ElectronIDExternalProducerRemapper.h>

Inheritance diagram for ElectronIDExternalProducerRemapper:
edm::stream::EDProducer<> edm::stream::EDProducerBase edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Public Member Functions

 ElectronIDExternalProducerRemapper (const edm::ParameterSet &)
 
void produce (edm::Event &, const edm::EventSetup &)
 
 ~ElectronIDExternalProducerRemapper ()
 
- Public Member Functions inherited from edm::stream::EDProducer<>
 EDProducer ()=default
 
- Public Member Functions inherited from edm::stream::EDProducerBase
 EDProducerBase ()
 
ModuleDescription const & moduleDescription () const
 
virtual ~EDProducerBase ()
 
- Public Member Functions inherited from edm::ProducerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
 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
std::vector< ConsumesInfoconsumesInfo () const
 
 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 (std::string const &iProcessName, std::string const &iModuleLabel, bool iPrint, std::vector< char const * > &oModuleLabels) const
 
void modulesWhoseProductsAreConsumed (std::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
bool registeredToConsume (ProductHolderIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void updateLookup (BranchType iBranchType, ProductHolderIndexHelper const &)
 
virtual ~EDConsumerBase ()
 

Private Types

typedef edm::Ref
< reco::GsfElectronCollection,
Value, typename
edm::refhelper::FindTrait
< reco::GsfElectronCollection,
Value >::value > 
CRef
 
typedef edm::ValueMap< CRefCRefMap
 
typedef
edm::refhelper::ValueTrait
< reco::GsfElectronCollection >
::value 
Value
 

Private Attributes

edm::EDGetTokenT
< reco::GsfElectronCollection
emObjectProducer_
 
edm::EDGetTokenT
< edm::ValueMap< float > > 
idMap_
 
edm::EDGetTokenT< CRefMapnewToOldObjectMap_
 

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, GlobalCache
LuminosityBlockContext
 
typedef
CacheTypes::LuminosityBlockSummaryCache 
LuminosityBlockSummaryCache
 
typedef CacheTypes::RunCache RunCache
 
typedef RunContextT< RunCache,
GlobalCache
RunContext
 
typedef CacheTypes::RunSummaryCache RunSummaryCache
 
- Public Types inherited from edm::stream::EDProducerBase
typedef EDProducerAdaptorBase ModuleType
 
- Public Types inherited from edm::ProducerBase
typedef
ProductRegistryHelper::TypeLabelList 
TypeLabelList
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- Static Public Member Functions inherited from edm::stream::EDProducerBase
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 
- 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

Definition at line 13 of file ElectronIDExternalProducerRemapper.h.

Member Typedef Documentation

Definition at line 21 of file ElectronIDExternalProducerRemapper.h.

Definition at line 22 of file ElectronIDExternalProducerRemapper.h.

Definition at line 20 of file ElectronIDExternalProducerRemapper.h.

Constructor & Destructor Documentation

ElectronIDExternalProducerRemapper::ElectronIDExternalProducerRemapper ( const edm::ParameterSet config)

Definition at line 9 of file ElectronIDExternalProducerRemapper.cc.

9  :
10  emObjectProducer_ (consumes<reco::GsfElectronCollection >(config.getParameter<edm::InputTag>("candidateProducer"))),
11  newToOldObjectMap_ (consumes<CRefMap>(config.getParameter<edm::InputTag>("newToOldObjectMap"))),
13 {
14  produces<edm::ValueMap<float> >();
15 }
T getParameter(std::string const &) const
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
edm::EDGetTokenT< edm::ValueMap< float > > idMap_
edm::EDGetTokenT< reco::GsfElectronCollection > emObjectProducer_
ElectronIDExternalProducerRemapper::~ElectronIDExternalProducerRemapper ( )

Definition at line 17 of file ElectronIDExternalProducerRemapper.cc.

18 {
19 }

Member Function Documentation

void ElectronIDExternalProducerRemapper::produce ( edm::Event iEvent,
const edm::EventSetup  
)
virtual

Implements edm::stream::EDProducerBase.

Definition at line 21 of file ElectronIDExternalProducerRemapper.cc.

References emObjectProducer_, edm::helper::Filler< Map >::fill(), edm::Event::getByToken(), idMap_, edm::helper::Filler< Map >::insert(), newToOldObjectMap_, and edm::Event::put().

22 {
24  iEvent.getByToken(emObjectProducer_, emObjectHandle);
25 
26  edm::Handle<CRefMap> objectMapHandle;
27  iEvent.getByToken(newToOldObjectMap_, objectMapHandle);
28  auto& objectMap(*objectMapHandle);
29 
31  iEvent.getByToken(idMap_, idMapHandle);
32  auto& idMap(*idMapHandle);
33 
34  std::vector<float> retV(emObjectHandle->size(), 0.);
35 
36  for (unsigned iO(0); iO != emObjectHandle->size(); ++iO) {
37  CRef ref(emObjectHandle, iO);
38  auto oldRef(objectMap[ref]);
39  retV[iO] = idMap[oldRef];
40  }
41 
42  std::auto_ptr<edm::ValueMap<float> > isoMap(new edm::ValueMap<float>);
43  edm::ValueMap<float>::Filler filler(*isoMap);
44 
45  filler.insert(emObjectHandle, retV.begin(), retV.end());
46  filler.fill();
47 
48  iEvent.put(isoMap);
49 }
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:462
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
Definition: Event.h:121
edm::EDGetTokenT< edm::ValueMap< float > > idMap_
edm::EDGetTokenT< reco::GsfElectronCollection > emObjectProducer_
edm::Ref< reco::GsfElectronCollection, Value, typename edm::refhelper::FindTrait< reco::GsfElectronCollection, Value >::value > CRef

Member Data Documentation

edm::EDGetTokenT<reco::GsfElectronCollection > ElectronIDExternalProducerRemapper::emObjectProducer_
private

Definition at line 24 of file ElectronIDExternalProducerRemapper.h.

Referenced by produce().

edm::EDGetTokenT<edm::ValueMap<float> > ElectronIDExternalProducerRemapper::idMap_
private

Definition at line 26 of file ElectronIDExternalProducerRemapper.h.

Referenced by produce().

edm::EDGetTokenT<CRefMap> ElectronIDExternalProducerRemapper::newToOldObjectMap_
private

Definition at line 25 of file ElectronIDExternalProducerRemapper.h.

Referenced by produce().