CMS 3D CMS Logo

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