CMS 3D CMS Logo

HLTDoubletDZ.cc
Go to the documentation of this file.
2 #include "HLTDoubletDZ.h"
3 
5 
8 
9 //#include "DataFormats/Candidate/interface/Particle.h"
22 
24 
26 
28 #include <cmath>
29 
30 //
31 // constructors and destructor
32 //
33 template <typename T1, typename T2>
35  : HLTFilter(iConfig),
36  originTag1_(iConfig.template getParameter<std::vector<edm::InputTag>>("originTag1")),
37  originTag2_(iConfig.template getParameter<std::vector<edm::InputTag>>("originTag2")),
38  inputTag1_(iConfig.template getParameter<edm::InputTag>("inputTag1")),
39  inputTag2_(iConfig.template getParameter<edm::InputTag>("inputTag2")),
40  inputToken1_(consumes<trigger::TriggerFilterObjectWithRefs>(inputTag1_)),
41  inputToken2_(consumes<trigger::TriggerFilterObjectWithRefs>(inputTag2_)),
42  //electronToken_ (consumes<reco::ElectronCollection>(iConfig.template getParameter<edm::InputTag>("electronTag"))),
43  triggerType1_(iConfig.template getParameter<int>("triggerType1")),
44  triggerType2_(iConfig.template getParameter<int>("triggerType2")),
45  minDR_(iConfig.template getParameter<double>("MinDR")),
46  maxDZ_(iConfig.template getParameter<double>("MaxDZ")),
47  minPixHitsForDZ_(iConfig.template getParameter<int>("MinPixHitsForDZ")),
48  min_N_(iConfig.template getParameter<int>("MinN")),
49  checkSC_(iConfig.template getParameter<bool>("checkSC")),
50  same_(inputTag1_.encode() == inputTag2_.encode()) // same collections to be compared?
51 {}
52 
53 template <>
55  : HLTFilter(iConfig),
56  originTag1_(iConfig.template getParameter<std::vector<edm::InputTag>>("originTag1")),
57  originTag2_(iConfig.template getParameter<std::vector<edm::InputTag>>("originTag2")),
58  inputTag1_(iConfig.template getParameter<edm::InputTag>("inputTag1")),
59  inputTag2_(iConfig.template getParameter<edm::InputTag>("inputTag2")),
60  inputToken1_(consumes<trigger::TriggerFilterObjectWithRefs>(inputTag1_)),
61  inputToken2_(consumes<trigger::TriggerFilterObjectWithRefs>(inputTag2_)),
62  electronToken_(consumes<reco::ElectronCollection>(iConfig.template getParameter<edm::InputTag>("electronTag"))),
63  triggerType1_(iConfig.template getParameter<int>("triggerType1")),
64  triggerType2_(iConfig.template getParameter<int>("triggerType2")),
65  minDR_(iConfig.template getParameter<double>("MinDR")),
66  maxDZ_(iConfig.template getParameter<double>("MaxDZ")),
67  minPixHitsForDZ_(iConfig.template getParameter<int>("MinPixHitsForDZ")),
68  min_N_(iConfig.template getParameter<int>("MinN")),
69  checkSC_(iConfig.template getParameter<bool>("checkSC")),
70  same_(inputTag1_.encode() == inputTag2_.encode()) // same collections to be compared?
71 {}
72 
73 template <>
75  : HLTFilter(iConfig),
76  originTag1_(iConfig.template getParameter<std::vector<edm::InputTag>>("originTag1")),
77  originTag2_(iConfig.template getParameter<std::vector<edm::InputTag>>("originTag2")),
78  inputTag1_(iConfig.template getParameter<edm::InputTag>("inputTag1")),
79  inputTag2_(iConfig.template getParameter<edm::InputTag>("inputTag2")),
80  inputToken1_(consumes<trigger::TriggerFilterObjectWithRefs>(inputTag1_)),
81  inputToken2_(consumes<trigger::TriggerFilterObjectWithRefs>(inputTag2_)),
82  electronToken_(consumes<reco::ElectronCollection>(iConfig.template getParameter<edm::InputTag>("electronTag"))),
83  triggerType1_(iConfig.template getParameter<int>("triggerType1")),
84  triggerType2_(iConfig.template getParameter<int>("triggerType2")),
85  minDR_(iConfig.template getParameter<double>("MinDR")),
86  maxDZ_(iConfig.template getParameter<double>("MaxDZ")),
87  minPixHitsForDZ_(iConfig.template getParameter<int>("MinPixHitsForDZ")),
88  min_N_(iConfig.template getParameter<int>("MinN")),
89  checkSC_(iConfig.template getParameter<bool>("checkSC")),
90  same_(inputTag1_.encode() == inputTag2_.encode()) // same collections to be compared?
91 {}
92 
93 template <>
95  : HLTFilter(iConfig),
96  originTag1_(iConfig.template getParameter<std::vector<edm::InputTag>>("originTag1")),
97  originTag2_(iConfig.template getParameter<std::vector<edm::InputTag>>("originTag2")),
98  inputTag1_(iConfig.template getParameter<edm::InputTag>("inputTag1")),
99  inputTag2_(iConfig.template getParameter<edm::InputTag>("inputTag2")),
100  inputToken1_(consumes<trigger::TriggerFilterObjectWithRefs>(inputTag1_)),
101  inputToken2_(consumes<trigger::TriggerFilterObjectWithRefs>(inputTag2_)),
102  electronToken_(consumes<reco::ElectronCollection>(iConfig.template getParameter<edm::InputTag>("electronTag"))),
103  triggerType1_(iConfig.template getParameter<int>("triggerType1")),
104  triggerType2_(iConfig.template getParameter<int>("triggerType2")),
105  minDR_(iConfig.template getParameter<double>("MinDR")),
106  maxDZ_(iConfig.template getParameter<double>("MaxDZ")),
107  minPixHitsForDZ_(iConfig.template getParameter<int>("MinPixHitsForDZ")),
108  min_N_(iConfig.template getParameter<int>("MinN")),
109  checkSC_(iConfig.template getParameter<bool>("checkSC")),
110  same_(inputTag1_.encode() == inputTag2_.encode()) // same collections to be compared?
111 {}
112 
113 template <>
115  : HLTFilter(iConfig),
116  originTag1_(iConfig.template getParameter<std::vector<edm::InputTag>>("originTag1")),
117  originTag2_(iConfig.template getParameter<std::vector<edm::InputTag>>("originTag2")),
118  inputTag1_(iConfig.template getParameter<edm::InputTag>("inputTag1")),
119  inputTag2_(iConfig.template getParameter<edm::InputTag>("inputTag2")),
120  inputToken1_(consumes<trigger::TriggerFilterObjectWithRefs>(inputTag1_)),
121  inputToken2_(consumes<trigger::TriggerFilterObjectWithRefs>(inputTag2_)),
122  //electronToken_ (consumes<reco::ElectronCollection>(iConfig.template getParameter<edm::InputTag>("electronTag"))),
123  triggerType1_(iConfig.template getParameter<int>("triggerType1")),
124  triggerType2_(iConfig.template getParameter<int>("triggerType2")),
125  minDR_(iConfig.template getParameter<double>("MinDR")),
126  maxDZ_(iConfig.template getParameter<double>("MaxDZ")),
127  minPixHitsForDZ_(iConfig.template getParameter<int>("MinPixHitsForDZ")),
128  min_N_(iConfig.template getParameter<int>("MinN")),
129  checkSC_(iConfig.template getParameter<bool>("checkSC")),
130  same_(inputTag1_.encode() == inputTag2_.encode()) // same collections to be compared?
131 {}
132 
133 template <>
135  : HLTFilter(iConfig),
136  originTag1_(iConfig.template getParameter<std::vector<edm::InputTag>>("originTag1")),
137  originTag2_(iConfig.template getParameter<std::vector<edm::InputTag>>("originTag2")),
138  inputTag1_(iConfig.template getParameter<edm::InputTag>("inputTag1")),
139  inputTag2_(iConfig.template getParameter<edm::InputTag>("inputTag2")),
140  inputToken1_(consumes<trigger::TriggerFilterObjectWithRefs>(inputTag1_)),
141  inputToken2_(consumes<trigger::TriggerFilterObjectWithRefs>(inputTag2_)),
142  triggerType1_(iConfig.template getParameter<int>("triggerType1")),
143  triggerType2_(iConfig.template getParameter<int>("triggerType2")),
144  minDR_(iConfig.template getParameter<double>("MinDR")),
145  maxDZ_(iConfig.template getParameter<double>("MaxDZ")),
146  minPixHitsForDZ_(iConfig.template getParameter<int>("MinPixHitsForDZ")),
147  min_N_(iConfig.template getParameter<int>("MinN")),
148  checkSC_(iConfig.template getParameter<bool>("checkSC")),
149  same_(inputTag1_.encode() == inputTag2_.encode()) // same collections to be compared?
150 {}
151 
152 template <typename T1, typename T2>
154 
155 template <typename T1, typename T2>
158  makeHLTFilterDescription(desc);
159  std::vector<edm::InputTag> originTag1(1, edm::InputTag("hltOriginal1"));
160  std::vector<edm::InputTag> originTag2(1, edm::InputTag("hltOriginal2"));
161  desc.add<std::vector<edm::InputTag>>("originTag1", originTag1);
162  desc.add<std::vector<edm::InputTag>>("originTag2", originTag2);
163  desc.add<edm::InputTag>("inputTag1", edm::InputTag("hltFiltered1"));
164  desc.add<edm::InputTag>("inputTag2", edm::InputTag("hltFiltered2"));
165  desc.add<int>("triggerType1", 0);
166  desc.add<int>("triggerType2", 0);
167  desc.add<double>("MinDR", -1.0);
168  desc.add<double>("MaxDZ", 0.2);
169  desc.add<int>("MinPixHitsForDZ", 0);
170  desc.add<bool>("checkSC", false);
171  desc.add<int>("MinN", 1);
172  descriptions.add(defaultModuleLabel<HLTDoubletDZ<T1, T2>>(), desc);
173 }
174 
175 template <>
177  edm::ConfigurationDescriptions& descriptions) {
179  makeHLTFilterDescription(desc);
180  std::vector<edm::InputTag> originTag1(1, edm::InputTag("hltOriginal1"));
181  std::vector<edm::InputTag> originTag2(1, edm::InputTag("hltOriginal2"));
182  desc.add<std::vector<edm::InputTag>>("originTag1", originTag1);
183  desc.add<std::vector<edm::InputTag>>("originTag2", originTag2);
184  desc.add<edm::InputTag>("inputTag1", edm::InputTag("hltFiltered1"));
185  desc.add<edm::InputTag>("inputTag2", edm::InputTag("hltFiltered2"));
186  desc.add<edm::InputTag>("electronTag", edm::InputTag("electronTag"));
187  desc.add<int>("triggerType1", 0);
188  desc.add<int>("triggerType2", 0);
189  desc.add<double>("MinDR", -1.0);
190  desc.add<double>("MaxDZ", 0.2);
191  desc.add<int>("MinPixHitsForDZ", 0);
192  desc.add<bool>("checkSC", false);
193  desc.add<int>("MinN", 1);
195 }
196 
197 template <>
199  edm::ConfigurationDescriptions& descriptions) {
201  makeHLTFilterDescription(desc);
202  std::vector<edm::InputTag> originTag1(1, edm::InputTag("hltOriginal1"));
203  std::vector<edm::InputTag> originTag2(1, edm::InputTag("hltOriginal2"));
204  desc.add<std::vector<edm::InputTag>>("originTag1", originTag1);
205  desc.add<std::vector<edm::InputTag>>("originTag2", originTag2);
206  desc.add<edm::InputTag>("inputTag1", edm::InputTag("hltFiltered1"));
207  desc.add<edm::InputTag>("inputTag2", edm::InputTag("hltFiltered2"));
208  desc.add<edm::InputTag>("electronTag", edm::InputTag("electronTag"));
209  desc.add<int>("triggerType1", 0);
210  desc.add<int>("triggerType2", 0);
211  desc.add<double>("MinDR", -1.0);
212  desc.add<double>("MaxDZ", 0.2);
213  desc.add<int>("MinPixHitsForDZ", 0);
214  desc.add<bool>("checkSC", false);
215  desc.add<int>("MinN", 1);
217 }
218 
219 template <>
221  edm::ConfigurationDescriptions& descriptions) {
223  makeHLTFilterDescription(desc);
224  std::vector<edm::InputTag> originTag1(1, edm::InputTag("hltOriginal1"));
225  std::vector<edm::InputTag> originTag2(1, edm::InputTag("hltOriginal2"));
226  desc.add<std::vector<edm::InputTag>>("originTag1", originTag1);
227  desc.add<std::vector<edm::InputTag>>("originTag2", originTag2);
228  desc.add<edm::InputTag>("inputTag1", edm::InputTag("hltFiltered1"));
229  desc.add<edm::InputTag>("inputTag2", edm::InputTag("hltFiltered2"));
230  desc.add<edm::InputTag>("electronTag", edm::InputTag("electronTag"));
231  desc.add<int>("triggerType1", 0);
232  desc.add<int>("triggerType2", 0);
233  desc.add<double>("MinDR", -1.0);
234  desc.add<double>("MaxDZ", 0.2);
235  desc.add<int>("MinPixHitsForDZ", 0);
236  desc.add<bool>("checkSC", false);
237  desc.add<int>("MinN", 1);
239 }
240 
241 template <>
243  edm::ConfigurationDescriptions& descriptions) {
245  makeHLTFilterDescription(desc);
246  std::vector<edm::InputTag> originTag1(1, edm::InputTag("hltOriginal1"));
247  std::vector<edm::InputTag> originTag2(1, edm::InputTag("hltOriginal2"));
248  desc.add<std::vector<edm::InputTag>>("originTag1", originTag1);
249  desc.add<std::vector<edm::InputTag>>("originTag2", originTag2);
250  desc.add<edm::InputTag>("inputTag1", edm::InputTag("hltFiltered1"));
251  desc.add<edm::InputTag>("inputTag2", edm::InputTag("hltFiltered2"));
252  desc.add<int>("triggerType1", 0);
253  desc.add<int>("triggerType2", 0);
254  desc.add<double>("MinDR", -1.0);
255  desc.add<double>("MaxDZ", 0.2);
256  desc.add<int>("MinPixHitsForDZ", 0);
257  desc.add<bool>("checkSC", false);
258  desc.add<int>("MinN", 1);
260 }
261 
262 template <typename T1, typename T2>
263 bool
264 //HLTDoubletDZ<T1, T2>::getCollections(edm::Event& iEvent, std::vector<T1Ref>& coll1, std::vector<T2Ref>& coll2) const {
266  std::vector<T1Ref>& coll1,
267  std::vector<T2Ref>& coll2,
268  trigger::TriggerFilterObjectWithRefs& filterproduct) const {
270  if (iEvent.getByToken(inputToken1_, handle1) and iEvent.getByToken(inputToken2_, handle2)) {
271  // get hold of pre-filtered object collections
272  handle1->getObjects(triggerType1_, coll1);
273  handle2->getObjects(triggerType2_, coll2);
274  const trigger::size_type n1(coll1.size());
275  const trigger::size_type n2(coll2.size());
276 
277  if (saveTags()) {
278  edm::InputTag tagOld;
279  for (unsigned int i = 0; i < originTag1_.size(); ++i) {
280  filterproduct.addCollectionTag(originTag1_[i]);
281  }
282  tagOld = edm::InputTag();
283  for (trigger::size_type i1 = 0; i1 != n1; ++i1) {
284  const edm::ProductID pid(coll1[i1].id());
285  const std::string& label(iEvent.getProvenance(pid).moduleLabel());
286  const std::string& instance(iEvent.getProvenance(pid).productInstanceName());
287  const std::string& process(iEvent.getProvenance(pid).processName());
289  if (tagOld.encode() != tagNew.encode()) {
290  filterproduct.addCollectionTag(tagNew);
291  tagOld = tagNew;
292  }
293  }
294  for (unsigned int i = 0; i < originTag2_.size(); ++i) {
295  filterproduct.addCollectionTag(originTag2_[i]);
296  }
297  tagOld = edm::InputTag();
298  for (trigger::size_type i2 = 0; i2 != n2; ++i2) {
299  const edm::ProductID pid(coll2[i2].id());
300  const std::string& label(iEvent.getProvenance(pid).moduleLabel());
301  const std::string& instance(iEvent.getProvenance(pid).productInstanceName());
302  const std::string& process(iEvent.getProvenance(pid).processName());
304  if (tagOld.encode() != tagNew.encode()) {
305  filterproduct.addCollectionTag(tagNew);
306  tagOld = tagNew;
307  }
308  }
309  }
310 
311  return true;
312  } else
313  return false;
314 }
315 
316 template <typename T1, typename T2>
318  const reco::Candidate& candidate1(*r1);
319  const reco::Candidate& candidate2(*r2);
320  if (reco::deltaR(candidate1, candidate2) < minDR_)
321  return false;
322  if (std::abs(candidate1.vz() - candidate2.vz()) > maxDZ_)
323  return false;
324 
325  return true;
326 }
327 
328 template <>
330  T1Ref& r1,
331  T2Ref& r2) const {
333  iEvent.getByToken(electronToken_, electronHandle_);
334  if (!electronHandle_.isValid())
335  edm::LogError("HLTDoubletDZ") << "HLTDoubletDZ: Electron Handle not valid.";
336 
337  if (reco::deltaR(*r1, *r2) < minDR_)
338  return false;
340  for (auto const& eleIt : *electronHandle_) {
341  if (eleIt.superCluster() == r1->superCluster())
342  e1 = eleIt;
343  }
344 
345  const reco::RecoChargedCandidate& candidate2(*r2);
346  bool skipDZ = false;
347  if (minPixHitsForDZ_ > 0 && (e1.gsfTrack()->hitPattern().numberOfValidPixelHits() < minPixHitsForDZ_ ||
348  candidate2.track()->hitPattern().numberOfValidPixelHits() < minPixHitsForDZ_))
349  skipDZ = true;
350  if (!skipDZ && std::abs(e1.vz() - candidate2.vz()) > maxDZ_)
351  return false;
352 
353  return true;
354 }
355 
356 template <>
358  T1Ref& r1,
359  T2Ref& r2) const {
361  iEvent.getByToken(electronToken_, electronHandle_);
362  if (!electronHandle_.isValid())
363  edm::LogError("HLTDoubletDZ") << "HLTDoubletDZ: Electron Handle not valid.";
364 
365  if (reco::deltaR(*r1, *r2) < minDR_)
366  return false;
367  reco::Electron e2;
368  for (auto const& eleIt : *electronHandle_) {
369  if (eleIt.superCluster() == r2->superCluster())
370  e2 = eleIt;
371  }
372 
373  const reco::RecoChargedCandidate& candidate1(*r1);
374  bool skipDZ = false;
375  if (minPixHitsForDZ_ > 0 && (candidate1.track()->hitPattern().numberOfValidPixelHits() < minPixHitsForDZ_ ||
376  e2.gsfTrack()->hitPattern().numberOfValidPixelHits() < minPixHitsForDZ_))
377  skipDZ = true;
378  if (!skipDZ && std::abs(e2.vz() - candidate1.vz()) > maxDZ_)
379  return false;
380 
381  return true;
382 }
383 
384 template <>
386  T1Ref& r1,
387  T2Ref& r2) const {
389  iEvent.getByToken(electronToken_, electronHandle_);
390  if (!electronHandle_.isValid())
391  edm::LogError("HLTDoubletDZ") << "HLTDoubletDZ: Electron Handle not valid.";
392 
393  if (reco::deltaR(*r1, *r2) < minDR_)
394  return false;
395  reco::Electron e1, e2;
396  for (auto const& eleIt : *electronHandle_) {
397  if (eleIt.superCluster() == r2->superCluster())
398  e2 = eleIt;
399  if (eleIt.superCluster() == r1->superCluster())
400  e1 = eleIt;
401  }
402 
403  bool skipDZ = false;
404  if (minPixHitsForDZ_ > 0 && (e1.gsfTrack()->hitPattern().numberOfValidPixelHits() < minPixHitsForDZ_ ||
405  e2.gsfTrack()->hitPattern().numberOfValidPixelHits() < minPixHitsForDZ_))
406  skipDZ = true;
407  if (!skipDZ && std::abs(e2.vz() - e1.vz()) > maxDZ_)
408  return false;
409 
410  return true;
411 }
412 
413 template <>
415  T1Ref& r1,
416  T2Ref& r2) const {
417  const reco::RecoChargedCandidate& candidate1(*r1);
418  const reco::RecoChargedCandidate& candidate2(*r2);
419  if (reco::deltaR(candidate1, candidate2) < minDR_)
420  return false;
421  bool skipDZ = false;
422  if (minPixHitsForDZ_ > 0 && (candidate1.track()->hitPattern().numberOfValidPixelHits() < minPixHitsForDZ_ ||
423  candidate2.track()->hitPattern().numberOfValidPixelHits() < minPixHitsForDZ_))
424  skipDZ = true;
425  if (!skipDZ && std::abs(candidate1.vz() - candidate2.vz()) > maxDZ_)
426  return false;
427 
428  return true;
429 }
430 
431 template <>
434  l1t::TkMuonRef& r2) const {
435  const l1t::TkMuon& candidate1(*r1);
436  const l1t::TkMuon& candidate2(*r2);
437  if (reco::deltaR(candidate1, candidate2) < minDR_)
438  return false;
439 
440  // We don't care about minPixHitsForDZ_ with the L1TkMuons,
441  // especially because the pixel does not participate in the L1T
442  if (std::abs(candidate1.trkzVtx() - candidate2.trkzVtx()) > maxDZ_)
443  return false;
444 
445  return true;
446 }
447 
448 template <>
451  l1t::HPSPFTauRef& r2) const {
452  const l1t::HPSPFTau& candidate1(*r1);
453  const l1t::HPSPFTau& candidate2(*r2);
454  if (reco::deltaR(candidate1, candidate2) < minDR_)
455  return false;
456 
457  // We don't care about minPixHitsForDZ_ with the L1HPSPFTaus,
458  // especially because the pixel does not participate in the L1T
459  if (std::abs(candidate1.leadChargedPFCand()->pfTrack()->vertex().z() -
460  candidate2.leadChargedPFCand()->pfTrack()->vertex().z()) > maxDZ_)
461  return false;
462 
463  return true;
464 }
465 
466 // ------------ method called to produce the data ------------
467 template <typename T1, typename T2>
469  const edm::EventSetup& iSetup,
470  trigger::TriggerFilterObjectWithRefs& filterproduct) const {
471  // All HLT filters must create and fill an HLT filter object,
472  // recording any reconstructed physics objects satisfying (or not)
473  // this HLT filter, and place it in the Event.
474  bool accept(false);
475 
476  std::vector<T1Ref> coll1;
477  std::vector<T2Ref> coll2;
478 
479  if (getCollections(iEvent, coll1, coll2, filterproduct)) {
480  int n(0);
481  T1Ref r1;
482  T2Ref r2;
483 
484  for (unsigned int i1 = 0; i1 != coll1.size(); i1++) {
485  r1 = coll1[i1];
486  //const reco::Candidate& candidate1(*r1);
487  unsigned int I(0);
488  if (same_) {
489  I = i1 + 1;
490  }
491  for (unsigned int i2 = I; i2 != coll2.size(); i2++) {
492  r2 = coll2[i2];
493  if (checkSC_) {
494  if (r1->superCluster().isNonnull() && r2->superCluster().isNonnull()) {
495  if (r1->superCluster() == r2->superCluster())
496  continue;
497  }
498  }
499 
500  if (!computeDZ(iEvent, r1, r2))
501  continue;
502 
503  n++;
504  filterproduct.addObject(triggerType1_, r1);
505  filterproduct.addObject(triggerType2_, r2);
506  }
507  }
508 
509  accept = accept || (n >= min_N_);
510  }
511 
512  return accept;
513 }
514 
518 template <>
520  const edm::EventSetup& iSetup,
521  trigger::TriggerFilterObjectWithRefs& filterproduct) const {
522  // All HLT filters must create and fill an HLT filter object,
523  // recording any reconstructed physics objects satisfying (or not)
524  // this HLT filter, and place it in the Event.
525  bool accept(false);
526 
527  std::vector<l1t::TkMuonRef> coll1;
528  std::vector<l1t::TkMuonRef> coll2;
529 
530  if (getCollections(iEvent, coll1, coll2, filterproduct)) {
531  int n(0);
534 
535  for (unsigned int i1 = 0; i1 != coll1.size(); i1++) {
536  r1 = coll1[i1];
537  unsigned int I(0);
538  if (same_) {
539  I = i1 + 1;
540  }
541  for (unsigned int i2 = I; i2 != coll2.size(); i2++) {
542  r2 = coll2[i2];
543 
544  if (!computeDZ(iEvent, r1, r2))
545  continue;
546 
547  n++;
548  filterproduct.addObject(triggerType1_, r1);
549  filterproduct.addObject(triggerType2_, r2);
550  }
551  }
552 
553  accept = accept || (n >= min_N_);
554  }
555 
556  return accept;
557 }
558 
562 template <>
564  const edm::EventSetup& iSetup,
565  trigger::TriggerFilterObjectWithRefs& filterproduct) const {
566  // All HLT filters must create and fill an HLT filter object,
567  // recording any reconstructed physics objects satisfying (or not)
568  // this HLT filter, and place it in the Event.
569  bool accept(false);
570 
571  std::vector<l1t::PFTauRef> coll1;
572  std::vector<l1t::PFTauRef> coll2;
573 
574  if (getCollections(iEvent, coll1, coll2, filterproduct)) {
575  int n(0);
578 
579  for (unsigned int i1 = 0; i1 != coll1.size(); i1++) {
580  r1 = coll1[i1];
581  unsigned int I(0);
582  if (same_) {
583  I = i1 + 1;
584  }
585  for (unsigned int i2 = I; i2 != coll2.size(); i2++) {
586  r2 = coll2[i2];
587 
588  if (!computeDZ(iEvent, r1, r2))
589  continue;
590 
591  n++;
592  filterproduct.addObject(triggerType1_, r1);
593  filterproduct.addObject(triggerType2_, r2);
594  }
595  }
596 
597  accept = accept || (n >= min_N_);
598  }
599 
600  return accept;
601 }
602 
606 template <>
608  const edm::EventSetup& iSetup,
609  trigger::TriggerFilterObjectWithRefs& filterproduct) const {
610  // All HLT filters must create and fill an HLT filter object,
611  // recording any reconstructed physics objects satisfying (or not)
612  // this HLT filter, and place it in the Event.
613  bool accept(false);
614 
615  std::vector<l1t::HPSPFTauRef> coll1;
616  std::vector<l1t::HPSPFTauRef> coll2;
617 
618  if (getCollections(iEvent, coll1, coll2, filterproduct)) {
619  int n(0);
622 
623  for (unsigned int i1 = 0; i1 != coll1.size(); i1++) {
624  r1 = coll1[i1];
625  unsigned int I(0);
626  if (same_) {
627  I = i1 + 1;
628  }
629  for (unsigned int i2 = I; i2 != coll2.size(); i2++) {
630  r2 = coll2[i2];
631 
632  if (!computeDZ(iEvent, r1, r2))
633  continue;
634 
635  n++;
636  filterproduct.addObject(triggerType1_, r1);
637  filterproduct.addObject(triggerType2_, r2);
638  }
639  }
640 
641  accept = accept || (n >= min_N_);
642  }
643 
644  return accept;
645 }
646 
656 
defaultModuleLabel.h
trigger::TriggerRefsCollections::addObject
void addObject(int id, const reco::RecoEcalCandidateRef &ref)
setters for L3 collections: (id=physics type, and Ref<C>)
Definition: TriggerRefsCollections.h:302
trigger::TriggerFilterObjectWithRefs
Definition: TriggerFilterObjectWithRefs.h:35
reco::RecoChargedCandidate::track
reco::TrackRef track() const override
reference to a track
Definition: RecoChargedCandidate.cc:9
testProducerWithPsetDescEmpty_cfi.i2
i2
Definition: testProducerWithPsetDescEmpty_cfi.py:46
Handle.h
electrons_cff.bool
bool
Definition: electrons_cff.py:372
mps_fire.i
i
Definition: mps_fire.py:355
edm::ParameterSetDescription::add
ParameterDescriptionBase * add(U const &iLabel, T const &value)
Definition: ParameterSetDescription.h:95
reco::Electron::gsfTrack
reco::GsfTrackRef gsfTrack() const override
reference to a GsfTrack
MessageLogger.h
dqmiodumpmetadata.n
n
Definition: dqmiodumpmetadata.py:28
HLTDoubletDZ::~HLTDoubletDZ
~HLTDoubletDZ() override
Definition: HLTDoubletDZ.cc:153
PFTau.h
HLT2L1PFTauL1PFTauDZ
HLTDoubletDZ< l1t::PFTau, l1t::PFTau > HLT2L1PFTauL1PFTauDZ
Definition: HLTDoubletDZ.cc:654
edm
HLT enums.
Definition: AlignableModifier.h:19
testProducerWithPsetDescEmpty_cfi.i1
i1
Definition: testProducerWithPsetDescEmpty_cfi.py:45
edm::ParameterSetDescription
Definition: ParameterSetDescription.h:52
trigger::TriggerFilterObjectWithRefs::addCollectionTag
void addCollectionTag(const edm::InputTag &collectionTag)
collectionTags
Definition: TriggerFilterObjectWithRefs.h:55
reco::LeafCandidate::vz
double vz() const override
z coordinate of vertex position
Definition: LeafCandidate.h:171
HLTDoubletDZ::getCollections
bool getCollections(edm::Event &iEvent, std::vector< T1Ref > &coll1, std::vector< T2Ref > &coll2, trigger::TriggerFilterObjectWithRefs &filterproduct) const
Definition: HLTDoubletDZ.cc:265
HLT_2018_cff.originTag2
originTag2
Definition: HLT_2018_cff.py:18107
TriggerFilterObjectWithRefs.h
reco
fixed size matrix
Definition: AlignmentAlgorithmBase.h:45
HLTDoubletDZ
Definition: HLTDoubletDZ.h:27
reco::Electron
Definition: Electron.h:16
HLTDoubletDZ::HLTDoubletDZ
HLTDoubletDZ(const edm::ParameterSet &)
Definition: HLTDoubletDZ.cc:34
edm::Handle< trigger::TriggerFilterObjectWithRefs >
HLTDoubletDZ::fillDescriptions
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
Definition: HLTDoubletDZ.cc:156
trigger::TriggerRefsCollections::getObjects
void getObjects(Vids &ids, VRphoton &refs) const
various physics-level getters:
Definition: TriggerRefsCollections.h:593
HLTFilter
Definition: HLTFilter.h:28
edm::Ref
Definition: AssociativeIterator.h:58
l1t::TkMuon::trkzVtx
float trkzVtx() const
Definition: TkMuon.h:42
TkMuon.h
deltaR.h
accept
bool accept(const edm::Event &event, const edm::TriggerResults &triggerTable, const std::string &triggerPath)
Definition: TopDQMHelpers.h:30
MakerMacros.h
trigger::size_type
uint16_t size_type
Definition: TriggerTypeDefs.h:18
DEFINE_FWK_MODULE
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:16
Exhume::I
const std::complex< double > I
Definition: I.h:8
edm::ConfigurationDescriptions::add
void add(std::string const &label, ParameterSetDescription const &psetDescription)
Definition: ConfigurationDescriptions.cc:57
HPSPFTauFwd.h
edm::ConfigurationDescriptions
Definition: ConfigurationDescriptions.h:28
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
BeamBkgSkim_cff.saveTags
saveTags
Definition: BeamBkgSkim_cff.py:9
ElectronFwd.h
HLT2MuonMuonDZ
HLTDoubletDZ< reco::RecoChargedCandidate, reco::RecoChargedCandidate > HLT2MuonMuonDZ
Definition: HLTDoubletDZ.cc:648
HLT_2018_cff.InputTag
InputTag
Definition: HLT_2018_cff.py:79016
edm::ParameterSet
Definition: ParameterSet.h:36
edm::LogError
Definition: MessageLogger.h:183
defaultModuleLabel
std::string defaultModuleLabel()
Definition: defaultModuleLabel.h:16
LaserDQM_cfg.process
process
Definition: LaserDQM_cfg.py:3
HLT2ElectronElectronDZ
HLTDoubletDZ< reco::Electron, reco::Electron > HLT2ElectronElectronDZ
Definition: HLTDoubletDZ.cc:647
StorageManager_cfg.e1
e1
Definition: StorageManager_cfg.py:16
diffTwoXMLs.r2
r2
Definition: diffTwoXMLs.py:73
createfilelist.int
int
Definition: createfilelist.py:10
l1t::HPSPFTau
Definition: HPSPFTau.h:14
iEvent
int iEvent
Definition: GenABIO.cc:224
edm::InputTag::encode
std::string encode() const
Definition: InputTag.cc:159
reco::RecoChargedCandidate
Definition: RecoChargedCandidate.h:15
edm::EventSetup
Definition: EventSetup.h:57
svgfig.template
def template(fileName, svg, replaceme="REPLACEME")
Definition: svgfig.py:521
HLT2ElectronMuonDZ
HLTDoubletDZ< reco::Electron, reco::RecoChargedCandidate > HLT2ElectronMuonDZ
Definition: HLTDoubletDZ.cc:649
l1t::TkMuon
Definition: TkMuon.h:13
HLT2MuonPhotonDZ
HLTDoubletDZ< reco::RecoChargedCandidate, reco::RecoEcalCandidate > HLT2MuonPhotonDZ
Definition: HLTDoubletDZ.cc:651
reco::ElectronCollection
std::vector< Electron > ElectronCollection
collectin of Electron objects
Definition: ElectronFwd.h:9
instance
static PFTauRenderPlugin instance
Definition: PFTauRenderPlugin.cc:70
reco::Candidate
Definition: Candidate.h:27
HPSPFTau.h
Electron.h
std
Definition: JetResolutionObject.h:76
Ref.h
RecoEcalCandidate.h
RecoChargedCandidate.h
diffTwoXMLs.r1
r1
Definition: diffTwoXMLs.py:53
HLT2PhotonMuonDZ
HLTDoubletDZ< reco::RecoEcalCandidate, reco::RecoChargedCandidate > HLT2PhotonMuonDZ
Definition: HLTDoubletDZ.cc:652
alcaDQMUpload.encode
def encode(args, files)
Definition: alcaDQMUpload.py:32
HLTDoubletDZ::hltFilter
bool hltFilter(edm::Event &, const edm::EventSetup &, trigger::TriggerFilterObjectWithRefs &filterproduct) const override
Definition: HLTDoubletDZ.cc:468
l1t::HPSPFTau::leadChargedPFCand
const l1t::PFCandidateRef & leadChargedPFCand() const
Definition: HPSPFTau.h:28
reco::Candidate::vz
virtual double vz() const =0
z coordinate of vertex position
reco::deltaR
constexpr auto deltaR(const T1 &t1, const T2 &t2) -> decltype(t1.eta())
Definition: deltaR.h:30
RecoEcalCandidateFwd.h
trigger
Definition: HLTPrescaleTableCond.h:8
HLT2PhotonPhotonDZ
HLTDoubletDZ< reco::RecoEcalCandidate, reco::RecoEcalCandidate > HLT2PhotonPhotonDZ
Definition: HLTDoubletDZ.cc:650
HLTDoubletDZ::computeDZ
bool computeDZ(edm::Event &iEvent, T1Ref &c1, T2Ref &c2) const
Definition: HLTDoubletDZ.cc:317
funct::abs
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
ParameterSet.h
HLT2L1HPSPFTauL1HPSPFTauDZ
HLTDoubletDZ< l1t::HPSPFTau, l1t::HPSPFTau > HLT2L1HPSPFTauL1HPSPFTauDZ
Definition: HLTDoubletDZ.cc:655
edm::HandleBase::isValid
bool isValid() const
Definition: HandleBase.h:70
edm::Event
Definition: Event.h:73
RecoChargedCandidateFwd.h
TkMuonFwd.h
edm::InputTag
Definition: InputTag.h:15
label
const char * label
Definition: PFTauDecayModeTools.cc:11
HLTDoubletDZ.h
edm::ProductID
Definition: ProductID.h:27
HLT_2018_cff.originTag1
originTag1
Definition: HLT_2018_cff.py:18110
HLT2L1TkMuonL1TkMuonDZ
HLTDoubletDZ< l1t::TkMuon, l1t::TkMuon > HLT2L1TkMuonL1TkMuonDZ
Definition: HLTDoubletDZ.cc:653