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")))
15 produces<edm::ValueMap<float>>();
27 iEvent.
getByToken(emObjectProducer_, emObjectHandle);
30 iEvent.
getByToken(newToOldObjectMap_, objectMapHandle);
31 auto& objectMap(*objectMapHandle);
34 iEvent.
getByToken(isolationMap_, isolationMapHandle);
35 auto& isolationMap(*isolationMapHandle);
37 std::vector<float> retV(emObjectHandle->size(), 0.);
39 for (
unsigned iO(0); iO != emObjectHandle->size(); ++iO) {
40 CRef ref(emObjectHandle, iO);
41 auto oldRef(objectMap[ref]);
42 retV[iO] = isolationMap[oldRef];
45 std::auto_ptr<FloatMap> isoMap(
new FloatMap());
48 filler.
insert(emObjectHandle, retV.begin(), retV.end());
EgammaPFClusterIsolationRemapper< reco::PhotonCollection > PhotonPFClusterIsolationRemapper
bool getByToken(EDGetToken token, Handle< PROD > &result) const
#define DEFINE_FWK_MODULE(type)
void insert(const H &h, I begin, I end)
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
void produce(edm::Event &, const edm::EventSetup &)
EgammaPFClusterIsolationRemapper(const edm::ParameterSet &)
~EgammaPFClusterIsolationRemapper()
EgammaPFClusterIsolationRemapper< reco::GsfElectronCollection > ElectronPFClusterIsolationRemapper