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
PhotonIDExternalProducerRemapper Class Reference

#include <PhotonIDExternalProducerRemapper.h>

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

Public Member Functions

 PhotonIDExternalProducerRemapper (const edm::ParameterSet &)
 
void produce (edm::Event &, const edm::EventSetup &)
 
 ~PhotonIDExternalProducerRemapper ()
 
- 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::PhotonCollection,
Value, typename
edm::refhelper::FindTrait
< reco::PhotonCollection,
Value >::value > 
CRef
 
typedef edm::ValueMap< CRefCRefMap
 
typedef
edm::refhelper::ValueTrait
< reco::PhotonCollection >
::value 
Value
 

Private Attributes

edm::EDGetTokenT
< reco::PhotonCollection
emObjectProducer_
 
edm::EDGetTokenT
< edm::ValueMap< bool > > 
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 PhotonIDExternalProducerRemapper.h.

Member Typedef Documentation

Definition at line 21 of file PhotonIDExternalProducerRemapper.h.

Definition at line 22 of file PhotonIDExternalProducerRemapper.h.

Definition at line 20 of file PhotonIDExternalProducerRemapper.h.

Constructor & Destructor Documentation

PhotonIDExternalProducerRemapper::PhotonIDExternalProducerRemapper ( const edm::ParameterSet config)

Definition at line 9 of file PhotonIDExternalProducerRemapper.cc.

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

Definition at line 17 of file PhotonIDExternalProducerRemapper.cc.

18 {
19 }

Member Function Documentation

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

Implements edm::stream::EDProducerBase.

Definition at line 21 of file PhotonIDExternalProducerRemapper.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 
30  edm::Handle<edm::ValueMap<bool> > idMapHandle;
31  iEvent.getByToken(idMap_, idMapHandle);
32  auto& idMap(*idMapHandle);
33 
34  std::vector<bool> 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<bool> > isoMap(new edm::ValueMap<bool>);
43  edm::ValueMap<bool>::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
edm::Ref< reco::PhotonCollection, Value, typename edm::refhelper::FindTrait< reco::PhotonCollection, Value >::value > CRef
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
Definition: Event.h:121
edm::EDGetTokenT< edm::ValueMap< bool > > idMap_
edm::EDGetTokenT< reco::PhotonCollection > emObjectProducer_

Member Data Documentation

edm::EDGetTokenT<reco::PhotonCollection > PhotonIDExternalProducerRemapper::emObjectProducer_
private

Definition at line 24 of file PhotonIDExternalProducerRemapper.h.

Referenced by produce().

edm::EDGetTokenT<edm::ValueMap<bool> > PhotonIDExternalProducerRemapper::idMap_
private

Definition at line 26 of file PhotonIDExternalProducerRemapper.h.

Referenced by produce().

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

Definition at line 25 of file PhotonIDExternalProducerRemapper.h.

Referenced by produce().