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 
17 
29 
30 
33 
36 
39 
44 
46 
47 namespace std {
48  template<>
49  struct hash<DetId> {
50  size_t operator()(const DetId& id) const {
51  return std::hash<uint32_t>()(id.rawId());
52  }
53  };
54 }
55 
57  photonT_(consumes<reco::PhotonCollection>(config.getParameter<edm::InputTag>("photons"))),
58  ootPhotonT_(consumes<reco::PhotonCollection>(config.getParameter<edm::InputTag>("ootPhotons"))),
59  gsfElectronT_(consumes<reco::GsfElectronCollection>(config.getParameter<edm::InputTag>("gsfElectrons"))),
60  conversionT_(consumes<reco::ConversionCollection>(config.getParameter<edm::InputTag>("conversions"))),
61  singleConversionT_(consumes<reco::ConversionCollection>(config.getParameter<edm::InputTag>("singleConversions"))),
62  barrelEcalHits_(consumes<EcalRecHitCollection>(config.getParameter<edm::InputTag>("barrelEcalHits"))),
63  endcapEcalHits_(consumes<EcalRecHitCollection>(config.getParameter<edm::InputTag>("endcapEcalHits"))),
64  doPreshowerEcalHits_(!config.getParameter<edm::InputTag>("preshowerEcalHits").label().empty()),
65  preshowerEcalHits_(doPreshowerEcalHits_ ? consumes<EcalRecHitCollection>(config.getParameter<edm::InputTag>("preshowerEcalHits")) : edm::EDGetTokenT<EcalRecHitCollection>()),
66  photonPfCandMapT_(consumes<edm::ValueMap<std::vector<reco::PFCandidateRef> > >(config.getParameter<edm::InputTag>("photonsPFValMap"))),
67  gsfElectronPfCandMapT_(consumes<edm::ValueMap<std::vector<reco::PFCandidateRef> > >(config.getParameter<edm::InputTag>("gsfElectronsPFValMap"))),
68  //output collections
69  outPhotons_("reducedGedPhotons"),
70  outPhotonCores_("reducedGedPhotonCores"),
71  outOOTPhotons_("reducedOOTPhotons"),
72  outOOTPhotonCores_("reducedOOTPhotonCores"),
73  outGsfElectrons_("reducedGedGsfElectrons"),
74  outGsfElectronCores_("reducedGedGsfElectronCores"),
75  outConversions_("reducedConversions"),
76  outSingleConversions_("reducedSingleLegConversions"),
77  outSuperClusters_("reducedSuperClusters"),
78  outEBEEClusters_("reducedEBEEClusters"),
79  outESClusters_("reducedESClusters"),
80  outOOTSuperClusters_("reducedOOTSuperClusters"),
81  outOOTEBEEClusters_("reducedOOTEBEEClusters"),
82  outOOTESClusters_("reducedOOTESClusters"),
83  outEBRecHits_("reducedEBRecHits"),
84  outEERecHits_("reducedEERecHits"),
85  outESRecHits_("reducedESRecHits"),
86  outPhotonPfCandMap_("reducedPhotonPfCandMap"),
87  outGsfElectronPfCandMap_("reducedGsfElectronPfCandMap"),
88  outPhotonIds_(config.getParameter<std::vector<std::string> >("photonIDOutput")),
89  outGsfElectronIds_(config.getParameter<std::vector<std::string> >("gsfElectronIDOutput")),
90  outPhotonPFClusterIsos_(config.getParameter<std::vector<std::string> >("photonPFClusterIsoOutput")),
91  outOOTPhotonPFClusterIsos_(config.getParameter<std::vector<std::string> >("ootPhotonPFClusterIsoOutput")),
92  outGsfElectronPFClusterIsos_(config.getParameter<std::vector<std::string> >("gsfElectronPFClusterIsoOutput")),
93  keepPhotonSel_(config.getParameter<std::string>("keepPhotons")),
94  slimRelinkPhotonSel_(config.getParameter<std::string>("slimRelinkPhotons")),
95  relinkPhotonSel_(config.getParameter<std::string>("relinkPhotons")),
96  keepOOTPhotonSel_(config.getParameter<std::string>("keepOOTPhotons")),
97  slimRelinkOOTPhotonSel_(config.getParameter<std::string>("slimRelinkOOTPhotons")),
98  relinkOOTPhotonSel_(config.getParameter<std::string>("relinkOOTPhotons")),
99  keepGsfElectronSel_(config.getParameter<std::string>("keepGsfElectrons")),
100  slimRelinkGsfElectronSel_(config.getParameter<std::string>("slimRelinkGsfElectrons")),
101  relinkGsfElectronSel_(config.getParameter<std::string>("relinkGsfElectrons"))
102 {
103  const std::vector<edm::InputTag>& photonidinputs =
104  config.getParameter<std::vector<edm::InputTag> >("photonIDSources");
105  for (const edm::InputTag &tag : photonidinputs) {
106  photonIdTs_.emplace_back(consumes<edm::ValueMap<bool> >(tag));
107  }
108 
109  const std::vector<edm::InputTag>& gsfelectronidinputs =
110  config.getParameter<std::vector<edm::InputTag> >("gsfElectronIDSources");
111  for (const edm::InputTag &tag : gsfelectronidinputs) {
113  }
114 
115  const std::vector<edm::InputTag>& photonpfclusterisoinputs =
116  config.getParameter<std::vector<edm::InputTag> >("photonPFClusterIsoSources");
117  for (const edm::InputTag &tag : photonpfclusterisoinputs) {
119  }
120 
121  const std::vector<edm::InputTag>& ootphotonpfclusterisoinputs =
122  config.getParameter<std::vector<edm::InputTag> >("ootPhotonPFClusterIsoSources");
123  for (const edm::InputTag &tag : ootphotonpfclusterisoinputs) {
125  }
126 
127  const std::vector<edm::InputTag>& gsfelectronpfclusterisoinputs =
128  config.getParameter<std::vector<edm::InputTag> >("gsfElectronPFClusterIsoSources");
129  for (const edm::InputTag &tag : gsfelectronpfclusterisoinputs) {
131  }
132 
133  produces< reco::PhotonCollection >(outPhotons_);
134  produces< reco::PhotonCoreCollection >(outPhotonCores_);
135  produces< reco::PhotonCollection >(outOOTPhotons_);
136  produces< reco::PhotonCoreCollection >(outOOTPhotonCores_);
137  produces< reco::GsfElectronCollection >(outGsfElectrons_);
138  produces< reco::GsfElectronCoreCollection >(outGsfElectronCores_);
139  produces< reco::ConversionCollection >(outConversions_);
140  produces< reco::ConversionCollection >(outSingleConversions_);
141  produces< reco::SuperClusterCollection >(outSuperClusters_);
142  produces< reco::CaloClusterCollection >(outEBEEClusters_);
143  produces< reco::CaloClusterCollection >(outESClusters_);
144  produces< reco::SuperClusterCollection >(outOOTSuperClusters_);
145  produces< reco::CaloClusterCollection >(outOOTEBEEClusters_);
146  produces< reco::CaloClusterCollection >(outOOTESClusters_);
147  produces< EcalRecHitCollection >(outEBRecHits_);
148  produces< EcalRecHitCollection >(outEERecHits_);
149  if (doPreshowerEcalHits_) produces< EcalRecHitCollection >(outESRecHits_);
150  produces< edm::ValueMap<std::vector<reco::PFCandidateRef> > >(outPhotonPfCandMap_);
151  produces< edm::ValueMap<std::vector<reco::PFCandidateRef> > >(outGsfElectronPfCandMap_);
152  for (const std::string &outid : outPhotonIds_) {
153  produces< edm::ValueMap<bool> >(outid);
154  }
155  for (const std::string &outid : outGsfElectronIds_) {
156  produces< edm::ValueMap<float> >(outid);
157  }
158  for (const std::string &outid : outPhotonPFClusterIsos_) {
159  produces< edm::ValueMap<float> >(outid);
160  }
161  for (const std::string &outid : outOOTPhotonPFClusterIsos_) {
162  produces< edm::ValueMap<float> >(outid);
163  }
164  for (const std::string &outid : outGsfElectronPFClusterIsos_) {
165  produces< edm::ValueMap<float> >(outid);
166  }
167 }
168 
170 {
171 }
172 
173 void ReducedEGProducer::produce(edm::Event& theEvent, const edm::EventSetup& theEventSetup) {
174 
175  //get input collections
176 
177 
179  theEvent.getByToken(photonT_, photonHandle);
180 
181  edm::Handle<reco::PhotonCollection> ootPhotonHandle;
182  theEvent.getByToken(ootPhotonT_, ootPhotonHandle);
183 
185  theEvent.getByToken(gsfElectronT_, gsfElectronHandle);
186 
188  theEvent.getByToken(conversionT_, conversionHandle);
189 
190  edm::Handle<reco::ConversionCollection> singleConversionHandle;
191  theEvent.getByToken(singleConversionT_, singleConversionHandle);
192 
193  edm::Handle<EcalRecHitCollection> barrelHitHandle;
194  theEvent.getByToken(barrelEcalHits_, barrelHitHandle);
195 
196  edm::Handle<EcalRecHitCollection> endcapHitHandle;
197  theEvent.getByToken(endcapEcalHits_, endcapHitHandle);
198 
199  edm::Handle<EcalRecHitCollection> preshowerHitHandle;
200  if (doPreshowerEcalHits_) theEvent.getByToken(preshowerEcalHits_, preshowerHitHandle);
201 
203  theEvent.getByToken(photonPfCandMapT_, photonPfCandMapHandle);
204 
206  theEvent.getByToken(gsfElectronPfCandMapT_, gsfElectronPfCandMapHandle);
207 
208  std::vector<edm::Handle<edm::ValueMap<bool> > > photonIdHandles(photonIdTs_.size());
209  int index = 0; // universal index for range based loops
210  for (const auto& photonIdT : photonIdTs_) {
211  theEvent.getByToken(photonIdT,photonIdHandles[index++]);
212  }
213 
214  std::vector<edm::Handle<edm::ValueMap<float> > > gsfElectronIdHandles(gsfElectronIdTs_.size());
215  index = 0;
216  for (const auto& gsfElectronIdT : gsfElectronIdTs_) {
217  theEvent.getByToken(gsfElectronIdT,gsfElectronIdHandles[index++]);
218  }
219 
220  std::vector<edm::Handle<edm::ValueMap<float> > > photonPFClusterIsoHandles(photonPFClusterIsoTs_.size());
221  index = 0;
222  for (const auto& photonPFClusterIsoT : photonPFClusterIsoTs_) {
223  theEvent.getByToken(photonPFClusterIsoT,photonPFClusterIsoHandles[index++]);
224  }
225 
226  std::vector<edm::Handle<edm::ValueMap<float> > > ootPhotonPFClusterIsoHandles(ootPhotonPFClusterIsoTs_.size());
227  index = 0;
228  for (const auto& ootPhotonPFClusterIsoT : ootPhotonPFClusterIsoTs_) {
229  theEvent.getByToken(ootPhotonPFClusterIsoT,ootPhotonPFClusterIsoHandles[index++]);
230  }
231 
232  std::vector<edm::Handle<edm::ValueMap<float> > > gsfElectronPFClusterIsoHandles(gsfElectronPFClusterIsoTs_.size());
233  index = 0;
234  for (const auto& gsfElectronPFClusterIsoT : gsfElectronPFClusterIsoTs_) {
235  theEvent.getByToken(gsfElectronPFClusterIsoT,gsfElectronPFClusterIsoHandles[index++]);
236  }
237 
238  edm::ESHandle<CaloTopology> theCaloTopology;
239  theEventSetup.get<CaloTopologyRecord>().get(theCaloTopology);
240  const CaloTopology *caloTopology = & (*theCaloTopology);
241 
242  //initialize output collections
243  auto photons = std::make_unique<reco::PhotonCollection>();
244  auto photonCores = std::make_unique<reco::PhotonCoreCollection>();
245  auto ootPhotons = std::make_unique<reco::PhotonCollection>();
246  auto ootPhotonCores = std::make_unique<reco::PhotonCoreCollection>();
247  auto gsfElectrons = std::make_unique<reco::GsfElectronCollection>();
248  auto gsfElectronCores = std::make_unique<reco::GsfElectronCoreCollection>();
249  auto conversions = std::make_unique<reco::ConversionCollection>();
250  auto singleConversions = std::make_unique<reco::ConversionCollection>();
251  auto superClusters = std::make_unique<reco::SuperClusterCollection>();
252  auto ebeeClusters = std::make_unique<reco::CaloClusterCollection>();
253  auto esClusters = std::make_unique<reco::CaloClusterCollection>();
254  auto ootSuperClusters = std::make_unique<reco::SuperClusterCollection>();
255  auto ootEbeeClusters = std::make_unique<reco::CaloClusterCollection>();
256  auto ootEsClusters = std::make_unique<reco::CaloClusterCollection>();
257  auto ebRecHits = std::make_unique<EcalRecHitCollection>();
258  auto eeRecHits = std::make_unique<EcalRecHitCollection>();
259  auto esRecHits = std::make_unique<EcalRecHitCollection>();
260  auto photonPfCandMap = std::make_unique<edm::ValueMap<std::vector<reco::PFCandidateRef>>>();
261  auto gsfElectronPfCandMap = std::make_unique<edm::ValueMap<std::vector<reco::PFCandidateRef>>>();
262 
263  //maps to collection indices of output objects
264  std::map<reco::PhotonCoreRef, unsigned int> photonCoreMap;
265  std::map<reco::PhotonCoreRef, unsigned int> ootPhotonCoreMap;
266  std::map<reco::GsfElectronCoreRef, unsigned int> gsfElectronCoreMap;
267  std::map<reco::ConversionRef, unsigned int> conversionMap;
268  std::map<reco::ConversionRef, unsigned int> singleConversionMap;
269  std::map<reco::SuperClusterRef, unsigned int> superClusterMap;
270  std::map<reco::CaloClusterPtr, unsigned int> ebeeClusterMap;
271  std::map<reco::CaloClusterPtr, unsigned int> esClusterMap;
272  std::map<reco::SuperClusterRef, unsigned int> ootSuperClusterMap;
273  std::map<reco::CaloClusterPtr, unsigned int> ootEbeeClusterMap;
274  std::map<reco::CaloClusterPtr, unsigned int> ootEsClusterMap;
275  std::unordered_set<DetId> rechitMap;
276 
277  std::unordered_set<unsigned int> superClusterFullRelinkMap;
278  std::unordered_set<unsigned int> ootSuperClusterFullRelinkMap;
279 
280  //vectors for pfcandidate valuemaps
281  std::vector<std::vector<reco::PFCandidateRef> > pfCandIsoPairVecPho;
282  std::vector<std::vector<reco::PFCandidateRef> > pfCandIsoPairVecEle;
283 
284  //vectors for id valuemaps
285  std::vector<std::vector<bool> > photonIdVals(photonIdHandles.size());
286  std::vector<std::vector<float> > gsfElectronIdVals(gsfElectronIdHandles.size());
287  std::vector<std::vector<float> > photonPFClusterIsoVals(photonPFClusterIsoHandles.size());
288  std::vector<std::vector<float> > ootPhotonPFClusterIsoVals(ootPhotonPFClusterIsoHandles.size());
289  std::vector<std::vector<float> > gsfElectronPFClusterIsoVals(gsfElectronPFClusterIsoHandles.size());
290 
291  //loop over photons and fill maps
292  index = -1;
293  for (const auto& photon : *photonHandle) {
294  index++;
295 
296  bool keep = keepPhotonSel_(photon);
297  if (!keep) continue;
298 
299  reco::PhotonRef photonref(photonHandle,index);
300 
301  photons->push_back(photon);
302 
303  //fill pf candidate value map vector
304  pfCandIsoPairVecPho.push_back((*photonPfCandMapHandle)[photonref]);
305 
306  //fill photon id valuemap vectors
307  int subindex = 0;
308  for (const auto& photonIdHandle : photonIdHandles) {
309  photonIdVals[subindex++].push_back((*photonIdHandle)[photonref]);
310  }
311 
312  subindex = 0;
313  for (const auto& photonPFClusterIsoHandle : photonPFClusterIsoHandles) {
314  photonPFClusterIsoVals[subindex++].push_back((*photonPFClusterIsoHandle)[photonref]);
315  }
316 
317  //link photon core
318  const reco::PhotonCoreRef &photonCore = photon.photonCore();
319  linkCore(photonCore, *photonCores, photonCoreMap);
320 
321  bool slimRelink = slimRelinkPhotonSel_(photon);
322  //no supercluster relinking unless slimRelink selection is satisfied
323  if (!slimRelink) continue;
324 
325  bool relink = relinkPhotonSel_(photon);
326 
327  //link supercluster
328  const reco::SuperClusterRef &superCluster = photon.superCluster();
329  linkSuperCluster(superCluster, superClusterMap, *superClusters, relink, superClusterFullRelinkMap);
330 
331  //conversions only for full relinking
332  if (!relink) continue;
333 
334  const reco::ConversionRefVector &convrefs = photon.conversions();
335  linkConversions(convrefs, *conversions, conversionMap);
336 
337  //explicitly references conversions
338  const reco::ConversionRefVector &singleconvrefs = photon.conversionsOneLeg();
339  linkConversions(singleconvrefs, *singleConversions, singleConversionMap);
340  }
341 
342  //loop over oot photons and fill maps
343  //special note1: since not PFCand --> no PF isolation, IDs (but we do have PFClusterIso!)
344  //special note2: conversion sequence not run over bcs from oot phos, so skip relinking of oot phos
345  //special note3: clusters and superclusters in own collections!
346  index = -1;
347  for (const auto& ootPhoton : *ootPhotonHandle) {
348  index++;
349 
350  bool keep = keepOOTPhotonSel_(ootPhoton);
351  if (!keep) continue;
352 
353  reco::PhotonRef ootPhotonref(ootPhotonHandle,index);
354 
355  ootPhotons->push_back(ootPhoton);
356 
357  //fill photon pfclusteriso valuemap vectors
358  int subindex = 0;
359  for (const auto& ootPhotonPFClusterIsoHandle : ootPhotonPFClusterIsoHandles) {
360  ootPhotonPFClusterIsoVals[subindex++].push_back((*ootPhotonPFClusterIsoHandle)[ootPhotonref]);
361  }
362 
363  //link photon core
364  const reco::PhotonCoreRef &ootPhotonCore = ootPhoton.photonCore();
365  linkCore(ootPhotonCore, *ootPhotonCores, ootPhotonCoreMap);
366 
367  bool slimRelink = slimRelinkOOTPhotonSel_(ootPhoton);
368  //no supercluster relinking unless slimRelink selection is satisfied
369  if (!slimRelink) continue;
370 
371  bool relink = relinkOOTPhotonSel_(ootPhoton);
372 
373  const reco::SuperClusterRef &ootSuperCluster = ootPhoton.superCluster();
374  linkSuperCluster(ootSuperCluster, ootSuperClusterMap, *ootSuperClusters, relink, ootSuperClusterFullRelinkMap);
375  }
376 
377  //loop over electrons and fill maps
378  index = -1;
379  for (const auto& gsfElectron : *gsfElectronHandle) {
380  index++;
381 
382  bool keep = keepGsfElectronSel_(gsfElectron);
383  if (!keep) continue;
384 
385  reco::GsfElectronRef gsfElectronref(gsfElectronHandle,index);
386 
387  gsfElectrons->push_back(gsfElectron);
388  pfCandIsoPairVecEle.push_back((*gsfElectronPfCandMapHandle)[gsfElectronref]);
389 
390  //fill electron id valuemap vectors
391  int subindex = 0;
392  for (const auto& gsfElectronIdHandle : gsfElectronIdHandles) {
393  gsfElectronIdVals[subindex++].push_back((*gsfElectronIdHandle)[gsfElectronref]);
394  }
395 
396  subindex = 0;
397  for (const auto& gsfElectronPFClusterIsoHandle : gsfElectronPFClusterIsoHandles) {
398  gsfElectronPFClusterIsoVals[subindex++].push_back((*gsfElectronPFClusterIsoHandle)[gsfElectronref]);
399  }
400 
401  const reco::GsfElectronCoreRef &gsfElectronCore = gsfElectron.core();
402  linkCore(gsfElectronCore, *gsfElectronCores, gsfElectronCoreMap);
403 
404  bool slimRelink = slimRelinkGsfElectronSel_(gsfElectron);
405  //no supercluster relinking unless slimRelink selection is satisfied
406  if (!slimRelink) continue;
407 
408  bool relink = relinkGsfElectronSel_(gsfElectron);
409 
410  const reco::SuperClusterRef &superCluster = gsfElectron.superCluster();
411  linkSuperCluster(superCluster, superClusterMap, *superClusters, relink, superClusterFullRelinkMap);
412 
413  //conversions only for full relinking
414  if (!relink) continue;
415 
416  const reco::ConversionRefVector &convrefs = gsfElectron.core()->conversions();
417  linkConversions(convrefs, *conversions, conversionMap);
418 
419  //explicitly references conversions
420  const reco::ConversionRefVector &singleconvrefs = gsfElectron.core()->conversionsOneLeg();
421  linkConversions(singleconvrefs, *singleConversions, singleConversionMap);
422 
423  //conversions matched by trackrefs
424  linkConversionsByTrackRef(conversionHandle, gsfElectron, *conversions, conversionMap);
425 
426  //single leg conversions matched by trackrefs
427  linkConversionsByTrackRef(singleConversionHandle, gsfElectron, *singleConversions, singleConversionMap);
428  }
429 
430  //loop over output SuperClusters and fill maps
431  index = 0;
432  for (auto& superCluster : *superClusters) {
433 
434  //link seed cluster no matter what
435  const reco::CaloClusterPtr &seedCluster = superCluster.seed();
436  linkCaloCluster(seedCluster, *ebeeClusters, ebeeClusterMap);
437 
438  //only proceed if superCluster is marked for full relinking
439  bool fullrelink = superClusterFullRelinkMap.count(index++);
440  if (!fullrelink) {
441  //zero detid vector which is anyways not useful without stored rechits
442  superCluster.clearHitsAndFractions();
443  continue;
444  }
445 
446  // link calo clusters
447  linkCaloClusters(superCluster, *ebeeClusters, ebeeClusterMap, rechitMap, barrelHitHandle, endcapHitHandle, caloTopology, *esClusters, esClusterMap);
448 
449  //conversions matched geometrically
450  linkConversionsByTrackRef(conversionHandle, superCluster, *conversions, conversionMap);
451 
452  //single leg conversions matched by trackrefs
453  linkConversionsByTrackRef(singleConversionHandle, superCluster, *singleConversions, singleConversionMap);
454  }
455 
456  //loop over output OOTSuperClusters and fill maps
457  index = 0;
458  for (auto& ootSuperCluster : *ootSuperClusters) {
459 
460  //link seed cluster no matter what
461  const reco::CaloClusterPtr &ootSeedCluster = ootSuperCluster.seed();
462  linkCaloCluster(ootSeedCluster, *ootEbeeClusters, ootEbeeClusterMap);
463 
464  //only proceed if ootSuperCluster is marked for full relinking
465  bool fullrelink = ootSuperClusterFullRelinkMap.count(index++);
466  if (!fullrelink) {
467  //zero detid vector which is anyways not useful without stored rechits
468  ootSuperCluster.clearHitsAndFractions();
469  continue;
470  }
471 
472  // link calo clusters
473  linkCaloClusters(ootSuperCluster, *ootEbeeClusters, ootEbeeClusterMap, rechitMap, barrelHitHandle, endcapHitHandle, caloTopology, *ootEsClusters, ootEsClusterMap);
474  }
475 
476  //now finalize and add to the event collections in "reverse" order
477 
478  //rechits (fill output collections of rechits to be stored)
479  for (const EcalRecHit &rechit : *barrelHitHandle) {
480  if (rechitMap.count(rechit.detid())) {
481  ebRecHits->push_back(rechit);
482  }
483  }
484 
485  for (const EcalRecHit &rechit : *endcapHitHandle) {
486  if (rechitMap.count(rechit.detid())) {
487  eeRecHits->push_back(rechit);
488  }
489  }
490 
491  theEvent.put(std::move(ebRecHits),outEBRecHits_);
492  theEvent.put(std::move(eeRecHits),outEERecHits_);
493 
494  if (doPreshowerEcalHits_) {
495  for (const EcalRecHit &rechit : *preshowerHitHandle) {
496  if (rechitMap.count(rechit.detid())) {
497  esRecHits->push_back(rechit);
498  }
499  }
500  theEvent.put(std::move(esRecHits),outESRecHits_);
501  }
502 
503  //CaloClusters
504  //put calocluster output collections in event and get orphan handles to create ptrs
505  const edm::OrphanHandle<reco::CaloClusterCollection> &outEBEEClusterHandle = theEvent.put(std::move(ebeeClusters),outEBEEClusters_);
506  const edm::OrphanHandle<reco::CaloClusterCollection> &outESClusterHandle = theEvent.put(std::move(esClusters),outESClusters_);;
507 
508  //Loop over SuperClusters and relink GEDPhoton + GSFElectron CaloClusters
509  for (reco::SuperCluster &superCluster : *superClusters) {
510  relinkCaloClusters(superCluster, ebeeClusterMap, esClusterMap, outEBEEClusterHandle, outESClusterHandle);
511  }
512 
513  //OOTCaloClusters
514  //put ootcalocluster output collections in event and get orphan handles to create ptrs
515  const edm::OrphanHandle<reco::CaloClusterCollection> &outOOTEBEEClusterHandle = theEvent.put(std::move(ootEbeeClusters),outOOTEBEEClusters_);
516  const edm::OrphanHandle<reco::CaloClusterCollection> &outOOTESClusterHandle = theEvent.put(std::move(ootEsClusters),outOOTESClusters_);;
517 
518  //Loop over OOTSuperClusters and relink OOTPhoton CaloClusters
519  for (reco::SuperCluster &ootSuperCluster : *ootSuperClusters) {
520  relinkCaloClusters(ootSuperCluster, ootEbeeClusterMap, ootEsClusterMap, outOOTEBEEClusterHandle, outOOTESClusterHandle);
521  }
522 
523  //put superclusters and conversions in the event
524  const edm::OrphanHandle<reco::SuperClusterCollection> &outSuperClusterHandle = theEvent.put(std::move(superClusters),outSuperClusters_);
525  const edm::OrphanHandle<reco::ConversionCollection> &outConversionHandle = theEvent.put(std::move(conversions),outConversions_);
526  const edm::OrphanHandle<reco::ConversionCollection> &outSingleConversionHandle = theEvent.put(std::move(singleConversions),outSingleConversions_);
527 
528  //Loop over PhotonCores and relink GEDPhoton SuperClusters (and conversions)
529  for (reco::PhotonCore &photonCore : *photonCores) {
530  // superclusters
531  relinkSuperCluster(photonCore, superClusterMap, outSuperClusterHandle);
532 
533  //conversions
534  const reco::ConversionRefVector &convrefs = photonCore.conversions();
535  relinkConversions(photonCore, convrefs, conversionMap, outConversionHandle);
536 
537  //single leg conversions
538  const reco::ConversionRefVector &singleconvrefs = photonCore.conversionsOneLeg();
539  relinkConversions(photonCore, singleconvrefs, singleConversionMap, outSingleConversionHandle);
540  }
541 
542  //Relink GSFElectron SuperClusters
543  for (reco::GsfElectronCore &gsfElectronCore : *gsfElectronCores) {
544  relinkSuperCluster(gsfElectronCore, superClusterMap, outSuperClusterHandle);
545  }
546 
547  //put ootsuperclusters in the event
548  const edm::OrphanHandle<reco::SuperClusterCollection> &outOOTSuperClusterHandle = theEvent.put(std::move(ootSuperClusters),outOOTSuperClusters_);
549 
550  //Relink OOTPhoton SuperClusters
551  for (reco::PhotonCore &ootPhotonCore : *ootPhotonCores) {
552  relinkSuperCluster(ootPhotonCore, ootSuperClusterMap, outOOTSuperClusterHandle);
553  }
554 
555  //put photoncores and gsfelectroncores into the event
556  const edm::OrphanHandle<reco::PhotonCoreCollection> &outPhotonCoreHandle = theEvent.put(std::move(photonCores),outPhotonCores_);
557  const edm::OrphanHandle<reco::PhotonCoreCollection> &outOOTPhotonCoreHandle = theEvent.put(std::move(ootPhotonCores),outOOTPhotonCores_);
558  const edm::OrphanHandle<reco::GsfElectronCoreCollection> &outgsfElectronCoreHandle = theEvent.put(std::move(gsfElectronCores),outGsfElectronCores_);
559 
560  //loop over photons, oot photons, and electrons and relink the cores
561  for (reco::Photon &photon : *photons) {
562  relinkPhotonCore(photon, photonCoreMap, outPhotonCoreHandle);
563  }
564 
565  for (reco::Photon &ootPhoton : *ootPhotons) {
566  relinkPhotonCore(ootPhoton, ootPhotonCoreMap, outOOTPhotonCoreHandle);
567  }
568 
569  for (reco::GsfElectron &gsfElectron : *gsfElectrons) {
570  relinkGsfElectronCore(gsfElectron, gsfElectronCoreMap, outgsfElectronCoreHandle);
571  }
572 
573  //(finally) store the output photon and electron collections
574  const edm::OrphanHandle<reco::PhotonCollection> &outPhotonHandle = theEvent.put(std::move(photons),outPhotons_);
575  const edm::OrphanHandle<reco::PhotonCollection> &outOOTPhotonHandle = theEvent.put(std::move(ootPhotons),outOOTPhotons_);
576  const edm::OrphanHandle<reco::GsfElectronCollection> &outGsfElectronHandle = theEvent.put(std::move(gsfElectrons),outGsfElectrons_);
577 
578  //still need to output relinked valuemaps
579 
580  //photon pfcand isolation valuemap
581  edm::ValueMap<std::vector<reco::PFCandidateRef>>::Filler fillerPhotons(*photonPfCandMap);
582  fillerPhotons.insert(outPhotonHandle,pfCandIsoPairVecPho.begin(),pfCandIsoPairVecPho.end());
583  fillerPhotons.fill();
584 
585  //electron pfcand isolation valuemap
586  edm::ValueMap<std::vector<reco::PFCandidateRef>>::Filler fillerGsfElectrons(*gsfElectronPfCandMap);
587  fillerGsfElectrons.insert(outGsfElectronHandle,pfCandIsoPairVecEle.begin(),pfCandIsoPairVecEle.end());
588  fillerGsfElectrons.fill();
589 
590  theEvent.put(std::move(photonPfCandMap),outPhotonPfCandMap_);
591  theEvent.put(std::move(gsfElectronPfCandMap),outGsfElectronPfCandMap_);
592 
593  auto fillMap = [](auto refH, auto& vec, edm::Event& ev, const std::string& cAl = ""){
595  auto oMap = std::make_unique<MapType>();
596  {
597  typename MapType::Filler filler(*oMap);
598  filler.insert(refH, vec.begin(), vec.end());
599  filler.fill();
600  }
601  ev.put(std::move(oMap), cAl);
602  };
603 
604  //photon id value maps
605  index = 0;
606  for (auto const& vals : photonIdVals){
607  fillMap(outPhotonHandle, vals, theEvent, outPhotonIds_[index++]);
608  }
609 
610  //electron id value maps
611  index = 0;
612  for (auto const& vals : gsfElectronIdVals){
613  fillMap(outGsfElectronHandle, vals, theEvent, outGsfElectronIds_[index++]);
614  }
615 
616  // photon iso value maps
617  index = 0;
618  for (auto const& vals : photonPFClusterIsoVals){
619  fillMap(outPhotonHandle, vals, theEvent, outPhotonPFClusterIsos_[index++]);
620  }
621 
622  //oot photon iso value maps
623  index = 0;
624  for (auto const& vals : ootPhotonPFClusterIsoVals){
625  fillMap(outOOTPhotonHandle, vals, theEvent, outOOTPhotonPFClusterIsos_[index++]);
626  }
627 
628  //electron iso value maps
629  index = 0;
630  for (auto const& vals : gsfElectronPFClusterIsoVals){
631  fillMap(outGsfElectronHandle, vals, theEvent, outGsfElectronPFClusterIsos_[index++]);
632  }
633 }
634 
635 template <typename T, typename U>
636 void ReducedEGProducer::linkCore(const T& core, U& cores, std::map<T, unsigned int>& coreMap)
637 {
638  if (!coreMap.count(core)) {
639  cores.push_back(*core);
640  coreMap[core] = cores.size() - 1;
641  }
642 }
643 
645  std::map<reco::SuperClusterRef, unsigned int>& superClusterMap,
646  reco::SuperClusterCollection& superClusters,
647  const bool relink,
648  std::unordered_set<unsigned int>& superClusterFullRelinkMap)
649 {
650  const auto &mappedsc = superClusterMap.find(superCluster);
651  //get index in output collection in order to keep track whether superCluster
652  //will be subject to full relinking
653  unsigned int mappedscidx = 0;
654  if (mappedsc==superClusterMap.end()) {
655  superClusters.push_back(*superCluster);
656  mappedscidx = superClusters.size() - 1;
657  superClusterMap[superCluster] = mappedscidx;
658  }
659  else {
660  mappedscidx = mappedsc->second;
661  }
662 
663  //additionally mark supercluster for full relinking
664  if (relink) superClusterFullRelinkMap.insert(mappedscidx);
665 }
666 
669  std::map<reco::ConversionRef, unsigned int>& conversionMap)
670 {
671  for (const auto& convref : convrefs) {
672  linkConversion(convref, conversions, conversionMap);
673  }
674 }
675 
677  const reco::GsfElectron& gsfElectron,
679  std::map<reco::ConversionRef, unsigned int>& conversionMap)
680 {
681  int index = 0;
682  for (const auto& conversion : *conversionHandle) {
683 
684  reco::ConversionRef convref(conversionHandle,index++);
685 
686  bool matched = ConversionTools::matchesConversion(gsfElectron,conversion,true,true);
687  if (!matched) continue;
688 
689  linkConversion(convref, conversions, conversionMap);
690  }
691 }
692 
694  const reco::SuperCluster& superCluster,
696  std::map<reco::ConversionRef, unsigned int>& conversionMap)
697 {
698  int index = 0;
699  for (const auto& conversion : *conversionHandle) {
700 
701  reco::ConversionRef convref(conversionHandle,index++);
702 
703  bool matched = ConversionTools::matchesConversion(superCluster,conversion,0.2);
704  if (!matched) continue;
705 
706  linkConversion(convref, conversions, conversionMap);
707  }
708 }
709 
712  std::map<reco::ConversionRef, unsigned int>& conversionMap)
713 {
714  if (!conversionMap.count(convref)) {
715  conversions.push_back(*convref);
716  conversionMap[convref] = conversions.size() - 1;
717  }
718 }
719 
721  reco::CaloClusterCollection& caloClusters,
722  std::map<reco::CaloClusterPtr, unsigned int>& caloClusterMap)
723 {
724  if (!caloClusterMap.count(caloCluster)) {
725  caloClusters.push_back(*caloCluster);
726  caloClusterMap[caloCluster] = caloClusters.size() - 1;
727  }
728 }
729 
731  reco::CaloClusterCollection& ebeeClusters,
732  std::map<reco::CaloClusterPtr, unsigned int>& ebeeClusterMap,
733  std::unordered_set<DetId>& rechitMap,
734  const edm::Handle<EcalRecHitCollection>& barrelHitHandle,
735  const edm::Handle<EcalRecHitCollection>& endcapHitHandle,
736  const CaloTopology *caloTopology,
737  reco::CaloClusterCollection& esClusters,
738  std::map<reco::CaloClusterPtr, unsigned int>& esClusterMap)
739 {
740  for (const auto& cluster : superCluster.clusters()) {
741  linkCaloCluster(cluster, ebeeClusters, ebeeClusterMap);
742 
743  for (const auto& hitfrac : cluster->hitsAndFractions()) {
744  rechitMap.insert(hitfrac.first);
745  }
746  //make sure to also take all hits in the 5x5 around the max energy xtal
747  bool barrel = cluster->hitsAndFractions().front().first.subdetId()==EcalBarrel;
748  const EcalRecHitCollection *rhcol = barrel ? barrelHitHandle.product() : endcapHitHandle.product();
749  DetId seed = EcalClusterTools::getMaximum(*cluster, rhcol).first;
750 
751  std::vector<DetId> dets5x5 = caloTopology->getSubdetectorTopology(DetId::Ecal, barrel ? EcalBarrel : EcalEndcap)->getWindow(seed,5,5);
752  for (const auto& detid : dets5x5) {
753  rechitMap.insert(detid);
754  }
755  }
756  for (const auto& cluster : superCluster.preshowerClusters()) {
757  linkCaloCluster(cluster, esClusters, esClusterMap);
758 
759  for (const auto& hitfrac : cluster->hitsAndFractions()) {
760  rechitMap.insert(hitfrac.first);
761  }
762  }
763 }
764 
765 
767  const std::map<reco::CaloClusterPtr, unsigned int>& ebeeClusterMap,
768  const std::map<reco::CaloClusterPtr, unsigned int>& esClusterMap,
769  const edm::OrphanHandle<reco::CaloClusterCollection>& outEBEEClusterHandle,
770  const edm::OrphanHandle<reco::CaloClusterCollection>& outESClusterHandle)
771 {
772  //remap seed cluster
773  const auto &seedmapped = ebeeClusterMap.find(superCluster.seed());
774  if (seedmapped != ebeeClusterMap.end()) {
775  //make new ptr
776  reco::CaloClusterPtr clusptr(outEBEEClusterHandle,seedmapped->second);
777  superCluster.setSeed(clusptr);
778  }
779 
780  //remap all clusters
782  for (const auto &cluster : superCluster.clusters()) {
783  const auto &clustermapped = ebeeClusterMap.find(cluster);
784  if (clustermapped != ebeeClusterMap.end()) {
785  //make new ptr
786  reco::CaloClusterPtr clusptr(outEBEEClusterHandle,clustermapped->second);
787  clusters.push_back(clusptr);
788  }
789  else {
790  //can only relink if all clusters are being relinked, so if one is missing, then skip the relinking completely
791  clusters.clear();
792  break;
793  }
794  }
795  if (clusters.size()) {
796  superCluster.setClusters(clusters);
797  }
798 
799  //remap preshower clusters
800  reco::CaloClusterPtrVector esclusters;
801  for (const auto& cluster : superCluster.preshowerClusters()) {
802  const auto &clustermapped = esClusterMap.find(cluster);
803  if (clustermapped != esClusterMap.end()) {
804  //make new ptr
805  reco::CaloClusterPtr clusptr(outESClusterHandle,clustermapped->second);
806  esclusters.push_back(clusptr);
807  }
808  else {
809  //can only relink if all clusters are being relinked, so if one is missing, then skip the relinking completely
810  esclusters.clear();
811  break;
812  }
813  }
814  if (esclusters.size()) {
815  superCluster.setPreshowerClusters(esclusters);
816  }
817 }
818 
819 template <typename T>
821  const std::map<reco::SuperClusterRef, unsigned int>& superClusterMap,
822  const edm::OrphanHandle<reco::SuperClusterCollection>& outSuperClusterHandle)
823 {
824  const auto &scmapped = superClusterMap.find(core.superCluster());
825  if (scmapped != superClusterMap.end()) {
826  //make new ref
827  reco::SuperClusterRef scref(outSuperClusterHandle,scmapped->second);
828  core.setSuperCluster(scref);
829  }
830 }
831 
833  const reco::ConversionRefVector& convrefs,
834  const std::map<reco::ConversionRef, unsigned int>& conversionMap,
835  const edm::OrphanHandle<reco::ConversionCollection> &outConversionHandle)
836 {
837  reco::ConversionRefVector outconvrefs;
838  for (const auto& convref : convrefs) {
839  const auto &convmapped = conversionMap.find(convref);
840  if (convmapped != conversionMap.end()) {
841  //make new ref
842  reco::ConversionRef outref(outConversionHandle,convmapped->second);
843  }
844  else {
845  //can only relink if all conversions are being relinked, so if one is missing, then skip the relinking completely
846  outconvrefs.clear();
847  break;
848  }
849  }
850  if (outconvrefs.size()) {
851  photonCore.setConversions(outconvrefs);
852  }
853 }
854 
856  const std::map<reco::PhotonCoreRef, unsigned int>& photonCoreMap,
857  const edm::OrphanHandle<reco::PhotonCoreCollection>& outPhotonCoreHandle)
858 {
859  const auto &coremapped = photonCoreMap.find(photon.photonCore());
860  if (coremapped != photonCoreMap.end()) {
861  //make new ref
862  reco::PhotonCoreRef coreref(outPhotonCoreHandle,coremapped->second);
863  photon.setPhotonCore(coreref);
864  }
865 }
866 
868  const std::map<reco::GsfElectronCoreRef, unsigned int>& gsfElectronCoreMap,
869  const edm::OrphanHandle<reco::GsfElectronCoreCollection>& outgsfElectronCoreHandle)
870 {
871  const auto &coremapped = gsfElectronCoreMap.find(gsfElectron.core());
872  if (coremapped != gsfElectronCoreMap.end()) {
873  //make new ref
874  reco::GsfElectronCoreRef coreref(outgsfElectronCoreHandle,coremapped->second);
875  gsfElectron.setCore(coreref);
876  }
877 }
const bool doPreshowerEcalHits_
void setPreshowerClusters(const CaloClusterPtrVector &clusters)
Definition: SuperCluster.h:105
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)
T getParameter(std::string const &) const
const StringCutObjectSelector< reco::Photon > relinkOOTPhotonSel_
static bool matchesConversion(const reco::GsfElectron &ele, const reco::Conversion &conv, bool allowCkfMatch=true, bool allowAmbiguousGsfMatch=false)
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
Definition: Event.h:122
const edm::EDGetTokenT< reco::GsfElectronCollection > gsfElectronT_
size_type size() const
Size of the RefVector.
Definition: PtrVectorBase.h:74
void setCore(const reco::GsfElectronCoreRef &core)
Definition: GsfElectron.h:181
const StringCutObjectSelector< reco::Photon > slimRelinkPhotonSel_
const edm::EDGetTokenT< reco::ConversionCollection > singleConversionT_
const std::vector< std::string > outPhotonIds_
std::vector< edm::EDGetTokenT< edm::ValueMap< float > > > photonPFClusterIsoTs_
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:460
void push_back(Ptr< T > const &iPtr)
Definition: PtrVector.h:141
std::vector< edm::EDGetTokenT< edm::ValueMap< float > > > gsfElectronPFClusterIsoTs_
Definition: __init__.py:1
const StringCutObjectSelector< reco::GsfElectron > keepGsfElectronSel_
const std::string outOOTPhotons_
bool ev
Definition: config.py:1
const std::string outEBEEClusters_
void setSeed(const CaloClusterPtr &r)
list of used xtals by DetId // now inherited by CaloCluster
Definition: SuperCluster.h:96
const StringCutObjectSelector< reco::Photon > keepPhotonSel_
const edm::EDGetTokenT< edm::ValueMap< std::vector< reco::PFCandidateRef > > > photonPfCandMapT_
const CaloClusterPtrVector & clusters() const
const access to the cluster list itself
Definition: SuperCluster.h:69
std::vector< GsfElectron > GsfElectronCollection
collection of GsfElectron objects
const StringCutObjectSelector< reco::GsfElectron > relinkGsfElectronSel_
void setClusters(const CaloClusterPtrVector &clusters)
Definition: SuperCluster.h:99
void linkConversion(const reco::ConversionRef &convref, reco::ConversionCollection &conversions, std::map< reco::ConversionRef, unsigned int > &conversionMap)
std::vector< Conversion > ConversionCollection
collectin of Conversion objects
Definition: ConversionFwd.h:9
const edm::EDGetTokenT< edm::ValueMap< std::vector< reco::PFCandidateRef > > > gsfElectronPfCandMapT_
const std::string outEBRecHits_
const std::string outESRecHits_
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
void relinkConversions(reco::PhotonCore &photonCore, const reco::ConversionRefVector &convrefs, const std::map< reco::ConversionRef, unsigned int > &conversionMap, const edm::OrphanHandle< reco::ConversionCollection > &outConversionHandle)
const edm::EDGetTokenT< EcalRecHitCollection > preshowerEcalHits_
void linkConversions(const reco::ConversionRefVector &convrefs, reco::ConversionCollection &conversions, std::map< reco::ConversionRef, unsigned int > &conversionMap)
reco::PhotonCoreRef photonCore() const
returns a reference to the core photon object
Definition: Photon.h:50
const int keep
const std::vector< std::string > outGsfElectronIds_
void setPhotonCore(const reco::PhotonCoreRef &photonCore)
Definition: Photon.h:51
const std::string outSingleConversions_
const std::string outESClusters_
const std::string outOOTSuperClusters_
std::vector< SuperCluster > SuperClusterCollection
collection of SuperCluser objectr
const StringCutObjectSelector< reco::Photon > keepOOTPhotonSel_
const std::string outOOTESClusters_
void relinkGsfElectronCore(reco::GsfElectron &gsfElectron, const std::map< reco::GsfElectronCoreRef, unsigned int > &gsfElectronCoreMap, const edm::OrphanHandle< reco::GsfElectronCoreCollection > &outGsfElectronCoreHandle)
void linkConversionsByTrackRef(const edm::Handle< reco::ConversionCollection > &conversionHandle, const reco::GsfElectron &gsfElectron, reco::ConversionCollection &conversions, std::map< reco::ConversionRef, unsigned int > &conversionMap)
void setConversions(const reco::ConversionRefVector &conversions)
Definition: PhotonCore.h:79
const std::string outOOTEBEEClusters_
std::vector< CaloCluster > CaloClusterCollection
collection of CaloCluster objects
const std::vector< std::string > outPhotonPFClusterIsos_
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)
void linkCore(const T &core, U &cores, std::map< T, unsigned int > &coreMap)
const StringCutObjectSelector< reco::Photon > relinkPhotonSel_
std::vector< edm::EDGetTokenT< edm::ValueMap< float > > > gsfElectronIdTs_
edm::Ref< PFCandidateCollection > PFCandidateRef
persistent reference to a PFCandidate
const CaloClusterPtrVector & preshowerClusters() const
const access to the preshower cluster list itself
Definition: SuperCluster.h:72
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)
const std::string outPhotons_
const std::string outGsfElectronPfCandMap_
void relinkSuperCluster(T &core, const std::map< reco::SuperClusterRef, unsigned int > &superClusterMap, const edm::OrphanHandle< reco::SuperClusterCollection > &outSuperClusterHandle)
const std::string outGsfElectronCores_
Definition: DetId.h:18
const edm::EDGetTokenT< reco::PhotonCollection > photonT_
void relinkPhotonCore(reco::Photon &photon, const std::map< reco::PhotonCoreRef, unsigned int > &photonCoreMap, const edm::OrphanHandle< reco::PhotonCoreCollection > &outPhotonCoreHandle)
void conversion(EventAux const &from, EventAuxiliary &to)
Definition: EventAux.cc:9
const std::vector< std::string > outGsfElectronPFClusterIsos_
const std::string outSuperClusters_
virtual std::vector< DetId > getWindow(const DetId &id, const int &northSouthSize, const int &eastWestSize) const
const std::string outConversions_
T const * product() const
Definition: Handle.h:81
void clear()
Clear the vector.
Definition: RefVector.h:147
std::vector< Photon > PhotonCollection
collectin of Photon objects
Definition: PhotonFwd.h:9
const T & get() const
Definition: EventSetup.h:56
const std::string outGsfElectrons_
const CaloSubdetectorTopology * getSubdetectorTopology(const DetId &id) const
access the subdetector Topology for the given subdetector directly
Definition: CaloTopology.cc:26
const StringCutObjectSelector< reco::GsfElectron > slimRelinkGsfElectronSel_
virtual GsfElectronCoreRef core() const
Definition: GsfElectron.cc:8
const std::string outPhotonCores_
void clear()
Clear the PtrVector.
Definition: PtrVectorBase.h:80
fixed size matrix
HLT enums.
void linkCaloCluster(const reco::CaloClusterPtr &caloCluster, reco::CaloClusterCollection &caloClusters, std::map< reco::CaloClusterPtr, unsigned int > &caloClusterMap)
const std::string outEERecHits_
const StringCutObjectSelector< reco::Photon > slimRelinkOOTPhotonSel_
size_type size() const
Size of the RefVector.
Definition: RefVector.h:107
const std::string outPhotonPfCandMap_
const std::vector< std::string > outOOTPhotonPFClusterIsos_
const edm::EDGetTokenT< EcalRecHitCollection > endcapEcalHits_
std::vector< edm::EDGetTokenT< edm::ValueMap< float > > > ootPhotonPFClusterIsoTs_
const CaloClusterPtr & seed() const
seed BasicCluster
Definition: SuperCluster.h:66
size_t operator()(const DetId &id) const
std::vector< edm::EDGetTokenT< edm::ValueMap< bool > > > photonIdTs_
const std::string outOOTPhotonCores_
long double T
const edm::EDGetTokenT< reco::PhotonCollection > ootPhotonT_
const edm::EDGetTokenT< EcalRecHitCollection > barrelEcalHits_
def move(src, dest)
Definition: eostools.py:510
ReducedEGProducer(const edm::ParameterSet &ps)
const edm::EDGetTokenT< reco::ConversionCollection > conversionT_
virtual void produce(edm::Event &evt, const edm::EventSetup &es) override final