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
EgammaPFClusterIsolationRemapper< C > Class Template Reference

#include <EgammaPFClusterIsolationRemapper.h>

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

Public Member Functions

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

Private Attributes

edm::EDGetTokenT< C > emObjectProducer_
 
edm::EDGetTokenT< FloatMapisolationMap_
 
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

template<typename C>
class EgammaPFClusterIsolationRemapper< C >

Definition at line 18 of file EgammaPFClusterIsolationRemapper.h.

Member Typedef Documentation

template<typename C >
typedef edm::Ref<C, Value, typename edm::refhelper::FindTrait<C, Value>::value> EgammaPFClusterIsolationRemapper< C >::CRef
private

Definition at line 26 of file EgammaPFClusterIsolationRemapper.h.

template<typename C >
typedef edm::ValueMap<CRef> EgammaPFClusterIsolationRemapper< C >::CRefMap
private

Definition at line 27 of file EgammaPFClusterIsolationRemapper.h.

template<typename C >
typedef edm::ValueMap<float> EgammaPFClusterIsolationRemapper< C >::FloatMap
private

Definition at line 28 of file EgammaPFClusterIsolationRemapper.h.

template<typename C >
typedef edm::refhelper::ValueTrait<C>::value EgammaPFClusterIsolationRemapper< C >::Value
private

Definition at line 25 of file EgammaPFClusterIsolationRemapper.h.

Constructor & Destructor Documentation

Definition at line 10 of file EgammaPFClusterIsolationRemapper.cc.

10  :
11  emObjectProducer_ (consumes<C>(config.getParameter<edm::InputTag>("candidateProducer"))),
12  newToOldObjectMap_ (consumes<CRefMap>(config.getParameter<edm::InputTag>("newToOldObjectMap"))),
13  isolationMap_ (consumes<FloatMap>(config.getParameter<edm::InputTag>("isolationMap")))
14 {
15  produces<edm::ValueMap<float>>();
16 }
T getParameter(std::string const &) const

Definition at line 19 of file EgammaPFClusterIsolationRemapper.cc.

20 {
21 }

Member Function Documentation

template<typename C >
void EgammaPFClusterIsolationRemapper< C >::produce ( edm::Event iEvent,
const edm::EventSetup  
)
virtual

Implements edm::stream::EDProducerBase.

Definition at line 24 of file EgammaPFClusterIsolationRemapper.cc.

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

25 {
26  edm::Handle<C> emObjectHandle;
27  iEvent.getByToken(emObjectProducer_, emObjectHandle);
28 
29  edm::Handle<CRefMap> objectMapHandle;
30  iEvent.getByToken(newToOldObjectMap_, objectMapHandle);
31  auto& objectMap(*objectMapHandle);
32 
33  edm::Handle<FloatMap> isolationMapHandle;
34  iEvent.getByToken(isolationMap_, isolationMapHandle);
35  auto& isolationMap(*isolationMapHandle);
36 
37  std::vector<float> retV(emObjectHandle->size(), 0.);
38 
39  for (unsigned iO(0); iO != emObjectHandle->size(); ++iO) {
40  CRef ref(emObjectHandle, iO);
41  auto oldRef(objectMap[ref]);
42  retV[iO] = isolationMap[oldRef];
43  }
44 
45  std::auto_ptr<FloatMap> isoMap(new FloatMap());
46  FloatMap::Filler filler(*isoMap);
47 
48  filler.insert(emObjectHandle, retV.begin(), retV.end());
49  filler.fill();
50 
51  iEvent.put(isoMap);
52 }
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::Ref< C, Value, typename edm::refhelper::FindTrait< C, Value >::value > CRef
helper::Filler< ValueMap< float > > Filler
Definition: ValueMap.h:168

Member Data Documentation

template<typename C >
edm::EDGetTokenT<C> EgammaPFClusterIsolationRemapper< C >::emObjectProducer_
private

Definition at line 30 of file EgammaPFClusterIsolationRemapper.h.

template<typename C >
edm::EDGetTokenT<FloatMap> EgammaPFClusterIsolationRemapper< C >::isolationMap_
private

Definition at line 32 of file EgammaPFClusterIsolationRemapper.h.

template<typename C >
edm::EDGetTokenT<CRefMap> EgammaPFClusterIsolationRemapper< C >::newToOldObjectMap_
private

Definition at line 31 of file EgammaPFClusterIsolationRemapper.h.