CMS 3D CMS Logo

ReducedEGProducer.cc
Go to the documentation of this file.
1 #include <iostream>
2 #include <vector>
3 #include <memory>
4 #include <unordered_set>
5 
6 // Framework
9 
11 
16 
29 
32 
35 
38 
40 
42 
44  : photonT_(consumes<reco::PhotonCollection>(config.getParameter<edm::InputTag>("photons"))),
45  gsfElectronT_(consumes<reco::GsfElectronCollection>(config.getParameter<edm::InputTag>("gsfElectrons"))),
46  gsfTrackT_(consumes<reco::GsfTrackCollection>(config.getParameter<edm::InputTag>("gsfTracks"))),
47  conversionT_(consumes<reco::ConversionCollection>(config.getParameter<edm::InputTag>("conversions"))),
48  singleConversionT_(consumes<reco::ConversionCollection>(config.getParameter<edm::InputTag>("singleConversions"))),
49  barrelEcalHits_(consumes<EcalRecHitCollection>(config.getParameter<edm::InputTag>("barrelEcalHits"))),
50  endcapEcalHits_(consumes<EcalRecHitCollection>(config.getParameter<edm::InputTag>("endcapEcalHits"))),
51  doPreshowerEcalHits_(!config.getParameter<edm::InputTag>("preshowerEcalHits").label().empty()),
52  preshowerEcalHits_(doPreshowerEcalHits_
53  ? consumes<EcalRecHitCollection>(config.getParameter<edm::InputTag>("preshowerEcalHits"))
54  : edm::EDGetTokenT<EcalRecHitCollection>()),
55  hbheHits_(consumes<HBHERecHitCollection>(config.getParameter<edm::InputTag>("hbheHits"))),
56  photonPfCandMapT_(consumes<edm::ValueMap<std::vector<reco::PFCandidateRef>>>(
57  config.getParameter<edm::InputTag>("photonsPFValMap"))),
58  gsfElectronPfCandMapT_(consumes<edm::ValueMap<std::vector<reco::PFCandidateRef>>>(
59  config.getParameter<edm::InputTag>("gsfElectronsPFValMap"))),
60  //calibration flags
61  applyPhotonCalibOnData_(config.getParameter<bool>("applyPhotonCalibOnData")),
62  applyPhotonCalibOnMC_(config.getParameter<bool>("applyPhotonCalibOnMC")),
63  applyGsfElectronCalibOnData_(config.getParameter<bool>("applyGsfElectronCalibOnData")),
64  applyGsfElectronCalibOnMC_(config.getParameter<bool>("applyGsfElectronCalibOnMC")),
65  //output collections
66  outPhotons_("reducedGedPhotons"),
67  outPhotonCores_("reducedGedPhotonCores"),
68  outOOTPhotons_("reducedOOTPhotons"),
69  outOOTPhotonCores_("reducedOOTPhotonCores"),
70  outGsfElectrons_("reducedGedGsfElectrons"),
71  outGsfElectronCores_("reducedGedGsfElectronCores"),
72  outGsfTracks_("reducedGsfTracks"),
73  outConversions_("reducedConversions"),
74  outSingleConversions_("reducedSingleLegConversions"),
75  outSuperClusters_("reducedSuperClusters"),
76  outEBEEClusters_("reducedEBEEClusters"),
77  outESClusters_("reducedESClusters"),
78  outOOTSuperClusters_("reducedOOTSuperClusters"),
79  outOOTEBEEClusters_("reducedOOTEBEEClusters"),
80  outOOTESClusters_("reducedOOTESClusters"),
81  outEBRecHits_("reducedEBRecHits"),
82  outEERecHits_("reducedEERecHits"),
83  outESRecHits_("reducedESRecHits"),
84  outHBHERecHits_("reducedHBHEHits"),
85  outPhotonPfCandMap_("reducedPhotonPfCandMap"),
86  outGsfElectronPfCandMap_("reducedGsfElectronPfCandMap"),
87  outPhotonIds_(config.getParameter<std::vector<std::string>>("photonIDOutput")),
88  outGsfElectronIds_(config.getParameter<std::vector<std::string>>("gsfElectronIDOutput")),
89  outPhotonFloatValueMaps_(config.getParameter<std::vector<std::string>>("photonFloatValueMapOutput")),
90  outOOTPhotonFloatValueMaps_(config.getParameter<std::vector<std::string>>("ootPhotonFloatValueMapOutput")),
91  outGsfElectronFloatValueMaps_(config.getParameter<std::vector<std::string>>("gsfElectronFloatValueMapOutput")),
92  keepPhotonSel_(config.getParameter<std::string>("keepPhotons")),
93  slimRelinkPhotonSel_(config.getParameter<std::string>("slimRelinkPhotons")),
94  relinkPhotonSel_(config.getParameter<std::string>("relinkPhotons")),
95  keepOOTPhotonSel_(config.getParameter<std::string>("keepOOTPhotons")),
96  slimRelinkOOTPhotonSel_(config.getParameter<std::string>("slimRelinkOOTPhotons")),
97  relinkOOTPhotonSel_(config.getParameter<std::string>("relinkOOTPhotons")),
98  keepGsfElectronSel_(config.getParameter<std::string>("keepGsfElectrons")),
99  slimRelinkGsfElectronSel_(config.getParameter<std::string>("slimRelinkGsfElectrons")),
100  relinkGsfElectronSel_(config.getParameter<std::string>("relinkGsfElectrons")),
101  hcalHitSel_(config.getParameter<edm::ParameterSet>("hcalHitSel")) {
102  const edm::InputTag& aTag = config.getParameter<edm::InputTag>("ootPhotons");
103  if (not aTag.label().empty())
104  ootPhotonT_ = consumes<reco::PhotonCollection>(aTag);
105 
106  const std::vector<edm::InputTag>& photonidinputs = config.getParameter<std::vector<edm::InputTag>>("photonIDSources");
107  for (const edm::InputTag& tag : photonidinputs) {
108  photonIdTs_.emplace_back(consumes<edm::ValueMap<bool>>(tag));
109  }
110 
111  const std::vector<edm::InputTag>& gsfelectronidinputs =
112  config.getParameter<std::vector<edm::InputTag>>("gsfElectronIDSources");
113  for (const edm::InputTag& tag : gsfelectronidinputs) {
114  gsfElectronIdTs_.emplace_back(consumes<edm::ValueMap<float>>(tag));
115  }
116 
117  const std::vector<edm::InputTag>& photonpfclusterisoinputs =
118  config.getParameter<std::vector<edm::InputTag>>("photonFloatValueMapSources");
119  for (const edm::InputTag& tag : photonpfclusterisoinputs) {
120  photonFloatValueMapTs_.emplace_back(consumes<edm::ValueMap<float>>(tag));
121  }
122 
123  const std::vector<edm::InputTag>& ootphotonpfclusterisoinputs =
124  config.getParameter<std::vector<edm::InputTag>>("ootPhotonFloatValueMapSources");
125  for (const edm::InputTag& tag : ootphotonpfclusterisoinputs) {
126  ootPhotonFloatValueMapTs_.emplace_back(consumes<edm::ValueMap<float>>(tag));
127  }
128 
129  const std::vector<edm::InputTag>& gsfelectronpfclusterisoinputs =
130  config.getParameter<std::vector<edm::InputTag>>("gsfElectronFloatValueMapSources");
131  for (const edm::InputTag& tag : gsfelectronpfclusterisoinputs) {
132  gsfElectronFloatValueMapTs_.emplace_back(consumes<edm::ValueMap<float>>(tag));
133  }
134 
136  setToken(photonCalibEnergyT_, config, "photonCalibEnergySource");
137  setToken(photonCalibEnergyErrT_, config, "photonCalibEnergyErrSource");
138  }
140  setToken(gsfElectronCalibEnergyT_, config, "gsfElectronCalibEnergySource");
141  setToken(gsfElectronCalibEnergyErrT_, config, "gsfElectronCalibEnergyErrSource");
142  setToken(gsfElectronCalibEcalEnergyT_, config, "gsfElectronCalibEcalEnergySource");
143  setToken(gsfElectronCalibEcalEnergyErrT_, config, "gsfElectronCalibEcalEnergyErrSource");
144  }
145 
146  produces<reco::PhotonCollection>(outPhotons_);
147  produces<reco::PhotonCoreCollection>(outPhotonCores_);
148  if (!ootPhotonT_.isUninitialized()) {
149  produces<reco::PhotonCollection>(outOOTPhotons_);
150  produces<reco::PhotonCoreCollection>(outOOTPhotonCores_);
151  }
152  produces<reco::GsfElectronCollection>(outGsfElectrons_);
153  produces<reco::GsfElectronCoreCollection>(outGsfElectronCores_);
154  produces<reco::GsfTrackCollection>(outGsfTracks_);
155  produces<reco::ConversionCollection>(outConversions_);
156  produces<reco::ConversionCollection>(outSingleConversions_);
157  produces<reco::SuperClusterCollection>(outSuperClusters_);
158  produces<reco::CaloClusterCollection>(outEBEEClusters_);
159  produces<reco::CaloClusterCollection>(outESClusters_);
160  if (!ootPhotonT_.isUninitialized()) {
161  produces<reco::SuperClusterCollection>(outOOTSuperClusters_);
162  produces<reco::CaloClusterCollection>(outOOTEBEEClusters_);
163  produces<reco::CaloClusterCollection>(outOOTESClusters_);
164  }
165  produces<EcalRecHitCollection>(outEBRecHits_);
166  produces<EcalRecHitCollection>(outEERecHits_);
168  produces<EcalRecHitCollection>(outESRecHits_);
169  produces<HBHERecHitCollection>(outHBHERecHits_);
170  produces<edm::ValueMap<std::vector<reco::PFCandidateRef>>>(outPhotonPfCandMap_);
171  produces<edm::ValueMap<std::vector<reco::PFCandidateRef>>>(outGsfElectronPfCandMap_);
172  for (const std::string& outid : outPhotonIds_) {
173  produces<edm::ValueMap<bool>>(outid);
174  }
175  for (const std::string& outid : outGsfElectronIds_) {
176  produces<edm::ValueMap<float>>(outid);
177  }
178  for (const std::string& outid : outPhotonFloatValueMaps_) {
179  produces<edm::ValueMap<float>>(outid);
180  }
181  if (!ootPhotonT_.isUninitialized()) {
182  for (const std::string& outid : outOOTPhotonFloatValueMaps_) {
183  produces<edm::ValueMap<float>>(outid);
184  }
185  }
186  for (const std::string& outid : outGsfElectronFloatValueMaps_) {
187  produces<edm::ValueMap<float>>(outid);
188  }
189 }
190 
192 
194 
195 void ReducedEGProducer::produce(edm::Event& theEvent, const edm::EventSetup& theEventSetup) {
196  //get input collections
197 
199  theEvent.getByToken(photonT_, photonHandle);
200 
201  edm::Handle<reco::PhotonCollection> ootPhotonHandle;
203  theEvent.getByToken(ootPhotonT_, ootPhotonHandle);
204 
206  theEvent.getByToken(gsfElectronT_, gsfElectronHandle);
207 
209  theEvent.getByToken(gsfTrackT_, gsfTrackHandle);
210 
213 
214  edm::Handle<reco::ConversionCollection> singleConversionHandle;
215  theEvent.getByToken(singleConversionT_, singleConversionHandle);
216 
217  edm::Handle<EcalRecHitCollection> barrelHitHandle;
218  theEvent.getByToken(barrelEcalHits_, barrelHitHandle);
219 
220  edm::Handle<EcalRecHitCollection> endcapHitHandle;
221  theEvent.getByToken(endcapEcalHits_, endcapHitHandle);
222 
223  edm::Handle<EcalRecHitCollection> preshowerHitHandle;
225  theEvent.getByToken(preshowerEcalHits_, preshowerHitHandle);
226 
227  edm::Handle<HBHERecHitCollection> hbheHitHandle;
228  theEvent.getByToken(hbheHits_, hbheHitHandle);
229 
231  theEvent.getByToken(photonPfCandMapT_, photonPfCandMapHandle);
232 
234  theEvent.getByToken(gsfElectronPfCandMapT_, gsfElectronPfCandMapHandle);
235 
236  std::vector<edm::Handle<edm::ValueMap<bool>>> photonIdHandles(photonIdTs_.size());
237  int index = 0; // universal index for range based loops
238  for (const auto& photonIdT : photonIdTs_) {
239  theEvent.getByToken(photonIdT, photonIdHandles[index++]);
240  }
241 
242  std::vector<edm::Handle<edm::ValueMap<float>>> gsfElectronIdHandles(gsfElectronIdTs_.size());
243  index = 0;
244  for (const auto& gsfElectronIdT : gsfElectronIdTs_) {
245  theEvent.getByToken(gsfElectronIdT, gsfElectronIdHandles[index++]);
246  }
247 
248  std::vector<edm::Handle<edm::ValueMap<float>>> photonFloatValueMapHandles(photonFloatValueMapTs_.size());
249  index = 0;
250  for (const auto& photonFloatValueMapT : photonFloatValueMapTs_) {
251  theEvent.getByToken(photonFloatValueMapT, photonFloatValueMapHandles[index++]);
252  }
253 
254  std::vector<edm::Handle<edm::ValueMap<float>>> ootPhotonFloatValueMapHandles(ootPhotonFloatValueMapTs_.size());
255  if (!ootPhotonT_.isUninitialized()) {
256  index = 0;
257  for (const auto& ootPhotonFloatValueMapT : ootPhotonFloatValueMapTs_) {
258  theEvent.getByToken(ootPhotonFloatValueMapT, ootPhotonFloatValueMapHandles[index++]);
259  }
260  }
261 
262  std::vector<edm::Handle<edm::ValueMap<float>>> gsfElectronFloatValueMapHandles(gsfElectronFloatValueMapTs_.size());
263  index = 0;
264  for (const auto& gsfElectronFloatValueMapT : gsfElectronFloatValueMapTs_) {
265  theEvent.getByToken(gsfElectronFloatValueMapT, gsfElectronFloatValueMapHandles[index++]);
266  }
267 
268  edm::Handle<edm::ValueMap<float>> gsfElectronCalibEnergyHandle;
269  edm::Handle<edm::ValueMap<float>> gsfElectronCalibEnergyErrHandle;
270  edm::Handle<edm::ValueMap<float>> gsfElectronCalibEcalEnergyHandle;
271  edm::Handle<edm::ValueMap<float>> gsfElectronCalibEcalEnergyErrHandle;
273  theEvent.getByToken(gsfElectronCalibEnergyT_, gsfElectronCalibEnergyHandle);
274  theEvent.getByToken(gsfElectronCalibEnergyErrT_, gsfElectronCalibEnergyErrHandle);
275  theEvent.getByToken(gsfElectronCalibEcalEnergyT_, gsfElectronCalibEcalEnergyHandle);
276  theEvent.getByToken(gsfElectronCalibEcalEnergyErrT_, gsfElectronCalibEcalEnergyErrHandle);
277  }
278  edm::Handle<edm::ValueMap<float>> photonCalibEnergyHandle;
279  edm::Handle<edm::ValueMap<float>> photonCalibEnergyErrHandle;
281  theEvent.getByToken(photonCalibEnergyT_, photonCalibEnergyHandle);
282  theEvent.getByToken(photonCalibEnergyErrT_, photonCalibEnergyErrHandle);
283  }
284 
285  edm::ESHandle<CaloTopology> theCaloTopology;
286  theEventSetup.get<CaloTopologyRecord>().get(theCaloTopology);
287  const CaloTopology* caloTopology = &(*theCaloTopology);
288 
289  //initialize output collections
290  auto photons = std::make_unique<reco::PhotonCollection>();
291  auto photonCores = std::make_unique<reco::PhotonCoreCollection>();
292  auto ootPhotons = std::make_unique<reco::PhotonCollection>();
293  auto ootPhotonCores = std::make_unique<reco::PhotonCoreCollection>();
294  auto gsfElectrons = std::make_unique<reco::GsfElectronCollection>();
295  auto gsfElectronCores = std::make_unique<reco::GsfElectronCoreCollection>();
296  auto gsfTracks = std::make_unique<reco::GsfTrackCollection>();
297  auto conversions = std::make_unique<reco::ConversionCollection>();
298  auto singleConversions = std::make_unique<reco::ConversionCollection>();
299  auto superClusters = std::make_unique<reco::SuperClusterCollection>();
300  auto ebeeClusters = std::make_unique<reco::CaloClusterCollection>();
301  auto esClusters = std::make_unique<reco::CaloClusterCollection>();
302  auto ootSuperClusters = std::make_unique<reco::SuperClusterCollection>();
303  auto ootEbeeClusters = std::make_unique<reco::CaloClusterCollection>();
304  auto ootEsClusters = std::make_unique<reco::CaloClusterCollection>();
305  auto ebRecHits = std::make_unique<EcalRecHitCollection>();
306  auto eeRecHits = std::make_unique<EcalRecHitCollection>();
307  auto esRecHits = std::make_unique<EcalRecHitCollection>();
308  auto hbheRecHits = std::make_unique<HBHERecHitCollection>();
309  auto photonPfCandMap = std::make_unique<edm::ValueMap<std::vector<reco::PFCandidateRef>>>();
310  auto gsfElectronPfCandMap = std::make_unique<edm::ValueMap<std::vector<reco::PFCandidateRef>>>();
311 
312  //maps to collection indices of output objects
313  std::map<reco::PhotonCoreRef, unsigned int> photonCoreMap;
314  std::map<reco::PhotonCoreRef, unsigned int> ootPhotonCoreMap;
315  std::map<reco::GsfElectronCoreRef, unsigned int> gsfElectronCoreMap;
316  std::map<reco::GsfTrackRef, unsigned int> gsfTrackMap;
317  std::map<reco::ConversionRef, unsigned int> conversionMap;
318  std::map<reco::ConversionRef, unsigned int> singleConversionMap;
319  std::map<reco::SuperClusterRef, unsigned int> superClusterMap;
320  std::map<reco::CaloClusterPtr, unsigned int> ebeeClusterMap;
321  std::map<reco::CaloClusterPtr, unsigned int> esClusterMap;
322  std::map<reco::SuperClusterRef, unsigned int> ootSuperClusterMap;
323  std::map<reco::CaloClusterPtr, unsigned int> ootEbeeClusterMap;
324  std::map<reco::CaloClusterPtr, unsigned int> ootEsClusterMap;
325  std::unordered_set<DetId> rechitMap;
326  std::unordered_set<DetId> hcalRechitMap;
327 
328  std::unordered_set<unsigned int> superClusterFullRelinkMap;
329  std::unordered_set<unsigned int> ootSuperClusterFullRelinkMap;
330 
331  //vectors for pfcandidate valuemaps
332  std::vector<std::vector<reco::PFCandidateRef>> pfCandIsoPairVecPho;
333  std::vector<std::vector<reco::PFCandidateRef>> pfCandIsoPairVecEle;
334 
335  //vectors for id valuemaps
336  std::vector<std::vector<bool>> photonIdVals(photonIdHandles.size());
337  std::vector<std::vector<float>> gsfElectronIdVals(gsfElectronIdHandles.size());
338  std::vector<std::vector<float>> photonFloatValueMapVals(photonFloatValueMapHandles.size());
339  std::vector<std::vector<float>> ootPhotonFloatValueMapVals(ootPhotonFloatValueMapHandles.size());
340  std::vector<std::vector<float>> gsfElectronFloatValueMapVals(gsfElectronFloatValueMapHandles.size());
341 
342  //loop over photons and fill maps
343  index = -1;
344  for (const auto& photon : *photonHandle) {
345  index++;
346 
347  reco::PhotonRef photonref(photonHandle, index);
348  photons->push_back(photon);
349  auto& newPhoton = photons->back();
350 
351  if ((applyPhotonCalibOnData_ && theEvent.isRealData()) || (applyPhotonCalibOnMC_ && !theEvent.isRealData())) {
352  calibratePhoton(newPhoton, photonref, *photonCalibEnergyHandle, *photonCalibEnergyErrHandle);
353  }
354 
355  //we do this after calibration
356  bool keep = keepPhotonSel_(newPhoton);
357  if (!keep) {
358  photons->pop_back();
359  continue;
360  }
361 
362  //fill pf candidate value map vector
363  pfCandIsoPairVecPho.push_back((*photonPfCandMapHandle)[photonref]);
364 
365  //fill photon id valuemap vectors
366  int subindex = 0;
367  for (const auto& photonIdHandle : photonIdHandles) {
368  photonIdVals[subindex++].push_back((*photonIdHandle)[photonref]);
369  }
370 
371  subindex = 0;
372  for (const auto& photonFloatValueMapHandle : photonFloatValueMapHandles) {
373  photonFloatValueMapVals[subindex++].push_back((*photonFloatValueMapHandle)[photonref]);
374  }
375 
376  //link photon core
377  const reco::PhotonCoreRef& photonCore = photon.photonCore();
378  linkCore(photonCore, *photonCores, photonCoreMap);
379 
380  bool slimRelink = slimRelinkPhotonSel_(newPhoton);
381  //no supercluster relinking unless slimRelink selection is satisfied
382  if (!slimRelink)
383  continue;
384 
385  bool relink = relinkPhotonSel_(newPhoton);
386 
387  //link supercluster
388  const reco::SuperClusterRef& superCluster = photon.superCluster();
389  linkSuperCluster(superCluster, superClusterMap, *superClusters, relink, superClusterFullRelinkMap);
390 
391  //conversions only for full relinking
392  if (!relink)
393  continue;
394 
395  const reco::ConversionRefVector& convrefs = photon.conversions();
396  linkConversions(convrefs, *conversions, conversionMap);
397 
398  //explicitly references conversions
399  const reco::ConversionRefVector& singleconvrefs = photon.conversionsOneLeg();
400  linkConversions(singleconvrefs, *singleConversions, singleConversionMap);
401 
402  //hcal hits
403  linkHcalHits(*photon.superCluster(), *hbheHitHandle, hcalRechitMap);
404  }
405 
406  //loop over oot photons and fill maps
407  //special note1: since not PFCand --> no PF isolation, IDs (but we do have FloatValueMap!)
408  //special note2: conversion sequence not run over bcs from oot phos, so skip relinking of oot phos
409  //special note3: clusters and superclusters in own collections!
410  if (!ootPhotonT_.isUninitialized()) {
411  index = -1;
412  for (const auto& ootPhoton : *ootPhotonHandle) {
413  index++;
414 
415  bool keep = keepOOTPhotonSel_(ootPhoton);
416  if (!keep)
417  continue;
418 
419  reco::PhotonRef ootPhotonref(ootPhotonHandle, index);
420 
421  ootPhotons->push_back(ootPhoton);
422 
423  //fill photon pfclusteriso valuemap vectors
424  int subindex = 0;
425  for (const auto& ootPhotonFloatValueMapHandle : ootPhotonFloatValueMapHandles) {
426  ootPhotonFloatValueMapVals[subindex++].push_back((*ootPhotonFloatValueMapHandle)[ootPhotonref]);
427  }
428 
429  //link photon core
430  const reco::PhotonCoreRef& ootPhotonCore = ootPhoton.photonCore();
431  linkCore(ootPhotonCore, *ootPhotonCores, ootPhotonCoreMap);
432 
433  bool slimRelink = slimRelinkOOTPhotonSel_(ootPhoton);
434  //no supercluster relinking unless slimRelink selection is satisfied
435  if (!slimRelink)
436  continue;
437 
438  bool relink = relinkOOTPhotonSel_(ootPhoton);
439 
440  const reco::SuperClusterRef& ootSuperCluster = ootPhoton.superCluster();
441  linkSuperCluster(ootSuperCluster, ootSuperClusterMap, *ootSuperClusters, relink, ootSuperClusterFullRelinkMap);
442  //hcal hits
443  linkHcalHits(*ootPhoton.superCluster(), *hbheHitHandle, hcalRechitMap);
444  }
445  }
446 
447  //loop over electrons and fill maps
448  index = -1;
449  for (const auto& gsfElectron : *gsfElectronHandle) {
450  index++;
451 
452  reco::GsfElectronRef gsfElectronref(gsfElectronHandle, index);
453  gsfElectrons->push_back(gsfElectron);
454  auto& newGsfElectron = gsfElectrons->back();
455  if ((applyGsfElectronCalibOnData_ && theEvent.isRealData()) ||
456  (applyGsfElectronCalibOnMC_ && !theEvent.isRealData())) {
457  calibrateElectron(newGsfElectron,
458  gsfElectronref,
459  *gsfElectronCalibEnergyHandle,
460  *gsfElectronCalibEnergyErrHandle,
461  *gsfElectronCalibEcalEnergyHandle,
462  *gsfElectronCalibEcalEnergyErrHandle);
463  }
464 
465  bool keep = keepGsfElectronSel_(newGsfElectron);
466  if (!keep) {
467  gsfElectrons->pop_back();
468  continue;
469  }
470 
471  pfCandIsoPairVecEle.push_back((*gsfElectronPfCandMapHandle)[gsfElectronref]);
472 
473  //fill electron id valuemap vectors
474  int subindex = 0;
475  for (const auto& gsfElectronIdHandle : gsfElectronIdHandles) {
476  gsfElectronIdVals[subindex++].push_back((*gsfElectronIdHandle)[gsfElectronref]);
477  }
478 
479  subindex = 0;
480  for (const auto& gsfElectronFloatValueMapHandle : gsfElectronFloatValueMapHandles) {
481  gsfElectronFloatValueMapVals[subindex++].push_back((*gsfElectronFloatValueMapHandle)[gsfElectronref]);
482  }
483 
484  const reco::GsfElectronCoreRef& gsfElectronCore = gsfElectron.core();
485  linkCore(gsfElectronCore, *gsfElectronCores, gsfElectronCoreMap);
486 
487  const reco::GsfTrackRef& gsfTrack = gsfElectron.gsfTrack();
488 
489  // Save the main gsfTrack
490  if (!gsfTrackMap.count(gsfTrack)) {
491  gsfTracks->push_back(*gsfTrack);
492  gsfTrackMap[gsfTrack] = gsfTracks->size() - 1;
493  }
494 
495  // Save additional ambiguous gsf tracks in a map:
496  for (reco::GsfTrackRefVector::const_iterator igsf = gsfElectron.ambiguousGsfTracksBegin();
497  igsf != gsfElectron.ambiguousGsfTracksEnd();
498  ++igsf) {
499  const reco::GsfTrackRef& ambigGsfTrack = *igsf;
500  if (!gsfTrackMap.count(ambigGsfTrack)) {
501  gsfTracks->push_back(*ambigGsfTrack);
502  gsfTrackMap[ambigGsfTrack] = gsfTracks->size() - 1;
503  }
504  }
505 
506  bool slimRelink = slimRelinkGsfElectronSel_(newGsfElectron);
507  //no supercluster relinking unless slimRelink selection is satisfied
508  if (!slimRelink)
509  continue;
510 
511  bool relink = relinkGsfElectronSel_(newGsfElectron);
512 
513  const reco::SuperClusterRef& superCluster = gsfElectron.superCluster();
514  linkSuperCluster(superCluster, superClusterMap, *superClusters, relink, superClusterFullRelinkMap);
515 
516  //conversions only for full relinking
517  if (!relink)
518  continue;
519 
520  const reco::ConversionRefVector& convrefs = gsfElectron.core()->conversions();
521  linkConversions(convrefs, *conversions, conversionMap);
522 
523  //explicitly references conversions
524  const reco::ConversionRefVector& singleconvrefs = gsfElectron.core()->conversionsOneLeg();
525  linkConversions(singleconvrefs, *singleConversions, singleConversionMap);
526 
527  //conversions matched by trackrefs
528  linkConversionsByTrackRef(conversionHandle, gsfElectron, *conversions, conversionMap);
529 
530  //single leg conversions matched by trackrefs
531  linkConversionsByTrackRef(singleConversionHandle, gsfElectron, *singleConversions, singleConversionMap);
532 
533  //hcal hits
534  linkHcalHits(*gsfElectron.superCluster(), *hbheHitHandle, hcalRechitMap);
535  }
536 
537  //loop over output SuperClusters and fill maps
538  index = 0;
539  for (auto& superCluster : *superClusters) {
540  //link seed cluster no matter what
541  const reco::CaloClusterPtr& seedCluster = superCluster.seed();
542  linkCaloCluster(seedCluster, *ebeeClusters, ebeeClusterMap);
543 
544  //only proceed if superCluster is marked for full relinking
545  bool fullrelink = superClusterFullRelinkMap.count(index++);
546  if (!fullrelink) {
547  //zero detid vector which is anyways not useful without stored rechits
548  superCluster.clearHitsAndFractions();
549  continue;
550  }
551 
552  // link calo clusters
553  linkCaloClusters(superCluster,
554  *ebeeClusters,
555  ebeeClusterMap,
556  rechitMap,
557  barrelHitHandle,
558  endcapHitHandle,
559  caloTopology,
560  *esClusters,
561  esClusterMap);
562 
563  //conversions matched geometrically
564  linkConversionsByTrackRef(conversionHandle, superCluster, *conversions, conversionMap);
565 
566  //single leg conversions matched by trackrefs
567  linkConversionsByTrackRef(singleConversionHandle, superCluster, *singleConversions, singleConversionMap);
568  }
569 
570  //loop over output OOTSuperClusters and fill maps
571  if (!ootPhotonT_.isUninitialized()) {
572  index = 0;
573  for (auto& ootSuperCluster : *ootSuperClusters) {
574  //link seed cluster no matter what
575  const reco::CaloClusterPtr& ootSeedCluster = ootSuperCluster.seed();
576  linkCaloCluster(ootSeedCluster, *ootEbeeClusters, ootEbeeClusterMap);
577 
578  //only proceed if ootSuperCluster is marked for full relinking
579  bool fullrelink = ootSuperClusterFullRelinkMap.count(index++);
580  if (!fullrelink) {
581  //zero detid vector which is anyways not useful without stored rechits
582  ootSuperCluster.clearHitsAndFractions();
583  continue;
584  }
585 
586  // link calo clusters
587  linkCaloClusters(ootSuperCluster,
588  *ootEbeeClusters,
589  ootEbeeClusterMap,
590  rechitMap,
591  barrelHitHandle,
592  endcapHitHandle,
593  caloTopology,
594  *ootEsClusters,
595  ootEsClusterMap);
596  }
597  }
598  //now finalize and add to the event collections in "reverse" order
599 
600  //rechits (fill output collections of rechits to be stored)
601  for (const EcalRecHit& rechit : *barrelHitHandle) {
602  if (rechitMap.count(rechit.detid())) {
603  ebRecHits->push_back(rechit);
604  }
605  }
606 
607  for (const EcalRecHit& rechit : *endcapHitHandle) {
608  if (rechitMap.count(rechit.detid())) {
609  eeRecHits->push_back(rechit);
610  }
611  }
612 
613  theEvent.put(std::move(ebRecHits), outEBRecHits_);
614  theEvent.put(std::move(eeRecHits), outEERecHits_);
615 
616  if (doPreshowerEcalHits_) {
617  for (const EcalRecHit& rechit : *preshowerHitHandle) {
618  if (rechitMap.count(rechit.detid())) {
619  esRecHits->push_back(rechit);
620  }
621  }
622  theEvent.put(std::move(esRecHits), outESRecHits_);
623  }
624 
625  for (const HBHERecHit& rechit : *hbheHitHandle) {
626  if (hcalRechitMap.count(rechit.detid())) {
627  hbheRecHits->push_back(rechit);
628  }
629  }
630  theEvent.put(std::move(hbheRecHits), outHBHERecHits_);
631 
632  //CaloClusters
633  //put calocluster output collections in event and get orphan handles to create ptrs
634  const edm::OrphanHandle<reco::CaloClusterCollection>& outEBEEClusterHandle =
635  theEvent.put(std::move(ebeeClusters), outEBEEClusters_);
636  const edm::OrphanHandle<reco::CaloClusterCollection>& outESClusterHandle =
637  theEvent.put(std::move(esClusters), outESClusters_);
638  ;
639 
640  //Loop over SuperClusters and relink GEDPhoton + GSFElectron CaloClusters
641  for (reco::SuperCluster& superCluster : *superClusters) {
642  relinkCaloClusters(superCluster, ebeeClusterMap, esClusterMap, outEBEEClusterHandle, outESClusterHandle);
643  }
644 
645  //OOTCaloClusters
646  //put ootcalocluster output collections in event and get orphan handles to create ptrs
647  edm::OrphanHandle<reco::CaloClusterCollection> outOOTEBEEClusterHandle;
649  //Loop over OOTSuperClusters and relink OOTPhoton CaloClusters
650  if (!ootPhotonT_.isUninitialized()) {
651  outOOTEBEEClusterHandle = theEvent.put(std::move(ootEbeeClusters), outOOTEBEEClusters_);
652  outOOTESClusterHandle = theEvent.put(std::move(ootEsClusters), outOOTESClusters_);
653  for (reco::SuperCluster& ootSuperCluster : *ootSuperClusters) {
655  ootSuperCluster, ootEbeeClusterMap, ootEsClusterMap, outOOTEBEEClusterHandle, outOOTESClusterHandle);
656  }
657  }
658  //put superclusters and conversions in the event
659  const edm::OrphanHandle<reco::SuperClusterCollection>& outSuperClusterHandle =
661  const edm::OrphanHandle<reco::ConversionCollection>& outConversionHandle =
663  const edm::OrphanHandle<reco::ConversionCollection>& outSingleConversionHandle =
665  const edm::OrphanHandle<reco::GsfTrackCollection>& outGsfTrackHandle =
666  theEvent.put(std::move(gsfTracks), outGsfTracks_);
667 
668  //Loop over PhotonCores and relink GEDPhoton SuperClusters (and conversions)
669  for (reco::PhotonCore& photonCore : *photonCores) {
670  // superclusters
671  relinkSuperCluster(photonCore, superClusterMap, outSuperClusterHandle);
672 
673  //conversions
674  const reco::ConversionRefVector& convrefs = photonCore.conversions();
675  relinkConversions(photonCore, convrefs, conversionMap, outConversionHandle);
676 
677  //single leg conversions
678  const reco::ConversionRefVector& singleconvrefs = photonCore.conversionsOneLeg();
679  relinkConversions(photonCore, singleconvrefs, singleConversionMap, outSingleConversionHandle);
680  }
681 
682  //Relink GSFElectron SuperClusters and main GSF Tracks
683  for (reco::GsfElectronCore& gsfElectronCore : *gsfElectronCores) {
684  relinkSuperCluster(gsfElectronCore, superClusterMap, outSuperClusterHandle);
685  relinkGsfTrack(gsfElectronCore, gsfTrackMap, outGsfTrackHandle);
686  }
687 
688  //put ootsuperclusters in the event
689  edm::OrphanHandle<reco::SuperClusterCollection> outOOTSuperClusterHandle;
691  outOOTSuperClusterHandle = theEvent.put(std::move(ootSuperClusters), outOOTSuperClusters_);
692 
693  //Relink OOTPhoton SuperClusters
694  for (reco::PhotonCore& ootPhotonCore : *ootPhotonCores) {
695  relinkSuperCluster(ootPhotonCore, ootSuperClusterMap, outOOTSuperClusterHandle);
696  }
697 
698  //put photoncores and gsfelectroncores into the event
699  const edm::OrphanHandle<reco::PhotonCoreCollection>& outPhotonCoreHandle =
700  theEvent.put(std::move(photonCores), outPhotonCores_);
701  edm::OrphanHandle<reco::PhotonCoreCollection> outOOTPhotonCoreHandle;
703  outOOTPhotonCoreHandle = theEvent.put(std::move(ootPhotonCores), outOOTPhotonCores_);
704  const edm::OrphanHandle<reco::GsfElectronCoreCollection>& outgsfElectronCoreHandle =
705  theEvent.put(std::move(gsfElectronCores), outGsfElectronCores_);
706 
707  //loop over photons, oot photons, and electrons and relink the cores
708  for (reco::Photon& photon : *photons) {
709  relinkPhotonCore(photon, photonCoreMap, outPhotonCoreHandle);
710  }
711 
712  if (!ootPhotonT_.isUninitialized()) {
713  for (reco::Photon& ootPhoton : *ootPhotons) {
714  relinkPhotonCore(ootPhoton, ootPhotonCoreMap, outOOTPhotonCoreHandle);
715  }
716  }
717 
718  for (reco::GsfElectron& gsfElectron : *gsfElectrons) {
719  relinkGsfElectronCore(gsfElectron, gsfElectronCoreMap, outgsfElectronCoreHandle);
720 
721  // -----
722  // Also in this loop let's relink ambiguous tracks
723  std::vector<reco::GsfTrackRef> ambigTracksInThisElectron;
724  // Here we loop over the ambiguous tracks and save them in a vector
725  for (reco::GsfTrackRefVector::const_iterator igsf = gsfElectron.ambiguousGsfTracksBegin();
726  igsf != gsfElectron.ambiguousGsfTracksEnd();
727  ++igsf) {
728  ambigTracksInThisElectron.push_back(*igsf);
729  }
730 
731  // Now we need to clear them (they are the refs to original collection):
732  gsfElectron.clearAmbiguousGsfTracks();
733 
734  // And here we add them back, now from a new reduced collection:
735  for (const auto& it : ambigTracksInThisElectron) {
736  const auto& gsftkmapped = gsfTrackMap.find(it);
737 
738  if (gsftkmapped != gsfTrackMap.end()) {
739  reco::GsfTrackRef gsftkref(outGsfTrackHandle, gsftkmapped->second);
740  gsfElectron.addAmbiguousGsfTrack(gsftkref);
741  } else
742  throw cms::Exception("There must be a problem with linking and mapping of ambiguous gsf tracks...");
743  }
744 
745  if (gsfElectron.ambiguousGsfTracksSize() > 0)
746  gsfElectron.setAmbiguous(true); // Set the flag
747 
748  ambigTracksInThisElectron.clear();
749  }
750 
751  //(finally) store the output photon and electron collections
752  const edm::OrphanHandle<reco::PhotonCollection>& outPhotonHandle = theEvent.put(std::move(photons), outPhotons_);
755  outOOTPhotonHandle = theEvent.put(std::move(ootPhotons), outOOTPhotons_);
756  const edm::OrphanHandle<reco::GsfElectronCollection>& outGsfElectronHandle =
758 
759  //still need to output relinked valuemaps
760 
761  //photon pfcand isolation valuemap
762  edm::ValueMap<std::vector<reco::PFCandidateRef>>::Filler fillerPhotons(*photonPfCandMap);
763  fillerPhotons.insert(outPhotonHandle, pfCandIsoPairVecPho.begin(), pfCandIsoPairVecPho.end());
764  fillerPhotons.fill();
765 
766  //electron pfcand isolation valuemap
767  edm::ValueMap<std::vector<reco::PFCandidateRef>>::Filler fillerGsfElectrons(*gsfElectronPfCandMap);
768  fillerGsfElectrons.insert(outGsfElectronHandle, pfCandIsoPairVecEle.begin(), pfCandIsoPairVecEle.end());
769  fillerGsfElectrons.fill();
770 
771  theEvent.put(std::move(photonPfCandMap), outPhotonPfCandMap_);
772  theEvent.put(std::move(gsfElectronPfCandMap), outGsfElectronPfCandMap_);
773 
774  auto fillMap = [](auto refH, auto& vec, edm::Event& ev, const std::string& cAl = "") {
775  typedef edm::ValueMap<typename std::decay<decltype(vec)>::type::value_type> MapType;
776  auto oMap = std::make_unique<MapType>();
777  {
778  typename MapType::Filler filler(*oMap);
779  filler.insert(refH, vec.begin(), vec.end());
780  filler.fill();
781  }
782  ev.put(std::move(oMap), cAl);
783  };
784 
785  //photon id value maps
786  index = 0;
787  for (auto const& vals : photonIdVals) {
788  fillMap(outPhotonHandle, vals, theEvent, outPhotonIds_[index++]);
789  }
790 
791  //electron id value maps
792  index = 0;
793  for (auto const& vals : gsfElectronIdVals) {
794  fillMap(outGsfElectronHandle, vals, theEvent, outGsfElectronIds_[index++]);
795  }
796 
797  // photon iso value maps
798  index = 0;
799  for (auto const& vals : photonFloatValueMapVals) {
800  fillMap(outPhotonHandle, vals, theEvent, outPhotonFloatValueMaps_[index++]);
801  }
802 
803  if (!ootPhotonT_.isUninitialized()) {
804  //oot photon iso value maps
805  index = 0;
806  for (auto const& vals : ootPhotonFloatValueMapVals) {
807  fillMap(outOOTPhotonHandle, vals, theEvent, outOOTPhotonFloatValueMaps_[index++]);
808  }
809  }
810 
811  //electron iso value maps
812  index = 0;
813  for (auto const& vals : gsfElectronFloatValueMapVals) {
814  fillMap(outGsfElectronHandle, vals, theEvent, outGsfElectronFloatValueMaps_[index++]);
815  }
816 }
817 
818 template <typename T, typename U>
819 void ReducedEGProducer::linkCore(const T& core, U& cores, std::map<T, unsigned int>& coreMap) {
820  if (!coreMap.count(core)) {
821  cores.push_back(*core);
822  coreMap[core] = cores.size() - 1;
823  }
824 }
825 
827  std::map<reco::SuperClusterRef, unsigned int>& superClusterMap,
829  const bool relink,
830  std::unordered_set<unsigned int>& superClusterFullRelinkMap) {
831  const auto& mappedsc = superClusterMap.find(superCluster);
832  //get index in output collection in order to keep track whether superCluster
833  //will be subject to full relinking
834  unsigned int mappedscidx = 0;
835  if (mappedsc == superClusterMap.end()) {
836  superClusters.push_back(*superCluster);
837  mappedscidx = superClusters.size() - 1;
838  superClusterMap[superCluster] = mappedscidx;
839  } else {
840  mappedscidx = mappedsc->second;
841  }
842 
843  //additionally mark supercluster for full relinking
844  if (relink)
845  superClusterFullRelinkMap.insert(mappedscidx);
846 }
847 
850  std::map<reco::ConversionRef, unsigned int>& conversionMap) {
851  for (const auto& convref : convrefs) {
852  linkConversion(convref, conversions, conversionMap);
853  }
854 }
855 
857  const reco::GsfElectron& gsfElectron,
859  std::map<reco::ConversionRef, unsigned int>& conversionMap) {
860  int index = 0;
861  for (const auto& conversion : *conversionHandle) {
863 
864  bool matched = ConversionTools::matchesConversion(gsfElectron, conversion, true, true);
865  if (!matched)
866  continue;
867 
868  linkConversion(convref, conversions, conversionMap);
869  }
870 }
871 
873  const reco::SuperCluster& superCluster,
875  std::map<reco::ConversionRef, unsigned int>& conversionMap) {
876  int index = 0;
877  for (const auto& conversion : *conversionHandle) {
879 
880  bool matched = ConversionTools::matchesConversion(superCluster, conversion, 0.2);
881  if (!matched)
882  continue;
883 
884  linkConversion(convref, conversions, conversionMap);
885  }
886 }
887 
890  std::map<reco::ConversionRef, unsigned int>& conversionMap) {
891  if (!conversionMap.count(convref)) {
892  conversions.push_back(*convref);
893  conversionMap[convref] = conversions.size() - 1;
894  }
895 }
896 
898  reco::CaloClusterCollection& caloClusters,
899  std::map<reco::CaloClusterPtr, unsigned int>& caloClusterMap) {
900  if (!caloClusterMap.count(caloCluster)) {
901  caloClusters.push_back(*caloCluster);
902  caloClusterMap[caloCluster] = caloClusters.size() - 1;
903  }
904 }
905 
907  reco::CaloClusterCollection& ebeeClusters,
908  std::map<reco::CaloClusterPtr, unsigned int>& ebeeClusterMap,
909  std::unordered_set<DetId>& rechitMap,
910  const edm::Handle<EcalRecHitCollection>& barrelHitHandle,
911  const edm::Handle<EcalRecHitCollection>& endcapHitHandle,
912  const CaloTopology* caloTopology,
913  reco::CaloClusterCollection& esClusters,
914  std::map<reco::CaloClusterPtr, unsigned int>& esClusterMap) {
915  for (const auto& cluster : superCluster.clusters()) {
916  linkCaloCluster(cluster, ebeeClusters, ebeeClusterMap);
917 
918  for (const auto& hitfrac : cluster->hitsAndFractions()) {
919  rechitMap.insert(hitfrac.first);
920  }
921  //make sure to also take all hits in the 5x5 around the max energy xtal
922  bool barrel = cluster->hitsAndFractions().front().first.subdetId() == EcalBarrel;
923  const EcalRecHitCollection* rhcol = barrel ? barrelHitHandle.product() : endcapHitHandle.product();
924  DetId seed = EcalClusterTools::getMaximum(*cluster, rhcol).first;
925 
926  std::vector<DetId> dets5x5 =
928  for (const auto& detid : dets5x5) {
929  rechitMap.insert(detid);
930  }
931  }
932  for (const auto& cluster : superCluster.preshowerClusters()) {
933  linkCaloCluster(cluster, esClusters, esClusterMap);
934 
935  for (const auto& hitfrac : cluster->hitsAndFractions()) {
936  rechitMap.insert(hitfrac.first);
937  }
938  }
939 }
940 
943  std::unordered_set<DetId>& hcalDetIds) {
944  hcalHitSel_.addDetIds(superClus, recHits, hcalDetIds);
945 }
946 
948  const std::map<reco::CaloClusterPtr, unsigned int>& ebeeClusterMap,
949  const std::map<reco::CaloClusterPtr, unsigned int>& esClusterMap,
950  const edm::OrphanHandle<reco::CaloClusterCollection>& outEBEEClusterHandle,
951  const edm::OrphanHandle<reco::CaloClusterCollection>& outESClusterHandle) {
952  //remap seed cluster
953  const auto& seedmapped = ebeeClusterMap.find(superCluster.seed());
954  if (seedmapped != ebeeClusterMap.end()) {
955  //make new ptr
956  reco::CaloClusterPtr clusptr(outEBEEClusterHandle, seedmapped->second);
957  superCluster.setSeed(clusptr);
958  }
959 
960  //remap all clusters
962  for (const auto& cluster : superCluster.clusters()) {
963  const auto& clustermapped = ebeeClusterMap.find(cluster);
964  if (clustermapped != ebeeClusterMap.end()) {
965  //make new ptr
966  reco::CaloClusterPtr clusptr(outEBEEClusterHandle, clustermapped->second);
967  clusters.push_back(clusptr);
968  } else {
969  //can only relink if all clusters are being relinked, so if one is missing, then skip the relinking completely
970  clusters.clear();
971  break;
972  }
973  }
974  if (!clusters.empty()) {
975  superCluster.setClusters(clusters);
976  }
977 
978  //remap preshower clusters
979  reco::CaloClusterPtrVector esclusters;
980  for (const auto& cluster : superCluster.preshowerClusters()) {
981  const auto& clustermapped = esClusterMap.find(cluster);
982  if (clustermapped != esClusterMap.end()) {
983  //make new ptr
984  reco::CaloClusterPtr clusptr(outESClusterHandle, clustermapped->second);
985  esclusters.push_back(clusptr);
986  } else {
987  //can only relink if all clusters are being relinked, so if one is missing, then skip the relinking completely
988  esclusters.clear();
989  break;
990  }
991  }
992  if (!esclusters.empty()) {
993  superCluster.setPreshowerClusters(esclusters);
994  }
995 }
996 
997 template <typename T>
999  T& core,
1000  const std::map<reco::SuperClusterRef, unsigned int>& superClusterMap,
1001  const edm::OrphanHandle<reco::SuperClusterCollection>& outSuperClusterHandle) {
1002  const auto& scmapped = superClusterMap.find(core.superCluster());
1003  if (scmapped != superClusterMap.end()) {
1004  //make new ref
1005  reco::SuperClusterRef scref(outSuperClusterHandle, scmapped->second);
1006  core.setSuperCluster(scref);
1007  }
1008 }
1009 
1011  const std::map<reco::GsfTrackRef, unsigned int>& gsfTrackMap,
1012  const edm::OrphanHandle<reco::GsfTrackCollection>& outGsfTrackHandle) {
1013  const auto& gsftkmapped = gsfTrackMap.find(gsfElectronCore.gsfTrack());
1014  if (gsftkmapped != gsfTrackMap.end()) {
1015  reco::GsfTrackRef gsftkref(outGsfTrackHandle, gsftkmapped->second);
1016  gsfElectronCore.setGsfTrack(gsftkref);
1017  }
1018 }
1019 
1021  const reco::ConversionRefVector& convrefs,
1022  const std::map<reco::ConversionRef, unsigned int>& conversionMap,
1023  const edm::OrphanHandle<reco::ConversionCollection>& outConversionHandle) {
1024  reco::ConversionRefVector outconvrefs;
1025  for (const auto& convref : convrefs) {
1026  const auto& convmapped = conversionMap.find(convref);
1027  if (convmapped != conversionMap.end()) {
1028  //make new ref
1029  reco::ConversionRef outref(outConversionHandle, convmapped->second);
1030  } else {
1031  //can only relink if all conversions are being relinked, so if one is missing, then skip the relinking completely
1032  outconvrefs.clear();
1033  break;
1034  }
1035  }
1036  if (!outconvrefs.empty()) {
1037  photonCore.setConversions(outconvrefs);
1038  }
1039 }
1040 
1042  const std::map<reco::PhotonCoreRef, unsigned int>& photonCoreMap,
1043  const edm::OrphanHandle<reco::PhotonCoreCollection>& outPhotonCoreHandle) {
1044  const auto& coremapped = photonCoreMap.find(photon.photonCore());
1045  if (coremapped != photonCoreMap.end()) {
1046  //make new ref
1047  reco::PhotonCoreRef coreref(outPhotonCoreHandle, coremapped->second);
1048  photon.setPhotonCore(coreref);
1049  }
1050 }
1051 
1053  reco::GsfElectron& gsfElectron,
1054  const std::map<reco::GsfElectronCoreRef, unsigned int>& gsfElectronCoreMap,
1055  const edm::OrphanHandle<reco::GsfElectronCoreCollection>& outgsfElectronCoreHandle) {
1056  const auto& coremapped = gsfElectronCoreMap.find(gsfElectron.core());
1057  if (coremapped != gsfElectronCoreMap.end()) {
1058  //make new ref
1059  reco::GsfElectronCoreRef coreref(outgsfElectronCoreHandle, coremapped->second);
1060  gsfElectron.setCore(coreref);
1061  }
1062 }
1063 
1065  const reco::PhotonRef& oldPhoRef,
1066  const edm::ValueMap<float>& energyMap,
1067  const edm::ValueMap<float>& energyErrMap) {
1068  float newEnergy = energyMap[oldPhoRef];
1069  float newEnergyErr = energyErrMap[oldPhoRef];
1070  photon.setCorrectedEnergy(reco::Photon::P4type::regression2, newEnergy, newEnergyErr, true);
1071 }
1072 
1074  const reco::GsfElectronRef& oldEleRef,
1075  const edm::ValueMap<float>& energyMap,
1076  const edm::ValueMap<float>& energyErrMap,
1077  const edm::ValueMap<float>& ecalEnergyMap,
1078  const edm::ValueMap<float>& ecalEnergyErrMap) {
1079  const float newEnergy = energyMap[oldEleRef];
1080  const float newEnergyErr = energyErrMap[oldEleRef];
1081  const float newEcalEnergy = ecalEnergyMap[oldEleRef];
1082  const float newEcalEnergyErr = ecalEnergyErrMap[oldEleRef];
1083 
1084  //make a copy of this as the setCorrectedEcalEnergy call with modifiy the electrons p4
1085  const math::XYZTLorentzVector oldP4 = electron.p4();
1086  const float corr = newEnergy / oldP4.E();
1087 
1088  electron.setCorrectedEcalEnergy(newEcalEnergy);
1089  electron.setCorrectedEcalEnergyError(newEcalEnergyErr);
1090 
1091  math::XYZTLorentzVector newP4 =
1092  math::XYZTLorentzVector(oldP4.x() * corr, oldP4.y() * corr, oldP4.z() * corr, newEnergy);
1093  electron.correctMomentum(newP4, electron.trackMomentumError(), newEnergyErr);
1094 }
ReducedEGProducer::outPhotonPfCandMap_
const std::string outPhotonPfCandMap_
Definition: ReducedEGProducer.h:195
ReducedEGProducer::endcapEcalHits_
const edm::EDGetTokenT< EcalRecHitCollection > endcapEcalHits_
Definition: ReducedEGProducer.h:149
muonTagProbeFilters_cff.matched
matched
Definition: muonTagProbeFilters_cff.py:62
ReducedEGProducer::applyGsfElectronCalibOnMC_
const bool applyGsfElectronCalibOnMC_
Definition: ReducedEGProducer.h:167
muons2muons_cfi.photon
photon
Definition: muons2muons_cfi.py:28
EGHcalRecHitSelector::setup
void setup(const edm::EventSetup &iSetup)
Definition: EGHcalRecHitSelector.h:27
ReducedEGProducer::photonCalibEnergyT_
edm::EDGetTokenT< edm::ValueMap< float > > photonCalibEnergyT_
Definition: ReducedEGProducer.h:168
ReducedEGProducer::ReducedEGProducer
ReducedEGProducer(const edm::ParameterSet &ps)
Definition: ReducedEGProducer.cc:43
EcalRecHit
Definition: EcalRecHit.h:15
ReducedEGProducer::outPhotonFloatValueMaps_
const std::vector< std::string > outPhotonFloatValueMaps_
Definition: ReducedEGProducer.h:199
edm::RefVector::clear
void clear()
Clear the vector.
Definition: RefVector.h:142
electrons_cff.bool
bool
Definition: electrons_cff.py:372
ReducedEGProducer::singleConversionT_
const edm::EDGetTokenT< reco::ConversionCollection > singleConversionT_
Definition: ReducedEGProducer.h:146
reco::SuperCluster::setPreshowerClusters
void setPreshowerClusters(const CaloClusterPtrVector &clusters)
Definition: SuperCluster.h:116
Reference_intrackfit_cff.barrel
list barrel
Definition: Reference_intrackfit_cff.py:37
ReducedEGProducer::doPreshowerEcalHits_
const bool doPreshowerEcalHits_
Definition: ReducedEGProducer.h:150
MessageLogger.h
reco::SuperCluster::clusters
const CaloClusterPtrVector & clusters() const
const access to the cluster list itself
Definition: SuperCluster.h:80
ReducedEGProducer::linkCaloClusters
void linkCaloClusters(const reco::SuperCluster &superCluster, reco::CaloClusterCollection &ebeeClusters, std::map< reco::CaloClusterPtr, unsigned int > &ebeeClusterMap, std::unordered_set< DetId > &rechitMap, const edm::Handle< EcalRecHitCollection > &barrelHitHandle, const edm::Handle< EcalRecHitCollection > &endcapHitHandle, const CaloTopology *caloTopology, reco::CaloClusterCollection &esClusters, std::map< reco::CaloClusterPtr, unsigned int > &esClusterMap)
Definition: ReducedEGProducer.cc:906
ReducedEGProducer::relinkOOTPhotonSel_
const StringCutObjectSelector< reco::Photon > relinkOOTPhotonSel_
Definition: ReducedEGProducer.h:208
edm::conversion
void conversion(EventAux const &from, EventAuxiliary &to)
Definition: EventAux.cc:9
edm::Handle::product
T const * product() const
Definition: Handle.h:70
ReducedEGProducer::linkHcalHits
void linkHcalHits(const reco::SuperCluster &superClus, const HBHERecHitCollection &recHits, std::unordered_set< DetId > &hcalDetIds)
Definition: ReducedEGProducer.cc:941
ReducedEGProducer::outOOTPhotons_
const std::string outOOTPhotons_
Definition: ReducedEGProducer.h:178
ConversionTools.h
ReducedEGProducer::beginRun
void beginRun(edm::Run const &, const edm::EventSetup &) final
Definition: ReducedEGProducer.cc:193
ReducedEGProducer::calibratePhoton
static void calibratePhoton(reco::Photon &photon, const reco::PhotonRef &oldPhoRef, const edm::ValueMap< float > &energyMap, const edm::ValueMap< float > &energyErrMap)
Definition: ReducedEGProducer.cc:1064
ReducedEGProducer::outEBEEClusters_
const std::string outEBEEClusters_
Definition: ReducedEGProducer.h:186
PFCandidate.h
ReducedEGProducer::keepPhotonSel_
const StringCutObjectSelector< reco::Photon > keepPhotonSel_
Definition: ReducedEGProducer.h:203
reco::SuperCluster
Definition: SuperCluster.h:18
EcalSeverityLevelAlgoRcd.h
edm::Run
Definition: Run.h:45
ReducedEGProducer::conversionT_
const edm::EDGetTokenT< reco::ConversionCollection > conversionT_
Definition: ReducedEGProducer.h:145
ootPhotons_cff.ootPhotons
ootPhotons
Definition: ootPhotons_cff.py:13
edm
HLT enums.
Definition: AlignableModifier.h:19
ReducedEGProducer::gsfElectronCalibEnergyT_
edm::EDGetTokenT< edm::ValueMap< float > > gsfElectronCalibEnergyT_
Definition: ReducedEGProducer.h:170
ReducedEGProducer::outGsfTracks_
const std::string outGsfTracks_
Definition: ReducedEGProducer.h:182
ReducedEGProducer::slimRelinkPhotonSel_
const StringCutObjectSelector< reco::Photon > slimRelinkPhotonSel_
Definition: ReducedEGProducer.h:204
HBHERecHit
Definition: HBHERecHit.h:13
ReducedEGProducer::relinkGsfTrack
void relinkGsfTrack(reco::GsfElectronCore &electroncore, const std::map< reco::GsfTrackRef, unsigned int > &gsfTrackMap, const edm::OrphanHandle< reco::GsfTrackCollection > &outGsfTrackHandle)
Definition: ReducedEGProducer.cc:1010
ReducedEGProducer::~ReducedEGProducer
~ReducedEGProducer() override
Definition: ReducedEGProducer.cc:191
ReducedEGProducer::outOOTPhotonFloatValueMaps_
const std::vector< std::string > outOOTPhotonFloatValueMaps_
Definition: ReducedEGProducer.h:200
ReducedEGProducer::hcalHitSel_
EGHcalRecHitSelector hcalHitSel_
Definition: ReducedEGProducer.h:213
ReducedEGProducer::keepGsfElectronSel_
const StringCutObjectSelector< reco::GsfElectron > keepGsfElectronSel_
Definition: ReducedEGProducer.h:209
ootPhotonCore_cff.ootPhotonCore
ootPhotonCore
Definition: ootPhotonCore_cff.py:4
edm::SortedCollection< EcalRecHit >
PhotonFwd.h
ReducedEGProducer::photonPfCandMapT_
const edm::EDGetTokenT< edm::ValueMap< std::vector< reco::PFCandidateRef > > > photonPfCandMapT_
Definition: ReducedEGProducer.h:154
reco::GsfElectronCollection
std::vector< GsfElectron > GsfElectronCollection
collection of GsfElectron objects
Definition: GsfElectronFwd.h:14
CaloTopologyRecord
Definition: CaloTopologyRecord.h:10
printConversionInfo.conversionHandle
conversionHandle
Definition: printConversionInfo.py:15
edm::RefVector< ConversionCollection >
PhotonCore.h
reco
fixed size matrix
Definition: AlignmentAlgorithmBase.h:45
EGHcalRecHitSelector::addDetIds
void addDetIds(const reco::SuperCluster &superClus, const HBHERecHitCollection &recHits, CollType &detIdsToStore) const
Definition: EGHcalRecHitSelector.h:46
ReducedEGProducer::outHBHERecHits_
const std::string outHBHERecHits_
Definition: ReducedEGProducer.h:194
ReducedEGProducer::setToken
void setToken(edm::EDGetTokenT< T > &token, const edm::ParameterSet &config, const std::string &name)
Definition: ReducedEGProducer.h:136
electronIsolatorFromEffectiveArea_cfi.gsfElectrons
gsfElectrons
Definition: electronIsolatorFromEffectiveArea_cfi.py:4
edm::Handle< reco::PhotonCollection >
CaloTopology
Definition: CaloTopology.h:19
ReducedEGProducer::outEBRecHits_
const std::string outEBRecHits_
Definition: ReducedEGProducer.h:191
EcalBarrel
Definition: EcalSubdetector.h:10
ReducedEGProducer::outESRecHits_
const std::string outESRecHits_
Definition: ReducedEGProducer.h:193
EgammaHadTower.h
edm::Ref< PhotonCollection >
reco::ConversionCollection
std::vector< Conversion > ConversionCollection
collectin of Conversion objects
Definition: ConversionFwd.h:9
ReducedEGProducer::relinkConversions
void relinkConversions(reco::PhotonCore &photonCore, const reco::ConversionRefVector &convrefs, const std::map< reco::ConversionRef, unsigned int > &conversionMap, const edm::OrphanHandle< reco::ConversionCollection > &outConversionHandle)
Definition: ReducedEGProducer.cc:1020
CaloConeSelector.h
reco::GsfElectron::core
virtual GsfElectronCoreRef core() const
Definition: GsfElectron.cc:8
reco::SuperCluster::setSeed
void setSeed(const CaloClusterPtr &r)
list of used xtals by DetId // now inherited by CaloCluster
Definition: SuperCluster.h:107
reco::SuperClusterCollection
std::vector< SuperCluster > SuperClusterCollection
collection of SuperCluser objectr
Definition: SuperClusterFwd.h:9
config
Definition: config.py:1
edm::InputTag::label
std::string const & label() const
Definition: InputTag.h:36
DetId
Definition: DetId.h:17
Photon.h
ReducedEGProducer::relinkGsfElectronSel_
const StringCutObjectSelector< reco::GsfElectron > relinkGsfElectronSel_
Definition: ReducedEGProducer.h:211
ReducedEGProducer::linkConversionsByTrackRef
void linkConversionsByTrackRef(const edm::Handle< reco::ConversionCollection > &conversionHandle, const reco::GsfElectron &gsfElectron, reco::ConversionCollection &conversions, std::map< reco::ConversionRef, unsigned int > &conversionMap)
Definition: ReducedEGProducer.cc:856
edm::EventSetup::get
T get() const
Definition: EventSetup.h:73
ReducedEGProducer::linkConversion
void linkConversion(const reco::ConversionRef &convref, reco::ConversionCollection &conversions, std::map< reco::ConversionRef, unsigned int > &conversionMap)
Definition: ReducedEGProducer.cc:888
edm::RefVector::empty
bool empty() const
Is the RefVector empty.
Definition: RefVector.h:99
l1t::PFCandidateRef
edm::Ref< l1t::PFCandidateCollection > PFCandidateRef
Definition: PFCandidate.h:58
edm::PtrVector< CaloCluster >
GlobalPosition_Frontier_DevDB_cff.tag
tag
Definition: GlobalPosition_Frontier_DevDB_cff.py:11
alignCSCRings.corr
dictionary corr
Definition: alignCSCRings.py:124
edm::EDGetTokenT::isUninitialized
bool isUninitialized() const
Definition: EDGetToken.h:70
reco::CaloClusterCollection
std::vector< CaloCluster > CaloClusterCollection
collection of CaloCluster objects
Definition: CaloClusterFwd.h:19
reco::PhotonCore
Definition: PhotonCore.h:24
ReducedEGProducer::preshowerEcalHits_
const edm::EDGetTokenT< EcalRecHitCollection > preshowerEcalHits_
Definition: ReducedEGProducer.h:151
metsig::electron
Definition: SignAlgoResolutions.h:48
ReducedEGProducer::applyPhotonCalibOnMC_
const bool applyPhotonCalibOnMC_
Definition: ReducedEGProducer.h:165
edm::ESHandle< CaloTopology >
ReducedEGProducer::applyGsfElectronCalibOnData_
const bool applyGsfElectronCalibOnData_
Definition: ReducedEGProducer.h:166
StringToEnumValue.h
ReducedEGProducer::photonCalibEnergyErrT_
edm::EDGetTokenT< edm::ValueMap< float > > photonCalibEnergyErrT_
Definition: ReducedEGProducer.h:169
reco::GsfElectron
Definition: GsfElectron.h:35
edm::Event::getByToken
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:528
EgammaTowerIsolation.h
ecalDrivenGsfElectronCoresFromMultiCl_cff.gsfTracks
gsfTracks
Definition: ecalDrivenGsfElectronCoresFromMultiCl_cff.py:4
ReducedEGProducer::ootPhotonT_
edm::EDGetTokenT< reco::PhotonCollection > ootPhotonT_
Definition: ReducedEGProducer.h:142
ReducedEGProducer::relinkSuperCluster
void relinkSuperCluster(T &core, const std::map< reco::SuperClusterRef, unsigned int > &superClusterMap, const edm::OrphanHandle< reco::SuperClusterCollection > &outSuperClusterHandle)
Definition: ReducedEGProducer.cc:998
ReducedEGProducer::outSingleConversions_
const std::string outSingleConversions_
Definition: ReducedEGProducer.h:184
EcalSeverityLevelAlgo.h
ReducedEGProducer::gsfElectronPfCandMapT_
const edm::EDGetTokenT< edm::ValueMap< std::vector< reco::PFCandidateRef > > > gsfElectronPfCandMapT_
Definition: ReducedEGProducer.h:155
mitigatedMETSequence_cff.U
U
Definition: mitigatedMETSequence_cff.py:36
CaloGeometryRecord.h
HLT_2018_cff.superClusters
superClusters
Definition: HLT_2018_cff.py:13791
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
Vertex.h
ReducedEGProducer::keepOOTPhotonSel_
const StringCutObjectSelector< reco::Photon > keepOOTPhotonSel_
Definition: ReducedEGProducer.h:206
ReducedEGProducer::relinkPhotonCore
void relinkPhotonCore(reco::Photon &photon, const std::map< reco::PhotonCoreRef, unsigned int > &photonCoreMap, const edm::OrphanHandle< reco::PhotonCoreCollection > &outPhotonCoreHandle)
Definition: ReducedEGProducer.cc:1041
EcalEndcap
Definition: EcalSubdetector.h:10
FastTrackerRecHitMaskProducer_cfi.recHits
recHits
Definition: FastTrackerRecHitMaskProducer_cfi.py:8
ReducedEGProducer::outOOTESClusters_
const std::string outOOTESClusters_
Definition: ReducedEGProducer.h:190
bsc_activity_cfg.clusters
clusters
Definition: bsc_activity_cfg.py:36
edm::PtrVector::push_back
void push_back(Ptr< T > const &iPtr)
Definition: PtrVector.h:149
ClusterShape.h
ReducedEGProducer::linkConversions
void linkConversions(const reco::ConversionRefVector &convrefs, reco::ConversionCollection &conversions, std::map< reco::ConversionRef, unsigned int > &conversionMap)
Definition: ReducedEGProducer.cc:848
ReducedEGProducer::hbheHits_
const edm::EDGetTokenT< HBHERecHitCollection > hbheHits_
Definition: ReducedEGProducer.h:152
CaloSubdetectorGeometry.h
HLT_2018_cff.InputTag
InputTag
Definition: HLT_2018_cff.py:79016
core
Definition: __init__.py:1
edm::ParameterSet
Definition: ParameterSet.h:36
ReducedEGProducer::relinkCaloClusters
void relinkCaloClusters(reco::SuperCluster &superCluster, const std::map< reco::CaloClusterPtr, unsigned int > &ebeeClusterMap, const std::map< reco::CaloClusterPtr, unsigned int > &esClusterMap, const edm::OrphanHandle< reco::CaloClusterCollection > &outEBEEClusterHandle, const edm::OrphanHandle< reco::CaloClusterCollection > &outESClusterHandle)
Definition: ReducedEGProducer.cc:947
ReducedEGProducer::outGsfElectronIds_
const std::vector< std::string > outGsfElectronIds_
Definition: ReducedEGProducer.h:198
reco::SuperCluster::seed
const CaloClusterPtr & seed() const
seed BasicCluster
Definition: SuperCluster.h:77
reco::SuperCluster::setClusters
void setClusters(const CaloClusterPtrVector &clusters)
Definition: SuperCluster.h:110
ParameterSet
Definition: Functions.h:16
ReducedEGProducer::ootPhotonFloatValueMapTs_
std::vector< edm::EDGetTokenT< edm::ValueMap< float > > > ootPhotonFloatValueMapTs_
Definition: ReducedEGProducer.h:161
ReducedEGProducer::gsfElectronFloatValueMapTs_
std::vector< edm::EDGetTokenT< edm::ValueMap< float > > > gsfElectronFloatValueMapTs_
Definition: ReducedEGProducer.h:162
ReducedEGProducer::outGsfElectronPfCandMap_
const std::string outGsfElectronPfCandMap_
Definition: ReducedEGProducer.h:196
edm::PtrVectorBase::empty
bool empty() const
Is the RefVector empty.
Definition: PtrVectorBase.h:70
edm::EventBase::isRealData
bool isRealData() const
Definition: EventBase.h:62
ReducedEGProducer::outGsfElectrons_
const std::string outGsfElectrons_
Definition: ReducedEGProducer.h:180
ConversionTools::matchesConversion
static bool matchesConversion(const reco::GsfElectron &ele, const reco::Conversion &conv, bool allowCkfMatch=true, bool allowAmbiguousGsfMatch=false)
Definition: ConversionTools.cc:54
trigObjTnPSource_cfi.filler
filler
Definition: trigObjTnPSource_cfi.py:21
ReducedEGProducer::outESClusters_
const std::string outESClusters_
Definition: ReducedEGProducer.h:187
CaloTopology::getSubdetectorTopology
const CaloSubdetectorTopology * getSubdetectorTopology(const DetId &id) const
access the subdetector Topology for the given subdetector directly
Definition: CaloTopology.cc:17
ReducedEGProducer::linkSuperCluster
void linkSuperCluster(const reco::SuperClusterRef &superCluster, std::map< reco::SuperClusterRef, unsigned int > &superClusterMap, reco::SuperClusterCollection &superClusters, const bool relink, std::unordered_set< unsigned int > &superClusterFullRelinkMap)
Definition: ReducedEGProducer.cc:826
ReducedEGProducer::outOOTSuperClusters_
const std::string outOOTSuperClusters_
Definition: ReducedEGProducer.h:188
CaloTopologyRecord.h
reco::GsfElectronCore
Definition: GsfElectronCore.h:32
ReducedEGProducer::gsfElectronIdTs_
std::vector< edm::EDGetTokenT< edm::ValueMap< float > > > gsfElectronIdTs_
Definition: ReducedEGProducer.h:158
ReducedEGProducer::gsfElectronCalibEnergyErrT_
edm::EDGetTokenT< edm::ValueMap< float > > gsfElectronCalibEnergyErrT_
Definition: ReducedEGProducer.h:171
photonCore_cfi.photonCore
photonCore
Definition: photonCore_cfi.py:7
edm::Event::put
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
Definition: Event.h:132
ReducedEGProducer::gsfElectronCalibEcalEnergyErrT_
edm::EDGetTokenT< edm::ValueMap< float > > gsfElectronCalibEcalEnergyErrT_
Definition: ReducedEGProducer.h:173
ReducedEGProducer::calibrateElectron
static void calibrateElectron(reco::GsfElectron &gsfElectron, const reco::GsfElectronRef &oldEleRef, const edm::ValueMap< float > &energyMap, const edm::ValueMap< float > &energyErrMap, const edm::ValueMap< float > &ecalEnergyMap, const edm::ValueMap< float > &ecalEnergyErrMap)
Definition: ReducedEGProducer.cc:1073
ReducedEGProducer::outPhotons_
const std::string outPhotons_
Definition: ReducedEGProducer.h:176
BPHMonitor_cfi.photons
photons
Definition: BPHMonitor_cfi.py:91
edm::EventSetup
Definition: EventSetup.h:57
ReducedEGProducer::relinkGsfElectronCore
void relinkGsfElectronCore(reco::GsfElectron &gsfElectron, const std::map< reco::GsfElectronCoreRef, unsigned int > &gsfElectronCoreMap, const edm::OrphanHandle< reco::GsfElectronCoreCollection > &outGsfElectronCoreHandle)
Definition: ReducedEGProducer.cc:1052
reco::JetExtendedAssociation::value_type
Container::value_type value_type
Definition: JetExtendedAssociation.h:30
edm::PtrVectorBase::clear
void clear()
Clear the PtrVector.
Definition: PtrVectorBase.h:79
DetId::Ecal
Definition: DetId.h:27
get
#define get
ReducedEGProducer::outGsfElectronCores_
const std::string outGsfElectronCores_
Definition: ReducedEGProducer.h:181
ReducedEGProducer::outOOTEBEEClusters_
const std::string outOOTEBEEClusters_
Definition: ReducedEGProducer.h:189
ReducedEGProducer::slimRelinkGsfElectronSel_
const StringCutObjectSelector< reco::GsfElectron > slimRelinkGsfElectronSel_
Definition: ReducedEGProducer.h:210
PFCandidateEGammaExtraFwd.h
ReducedEGProducer::photonFloatValueMapTs_
std::vector< edm::EDGetTokenT< edm::ValueMap< float > > > photonFloatValueMapTs_
Definition: ReducedEGProducer.h:160
ReducedEGProducer::linkCore
void linkCore(const T &core, U &cores, std::map< T, unsigned int > &coreMap)
Definition: ReducedEGProducer.cc:819
reducedEgamma_cfi.singleConversions
singleConversions
Definition: reducedEgamma_cfi.py:20
edm::Ptr< CaloCluster >
ReducedEGProducer::relinkPhotonSel_
const StringCutObjectSelector< reco::Photon > relinkPhotonSel_
Definition: ReducedEGProducer.h:205
CaloTopology.h
ValueMap.h
CaloSubdetectorTopology::getWindow
virtual std::vector< DetId > getWindow(const DetId &id, const int &northSouthSize, const int &eastWestSize) const
Definition: CaloSubdetectorTopology.cc:4
VertexFwd.h
reco::Photon
Definition: Photon.h:21
ReducedEGProducer.h
ReducedEGProducer::outConversions_
const std::string outConversions_
Definition: ReducedEGProducer.h:183
ReducedEGProducer::photonIdTs_
std::vector< edm::EDGetTokenT< edm::ValueMap< bool > > > photonIdTs_
Definition: ReducedEGProducer.h:157
PA_ZEESkim_cff.decay
decay
Definition: PA_ZEESkim_cff.py:26
reco::GsfTrackCollection
std::vector< GsfTrack > GsfTrackCollection
collection of GsfTracks
Definition: GsfTrackFwd.h:9
ReducedEGProducer::outOOTPhotonCores_
const std::string outOOTPhotonCores_
Definition: ReducedEGProducer.h:179
eostools.move
def move(src, dest)
Definition: eostools.py:511
std
Definition: JetResolutionObject.h:76
ReducedEGProducer::outEERecHits_
const std::string outEERecHits_
Definition: ReducedEGProducer.h:192
writedatasetfile.run
run
Definition: writedatasetfile.py:27
edm::OrphanHandle
Definition: EDProductfwd.h:39
ReducedEGProducer::slimRelinkOOTPhotonSel_
const StringCutObjectSelector< reco::Photon > slimRelinkOOTPhotonSel_
Definition: ReducedEGProducer.h:207
ReducedEGProducer::produce
void produce(edm::Event &evt, const edm::EventSetup &es) final
Definition: ReducedEGProducer.cc:195
T
long double T
Definition: Basic3DVectorLD.h:48
math::XYZTLorentzVector
XYZTLorentzVectorD XYZTLorentzVector
Lorentz vector with cylindrical internal representation using pseudorapidity.
Definition: LorentzVector.h:29
ReducedEGProducer::barrelEcalHits_
const edm::EDGetTokenT< EcalRecHitCollection > barrelEcalHits_
Definition: ReducedEGProducer.h:148
PFCandidateEGammaExtra.h
edm::ValueMap
Definition: ValueMap.h:107
relativeConstraints.empty
bool empty
Definition: relativeConstraints.py:46
ev
bool ev
Definition: Hydjet2Hadronizer.cc:95
Exception
Definition: hltDiff.cc:246
reco::GsfElectronCore::gsfTrack
const GsfTrackRef & gsfTrack() const
Definition: GsfElectronCore.h:48
edm::RefVectorIterator
Definition: EDProductfwd.h:33
ReducedEGProducer::photonT_
const edm::EDGetTokenT< reco::PhotonCollection > photonT_
Definition: ReducedEGProducer.h:141
HLT_FULL_cff.cores
cores
Definition: HLT_FULL_cff.py:100366
ReducedEGProducer::outSuperClusters_
const std::string outSuperClusters_
Definition: ReducedEGProducer.h:185
HcalRecHitCollections.h
Exception.h
ReducedEGProducer::linkCaloCluster
void linkCaloCluster(const reco::CaloClusterPtr &caloCluster, reco::CaloClusterCollection &caloClusters, std::map< reco::CaloClusterPtr, unsigned int > &caloClusterMap)
Definition: ReducedEGProducer.cc:897
AlignmentPI::index
index
Definition: AlignmentPayloadInspectorHelper.h:46
reco::PhotonCollection
std::vector< Photon > PhotonCollection
collectin of Photon objects
Definition: PhotonFwd.h:9
ReducedEGProducer::gsfElectronCalibEcalEnergyT_
edm::EDGetTokenT< edm::ValueMap< float > > gsfElectronCalibEcalEnergyT_
Definition: ReducedEGProducer.h:172
reco::SuperCluster::preshowerClusters
const CaloClusterPtrVector & preshowerClusters() const
const access to the preshower cluster list itself
Definition: SuperCluster.h:83
ReducedEGProducer::outGsfElectronFloatValueMaps_
const std::vector< std::string > outGsfElectronFloatValueMaps_
Definition: ReducedEGProducer.h:201
ReducedEGProducer::gsfElectronT_
const edm::EDGetTokenT< reco::GsfElectronCollection > gsfElectronT_
Definition: ReducedEGProducer.h:143
pwdgSkimBPark_cfi.conversions
conversions
Definition: pwdgSkimBPark_cfi.py:10
edm::Event
Definition: Event.h:73
ReducedEGProducer::outPhotonCores_
const std::string outPhotonCores_
Definition: ReducedEGProducer.h:177
ReducedEGProducer::applyPhotonCalibOnData_
const bool applyPhotonCalibOnData_
Definition: ReducedEGProducer.h:164
ReducedEGProducer::gsfTrackT_
const edm::EDGetTokenT< reco::GsfTrackCollection > gsfTrackT_
Definition: ReducedEGProducer.h:144
MapType
MapType
Definition: SiPixelTemplateDBObject_PayloadInspector.cc:51
keep
const int keep
Definition: GenParticlePruner.cc:48
reco::GsfElectron::setCore
void setCore(const reco::GsfElectronCoreRef &core)
Definition: GsfElectron.h:160
reco::GsfElectronCore::setGsfTrack
void setGsfTrack(const GsfTrackRef &gsfTrack)
Definition: GsfElectronCore.h:67
edm::InputTag
Definition: InputTag.h:15
label
const char * label
Definition: PFTauDecayModeTools.cc:11
ReducedEGProducer::outPhotonIds_
const std::vector< std::string > outPhotonIds_
Definition: ReducedEGProducer.h:197
SurveyInfoScenario_cff.seed
seed
Definition: SurveyInfoScenario_cff.py:295
ElectronSeed.h
Conversion.h