CMS 3D CMS Logo

L1TMuonProducer.cc
Go to the documentation of this file.
1 // -*- C++ -*-
2 //
3 // Package: L1TMuonProducer
4 // Class: L1TMuonProducer
5 //
13 //
14 // Original Author: Joschka Philip Lingemann,40 3-B01,+41227671598,
15 // Created: Thu Oct 3 16:31:34 CEST 2013
16 // $Id$
17 //
18 //
19 
20 // system include files
21 #include <memory>
22 #include <fstream>
23 
24 // user include files
29 
32 
35 
42 
46 
52 
53 #include "TMath.h"
54 //
55 // class declaration
56 //
57 using namespace l1t;
58 
60 public:
61  explicit L1TMuonProducer(const edm::ParameterSet&);
62  ~L1TMuonProducer() override;
63 
64  static void fillDescriptions(edm::ConfigurationDescriptions& descriptions);
65 
66 private:
67  void produce(edm::Event&, const edm::EventSetup&) override;
68 
69  void beginRun(edm::Run const&, edm::EventSetup const&) override;
70  void endRun(edm::Run const&, edm::EventSetup const&) override;
71  void beginLuminosityBlock(edm::LuminosityBlock const&, edm::EventSetup const&) override;
72  void endLuminosityBlock(edm::LuminosityBlock const&, edm::EventSetup const&) override;
73 
74  static bool compareMuons(const std::shared_ptr<MicroGMTConfiguration::InterMuon>& mu1,
75  const std::shared_ptr<MicroGMTConfiguration::InterMuon>& mu2);
76 
77  void sortMuons(MicroGMTConfiguration::InterMuonList&, unsigned) const;
78 
79  void calculateRank(MicroGMTConfiguration::InterMuonList& muons) const;
80 
81  void splitAndConvertMuons(edm::Handle<MicroGMTConfiguration::InputCollection> const& in,
84  GMTInternalWedges& wedges_pos,
85  GMTInternalWedges& wedges_neg,
86  int bx) const;
87 
90  GMTInternalWedges& wedges,
91  int bx) const;
92 
93  void addMuonsToCollections(MicroGMTConfiguration::InterMuonList& coll,
95  std::unique_ptr<MuonBxCollection>& out,
96  int bx) const;
97 
98  // ----------member data ---------------------------
100  int m_bxMin;
101  int m_bxMax;
103  std::bitset<72> m_inputsToDisable;
104  std::bitset<28> m_caloInputsToDisable;
105  std::bitset<12> m_bmtfInputsToDisable;
106  std::bitset<12> m_omtfInputsToDisable;
107  std::bitset<12> m_emtfInputsToDisable;
108  std::bitset<72> m_maskedInputs;
109  std::bitset<28> m_maskedCaloInputs;
110  std::bitset<12> m_maskedBmtfInputs;
111  std::bitset<12> m_maskedOmtfInputs;
112  std::bitset<12> m_maskedEmtfInputs;
113  std::unique_ptr<L1TMuonGlobalParamsHelper> microGMTParamsHelper;
118  std::shared_ptr<MicroGMTRankPtQualLUT> m_rankPtQualityLUT;
121  std::ofstream m_debugOut;
124 
131 };
132 
133 //
134 // constants, enums and typedefs
135 //
136 
137 //
138 // static data member definitions
139 //
140 
141 //
142 // constructors and destructor
143 //
145  : m_debugOut("test/debug/iso_debug.dat"),
146  m_bmtfCancelMode(cancelmode::tracks),
147  m_emtfCancelMode(cancelmode::coordinate) {
148  // edm::InputTag barrelTfInputTag = iConfig.getParameter<edm::InputTag>("barrelTFInput");
149  // edm::InputTag overlapTfInputTag = iConfig.getParameter<edm::InputTag>("overlapTFInput");
150  // edm::InputTag forwardTfInputTag = iConfig.getParameter<edm::InputTag>("forwardTFInput");
151 
152  m_barrelTfInputTag = iConfig.getParameter<edm::InputTag>("barrelTFInput");
153  m_overlapTfInputTag = iConfig.getParameter<edm::InputTag>("overlapTFInput");
154  m_endcapTfInputTag = iConfig.getParameter<edm::InputTag>("forwardTFInput");
155  m_trigTowerTag = iConfig.getParameter<edm::InputTag>("triggerTowerInput");
156 
157  m_autoBxRange = iConfig.getParameter<bool>("autoBxRange");
158  m_bxMin = iConfig.getParameter<int>("bxMin");
159  m_bxMax = iConfig.getParameter<int>("bxMax");
160 
161  m_autoCancelMode = iConfig.getParameter<bool>("autoCancelMode");
162  if (!m_autoCancelMode) {
163  if (iConfig.getParameter<std::string>("bmtfCancelMode").find("kftracks") == 0) {
165  }
166  if (iConfig.getParameter<std::string>("emtfCancelMode").find("tracks") == 0) {
168  }
169  }
170 
171  m_barrelTfInputToken = consumes<MicroGMTConfiguration::InputCollection>(m_barrelTfInputTag);
172  m_overlapTfInputToken = consumes<MicroGMTConfiguration::InputCollection>(m_overlapTfInputTag);
173  m_endcapTfInputToken = consumes<MicroGMTConfiguration::InputCollection>(m_endcapTfInputTag);
174  m_caloTowerInputToken = consumes<MicroGMTConfiguration::CaloInputCollection>(m_trigTowerTag);
175  m_microGMTParamsToken = esConsumes<L1TMuonGlobalParams, L1TMuonGlobalParamsRcd, edm::Transition::BeginRun>();
176  m_o2oProtoToken = esConsumes<L1TMuonGlobalParams, L1TMuonGlobalParamsO2ORcd, edm::Transition::BeginRun>();
177 
178  //register your products
179  produces<MuonBxCollection>();
180  produces<MuonBxCollection>("imdMuonsBMTF");
181  produces<MuonBxCollection>("imdMuonsEMTFPos");
182  produces<MuonBxCollection>("imdMuonsEMTFNeg");
183  produces<MuonBxCollection>("imdMuonsOMTFPos");
184  produces<MuonBxCollection>("imdMuonsOMTFNeg");
185 }
186 
188 
189 //
190 // member functions
191 //
192 
193 // ------------ method called to produce the data ------------
195  using namespace edm;
196  std::unique_ptr<MuonBxCollection> outMuons(new MuonBxCollection());
197  std::unique_ptr<MuonBxCollection> imdMuonsBMTF(new MuonBxCollection());
198  std::unique_ptr<MuonBxCollection> imdMuonsEMTFPos(new MuonBxCollection());
199  std::unique_ptr<MuonBxCollection> imdMuonsEMTFNeg(new MuonBxCollection());
200  std::unique_ptr<MuonBxCollection> imdMuonsOMTFPos(new MuonBxCollection());
201  std::unique_ptr<MuonBxCollection> imdMuonsOMTFNeg(new MuonBxCollection());
202 
207 
208  iEvent.getByToken(m_barrelTfInputToken, bmtfMuons);
209  iEvent.getByToken(m_endcapTfInputToken, emtfMuons);
210  iEvent.getByToken(m_overlapTfInputToken, omtfMuons);
211  iEvent.getByToken(m_caloTowerInputToken, trigTowers);
212 
213  // find out the BX range from the inputs
214  // the smallest BX window defines the output BX window
215  if (m_autoBxRange) {
216  int bxMin = -1000;
217  int bxMax = 1000;
218  if (!(m_caloInputsToDisable.all() || m_maskedCaloInputs.all())) {
219  bxMin = std::max(bxMin, trigTowers->getFirstBX());
220  bxMax = std::min(bxMax, trigTowers->getLastBX());
221  }
222  if (!(m_bmtfInputsToDisable.all() || m_maskedBmtfInputs.all())) {
223  bxMin = std::max(bxMin, bmtfMuons->getFirstBX());
224  bxMax = std::min(bxMax, bmtfMuons->getLastBX());
225  }
226  if (!(m_omtfInputsToDisable.all() || m_maskedOmtfInputs.all())) {
227  bxMin = std::max(bxMin, omtfMuons->getFirstBX());
228  bxMax = std::min(bxMax, omtfMuons->getLastBX());
229  }
230  if (!(m_emtfInputsToDisable.all() || m_maskedEmtfInputs.all())) {
231  bxMin = std::max(bxMin, emtfMuons->getFirstBX());
232  bxMax = std::min(bxMax, emtfMuons->getLastBX());
233  }
234  if (bxMin > 0) {
235  bxMin = 0;
236  }
237  if (bxMax < 0) {
238  bxMax = 0;
239  }
240  if (bxMin > -1000) {
241  m_bxMin = bxMin;
242  } else {
243  m_bxMin = 0;
244  }
245  if (bxMax < 1000) {
246  m_bxMax = bxMax;
247  } else {
248  m_bxMax = 0;
249  }
250  }
251 
252  // set BX range for outputs
253  outMuons->setBXRange(m_bxMin, m_bxMax);
254  imdMuonsBMTF->setBXRange(m_bxMin, m_bxMax);
255  imdMuonsEMTFPos->setBXRange(m_bxMin, m_bxMax);
256  imdMuonsEMTFNeg->setBXRange(m_bxMin, m_bxMax);
257  imdMuonsOMTFPos->setBXRange(m_bxMin, m_bxMax);
258  imdMuonsOMTFNeg->setBXRange(m_bxMin, m_bxMax);
259 
260  for (int bx = m_bxMin; bx <= m_bxMax; ++bx) {
261  m_isolationUnit.setTowerSums(*trigTowers, bx);
262  MicroGMTConfiguration::InterMuonList internMuonsBmtf;
263  MicroGMTConfiguration::InterMuonList internMuonsEmtfPos;
264  MicroGMTConfiguration::InterMuonList internMuonsEmtfNeg;
265  MicroGMTConfiguration::InterMuonList internMuonsOmtfPos;
266  MicroGMTConfiguration::InterMuonList internMuonsOmtfNeg;
267 
268  // These wedges contain shared pointers to the ones in the InterMuonList
269  GMTInternalWedges omtfNegWedges;
270  GMTInternalWedges bmtfWedges;
271  GMTInternalWedges emtfPosWedges;
272  GMTInternalWedges emtfNegWedges;
273  GMTInternalWedges omtfPosWedges;
274 
275  // this converts the InputMuon type to the InternalMuon type and splits them into
276  // positive / negative eta collections necessary as LUTs may differ for pos / neg.
277  convertMuons(bmtfMuons, internMuonsBmtf, bmtfWedges, bx);
278  splitAndConvertMuons(emtfMuons, internMuonsEmtfPos, internMuonsEmtfNeg, emtfPosWedges, emtfNegWedges, bx);
279  splitAndConvertMuons(omtfMuons, internMuonsOmtfPos, internMuonsOmtfNeg, omtfPosWedges, omtfNegWedges, bx);
280 
281  // cancel out within the track finders:
287 
288  // cancel out between track finder acceptance overlaps:
293 
294  m_isolationUnit.extrapolateMuons(internMuonsBmtf);
295  m_isolationUnit.extrapolateMuons(internMuonsEmtfNeg);
296  m_isolationUnit.extrapolateMuons(internMuonsEmtfPos);
297  m_isolationUnit.extrapolateMuons(internMuonsOmtfNeg);
298  m_isolationUnit.extrapolateMuons(internMuonsOmtfPos);
299 
300  // the rank calculated here is used in the sort below
301  calculateRank(internMuonsBmtf);
302  calculateRank(internMuonsEmtfNeg);
303  calculateRank(internMuonsEmtfPos);
304  calculateRank(internMuonsOmtfNeg);
305  calculateRank(internMuonsOmtfPos);
306 
307  // The sort function both sorts and removes all but best "nSurvivors"
308  sortMuons(internMuonsBmtf, 8);
309  sortMuons(internMuonsOmtfPos, 4);
310  sortMuons(internMuonsOmtfNeg, 4);
311  sortMuons(internMuonsEmtfPos, 4);
312  sortMuons(internMuonsEmtfNeg, 4);
313 
314  // This combines the 5 streams into one InternalMuon collection for
315  // the final global sort.
317  addMuonsToCollections(internMuonsEmtfPos, internalMuons, imdMuonsEMTFPos, bx);
318  addMuonsToCollections(internMuonsOmtfPos, internalMuons, imdMuonsOMTFPos, bx);
319  addMuonsToCollections(internMuonsBmtf, internalMuons, imdMuonsBMTF, bx);
320  addMuonsToCollections(internMuonsOmtfNeg, internalMuons, imdMuonsOMTFNeg, bx);
321  addMuonsToCollections(internMuonsEmtfNeg, internalMuons, imdMuonsEMTFNeg, bx);
322 
323  // sort internal muons and delete all but best 8
324  sortMuons(internalMuons, 8);
325 
326  m_isolationUnit.isolatePreSummed(internalMuons);
327  // copy muons to output collection...
328  for (const auto& mu : internalMuons) {
329  if (mu->hwPt() > 0) {
331  (mu->hwPt() - 1) * 0.5, mu->hwEta() * 0.010875, mu->hwGlobalPhi() * 0.010908, 0.0};
332  int iso = mu->hwAbsIso() + (mu->hwRelIso() << 1);
333  int outMuQual = MicroGMTConfiguration::setOutputMuonQuality(mu->hwQual(), mu->trackFinderType(), mu->hwHF());
334  Muon outMu{vec,
335  mu->hwPt(),
336  mu->hwEta(),
337  mu->hwGlobalPhi(),
338  outMuQual,
339  mu->hwSign(),
340  mu->hwSignValid(),
341  iso,
342  mu->tfMuonIndex(),
343  0,
344  true,
345  mu->hwIsoSum(),
346  mu->hwDPhi(),
347  mu->hwDEta(),
348  mu->hwRank()};
349 
350  // Set coordinates at the vertex
351  outMu.setHwEtaAtVtx(MicroGMTConfiguration::calcMuonHwEtaExtra(outMu));
352  outMu.setHwPhiAtVtx(MicroGMTConfiguration::calcMuonHwPhiExtra(outMu));
353  outMu.setEtaAtVtx(MicroGMTConfiguration::calcMuonEtaExtra(outMu));
354  outMu.setPhiAtVtx(MicroGMTConfiguration::calcMuonPhiExtra(outMu));
355 
356  // Set displacement information
357  int hwPtUnconstrained{mu->hwPtUnconstrained()};
358  outMu.setPtUnconstrained(hwPtUnconstrained == 0 ? 0
359  : (hwPtUnconstrained - 1) * 0.5); // Don't want negative pT.
360  outMu.setHwPtUnconstrained(hwPtUnconstrained);
361  outMu.setHwDXY(mu->hwDXY());
362 
363  if (mu->hwSignValid()) {
364  outMu.setCharge(1 - 2 * mu->hwSign());
365  } else {
366  outMu.setCharge(0);
367  }
368  m_debugOut << mu->hwCaloPhi() << " " << mu->hwCaloEta() << std::endl;
369  outMuons->push_back(bx, outMu);
370  }
371  }
372  }
373 
374  iEvent.put(std::move(outMuons));
375  iEvent.put(std::move(imdMuonsBMTF), "imdMuonsBMTF");
376  iEvent.put(std::move(imdMuonsEMTFPos), "imdMuonsEMTFPos");
377  iEvent.put(std::move(imdMuonsEMTFNeg), "imdMuonsEMTFNeg");
378  iEvent.put(std::move(imdMuonsOMTFPos), "imdMuonsOMTFPos");
379  iEvent.put(std::move(imdMuonsOMTFNeg), "imdMuonsOMTFNeg");
380 }
381 
382 bool L1TMuonProducer::compareMuons(const std::shared_ptr<MicroGMTConfiguration::InterMuon>& mu1,
383  const std::shared_ptr<MicroGMTConfiguration::InterMuon>& mu2) {
384  return (mu1->hwWins() >= mu2->hwWins());
385 }
386 
388  MicroGMTConfiguration::InterMuonList::iterator mu1;
389  // reset from previous sort stage
390  for (mu1 = muons.begin(); mu1 != muons.end(); ++mu1) {
391  (*mu1)->setHwWins(0);
392  }
393 
394  int nCancelled = 0;
395  for (mu1 = muons.begin(); mu1 != muons.end(); ++mu1) {
396  int mu1CancelBit = (*mu1)->hwCancelBit();
397  nCancelled += mu1CancelBit;
398  auto mu2 = mu1;
399  mu2++;
400  for (; mu2 != muons.end(); ++mu2) {
401  if (mu1CancelBit != 1 && (*mu2)->hwCancelBit() != 1) {
402  if ((*mu1)->hwRank() >= (*mu2)->hwRank()) {
403  (*mu1)->increaseWins();
404  } else {
405  (*mu2)->increaseWins();
406  }
407  } else if (mu1CancelBit != 1) {
408  (*mu1)->increaseWins();
409  } else if ((*mu2)->hwCancelBit() != 1) {
410  (*mu2)->increaseWins();
411  }
412  }
413  }
414 
415  size_t nMuonsBefore = muons.size();
416  int minWins = nMuonsBefore - nSurvivors;
417 
418  // remove all muons that were cancelled or that do not have sufficient rank
419  // (reduces the container size to nSurvivors)
420  muons.remove_if([&minWins](auto muon) { return ((muon->hwWins() < minWins) || (muon->hwCancelBit() == 1)); });
422 }
423 
425  for (auto& mu1 : muons) {
426  int rank = m_rankPtQualityLUT->lookup(mu1->hwPt(), mu1->hwQual());
427  mu1->setHwRank(rank);
428  }
429 }
430 
433  std::unique_ptr<MuonBxCollection>& out,
434  int bx) const {
435  for (auto& mu : coll) {
436  interout.push_back(mu);
437  math::PtEtaPhiMLorentzVector vec{(mu->hwPt() - 1) * 0.5, mu->hwEta() * 0.010875, mu->hwGlobalPhi() * 0.010908, 0.0};
438  int outMuQual = MicroGMTConfiguration::setOutputMuonQuality(mu->hwQual(), mu->trackFinderType(), mu->hwHF());
439  // set tfMuonIndex and iso to 0 like in the FW
440  Muon outMu{vec,
441  mu->hwPt(),
442  mu->hwEta(),
443  mu->hwGlobalPhi(),
444  outMuQual,
445  mu->hwSign(),
446  mu->hwSignValid(),
447  0,
448  0,
449  0,
450  true,
451  0,
452  mu->hwDPhi(),
453  mu->hwDEta(),
454  mu->hwRank()};
455 
456  int hwPtUnconstrained{mu->hwPtUnconstrained()};
457  outMu.setPtUnconstrained(hwPtUnconstrained == 0 ? 0 : (hwPtUnconstrained - 1) * 0.5); // Don't want negative pT.
458  outMu.setHwPtUnconstrained(hwPtUnconstrained);
459  outMu.setHwDXY(mu->hwDXY());
460 
461  if (mu->hwSignValid()) {
462  outMu.setCharge(1 - 2 * mu->hwSign());
463  } else {
464  outMu.setCharge(0);
465  }
466 
467  out->push_back(bx, outMu);
468  }
469 }
470 
474  GMTInternalWedges& wedges_pos,
475  GMTInternalWedges& wedges_neg,
476  int bx) const {
477  // initialize the wedge collections:
478  for (int i = 0; i < 6; ++i) {
479  wedges_pos[i] = std::vector<std::shared_ptr<GMTInternalMuon>>();
480  wedges_pos[i].reserve(3);
481  wedges_neg[i] = std::vector<std::shared_ptr<GMTInternalMuon>>();
482  wedges_neg[i].reserve(3);
483  }
484  if (bx < in->getFirstBX() || bx > in->getLastBX())
485  return;
486  int muIdx = 0;
487  int currentLink = 0;
488  for (size_t i = 0; i < in->size(bx); ++i, ++muIdx) {
489  if (in->at(bx, i).hwPt() > 0) {
490  int link = in->at(bx, i).link();
491  if (m_inputsToDisable.test(link) || m_maskedInputs.test(link)) {
492  continue; // only process if input link is enabled and not masked
493  }
494  if (currentLink != link) {
495  muIdx = 0;
496  currentLink = link;
497  }
498  int gPhi = MicroGMTConfiguration::calcGlobalPhi(
499  in->at(bx, i).hwPhi(), in->at(bx, i).trackFinderType(), in->at(bx, i).processor());
500  int tfMuonIdx = 3 * (currentLink - 36) + muIdx;
501  std::shared_ptr<GMTInternalMuon> out = std::make_shared<GMTInternalMuon>(in->at(bx, i), gPhi, tfMuonIdx);
502  if (in->at(bx, i).hwEta() > 0) {
503  out_pos.push_back(out);
504  wedges_pos[in->at(bx, i).processor()].push_back(out);
505  } else {
506  out_neg.emplace_back(out);
507  wedges_neg[in->at(bx, i).processor()].push_back(out);
508  }
509  }
510  }
511  for (int i = 0; i < 6; ++i) {
512  if (wedges_pos[i].size() > 3)
513  edm::LogWarning("Input Mismatch") << " too many inputs per processor for emtf+ / omtf+. Wedge " << i << ": Size "
514  << wedges_pos[i].size() << std::endl;
515  if (wedges_neg[i].size() > 3)
516  edm::LogWarning("Input Mismatch") << " too many inputs per processor for emtf- / omtf-. Wedge " << i << ": Size "
517  << wedges_neg[i].size() << std::endl;
518  }
519 }
520 
523  GMTInternalWedges& wedges,
524  int bx) const {
525  // initialize the wedge collection:
526  for (int i = 0; i < 12; ++i) {
527  wedges[i] = std::vector<std::shared_ptr<GMTInternalMuon>>();
528  wedges[i].reserve(3);
529  }
530  if (bx < in->getFirstBX() || bx > in->getLastBX())
531  return;
532  int muIdx = 0;
533  int currentLink = 0;
534  for (size_t i = 0; i < in->size(bx); ++i, ++muIdx) {
535  if (in->at(bx, i).hwPt() > 0) {
536  int link = in->at(bx, i).link();
537  if (m_inputsToDisable.test(link) || m_maskedInputs.test(link)) {
538  continue; // only process if input link is enabled and not masked
539  }
540  if (currentLink != link) {
541  muIdx = 0;
542  currentLink = link;
543  }
544  int gPhi = MicroGMTConfiguration::calcGlobalPhi(
545  in->at(bx, i).hwPhi(), in->at(bx, i).trackFinderType(), in->at(bx, i).processor());
546  int tfMuonIdx = 3 * (currentLink - 36) + muIdx;
547  std::shared_ptr<GMTInternalMuon> outMu = std::make_shared<GMTInternalMuon>(in->at(bx, i), gPhi, tfMuonIdx);
548  out.emplace_back(outMu);
549  wedges[in->at(bx, i).processor()].push_back(outMu);
550  }
551  }
552  for (int i = 0; i < 12; ++i) {
553  if (wedges[i].size() > 3)
554  edm::LogWarning("Input Mismatch") << " too many inputs per processor for barrel. Wedge " << i << ": Size "
555  << wedges[i].size() << std::endl;
556  }
557 }
558 
559 // ------------ method called when starting to processes a run ------------
562 
563  std::unique_ptr<L1TMuonGlobalParams_PUBLIC> microGMTParams(
565  if (microGMTParams->pnodes_.empty()) {
567  microGMTParamsHelper = std::make_unique<L1TMuonGlobalParamsHelper>(*o2oProtoHandle.product());
568  } else
570  std::make_unique<L1TMuonGlobalParamsHelper>(cast_to_L1TMuonGlobalParams(*microGMTParams.get()));
571 
572  //microGMTParamsHelper->print(std::cout);
573  m_inputsToDisable = microGMTParamsHelper->inputsToDisable();
574  edm::LogVerbatim("L1TMuonProducer")
575  << "uGMT inputsToDisable: " << m_inputsToDisable
576  << "\n EMTF-|OMTF-| BMTF |OMTF+|EMTF+| CALO | res 0";
577  m_caloInputsToDisable = microGMTParamsHelper->caloInputsToDisable();
578  m_bmtfInputsToDisable = microGMTParamsHelper->bmtfInputsToDisable();
579  m_omtfInputsToDisable = microGMTParamsHelper->omtfInputsToDisable();
580  m_emtfInputsToDisable = microGMTParamsHelper->emtfInputsToDisable();
581  m_maskedInputs = microGMTParamsHelper->maskedInputs();
582  edm::LogVerbatim("L1TMuonProducer")
583  << "uGMT maskedInputs: " << m_maskedInputs
584  << "\n EMTF-|OMTF-| BMTF |OMTF+|EMTF+| CALO | res 0";
585  m_maskedCaloInputs = microGMTParamsHelper->maskedCaloInputs();
586  m_maskedBmtfInputs = microGMTParamsHelper->maskedBmtfInputs();
587  m_maskedOmtfInputs = microGMTParamsHelper->maskedOmtfInputs();
588  m_maskedEmtfInputs = microGMTParamsHelper->maskedEmtfInputs();
593 
594  if (m_autoCancelMode) {
595  if (microGMTParamsHelper->fwVersion() >= 0x6000000) {
597  }
598  // TODO: No decision yet on when to use EMTF track addresses for cancel-out.
599  // if (microGMTParamsHelper->fwVersion() > 0x5000000) {
600  // m_emtfCancelMode = cancelmode::tracks;
601  // }
602  }
603 }
604 
605 // ------------ method called when ending the processing of a run ------------
607 
608 // ------------ method called when starting to processes a luminosity block ------------
610 
611 // ------------ method called when ending the processing of a luminosity block ------------
613 
614 // ------------ method fills 'descriptions' with the allowed parameters for the module ------------
616  //The following says we do not know what parameters are allowed so do no validation
617  // Please change this to state exactly what you do use, even if it is no parameters
619  desc.setUnknown();
620  descriptions.addDefault(desc);
621 }
622 
623 //define this as a plug-in
edm::ESHandle::product
T const * product() const
Definition: ESHandle.h:86
PDWG_BPHSkim_cff.muons
muons
Definition: PDWG_BPHSkim_cff.py:47
Ecal2004TBTDCRanges_v1_cff.endRun
endRun
Definition: Ecal2004TBTDCRanges_v1_cff.py:4
l1t::bmtf
Definition: RegionalMuonCandFwd.h:8
l1t::MicroGMTCancelOutUnit::setCancelOutBits
void setCancelOutBits(GMTInternalWedges &, tftype, cancelmode)
Cancel out between sectors/wedges in one track finder.
Definition: MicroGMTCancelOutUnit.cc:39
l1t::emtf_neg
Definition: RegionalMuonCandFwd.h:8
L1TMuonProducer::m_endcapTfInputTag
edm::InputTag m_endcapTfInputTag
Definition: L1TMuonProducer.cc:116
PDWG_EXOHSCP_cff.tracks
tracks
Definition: PDWG_EXOHSCP_cff.py:28
l1t::tracks
Definition: MicroGMTCancelOutUnit.h:11
mps_fire.i
i
Definition: mps_fire.py:428
l1t::MicroGMTCancelOutUnit::setCancelOutBitsOverlapEndcap
void setCancelOutBitsOverlapEndcap(GMTInternalWedges &, GMTInternalWedges &, cancelmode)
Cancel-out between overlap and endcap track finders.
Definition: MicroGMTCancelOutUnit.cc:102
L1TMuonProducer::m_overlapTfInputToken
edm::EDGetTokenT< MicroGMTConfiguration::InputCollection > m_overlapTfInputToken
Definition: L1TMuonProducer.cc:126
GMTInternalMuon.h
MainPageGenerator.link
link
Definition: MainPageGenerator.py:271
L1TMuonProducer::m_bmtfCancelMode
l1t::cancelmode m_bmtfCancelMode
Definition: L1TMuonProducer.cc:122
ESHandle.h
muon
Definition: MuonCocktails.h:17
l1t::omtf_pos
Definition: RegionalMuonCandFwd.h:8
edm::LuminosityBlock
Definition: LuminosityBlock.h:50
L1TMuonProducer::fillDescriptions
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
Definition: L1TMuonProducer.cc:615
l1t::MicroGMTConfiguration::InterMuonList
GMTInternalMuonList InterMuonList
Definition: MicroGMTConfiguration.h:39
amptDefaultParameters_cff.mu
mu
Definition: amptDefaultParameters_cff.py:16
edm::Run
Definition: Run.h:45
min
T min(T a, T b)
Definition: MathUtil.h:58
edm::EDGetTokenT< MicroGMTConfiguration::InputCollection >
edm
HLT enums.
Definition: AlignableModifier.h:19
L1TMuonProducer
Definition: L1TMuonProducer.cc:59
l1t::MuonBxCollection
BXVector< Muon > MuonBxCollection
Definition: Muon.h:11
Muon.h
L1TMuonProducer::~L1TMuonProducer
~L1TMuonProducer() override
Definition: L1TMuonProducer.cc:187
l1GtPatternGenerator_cfi.bx
bx
Definition: l1GtPatternGenerator_cfi.py:18
edm::ParameterSetDescription
Definition: ParameterSetDescription.h:52
l1t::cancelmode
cancelmode
Definition: MicroGMTCancelOutUnit.h:11
L1TMuonProducer::m_autoCancelMode
bool m_autoCancelMode
Definition: L1TMuonProducer.cc:102
EDProducer.h
l1t::MicroGMTIsolationUnit::initialise
void initialise(L1TMuonGlobalParamsHelper *)
Initialisation from ES record.
Definition: MicroGMTIsolationUnit.cc:12
L1TMuonProducer::m_bmtfInputsToDisable
std::bitset< 12 > m_bmtfInputsToDisable
Definition: L1TMuonProducer.cc:105
L1TMuonProducer::convertMuons
void convertMuons(edm::Handle< MicroGMTConfiguration::InputCollection > const &in, MicroGMTConfiguration::InterMuonList &out, GMTInternalWedges &wedges, int bx) const
Definition: L1TMuonProducer.cc:521
L1TMuonProducer::m_maskedOmtfInputs
std::bitset< 12 > m_maskedOmtfInputs
Definition: L1TMuonProducer.cc:111
MicroGMTCancelOutUnit.h
edm::Handle
Definition: AssociativeIterator.h:50
L1TMuonProducer::m_o2oProtoToken
edm::ESGetToken< L1TMuonGlobalParams, L1TMuonGlobalParamsO2ORcd > m_o2oProtoToken
Definition: L1TMuonProducer.cc:130
ESGetToken.h
edm::LogWarning
Log< level::Warning, false > LogWarning
Definition: MessageLogger.h:122
L1TMuonProducer::m_caloTowerInputToken
edm::EDGetTokenT< MicroGMTConfiguration::CaloInputCollection > m_caloTowerInputToken
Definition: L1TMuonProducer.cc:128
L1TMuonProducer::m_rankPtQualityLUT
std::shared_ptr< MicroGMTRankPtQualLUT > m_rankPtQualityLUT
Definition: L1TMuonProducer.cc:118
Muon
Definition: Muon.py:1
MicroGMTRankPtQualLUT.h
L1TMuonProducer::m_emtfInputsToDisable
std::bitset< 12 > m_emtfInputsToDisable
Definition: L1TMuonProducer.cc:107
l1t::MicroGMTIsolationUnit
Definition: MicroGMTIsolationUnit.h:14
BXVector::getFirstBX
int getFirstBX() const
l1tstage1emulator_dqm_sourceclient-live_cfg.bxMin
bxMin
Definition: l1tstage1emulator_dqm_sourceclient-live_cfg.py:89
MakerMacros.h
l1t::GMTInternalWedges
std::map< int, std::vector< std::shared_ptr< GMTInternalMuon > > > GMTInternalWedges
Definition: GMTInternalMuonFwd.h:11
L1TMuonProducer::m_trigTowerTag
edm::InputTag m_trigTowerTag
Definition: L1TMuonProducer.cc:117
l1t::MicroGMTRankPtQualLUTFactory::create
static ReturnType create(const std::string &filename, const int fwVersion, const unsigned ptFactor, const unsigned qualFactor)
Definition: MicroGMTRankPtQualLUTFactory.cc:18
l1t::coordinate
Definition: MicroGMTCancelOutUnit.h:11
DEFINE_FWK_MODULE
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:16
MicroGMTConfiguration.h
L1TMuonGlobalParams_PUBLIC
Definition: L1TMuonGlobalParams_PUBLIC.h:21
fillDescriptions
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
L1TMuonProducer::calculateRank
void calculateRank(MicroGMTConfiguration::InterMuonList &muons) const
Definition: L1TMuonProducer.cc:424
edm::ESHandle
Definition: DTSurvey.h:22
l1tstage1emulator_dqm_sourceclient-live_cfg.bxMax
bxMax
Definition: l1tstage1emulator_dqm_sourceclient-live_cfg.py:90
l1t::MicroGMTCancelOutUnit
Definition: MicroGMTCancelOutUnit.h:13
L1TMuonProducer::microGMTParamsHelper
std::unique_ptr< L1TMuonGlobalParamsHelper > microGMTParamsHelper
Definition: L1TMuonProducer.cc:113
L1TMuonProducer::endLuminosityBlock
void endLuminosityBlock(edm::LuminosityBlock const &, edm::EventSetup const &) override
Definition: L1TMuonProducer.cc:612
L1TMuonProducer::splitAndConvertMuons
void splitAndConvertMuons(edm::Handle< MicroGMTConfiguration::InputCollection > const &in, MicroGMTConfiguration::InterMuonList &out_pos, MicroGMTConfiguration::InterMuonList &out_neg, GMTInternalWedges &wedges_pos, GMTInternalWedges &wedges_neg, int bx) const
Definition: L1TMuonProducer.cc:471
L1TMuonProducer::m_barrelTfInputToken
edm::EDGetTokenT< MicroGMTConfiguration::InputCollection > m_barrelTfInputToken
Definition: L1TMuonProducer.cc:125
L1TMuonProducer::m_maskedCaloInputs
std::bitset< 28 > m_maskedCaloInputs
Definition: L1TMuonProducer.cc:109
l1t::MicroGMTIsolationUnit::setTowerSums
void setTowerSums(const MicroGMTConfiguration::CaloInputCollection &inputs, int bx)
Definition: MicroGMTIsolationUnit.cc:185
edm::ConfigurationDescriptions
Definition: ConfigurationDescriptions.h:28
L1TMuonProducer::m_barrelTfInputTag
edm::InputTag m_barrelTfInputTag
Definition: L1TMuonProducer.cc:114
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
MicroGMTIsolationUnit.h
L1TMuonProducer::m_maskedBmtfInputs
std::bitset< 12 > m_maskedBmtfInputs
Definition: L1TMuonProducer.cc:110
L1TMuonGlobalParamsO2ORcd.h
edm::ParameterSet
Definition: ParameterSet.h:47
L1TMuonProducer::m_maskedEmtfInputs
std::bitset< 12 > m_maskedEmtfInputs
Definition: L1TMuonProducer.cc:112
Event.h
SiStripPI::max
Definition: SiStripPayloadInspectorHelper.h:169
l1t::MicroGMTIsolationUnit::extrapolateMuons
void extrapolateMuons(MicroGMTConfiguration::InterMuonList &) const
Definition: MicroGMTIsolationUnit.cc:67
l1t
delete x;
Definition: CaloConfig.h:22
L1TMuonProducer::m_microGMTParamsToken
edm::ESGetToken< L1TMuonGlobalParams, L1TMuonGlobalParamsRcd > m_microGMTParamsToken
Definition: L1TMuonProducer.cc:129
l1t::kftracks
Definition: MicroGMTCancelOutUnit.h:11
MicroGMTLUTFactories.h
L1TMuonProducer::m_emtfCancelMode
l1t::cancelmode m_emtfCancelMode
Definition: L1TMuonProducer.cc:123
L1TMuonGlobalParams.h
recoMuon::in
Definition: RecoMuonEnumerators.h:6
L1TMuonGlobalParams_PUBLIC.h
L1TMuonProducer::m_maskedInputs
std::bitset< 72 > m_maskedInputs
Definition: L1TMuonProducer.cc:108
L1TMuonProducer::m_endcapTfInputToken
edm::EDGetTokenT< MicroGMTConfiguration::InputCollection > m_endcapTfInputToken
Definition: L1TMuonProducer.cc:127
LorentzVector.h
iEvent
int iEvent
Definition: GenABIO.cc:224
L1TMuonProducer::m_bxMax
int m_bxMax
Definition: L1TMuonProducer.cc:101
L1TMuonProducer::m_autoBxRange
bool m_autoBxRange
Definition: L1TMuonProducer.cc:99
edm::EventSetup::getHandle
ESHandle< T > getHandle(const ESGetToken< T, R > &iToken) const
Definition: EventSetup.h:148
edm::stream::EDProducer
Definition: EDProducer.h:38
edm::EventSetup
Definition: EventSetup.h:57
L1TMuonProducer::beginLuminosityBlock
void beginLuminosityBlock(edm::LuminosityBlock const &, edm::EventSetup const &) override
Definition: L1TMuonProducer.cc:609
edm::ESGetToken< L1TMuonGlobalParams, L1TMuonGlobalParamsRcd >
L1TMuonProducer::m_isolationUnit
MicroGMTIsolationUnit m_isolationUnit
Definition: L1TMuonProducer.cc:119
L1TMuonProducer::beginRun
void beginRun(edm::Run const &, edm::EventSetup const &) override
Definition: L1TMuonProducer.cc:560
L1TMuonGlobalParamsHelper.h
L1TMuonProducer::m_debugOut
std::ofstream m_debugOut
Definition: L1TMuonProducer.cc:121
L1TMuonProducer::compareMuons
static bool compareMuons(const std::shared_ptr< MicroGMTConfiguration::InterMuon > &mu1, const std::shared_ptr< MicroGMTConfiguration::InterMuon > &mu2)
Definition: L1TMuonProducer.cc:382
submitPVResolutionJobs.desc
string desc
Definition: submitPVResolutionJobs.py:251
l1t::MicroGMTIsolationUnit::isolatePreSummed
void isolatePreSummed(MicroGMTConfiguration::InterMuonList &muons) const
Definition: MicroGMTIsolationUnit.cc:203
eostools.move
def move(src, dest)
Definition: eostools.py:511
writedatasetfile.run
run
Definition: writedatasetfile.py:27
L1TMuonProducer::endRun
void endRun(edm::Run const &, edm::EventSetup const &) override
Definition: L1TMuonProducer.cc:606
L1TMuonProducer::m_bxMin
int m_bxMin
Definition: L1TMuonProducer.cc:100
l1t::emtf_pos
Definition: RegionalMuonCandFwd.h:8
Frameworkfwd.h
edm::LogVerbatim
Log< level::Info, true > LogVerbatim
Definition: MessageLogger.h:128
l1t::MicroGMTCancelOutUnit::initialise
void initialise(L1TMuonGlobalParamsHelper *)
Initialisation from ES record.
Definition: MicroGMTCancelOutUnit.cc:10
AlignmentPI::coordinate
coordinate
Definition: AlignmentPayloadInspectorHelper.h:33
l1t::MicroGMTCancelOutUnit::setCancelOutBitsOverlapBarrel
void setCancelOutBitsOverlapBarrel(GMTInternalWedges &, GMTInternalWedges &, cancelmode)
Cancel-out between overlap and barrel track finders.
Definition: MicroGMTCancelOutUnit.cc:68
L1TMuonProducer::m_omtfInputsToDisable
std::bitset< 12 > m_omtfInputsToDisable
Definition: L1TMuonProducer.cc:106
L1TMuonProducer::m_cancelOutUnit
MicroGMTCancelOutUnit m_cancelOutUnit
Definition: L1TMuonProducer.cc:120
EventSetup.h
RegionalMuonCand.h
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
cast_to_L1TMuonGlobalParams
const L1TMuonGlobalParams & cast_to_L1TMuonGlobalParams(const L1TMuonGlobalParams_PUBLIC &x)
Definition: L1TMuonGlobalParams_PUBLIC.cc:10
MillePedeFileConverter_cfg.out
out
Definition: MillePedeFileConverter_cfg.py:31
L1TMuonProducer::sortMuons
void sortMuons(MicroGMTConfiguration::InterMuonList &, unsigned) const
Definition: L1TMuonProducer.cc:387
math::PtEtaPhiMLorentzVector
PtEtaPhiMLorentzVectorD PtEtaPhiMLorentzVector
Lorentz vector with cartesian internal representation.
Definition: LorentzVector.h:25
cast_to_L1TMuonGlobalParams_PUBLIC
const L1TMuonGlobalParams_PUBLIC & cast_to_L1TMuonGlobalParams_PUBLIC(const L1TMuonGlobalParams &x)
Definition: L1TMuonGlobalParams_PUBLIC.cc:3
ParameterSet.h
L1TMuonProducer::produce
void produce(edm::Event &, const edm::EventSetup &) override
Definition: L1TMuonProducer.cc:194
edm::Event
Definition: Event.h:73
l1t::omtf_neg
Definition: RegionalMuonCandFwd.h:8
edm::ConfigurationDescriptions::addDefault
void addDefault(ParameterSetDescription const &psetDescription)
Definition: ConfigurationDescriptions.cc:99
BXVector::getLastBX
int getLastBX() const
L1TMuonProducer::m_overlapTfInputTag
edm::InputTag m_overlapTfInputTag
Definition: L1TMuonProducer.cc:115
L1TMuonGlobalParamsRcd.h
edm::InputTag
Definition: InputTag.h:15
L1TMuonProducer::L1TMuonProducer
L1TMuonProducer(const edm::ParameterSet &)
Definition: L1TMuonProducer.cc:144
L1TMuonProducer::m_inputsToDisable
std::bitset< 72 > m_inputsToDisable
Definition: L1TMuonProducer.cc:103
findQualityFiles.size
size
Write out results.
Definition: findQualityFiles.py:443
L1TMuonProducer::m_caloInputsToDisable
std::bitset< 28 > m_caloInputsToDisable
Definition: L1TMuonProducer.cc:104
L1TMuonProducer::addMuonsToCollections
void addMuonsToCollections(MicroGMTConfiguration::InterMuonList &coll, MicroGMTConfiguration::InterMuonList &interout, std::unique_ptr< MuonBxCollection > &out, int bx) const
Definition: L1TMuonProducer.cc:431