CMS 3D CMS Logo

EgammaHLTExtraProducer.cc
Go to the documentation of this file.
1 
12 
31 
35 
36 #include <sstream>
37 #include <vector>
38 
39 namespace {
40  //changes double to string for product name
41  //ie "." is replaced with "p" and for -ve vals, string is M instead so -28 is M28
42  //has a fixed precision of precision although it removes trailing zeros and the .
43  std::string convertToProdNameStr(double val, int precision = 3) {
44  std::ostringstream valOStr;
45  valOStr << std::fixed << std::setprecision(precision) << val;
46  std::string valStr = valOStr.str();
47  while (valStr.size() > 1 && valStr.back() == '0') {
48  valStr.pop_back();
49  }
50  if (valStr.size() > 1 && valStr.back() == '.') {
51  valStr.pop_back();
52  }
53  auto decPoint = valStr.find('.');
54  if (decPoint != std::string::npos) {
55  valStr.replace(decPoint, 1, "p");
56  }
57  if (val < 0)
58  valStr.replace(0, 1, "M");
59  return valStr;
60  }
61 
62  template <typename T>
63  std::vector<std::unique_ptr<int>> countRecHits(const T& recHitHandle, const std::vector<double>& thresholds) {
64  std::vector<std::unique_ptr<int>> counts(thresholds.size());
65  for (auto& count : counts)
66  count = std::make_unique<int>(0);
67  if (recHitHandle.isValid()) {
68  for (const auto& recHit : *recHitHandle) {
69  for (size_t thresNr = 0; thresNr < thresholds.size(); thresNr++) {
70  if (recHit.energy() >= thresholds[thresNr]) {
71  (*counts[thresNr])++;
72  }
73  }
74  }
75  }
76  return counts;
77  }
78 } // namespace
79 
81 public:
84 
85  void produce(edm::StreamID streamID, edm::Event& event, const edm::EventSetup& eventSetup) const override;
86  static void fillDescriptions(edm::ConfigurationDescriptions& descriptions);
87 
88 private:
89  static void setVars(trigger::EgammaObject& egTrigObj,
90  const reco::RecoEcalCandidateRef& ecalCandRef,
93  const edm::Handle<reco::GsfTrackCollection>& gsfTrksHandle);
94  static void setGsfTracks(trigger::EgammaObject& egTrigObj,
95  const edm::Handle<reco::GsfTrackCollection>& gsfTrksHandle);
96  static void setSeeds(trigger::EgammaObject& egTrigObj, edm::Handle<reco::ElectronSeedCollection>& eleSeedsHandle);
97 
98  //these three filter functions are overly similar but with annoying differences
99  //eg rechits needs to access geometry, trk dr is also w.r.t the track eta/phi
100  //still could collapse into a single function
101  template <typename RecHitCollection>
102  std::unique_ptr<RecHitCollection> filterRecHits(
103  const std::vector<std::unique_ptr<trigger::EgammaObjectCollection>>& egTrigObjs,
105  const CaloGeometry& geom,
106  float maxDR2 = 0.4 * 0.4) const;
107 
108  std::unique_ptr<reco::TrackCollection> filterTrks(
109  const std::vector<std::unique_ptr<trigger::EgammaObjectCollection>>& egTrigObjs,
111  float maxDR2 = 0.4 * 0.4) const;
112 
113  std::unique_ptr<reco::PFClusterCollection> filterPFClusIso(
114  const std::vector<std::unique_ptr<trigger::EgammaObjectCollection>>& egTrigObjs,
116  float maxDR2 = 0.4 * 0.4) const;
117 
118  struct Tokens {
119  //these are the tokens which comprise the E/gamma candidate (eg cand,gsf track, pixel seeds)
120  struct EgObjTokens {
124  };
125  std::vector<std::pair<EgObjTokens, std::string>> egCands;
126 
127  std::vector<std::pair<edm::EDGetTokenT<EcalRecHitCollection>, std::string>> ecal;
128  std::vector<std::pair<edm::EDGetTokenT<HBHERecHitCollection>, std::string>> hcal;
129  std::vector<std::pair<edm::EDGetTokenT<reco::TrackCollection>, std::string>> trks;
130  std::vector<std::pair<edm::EDGetTokenT<reco::PFClusterCollection>, std::string>> pfClusIso;
131 
132  template <typename T>
135  const edm::ParameterSet& pset,
136  const std::string& tagname) {
137  token = cc.consumes<T>(pset.getParameter<edm::InputTag>(tagname));
138  }
139  template <typename T>
142  const edm::ParameterSet& pset,
143  const std::string& tagname) {
144  auto inputTags = pset.getParameter<std::vector<edm::InputTag>>(tagname);
145  tokens.resize(inputTags.size());
146  for (size_t tagNr = 0; tagNr < inputTags.size(); tagNr++) {
147  tokens[tagNr] = cc.consumes<T>(inputTags[tagNr]);
148  }
149  }
150  template <typename T>
151  static void setToken(std::vector<std::pair<edm::EDGetTokenT<T>, std::string>>& tokens,
153  const edm::ParameterSet& pset,
154  const std::string& tagname) {
155  const auto& collectionPSets = pset.getParameter<std::vector<edm::ParameterSet>>(tagname);
156  for (const auto& collPSet : collectionPSets) {
157  edm::EDGetTokenT<T> token = cc.consumes<T>(collPSet.getParameter<edm::InputTag>("src"));
158  std::string label = collPSet.getParameter<std::string>("label");
159  tokens.emplace_back(token, std::move(label));
160  }
161  }
162 
163  static void setToken(std::vector<std::pair<EgObjTokens, std::string>>& tokens,
165  const edm::ParameterSet& pset,
166  const std::string& tagname) {
167  const auto& collectionPSets = pset.getParameter<std::vector<edm::ParameterSet>>(tagname);
168  for (const auto& collPSet : collectionPSets) {
169  EgObjTokens objTokens;
170  setToken(objTokens.ecalCands, cc, collPSet, "ecalCands");
171  setToken(objTokens.gsfTracks, cc, collPSet, "gsfTracks");
172  setToken(objTokens.pixelSeeds, cc, collPSet, "pixelSeeds");
173  std::string label = collPSet.getParameter<std::string>("label");
174  tokens.emplace_back(objTokens, std::move(label));
175  }
176  }
178  };
179 
181 
183 
187  std::vector<double> recHitCountThresholds_;
189 };
190 
192  setToken(egCands, cc, pset, "egCands");
193  setToken(ecal, cc, pset, "ecal");
194  setToken(hcal, cc, pset, "hcal");
195  setToken(trks, cc, pset, "trks");
196  setToken(pfClusIso, cc, pset, "pfClusIso");
197 }
198 
202  minPtToSaveHits_(pset.getParameter<double>("minPtToSaveHits")),
203  saveHitsPlusPi_(pset.getParameter<bool>("saveHitsPlusPi")),
204  saveHitsPlusHalfPi_(pset.getParameter<bool>("saveHitsPlusHalfPi")),
205  recHitCountThresholds_(pset.getParameter<std::vector<double>>("recHitCountThresholds")) {
207  callWhenNewProductsRegistered(getterOfProducts_);
208  for (auto& tokenLabel : tokens_.egCands) {
209  produces<trigger::EgammaObjectCollection>(tokenLabel.second);
210  }
211  for (auto& tokenLabel : tokens_.ecal) {
212  produces<EcalRecHitCollection>(tokenLabel.second);
213  for (const auto& thres : recHitCountThresholds_) {
214  produces<int>("countEcalRecHits" + tokenLabel.second + "Thres" + convertToProdNameStr(thres) + "GeV");
215  }
216  }
217  for (auto& tokenLabel : tokens_.hcal) {
218  produces<HBHERecHitCollection>(tokenLabel.second);
219  for (const auto& thres : recHitCountThresholds_) {
220  produces<int>("countHcalRecHits" + tokenLabel.second + "Thres" + convertToProdNameStr(thres) + "GeV");
221  }
222  }
223  for (auto& tokenLabel : tokens_.trks) {
224  produces<reco::TrackCollection>(tokenLabel.second);
225  }
226  for (auto& tokenLabel : tokens_.pfClusIso) {
227  produces<reco::PFClusterCollection>(tokenLabel.second);
228  }
229 }
230 
233  desc.add<double>("minPtToSaveHits", 0.);
234  desc.add<bool>("saveHitsPlusPi", false);
235  desc.add<bool>("saveHitsPlusHalfPi", true);
236  desc.add<std::vector<double>>("recHitCountThresholds", std::vector{0., 0.5, 1.0, 1.5, 2.0});
237 
238  edm::ParameterSetDescription egCandsDesc;
239  egCandsDesc.add<edm::InputTag>("ecalCands", edm::InputTag(""));
240  egCandsDesc.add<edm::InputTag>("pixelSeeds", edm::InputTag(""));
241  egCandsDesc.add<edm::InputTag>("gsfTracks", edm::InputTag(""));
242  egCandsDesc.add<std::string>("label", "");
243  std::vector<edm::ParameterSet> egCandsDefaults(1);
244  egCandsDefaults[0].addParameter("ecalCands", edm::InputTag("hltEgammaCandidates"));
245  egCandsDefaults[0].addParameter("pixelSeeds", edm::InputTag("hltEgammaElectronPixelSeeds"));
246  egCandsDefaults[0].addParameter("gsfTracks", edm::InputTag("hltEgammaGsfTracks"));
247  egCandsDefaults[0].addParameter("label", std::string(""));
248 
249  edm::ParameterSetDescription tokenLabelDesc;
250  tokenLabelDesc.add<edm::InputTag>("src", edm::InputTag(""));
251  tokenLabelDesc.add<std::string>("label", "");
252  std::vector<edm::ParameterSet> ecalDefaults(2);
253  ecalDefaults[0].addParameter("src", edm::InputTag("hltEcalRecHit", "EcalRecHitsEB"));
254  ecalDefaults[0].addParameter("label", std::string("EcalRecHitsEB"));
255  ecalDefaults[1].addParameter("src", edm::InputTag("hltEcalRecHit", "EcalRecHitsEE"));
256  ecalDefaults[1].addParameter("label", std::string("EcalRecHitsEE"));
257  std::vector<edm::ParameterSet> hcalDefaults(1);
258  hcalDefaults[0].addParameter("src", edm::InputTag("hltHbhereco"));
259  hcalDefaults[0].addParameter("label", std::string(""));
260  std::vector<edm::ParameterSet> trksDefaults(1);
261  trksDefaults[0].addParameter("src", edm::InputTag("generalTracks"));
262  trksDefaults[0].addParameter("label", std::string(""));
263  std::vector<edm::ParameterSet> pfClusIsoDefaults(3);
264  pfClusIsoDefaults[0].addParameter("src", edm::InputTag("hltParticleFlowClusterECALL1Seeded"));
265  pfClusIsoDefaults[0].addParameter("label", std::string("Ecal"));
266  pfClusIsoDefaults[1].addParameter("src", edm::InputTag("hltParticleFlowClusterECALUnseeded"));
267  pfClusIsoDefaults[1].addParameter("label", std::string("EcalUnseeded"));
268  pfClusIsoDefaults[2].addParameter("src", edm::InputTag("hltParticleFlowClusterHCAL"));
269  pfClusIsoDefaults[2].addParameter("label", std::string("Hcal"));
270 
271  desc.addVPSet("egCands", egCandsDesc, egCandsDefaults);
272  desc.addVPSet("ecal", tokenLabelDesc, ecalDefaults);
273  desc.addVPSet("hcal", tokenLabelDesc, hcalDefaults);
274  desc.addVPSet("trks", tokenLabelDesc, trksDefaults);
275  desc.addVPSet("pfClusIso", tokenLabelDesc, pfClusIsoDefaults);
276 
277  descriptions.add(("hltEgammaHLTExtraProducer"), desc);
278 }
279 
281  edm::Event& event,
282  const edm::EventSetup& eventSetup) const {
283  std::vector<edm::Handle<reco::RecoEcalCandidateIsolationMap>> valueMapHandles;
284  getterOfProducts_.fillHandles(event, valueMapHandles);
285  std::vector<std::unique_ptr<trigger::EgammaObjectCollection>> egTrigObjColls;
286  for (const auto& egCandsToken : tokens_.egCands) {
287  auto ecalCandsHandle = event.getHandle(egCandsToken.first.ecalCands);
288  auto gsfTrksHandle = event.getHandle(egCandsToken.first.gsfTracks);
289  auto pixelSeedsHandle = event.getHandle(egCandsToken.first.pixelSeeds);
290 
291  auto egTrigObjs = std::make_unique<trigger::EgammaObjectCollection>();
292  for (size_t candNr = 0; ecalCandsHandle.isValid() && candNr < ecalCandsHandle->size(); candNr++) {
293  reco::RecoEcalCandidateRef candRef(ecalCandsHandle, candNr);
294  egTrigObjs->push_back(*candRef);
295  auto& egTrigObj = egTrigObjs->back();
296  setVars(egTrigObj, candRef, valueMapHandles);
297  setGsfTracks(egTrigObj, gsfTrksHandle);
298  setSeeds(egTrigObj, pixelSeedsHandle);
299  }
300  egTrigObjColls.emplace_back(std::move(egTrigObjs));
301  }
302 
303  auto const caloGeomHandle = eventSetup.getHandle(caloGeomToken_);
304 
305  auto filterAndStoreRecHits = [caloGeomHandle, &event, this](const auto& egTrigObjs, const auto& tokenLabels) {
306  for (const auto& tokenLabel : tokenLabels) {
307  auto handle = event.getHandle(tokenLabel.first);
308  auto recHits = filterRecHits(egTrigObjs, handle, *caloGeomHandle);
309  event.put(std::move(recHits), tokenLabel.second);
310  }
311  };
312 
313  auto storeCountRecHits = [&event](const auto& tokenLabels, const auto& thresholds, const std::string& prefixLabel) {
314  for (const auto& tokenLabel : tokenLabels) {
315  auto handle = event.getHandle(tokenLabel.first);
316  auto count = countRecHits(handle, thresholds);
317  for (size_t thresNr = 0; thresNr < thresholds.size(); thresNr++) {
318  const auto& thres = thresholds[thresNr];
319  event.put(std::move(count[thresNr]),
320  prefixLabel + tokenLabel.second + "Thres" + convertToProdNameStr(thres) + "GeV");
321  }
322  }
323  };
324 
325  auto filterAndStore = [&event, this](const auto& egTrigObjs, const auto& tokenLabels, auto filterFunc) {
326  for (const auto& tokenLabel : tokenLabels) {
327  auto handle = event.getHandle(tokenLabel.first);
328  auto filtered = (this->*filterFunc)(egTrigObjs, handle, 0.4 * 0.4);
329  event.put(std::move(filtered), tokenLabel.second);
330  }
331  };
332 
333  filterAndStoreRecHits(egTrigObjColls, tokens_.ecal);
334  filterAndStoreRecHits(egTrigObjColls, tokens_.hcal);
335  storeCountRecHits(tokens_.ecal, recHitCountThresholds_, "countEcalRecHits");
336  storeCountRecHits(tokens_.hcal, recHitCountThresholds_, "countHcalRecHits");
337  filterAndStore(egTrigObjColls, tokens_.pfClusIso, &EgammaHLTExtraProducer::filterPFClusIso);
338  filterAndStore(egTrigObjColls, tokens_.trks, &EgammaHLTExtraProducer::filterTrks);
339 
340  for (size_t collNr = 0; collNr < egTrigObjColls.size(); collNr++) {
341  event.put(std::move(egTrigObjColls[collNr]), tokens_.egCands[collNr].second);
342  }
343 }
344 
346  trigger::EgammaObject& egTrigObj,
347  const reco::RecoEcalCandidateRef& ecalCandRef,
349  std::vector<std::pair<std::string, float>> vars;
350  for (auto& valueMapHandle : valueMapHandles) {
351  auto mapIt = valueMapHandle->find(ecalCandRef);
352  if (mapIt != valueMapHandle->end()) {
353  std::string name = valueMapHandle.provenance()->moduleLabel();
354  if (!valueMapHandle.provenance()->productInstanceName().empty()) {
355  name += "_" + valueMapHandle.provenance()->productInstanceName();
356  }
357  vars.emplace_back(std::move(name), mapIt->val);
358  }
359  }
360  egTrigObj.setVars(std::move(vars));
361 }
362 
364  const reco::SuperClusterRef& scRef, const edm::Handle<reco::GsfTrackCollection>& gsfTrksHandle) {
365  if (!gsfTrksHandle.isValid()) {
366  return reco::GsfTrackRefVector();
367  }
368 
369  reco::GsfTrackRefVector gsfTrkRefs(gsfTrksHandle.id());
370  for (size_t trkNr = 0; gsfTrksHandle.isValid() && trkNr < gsfTrksHandle->size(); trkNr++) {
371  reco::GsfTrackRef trkRef(gsfTrksHandle, trkNr);
372  edm::RefToBase<TrajectorySeed> seed = trkRef->extra()->seedRef();
374  edm::RefToBase<reco::CaloCluster> caloCluster = eleSeed->caloCluster();
375  reco::SuperClusterRef scRefFromTrk = caloCluster.castTo<reco::SuperClusterRef>();
376  if (scRefFromTrk == scRef) {
377  gsfTrkRefs.push_back(trkRef);
378  }
379  }
380  return gsfTrkRefs;
381 }
382 
384  const edm::Handle<reco::GsfTrackCollection>& gsfTrksHandle) {
385  egTrigObj.setGsfTracks(matchingGsfTrks(egTrigObj.superCluster(), gsfTrksHandle));
386 }
387 
390  if (!eleSeedsHandle.isValid()) {
392  } else {
393  reco::ElectronSeedRefVector trigObjSeeds(eleSeedsHandle.id());
394 
395  for (size_t seedNr = 0; eleSeedsHandle.isValid() && seedNr < eleSeedsHandle->size(); seedNr++) {
396  reco::ElectronSeedRef eleSeed(eleSeedsHandle, seedNr);
397  edm::RefToBase<reco::CaloCluster> caloCluster = eleSeed->caloCluster();
398  reco::SuperClusterRef scRefFromSeed = caloCluster.castTo<reco::SuperClusterRef>();
399 
400  if (scRefFromSeed == egTrigObj.superCluster()) {
401  trigObjSeeds.push_back(eleSeed);
402  }
403  }
404  egTrigObj.setSeeds(std::move(trigObjSeeds));
405  }
406 }
407 
408 template <typename RecHitCollection>
409 std::unique_ptr<RecHitCollection> EgammaHLTExtraProducer::filterRecHits(
410  const std::vector<std::unique_ptr<trigger::EgammaObjectCollection>>& egTrigObjColls,
412  const CaloGeometry& geom,
413  float maxDR2) const {
414  auto filteredHits = std::make_unique<RecHitCollection>();
415  if (!recHits.isValid())
416  return filteredHits;
417 
418  std::vector<std::pair<float, float>> etaPhis;
419  for (const auto& egTrigObjs : egTrigObjColls) {
420  for (const auto& egTrigObj : *egTrigObjs) {
421  if (egTrigObj.pt() >= minPtToSaveHits_) {
422  etaPhis.push_back({egTrigObj.eta(), egTrigObj.phi()});
423  if (saveHitsPlusPi_)
424  etaPhis.push_back({egTrigObj.eta(), egTrigObj.phi() + 3.14159});
426  etaPhis.push_back({egTrigObj.eta(), egTrigObj.phi() + 3.14159 / 2.});
427  }
428  }
429  }
430  auto deltaR2Match = [&etaPhis, &maxDR2](const GlobalPoint& pos) {
431  float eta = pos.eta();
432  float phi = pos.phi();
433  for (auto& etaPhi : etaPhis) {
434  if (reco::deltaR2(eta, phi, etaPhi.first, etaPhi.second) < maxDR2)
435  return true;
436  }
437  return false;
438  };
439 
440  for (auto& hit : *recHits) {
441  const CaloSubdetectorGeometry* subDetGeom = geom.getSubdetectorGeometry(hit.id());
442  if (subDetGeom) {
443  auto cellGeom = subDetGeom->getGeometry(hit.id());
444  if (deltaR2Match(cellGeom->getPosition()))
445  filteredHits->push_back(hit);
446  } else {
447  throw cms::Exception("GeomError") << "could not get geometry for det id " << hit.id().rawId();
448  }
449  }
450  return filteredHits;
451 }
452 
453 std::unique_ptr<reco::TrackCollection> EgammaHLTExtraProducer::filterTrks(
454  const std::vector<std::unique_ptr<trigger::EgammaObjectCollection>>& egTrigObjColls,
456  float maxDR2) const {
457  auto filteredTrks = std::make_unique<reco::TrackCollection>();
458  if (!trks.isValid())
459  return filteredTrks;
460 
461  //so because each egamma object can have multiple eta/phi pairs
462  //easier to just make a temp vector and then copy that in with the +pi and +pi/2
463  std::vector<std::pair<float, float>> etaPhisTmp;
464  for (const auto& egTrigObjs : egTrigObjColls) {
465  for (const auto& egTrigObj : *egTrigObjs) {
466  if (egTrigObj.pt() >= minPtToSaveHits_) {
467  etaPhisTmp.push_back({egTrigObj.eta(), egTrigObj.phi()});
468  //also save the eta /phi of all gsf tracks with the object
469  for (const auto& gsfTrk : egTrigObj.gsfTracks()) {
470  etaPhisTmp.push_back({gsfTrk->eta(), gsfTrk->phi()});
471  }
472  }
473  }
474  }
475  std::vector<std::pair<float, float>> etaPhis;
476  for (const auto& etaPhi : etaPhisTmp) {
477  etaPhis.push_back(etaPhi);
478  if (saveHitsPlusPi_)
479  etaPhis.push_back({etaPhi.first, etaPhi.second + 3.14159});
481  etaPhis.push_back({etaPhi.first, etaPhi.second + 3.14159 / 2.});
482  }
483 
484  auto deltaR2Match = [&etaPhis, &maxDR2](float eta, float phi) {
485  for (auto& etaPhi : etaPhis) {
486  if (reco::deltaR2(eta, phi, etaPhi.first, etaPhi.second) < maxDR2)
487  return true;
488  }
489  return false;
490  };
491 
492  for (auto& trk : *trks) {
493  if (deltaR2Match(trk.eta(), trk.phi()))
494  filteredTrks->push_back(trk);
495  }
496  return filteredTrks;
497 }
498 
499 std::unique_ptr<reco::PFClusterCollection> EgammaHLTExtraProducer::filterPFClusIso(
500  const std::vector<std::unique_ptr<trigger::EgammaObjectCollection>>& egTrigObjColls,
502  float maxDR2) const {
503  auto filteredPFClus = std::make_unique<reco::PFClusterCollection>();
504  if (!pfClus.isValid())
505  return filteredPFClus;
506 
507  std::vector<std::pair<float, float>> etaPhis;
508  for (const auto& egTrigObjs : egTrigObjColls) {
509  for (const auto& egTrigObj : *egTrigObjs) {
510  if (egTrigObj.pt() >= minPtToSaveHits_) {
511  etaPhis.push_back({egTrigObj.eta(), egTrigObj.phi()});
512  if (saveHitsPlusPi_)
513  etaPhis.push_back({egTrigObj.eta(), egTrigObj.phi() + 3.14159});
515  etaPhis.push_back({egTrigObj.eta(), egTrigObj.phi() + 3.14159 / 2.});
516  }
517  }
518  }
519  auto deltaR2Match = [&etaPhis, &maxDR2](float eta, float phi) {
520  for (auto& etaPhi : etaPhis) {
521  if (reco::deltaR2(eta, phi, etaPhi.first, etaPhi.second) < maxDR2)
522  return true;
523  }
524  return false;
525  };
526 
527  for (auto& clus : *pfClus) {
528  if (deltaR2Match(clus.eta(), clus.phi()))
529  filteredPFClus->push_back(clus);
530  }
531  return filteredPFClus;
532 }
533 
edm::ESGetToken< CaloGeometry, CaloGeometryRecord > const caloGeomToken_
const reco::SuperClusterRef & superCluster() const
Definition: EgammaObject.h:25
edm::EDGetTokenT< reco::ElectronSeedCollection > pixelSeeds
ProductID id() const
Definition: HandleBase.cc:29
REF castTo() const
Definition: RefToBase.h:259
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
constexpr SubDetector subDetGeom[21]
void setVars(std::vector< std::pair< std::string, float >> vars)
Definition: EgammaObject.cc:60
uint32_t cc[maxCellsPerHit]
Definition: gpuFishbone.h:49
vars
Definition: DeepTauIdBase.h:60
EgammaHLTExtraProducer(const edm::ParameterSet &pset)
edm::EDGetTokenT< reco::RecoEcalCandidateCollection > ecalCands
void produce(edm::StreamID streamID, edm::Event &event, const edm::EventSetup &eventSetup) const override
static void setGsfTracks(trigger::EgammaObject &egTrigObj, const edm::Handle< reco::GsfTrackCollection > &gsfTrksHandle)
static void setVars(trigger::EgammaObject &egTrigObj, const reco::RecoEcalCandidateRef &ecalCandRef, const std::vector< edm::Handle< reco::RecoEcalCandidateIsolationMap >> &valueMapHandles)
Tokens(const edm::ParameterSet &pset, edm::ConsumesCollector &&cc)
static reco::GsfTrackRefVector matchingGsfTrks(const reco::SuperClusterRef &scRef, const edm::Handle< reco::GsfTrackCollection > &gsfTrksHandle)
std::unique_ptr< reco::TrackCollection > filterTrks(const std::vector< std::unique_ptr< trigger::EgammaObjectCollection >> &egTrigObjs, const edm::Handle< reco::TrackCollection > &trks, float maxDR2=0.4 *0.4) const
std::vector< std::pair< edm::EDGetTokenT< reco::PFClusterCollection >, std::string > > pfClusIso
char const * label
std::vector< std::pair< edm::EDGetTokenT< reco::TrackCollection >, std::string > > trks
ConsumesCollector consumesCollector()
Use a ConsumesCollector to gather consumes information from helper functions.
static const TGPicture * filtered(bool iBackgroundIsBlack)
void setGsfTracks(reco::GsfTrackRefVector trks)
Definition: EgammaObject.h:30
static void setToken(std::vector< edm::EDGetTokenT< T >> &tokens, edm::ConsumesCollector &cc, const edm::ParameterSet &pset, const std::string &tagname)
edm::RefVector< GsfTrackCollection > GsfTrackRefVector
vector of reference to GsfTrack in the same collection
Definition: GsfTrackFwd.h:17
std::unique_ptr< reco::PFClusterCollection > filterPFClusIso(const std::vector< std::unique_ptr< trigger::EgammaObjectCollection >> &egTrigObjs, const edm::Handle< reco::PFClusterCollection > &pfClus, float maxDR2=0.4 *0.4) const
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:16
std::vector< std::pair< edm::EDGetTokenT< HBHERecHitCollection >, std::string > > hcal
std::vector< double > recHitCountThresholds_
ParameterDescriptionBase * add(U const &iLabel, T const &value)
static void setToken(std::vector< std::pair< EgObjTokens, std::string >> &tokens, edm::ConsumesCollector &cc, const edm::ParameterSet &pset, const std::string &tagname)
unsigned int id
std::vector< edm::EDGetTokenT< int > > tokens_
std::vector< std::pair< edm::EDGetTokenT< EcalRecHitCollection >, std::string > > ecal
static void setToken(std::vector< std::pair< edm::EDGetTokenT< T >, std::string >> &tokens, edm::ConsumesCollector &cc, const edm::ParameterSet &pset, const std::string &tagname)
constexpr auto deltaR2(const T1 &t1, const T2 &t2) -> decltype(t1.eta())
Definition: deltaR.h:16
static void setToken(edm::EDGetTokenT< T > &token, edm::ConsumesCollector &cc, const edm::ParameterSet &pset, const std::string &tagname)
void setSeeds(reco::ElectronSeedRefVector seeds)
Definition: EgammaObject.cc:11
inputTags
All input tags are specified in this pset for convenience.
void add(std::string const &label, ParameterSetDescription const &psetDescription)
static void setSeeds(trigger::EgammaObject &egTrigObj, edm::Handle< reco::ElectronSeedCollection > &eleSeedsHandle)
bool isValid() const
Definition: HandleBase.h:70
std::unique_ptr< RecHitCollection > filterRecHits(const std::vector< std::unique_ptr< trigger::EgammaObjectCollection >> &egTrigObjs, const edm::Handle< RecHitCollection > &recHits, const CaloGeometry &geom, float maxDR2=0.4 *0.4) const
edm::EDGetTokenT< reco::GsfTrackCollection > gsfTracks
long double T
edm::GetterOfProducts< reco::RecoEcalCandidateIsolationMap > getterOfProducts_
std::vector< std::pair< EgObjTokens, std::string > > egCands
def move(src, dest)
Definition: eostools.py:511
Definition: event.py:1