CMS 3D CMS Logo

HLTDoubletDZ.cc
Go to the documentation of this file.
1 #include "HLTDoubletDZ.h"
2 
19 
20 #include <cmath>
21 
22 template <typename T1, typename T2>
24  : HLTFilter(iConfig),
25  originTag1_(iConfig.getParameter<std::vector<edm::InputTag>>("originTag1")),
26  originTag2_(iConfig.getParameter<std::vector<edm::InputTag>>("originTag2")),
27  inputTag1_(iConfig.getParameter<edm::InputTag>("inputTag1")),
28  inputTag2_(iConfig.getParameter<edm::InputTag>("inputTag2")),
29  inputToken1_(consumes(inputTag1_)),
30  inputToken2_(consumes(inputTag2_)),
31  electronToken_(edm::EDGetTokenT<reco::ElectronCollection>()),
32  triggerType1_(iConfig.getParameter<int>("triggerType1")),
33  triggerType2_(iConfig.getParameter<int>("triggerType2")),
34  minDR_(iConfig.getParameter<double>("MinDR")),
35  minDR2_(minDR_ * minDR_),
36  maxDZ_(iConfig.getParameter<double>("MaxDZ")),
37  min_N_(iConfig.getParameter<int>("MinN")),
38  minPixHitsForDZ_(iConfig.getParameter<int>("MinPixHitsForDZ")),
39  checkSC_(iConfig.getParameter<bool>("checkSC")),
40  same_(inputTag1_.encode() == inputTag2_.encode()) // same collections to be compared?
41 {}
42 
43 template <>
45  : HLTFilter(iConfig),
46  originTag1_(iConfig.getParameter<std::vector<edm::InputTag>>("originTag1")),
47  originTag2_(iConfig.getParameter<std::vector<edm::InputTag>>("originTag2")),
48  inputTag1_(iConfig.getParameter<edm::InputTag>("inputTag1")),
49  inputTag2_(iConfig.getParameter<edm::InputTag>("inputTag2")),
50  inputToken1_(consumes(inputTag1_)),
51  inputToken2_(consumes(inputTag2_)),
52  electronToken_(consumes(iConfig.getParameter<edm::InputTag>("electronTag"))),
53  triggerType1_(iConfig.getParameter<int>("triggerType1")),
54  triggerType2_(iConfig.getParameter<int>("triggerType2")),
55  minDR_(iConfig.getParameter<double>("MinDR")),
56  minDR2_(minDR_ * minDR_),
57  maxDZ_(iConfig.getParameter<double>("MaxDZ")),
58  min_N_(iConfig.getParameter<int>("MinN")),
59  minPixHitsForDZ_(iConfig.getParameter<int>("MinPixHitsForDZ")),
60  checkSC_(iConfig.getParameter<bool>("checkSC")),
61  same_(inputTag1_.encode() == inputTag2_.encode()) // same collections to be compared?
62 {}
63 
64 template <>
66  : HLTFilter(iConfig),
67  originTag1_(iConfig.getParameter<std::vector<edm::InputTag>>("originTag1")),
68  originTag2_(iConfig.getParameter<std::vector<edm::InputTag>>("originTag2")),
69  inputTag1_(iConfig.getParameter<edm::InputTag>("inputTag1")),
70  inputTag2_(iConfig.getParameter<edm::InputTag>("inputTag2")),
71  inputToken1_(consumes(inputTag1_)),
72  inputToken2_(consumes(inputTag2_)),
73  electronToken_(consumes(iConfig.getParameter<edm::InputTag>("electronTag"))),
74  triggerType1_(iConfig.getParameter<int>("triggerType1")),
75  triggerType2_(iConfig.getParameter<int>("triggerType2")),
76  minDR_(iConfig.getParameter<double>("MinDR")),
77  minDR2_(minDR_ * minDR_),
78  maxDZ_(iConfig.getParameter<double>("MaxDZ")),
79  min_N_(iConfig.getParameter<int>("MinN")),
80  minPixHitsForDZ_(iConfig.getParameter<int>("MinPixHitsForDZ")),
81  checkSC_(iConfig.getParameter<bool>("checkSC")),
82  same_(inputTag1_.encode() == inputTag2_.encode()) // same collections to be compared?
83 {}
84 
85 template <>
87  : HLTFilter(iConfig),
88  originTag1_(iConfig.getParameter<std::vector<edm::InputTag>>("originTag1")),
89  originTag2_(iConfig.getParameter<std::vector<edm::InputTag>>("originTag2")),
90  inputTag1_(iConfig.getParameter<edm::InputTag>("inputTag1")),
91  inputTag2_(iConfig.getParameter<edm::InputTag>("inputTag2")),
92  inputToken1_(consumes(inputTag1_)),
93  inputToken2_(consumes(inputTag2_)),
94  electronToken_(consumes(iConfig.getParameter<edm::InputTag>("electronTag"))),
95  triggerType1_(iConfig.getParameter<int>("triggerType1")),
96  triggerType2_(iConfig.getParameter<int>("triggerType2")),
97  minDR_(iConfig.getParameter<double>("MinDR")),
98  minDR2_(minDR_ * minDR_),
99  maxDZ_(iConfig.getParameter<double>("MaxDZ")),
100  min_N_(iConfig.getParameter<int>("MinN")),
101  minPixHitsForDZ_(iConfig.getParameter<int>("MinPixHitsForDZ")),
102  checkSC_(iConfig.getParameter<bool>("checkSC")),
103  same_(inputTag1_.encode() == inputTag2_.encode()) // same collections to be compared?
104 {}
105 
106 template <>
108  : HLTFilter(iConfig),
109  originTag1_(iConfig.getParameter<std::vector<edm::InputTag>>("originTag1")),
110  originTag2_(iConfig.getParameter<std::vector<edm::InputTag>>("originTag2")),
111  inputTag1_(iConfig.getParameter<edm::InputTag>("inputTag1")),
112  inputTag2_(iConfig.getParameter<edm::InputTag>("inputTag2")),
113  inputToken1_(consumes(inputTag1_)),
114  inputToken2_(consumes(inputTag2_)),
115  electronToken_(edm::EDGetTokenT<reco::ElectronCollection>()),
116  triggerType1_(iConfig.getParameter<int>("triggerType1")),
117  triggerType2_(iConfig.getParameter<int>("triggerType2")),
118  minDR_(iConfig.getParameter<double>("MinDR")),
119  minDR2_(minDR_ * minDR_),
120  maxDZ_(iConfig.getParameter<double>("MaxDZ")),
121  min_N_(iConfig.getParameter<int>("MinN")),
122  minPixHitsForDZ_(0),
123  checkSC_(false),
124  same_(inputTag1_.encode() == inputTag2_.encode()) // same collections to be compared?
125 {}
126 
127 template <>
129  : HLTFilter(iConfig),
130  originTag1_(iConfig.getParameter<std::vector<edm::InputTag>>("originTag1")),
131  originTag2_(iConfig.getParameter<std::vector<edm::InputTag>>("originTag2")),
132  inputTag1_(iConfig.getParameter<edm::InputTag>("inputTag1")),
133  inputTag2_(iConfig.getParameter<edm::InputTag>("inputTag2")),
134  inputToken1_(consumes(inputTag1_)),
135  inputToken2_(consumes(inputTag2_)),
136  electronToken_(edm::EDGetTokenT<reco::ElectronCollection>()),
137  triggerType1_(iConfig.getParameter<int>("triggerType1")),
138  triggerType2_(iConfig.getParameter<int>("triggerType2")),
139  minDR_(iConfig.getParameter<double>("MinDR")),
140  minDR2_(minDR_ * minDR_),
141  maxDZ_(iConfig.getParameter<double>("MaxDZ")),
142  min_N_(iConfig.getParameter<int>("MinN")),
143  minPixHitsForDZ_(0),
144  checkSC_(false),
145  same_(inputTag1_.encode() == inputTag2_.encode()) // same collections to be compared?
146 {}
147 
148 template <>
150  : HLTFilter(iConfig),
151  originTag1_(iConfig.getParameter<std::vector<edm::InputTag>>("originTag1")),
152  originTag2_(iConfig.getParameter<std::vector<edm::InputTag>>("originTag2")),
153  inputTag1_(iConfig.getParameter<edm::InputTag>("inputTag1")),
154  inputTag2_(iConfig.getParameter<edm::InputTag>("inputTag2")),
155  inputToken1_(consumes(inputTag1_)),
156  inputToken2_(consumes(inputTag2_)),
157  electronToken_(edm::EDGetTokenT<reco::ElectronCollection>()),
158  triggerType1_(iConfig.getParameter<int>("triggerType1")),
159  triggerType2_(iConfig.getParameter<int>("triggerType2")),
160  minDR_(iConfig.getParameter<double>("MinDR")),
161  minDR2_(minDR_ * minDR_),
162  maxDZ_(iConfig.getParameter<double>("MaxDZ")),
163  min_N_(iConfig.getParameter<int>("MinN")),
164  minPixHitsForDZ_(0),
165  checkSC_(false),
166  same_(inputTag1_.encode() == inputTag2_.encode()) // same collections to be compared?
167 {}
168 
169 template <typename T1, typename T2>
172  makeHLTFilterDescription(desc);
173  desc.add<std::vector<edm::InputTag>>("originTag1", {edm::InputTag("hltOriginal1")});
174  desc.add<std::vector<edm::InputTag>>("originTag2", {edm::InputTag("hltOriginal2")});
175  desc.add<edm::InputTag>("inputTag1", edm::InputTag("hltFiltered1"));
176  desc.add<edm::InputTag>("inputTag2", edm::InputTag("hltFiltered2"));
177  desc.add<int>("triggerType1", 0);
178  desc.add<int>("triggerType2", 0);
179  desc.add<double>("MinDR", -1.0);
180  desc.add<double>("MaxDZ", 0.2);
181  desc.add<int>("MinN", 1);
182  desc.add<int>("MinPixHitsForDZ", 0);
183  desc.add<bool>("checkSC", false);
184  descriptions.addWithDefaultLabel(desc);
185 }
186 
187 template <>
189  edm::ConfigurationDescriptions& descriptions) {
191  makeHLTFilterDescription(desc);
192  desc.add<std::vector<edm::InputTag>>("originTag1", {edm::InputTag("hltOriginal1")});
193  desc.add<std::vector<edm::InputTag>>("originTag2", {edm::InputTag("hltOriginal2")});
194  desc.add<edm::InputTag>("inputTag1", edm::InputTag("hltFiltered1"));
195  desc.add<edm::InputTag>("inputTag2", edm::InputTag("hltFiltered2"));
196  desc.add<edm::InputTag>("electronTag", edm::InputTag("electronTag"));
197  desc.add<int>("triggerType1", 0);
198  desc.add<int>("triggerType2", 0);
199  desc.add<double>("MinDR", -1.0);
200  desc.add<double>("MaxDZ", 0.2);
201  desc.add<int>("MinN", 1);
202  desc.add<int>("MinPixHitsForDZ", 0);
203  desc.add<bool>("checkSC", false);
204  descriptions.addWithDefaultLabel(desc);
205 }
206 
207 template <>
209  edm::ConfigurationDescriptions& descriptions) {
211  makeHLTFilterDescription(desc);
212  desc.add<std::vector<edm::InputTag>>("originTag1", {edm::InputTag("hltOriginal1")});
213  desc.add<std::vector<edm::InputTag>>("originTag2", {edm::InputTag("hltOriginal2")});
214  desc.add<edm::InputTag>("inputTag1", edm::InputTag("hltFiltered1"));
215  desc.add<edm::InputTag>("inputTag2", edm::InputTag("hltFiltered2"));
216  desc.add<edm::InputTag>("electronTag", edm::InputTag("electronTag"));
217  desc.add<int>("triggerType1", 0);
218  desc.add<int>("triggerType2", 0);
219  desc.add<double>("MinDR", -1.0);
220  desc.add<double>("MaxDZ", 0.2);
221  desc.add<int>("MinN", 1);
222  desc.add<int>("MinPixHitsForDZ", 0);
223  desc.add<bool>("checkSC", false);
224  descriptions.addWithDefaultLabel(desc);
225 }
226 
227 template <>
229  edm::ConfigurationDescriptions& descriptions) {
231  makeHLTFilterDescription(desc);
232  desc.add<std::vector<edm::InputTag>>("originTag1", {edm::InputTag("hltOriginal1")});
233  desc.add<std::vector<edm::InputTag>>("originTag2", {edm::InputTag("hltOriginal2")});
234  desc.add<edm::InputTag>("inputTag1", edm::InputTag("hltFiltered1"));
235  desc.add<edm::InputTag>("inputTag2", edm::InputTag("hltFiltered2"));
236  desc.add<edm::InputTag>("electronTag", edm::InputTag("electronTag"));
237  desc.add<int>("triggerType1", 0);
238  desc.add<int>("triggerType2", 0);
239  desc.add<double>("MinDR", -1.0);
240  desc.add<double>("MaxDZ", 0.2);
241  desc.add<int>("MinN", 1);
242  desc.add<int>("MinPixHitsForDZ", 0);
243  desc.add<bool>("checkSC", false);
244  descriptions.addWithDefaultLabel(desc);
245 }
246 
247 template <>
250  makeHLTFilterDescription(desc);
251  desc.add<std::vector<edm::InputTag>>("originTag1", {edm::InputTag("hltOriginal1")});
252  desc.add<std::vector<edm::InputTag>>("originTag2", {edm::InputTag("hltOriginal2")});
253  desc.add<edm::InputTag>("inputTag1", edm::InputTag("hltFiltered1"));
254  desc.add<edm::InputTag>("inputTag2", edm::InputTag("hltFiltered2"));
255  desc.add<int>("triggerType1", 0);
256  desc.add<int>("triggerType2", 0);
257  desc.add<double>("MinDR", -1.0);
258  desc.add<double>("MaxDZ", 0.2);
259  desc.add<int>("MinN", 1);
260  descriptions.addWithDefaultLabel(desc);
261 }
262 
263 template <>
266  makeHLTFilterDescription(desc);
267  desc.add<std::vector<edm::InputTag>>("originTag1", {edm::InputTag("hltOriginal1")});
268  desc.add<std::vector<edm::InputTag>>("originTag2", {edm::InputTag("hltOriginal2")});
269  desc.add<edm::InputTag>("inputTag1", edm::InputTag("hltFiltered1"));
270  desc.add<edm::InputTag>("inputTag2", edm::InputTag("hltFiltered2"));
271  desc.add<int>("triggerType1", 0);
272  desc.add<int>("triggerType2", 0);
273  desc.add<double>("MinDR", -1.0);
274  desc.add<double>("MaxDZ", 0.2);
275  desc.add<int>("MinN", 1);
276  descriptions.addWithDefaultLabel(desc);
277 }
278 
279 template <>
282  makeHLTFilterDescription(desc);
283  desc.add<std::vector<edm::InputTag>>("originTag1", {edm::InputTag("hltOriginal1")});
284  desc.add<std::vector<edm::InputTag>>("originTag2", {edm::InputTag("hltOriginal2")});
285  desc.add<edm::InputTag>("inputTag1", edm::InputTag("hltFiltered1"));
286  desc.add<edm::InputTag>("inputTag2", edm::InputTag("hltFiltered2"));
287  desc.add<int>("triggerType1", 0);
288  desc.add<int>("triggerType2", 0);
289  desc.add<double>("MinDR", -1.0);
290  desc.add<double>("MaxDZ", 0.2);
291  desc.add<int>("MinN", 1);
292  descriptions.addWithDefaultLabel(desc);
293 }
294 
295 template <typename T1, typename T2>
297  std::vector<T1Ref>& coll1,
298  std::vector<T2Ref>& coll2,
299  trigger::TriggerFilterObjectWithRefs& filterproduct) const {
301  if (iEvent.getByToken(inputToken1_, handle1) and iEvent.getByToken(inputToken2_, handle2)) {
302  // get hold of pre-filtered object collections
303  handle1->getObjects(triggerType1_, coll1);
304  handle2->getObjects(triggerType2_, coll2);
305  const trigger::size_type n1(coll1.size());
306  const trigger::size_type n2(coll2.size());
307 
308  if (saveTags()) {
309  edm::InputTag tagOld;
310  for (unsigned int i = 0; i < originTag1_.size(); ++i) {
311  filterproduct.addCollectionTag(originTag1_[i]);
312  }
313  tagOld = edm::InputTag();
314  for (trigger::size_type i1 = 0; i1 != n1; ++i1) {
315  const edm::ProductID pid(coll1[i1].id());
316  const auto& prov = iEvent.getStableProvenance(pid);
317  const std::string& label(prov.moduleLabel());
318  const std::string& instance(prov.productInstanceName());
319  const std::string& process(prov.processName());
321  if (tagOld.encode() != tagNew.encode()) {
322  filterproduct.addCollectionTag(tagNew);
323  tagOld = tagNew;
324  }
325  }
326  for (unsigned int i = 0; i < originTag2_.size(); ++i) {
327  filterproduct.addCollectionTag(originTag2_[i]);
328  }
329  tagOld = edm::InputTag();
330  for (trigger::size_type i2 = 0; i2 != n2; ++i2) {
331  const edm::ProductID pid(coll2[i2].id());
332  const auto& prov = iEvent.getStableProvenance(pid);
333  const std::string& label(prov.moduleLabel());
334  const std::string& instance(prov.productInstanceName());
335  const std::string& process(prov.processName());
337  if (tagOld.encode() != tagNew.encode()) {
338  filterproduct.addCollectionTag(tagNew);
339  tagOld = tagNew;
340  }
341  }
342  }
343 
344  return true;
345  }
346 
347  return false;
348 }
349 
350 template <typename T1, typename T2>
351 bool HLTDoubletDZ<T1, T2>::haveSameSuperCluster(T1 const& c1, T2 const& c2) const {
352  return (c1.superCluster().isNonnull() and c2.superCluster().isNonnull() and (c1.superCluster() == c2.superCluster()));
353 }
354 
355 template <>
357  l1t::TrackerMuon const&) const {
358  return false;
359 }
360 
361 template <>
363  return false;
364 }
365 
366 template <>
368  l1t::HPSPFTau const&) const {
369  return false;
370 }
371 
372 template <typename C1, typename C2>
373 bool HLTDoubletDZ<C1, C2>::passCutMinDeltaR(C1 const& c1, C2 const& c2) const {
374  return (minDR_ < 0 or reco::deltaR2(c1, c2) >= minDR2_);
375 }
376 
377 template <>
379  l1t::TrackerMuon const& m2) const {
380  return (minDR_ < 0 or reco::deltaR2(m1.phEta(), m1.phPhi(), m2.phEta(), m2.phPhi()) >= minDR2_);
381 }
382 
383 namespace {
384 
385  double getCandidateVZ(reco::RecoChargedCandidate const& cand, bool& isValidVZ, int const minPixHitsForValidVZ) {
386  if (minPixHitsForValidVZ > 0) {
387  auto const track = cand.track();
388  if (not(track.isNonnull() and track.isAvailable() and
389  track->hitPattern().numberOfValidPixelHits() >= minPixHitsForValidVZ)) {
390  isValidVZ = false;
391  return 0;
392  }
393  }
394 
395  isValidVZ = true;
396  return cand.vz();
397  }
398 
399  double getCandidateVZ(reco::RecoEcalCandidate const& cand,
400  bool& isValidVZ,
401  int const minPixHitsForValidVZ,
403  reco::Electron const* elec_ptr = nullptr;
404  for (auto const& elec : electrons) {
405  if (elec.superCluster() == cand.superCluster()) {
406  elec_ptr = &elec;
407  }
408  }
409 
410  if (elec_ptr == nullptr) {
411  // IMPROVE, kept for backward compatibility
412  isValidVZ = true;
413  return 0; // equivalent to 'reco::Electron e1; return e1.vz();'
414  }
415 
416  if (minPixHitsForValidVZ > 0) {
417  auto const track = elec_ptr->gsfTrack();
418  if (not(track.isNonnull() and track.isAvailable() and
419  track->hitPattern().numberOfValidPixelHits() >= minPixHitsForValidVZ)) {
420  isValidVZ = false;
421  return 0;
422  }
423  }
424 
425  isValidVZ = true;
426  return elec_ptr->vz();
427  }
428 
429  double getCandidateVZ(l1t::HPSPFTau const& cand, bool& isValidVZ) {
430  auto const& leadChargedPFCand = cand.leadChargedPFCand();
431  if (leadChargedPFCand.isNonnull() and leadChargedPFCand.isAvailable()) {
432  auto const& pfTrack = leadChargedPFCand->pfTrack();
433  if (pfTrack.isNonnull() and pfTrack.isAvailable()) {
434  isValidVZ = true;
435  return pfTrack->vertex().z();
436  }
437  }
438 
439  isValidVZ = false;
440  return 0;
441  }
442 
443 } // namespace
444 
445 template <typename T1, typename T2>
446 bool HLTDoubletDZ<T1, T2>::computeDZ(edm::Event const&, T1 const& c1, T2 const& c2) const {
447  return ((std::abs(c1.vz() - c2.vz()) <= maxDZ_) and passCutMinDeltaR(c1, c2));
448 }
449 
450 template <>
452  edm::Event const& iEvent, reco::RecoEcalCandidate const& c1, reco::RecoChargedCandidate const& c2) const {
453  if (not passCutMinDeltaR(c1, c2))
454  return false;
455 
456  bool hasValidVZ2 = false;
457  auto const vz2 = getCandidateVZ(c2, hasValidVZ2, minPixHitsForDZ_);
458  if (not hasValidVZ2)
459  return true;
460 
461  bool hasValidVZ1 = false;
462  auto const& electrons = iEvent.get(electronToken_);
463  auto const vz1 = getCandidateVZ(c1, hasValidVZ1, minPixHitsForDZ_, electrons);
464  if (not hasValidVZ1)
465  return true;
466 
467  return (std::abs(vz1 - vz2) <= maxDZ_);
468 }
469 
470 template <>
472  edm::Event const& iEvent, reco::RecoChargedCandidate const& c1, reco::RecoEcalCandidate const& c2) const {
473  if (not passCutMinDeltaR(c1, c2))
474  return false;
475 
476  bool hasValidVZ1 = false;
477  auto const vz1 = getCandidateVZ(c1, hasValidVZ1, minPixHitsForDZ_);
478  if (not hasValidVZ1)
479  return true;
480 
481  bool hasValidVZ2 = false;
482  auto const& electrons = iEvent.get(electronToken_);
483  auto const vz2 = getCandidateVZ(c2, hasValidVZ2, minPixHitsForDZ_, electrons);
484  if (not hasValidVZ2)
485  return true;
486 
487  return (std::abs(vz1 - vz2) <= maxDZ_);
488 }
489 
490 template <>
492  edm::Event const& iEvent, reco::RecoEcalCandidate const& c1, reco::RecoEcalCandidate const& c2) const {
493  if (not passCutMinDeltaR(c1, c2))
494  return false;
495 
496  auto const& electrons = iEvent.get(electronToken_);
497 
498  bool hasValidVZ1 = false;
499  auto const vz1 = getCandidateVZ(c1, hasValidVZ1, minPixHitsForDZ_, electrons);
500  if (not hasValidVZ1)
501  return true;
502 
503  bool hasValidVZ2 = false;
504  auto const vz2 = getCandidateVZ(c2, hasValidVZ2, minPixHitsForDZ_, electrons);
505  if (not hasValidVZ2)
506  return true;
507 
508  return (std::abs(vz1 - vz2) <= maxDZ_);
509 }
510 
511 template <>
514  if (not passCutMinDeltaR(c1, c2))
515  return false;
516 
517  bool hasValidVZ1 = false;
518  auto const vz1 = getCandidateVZ(c1, hasValidVZ1, minPixHitsForDZ_);
519  if (not hasValidVZ1)
520  return true;
521 
522  bool hasValidVZ2 = false;
523  auto const vz2 = getCandidateVZ(c2, hasValidVZ2, minPixHitsForDZ_);
524  if (not hasValidVZ2)
525  return true;
526 
527  return (std::abs(vz1 - vz2) <= maxDZ_);
528 }
529 
530 template <>
532  l1t::TrackerMuon const& c1,
533  l1t::TrackerMuon const& c2) const {
534  return ((std::abs(c1.phZ0() - c2.phZ0()) <= maxDZ_) and passCutMinDeltaR(c1, c2));
535 }
536 
537 template <>
539  l1t::HPSPFTau const& c1,
540  l1t::HPSPFTau const& c2) const {
541  if (not passCutMinDeltaR(c1, c2))
542  return false;
543 
544  bool hasValidVZ1 = false;
545  auto const vz1 = getCandidateVZ(c1, hasValidVZ1);
546  if (not hasValidVZ1)
547  return false;
548 
549  bool hasValidVZ2 = false;
550  auto const vz2 = getCandidateVZ(c2, hasValidVZ2);
551  if (not hasValidVZ2)
552  return false;
553 
554  return (std::abs(vz1 - vz2) <= maxDZ_);
555 }
556 
557 template <typename T1, typename T2>
559  edm::EventSetup const& iSetup,
560  trigger::TriggerFilterObjectWithRefs& filterproduct) const {
561  // All HLT filters must create and fill an HLT filter object,
562  // recording any reconstructed physics objects satisfying (or not)
563  // this HLT filter, and place it in the Event.
564  std::vector<T1Ref> coll1;
565  std::vector<T2Ref> coll2;
566 
567  if (getCollections(iEvent, coll1, coll2, filterproduct)) {
568  int n(0);
569  T1Ref r1;
570  T2Ref r2;
571 
572  for (unsigned int i1 = 0; i1 < coll1.size(); ++i1) {
573  r1 = coll1[i1];
574  unsigned int const I = same_ ? i1 + 1 : 0;
575  for (unsigned int i2 = I; i2 < coll2.size(); ++i2) {
576  r2 = coll2[i2];
577 
578  if (checkSC_ and haveSameSuperCluster(*r1, *r2)) {
579  continue;
580  }
581 
582  if (not computeDZ(iEvent, *r1, *r2)) {
583  continue;
584  }
585 
586  n++;
587  filterproduct.addObject(triggerType1_, r1);
588  filterproduct.addObject(triggerType2_, r2);
589  }
590  }
591 
592  return (n >= min_N_);
593  }
594 
595  return false;
596 }
597 
607 
void getObjects(Vids &ids, VRphoton &refs) const
various physics-level getters:
void addWithDefaultLabel(ParameterSetDescription const &psetDescription)
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
bool computeDZ(edm::Event const &iEvent, T1 const &c1, T2 const &c2) const
double vz() const override
z coordinate of vertex position
static PFTauRenderPlugin instance
std::string encode() const
Definition: InputTag.cc:159
uint16_t size_type
bool passCutMinDeltaR(T1 const &c1, T2 const &c2) const
void addObject(int id, const reco::RecoEcalCandidateRef &ref)
setters for L3 collections: (id=physics type, and Ref<C>)
char const * label
int iEvent
Definition: GenABIO.cc:224
bool getCollections(edm::Event const &iEvent, std::vector< T1Ref > &coll1, std::vector< T2Ref > &coll2, trigger::TriggerFilterObjectWithRefs &filterproduct) const
The Signals That Services Can Subscribe To This is based on ActivityRegistry and is current per Services can connect to the signals distributed by the ActivityRegistry in order to monitor the activity of the application Each possible callback has some defined which we here list in angle e< void, edm::EventID const &, edm::Timestamp const & > We also list in braces which AR_WATCH_USING_METHOD_ is used for those or
Definition: Activities.doc:12
reco::GsfTrackRef gsfTrack() const override
reference to a GsfTrack
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
const std::complex< double > I
Definition: I.h:8
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:16
bool haveSameSuperCluster(T1 const &c1, T2 const &c2) const
std::vector< Electron > ElectronCollection
collectin of Electron objects
Definition: ElectronFwd.h:9
constexpr auto deltaR2(const T1 &t1, const T2 &t2) -> decltype(t1.eta())
Definition: deltaR.h:16
void addCollectionTag(const edm::InputTag &collectionTag)
collectionTags
def encode(args, files)
fixed size matrix
HLT enums.
bool hltFilter(edm::Event &iEvent, edm::EventSetup const &iSetup, trigger::TriggerFilterObjectWithRefs &filterproduct) const override
HLTDoubletDZ(edm::ParameterSet const &)
Definition: HLTDoubletDZ.cc:23
const double phZ0() const
Definition: TrackerMuon.h:49