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 
71  static bool compareMuons(const std::shared_ptr<MicroGMTConfiguration::InterMuon>& mu1,
72  const std::shared_ptr<MicroGMTConfiguration::InterMuon>& mu2);
73 
74  void sortMuons(MicroGMTConfiguration::InterMuonList&, unsigned) const;
75 
76  void calculateRank(MicroGMTConfiguration::InterMuonList& muons) const;
77 
78  void splitAndConvertMuons(edm::Handle<MicroGMTConfiguration::InputCollection> const& in,
81  GMTInternalWedges& wedges_pos,
82  GMTInternalWedges& wedges_neg,
83  int bx) const;
84 
87  GMTInternalWedges& wedges,
88  int bx) const;
89 
90  int computeMuonIdx(const RegionalMuonCand& mu, int currentLink, int muIdxAuto) const;
91 
92  void addMuonsToCollections(MicroGMTConfiguration::InterMuonList& coll,
94  std::unique_ptr<MuonBxCollection>& out,
95  int bx) const;
96 
97  // ----------member data ---------------------------
99  int m_bxMin;
100  int m_bxMax;
102  std::bitset<72> m_inputsToDisable;
103  std::bitset<28> m_caloInputsToDisable;
104  std::bitset<12> m_bmtfInputsToDisable;
105  std::bitset<12> m_omtfInputsToDisable;
106  std::bitset<12> m_emtfInputsToDisable;
107  std::bitset<72> m_maskedInputs;
108  std::bitset<28> m_maskedCaloInputs;
109  std::bitset<12> m_maskedBmtfInputs;
110  std::bitset<12> m_maskedOmtfInputs;
111  std::bitset<12> m_maskedEmtfInputs;
112  std::unique_ptr<L1TMuonGlobalParamsHelper> microGMTParamsHelper;
117  std::shared_ptr<MicroGMTRankPtQualLUT> m_rankPtQualityLUT;
120  std::ofstream m_debugOut;
123 
130 };
131 
132 //
133 // constants, enums and typedefs
134 //
135 
136 //
137 // static data member definitions
138 //
139 
140 //
141 // constructors and destructor
142 //
144  : m_debugOut("test/debug/iso_debug.dat"),
145  m_bmtfCancelMode(cancelmode::tracks),
146  m_emtfCancelMode(cancelmode::coordinate) {
147  // edm::InputTag barrelTfInputTag = iConfig.getParameter<edm::InputTag>("barrelTFInput");
148  // edm::InputTag overlapTfInputTag = iConfig.getParameter<edm::InputTag>("overlapTFInput");
149  // edm::InputTag forwardTfInputTag = iConfig.getParameter<edm::InputTag>("forwardTFInput");
150 
151  m_barrelTfInputTag = iConfig.getParameter<edm::InputTag>("barrelTFInput");
152  m_overlapTfInputTag = iConfig.getParameter<edm::InputTag>("overlapTFInput");
153  m_endcapTfInputTag = iConfig.getParameter<edm::InputTag>("forwardTFInput");
154  m_trigTowerTag = iConfig.getParameter<edm::InputTag>("triggerTowerInput");
155 
156  m_autoBxRange = iConfig.getParameter<bool>("autoBxRange");
157  m_bxMin = iConfig.getParameter<int>("bxMin");
158  m_bxMax = iConfig.getParameter<int>("bxMax");
159 
160  m_autoCancelMode = iConfig.getParameter<bool>("autoCancelMode");
161  if (!m_autoCancelMode) {
162  if (iConfig.getParameter<std::string>("bmtfCancelMode").find("kftracks") == 0) {
164  }
165  if (iConfig.getParameter<std::string>("emtfCancelMode").find("tracks") == 0) {
167  }
168  }
169 
170  m_barrelTfInputToken = consumes<MicroGMTConfiguration::InputCollection>(m_barrelTfInputTag);
171  m_overlapTfInputToken = consumes<MicroGMTConfiguration::InputCollection>(m_overlapTfInputTag);
172  m_endcapTfInputToken = consumes<MicroGMTConfiguration::InputCollection>(m_endcapTfInputTag);
173  m_caloTowerInputToken = consumes<MicroGMTConfiguration::CaloInputCollection>(m_trigTowerTag);
174  m_microGMTParamsToken = esConsumes<L1TMuonGlobalParams, L1TMuonGlobalParamsRcd, edm::Transition::BeginRun>();
175  m_o2oProtoToken = esConsumes<L1TMuonGlobalParams, L1TMuonGlobalParamsO2ORcd, edm::Transition::BeginRun>();
176 
177  //register your products
178  produces<MuonBxCollection>();
179  produces<MuonBxCollection>("imdMuonsBMTF");
180  produces<MuonBxCollection>("imdMuonsEMTFPos");
181  produces<MuonBxCollection>("imdMuonsEMTFNeg");
182  produces<MuonBxCollection>("imdMuonsOMTFPos");
183  produces<MuonBxCollection>("imdMuonsOMTFNeg");
184 }
185 
187 
188 //
189 // member functions
190 //
191 
192 // ------------ method called to produce the data ------------
194  using namespace edm;
195  std::unique_ptr<MuonBxCollection> outMuons(new MuonBxCollection());
196  std::unique_ptr<MuonBxCollection> imdMuonsBMTF(new MuonBxCollection());
197  std::unique_ptr<MuonBxCollection> imdMuonsEMTFPos(new MuonBxCollection());
198  std::unique_ptr<MuonBxCollection> imdMuonsEMTFNeg(new MuonBxCollection());
199  std::unique_ptr<MuonBxCollection> imdMuonsOMTFPos(new MuonBxCollection());
200  std::unique_ptr<MuonBxCollection> imdMuonsOMTFNeg(new MuonBxCollection());
201 
206 
207  iEvent.getByToken(m_barrelTfInputToken, bmtfMuons);
208  iEvent.getByToken(m_endcapTfInputToken, emtfMuons);
209  iEvent.getByToken(m_overlapTfInputToken, omtfMuons);
210  iEvent.getByToken(m_caloTowerInputToken, trigTowers);
211 
212  // find out the BX range from the inputs
213  // the smallest BX window defines the output BX window
214  if (m_autoBxRange) {
215  int bxMin = -1000;
216  int bxMax = 1000;
217  if (!(m_caloInputsToDisable.all() || m_maskedCaloInputs.all())) {
218  bxMin = std::max(bxMin, trigTowers->getFirstBX());
219  bxMax = std::min(bxMax, trigTowers->getLastBX());
220  }
221  if (!(m_bmtfInputsToDisable.all() || m_maskedBmtfInputs.all())) {
222  bxMin = std::max(bxMin, bmtfMuons->getFirstBX());
223  bxMax = std::min(bxMax, bmtfMuons->getLastBX());
224  }
225  if (!(m_omtfInputsToDisable.all() || m_maskedOmtfInputs.all())) {
226  bxMin = std::max(bxMin, omtfMuons->getFirstBX());
227  bxMax = std::min(bxMax, omtfMuons->getLastBX());
228  }
229  if (!(m_emtfInputsToDisable.all() || m_maskedEmtfInputs.all())) {
230  bxMin = std::max(bxMin, emtfMuons->getFirstBX());
231  bxMax = std::min(bxMax, emtfMuons->getLastBX());
232  }
233  if (bxMin > 0) {
234  bxMin = 0;
235  }
236  if (bxMax < 0) {
237  bxMax = 0;
238  }
239  if (bxMin > -1000) {
240  m_bxMin = bxMin;
241  } else {
242  m_bxMin = 0;
243  }
244  if (bxMax < 1000) {
245  m_bxMax = bxMax;
246  } else {
247  m_bxMax = 0;
248  }
249  }
250 
251  // set BX range for outputs
252  outMuons->setBXRange(m_bxMin, m_bxMax);
253  imdMuonsBMTF->setBXRange(m_bxMin, m_bxMax);
254  imdMuonsEMTFPos->setBXRange(m_bxMin, m_bxMax);
255  imdMuonsEMTFNeg->setBXRange(m_bxMin, m_bxMax);
256  imdMuonsOMTFPos->setBXRange(m_bxMin, m_bxMax);
257  imdMuonsOMTFNeg->setBXRange(m_bxMin, m_bxMax);
258 
259  for (int bx = m_bxMin; bx <= m_bxMax; ++bx) {
260  m_isolationUnit.setTowerSums(*trigTowers, bx);
261  MicroGMTConfiguration::InterMuonList internMuonsBmtf;
262  MicroGMTConfiguration::InterMuonList internMuonsEmtfPos;
263  MicroGMTConfiguration::InterMuonList internMuonsEmtfNeg;
264  MicroGMTConfiguration::InterMuonList internMuonsOmtfPos;
265  MicroGMTConfiguration::InterMuonList internMuonsOmtfNeg;
266 
267  // These wedges contain shared pointers to the ones in the InterMuonList
268  GMTInternalWedges omtfNegWedges;
269  GMTInternalWedges bmtfWedges;
270  GMTInternalWedges emtfPosWedges;
271  GMTInternalWedges emtfNegWedges;
272  GMTInternalWedges omtfPosWedges;
273 
274  // this converts the InputMuon type to the InternalMuon type and splits them into
275  // positive / negative eta collections necessary as LUTs may differ for pos / neg.
276  convertMuons(bmtfMuons, internMuonsBmtf, bmtfWedges, bx);
277  splitAndConvertMuons(emtfMuons, internMuonsEmtfPos, internMuonsEmtfNeg, emtfPosWedges, emtfNegWedges, bx);
278  splitAndConvertMuons(omtfMuons, internMuonsOmtfPos, internMuonsOmtfNeg, omtfPosWedges, omtfNegWedges, bx);
279 
280  // cancel out within the track finders:
286 
287  // cancel out between track finder acceptance overlaps:
292 
293  m_isolationUnit.extrapolateMuons(internMuonsBmtf);
294  m_isolationUnit.extrapolateMuons(internMuonsEmtfNeg);
295  m_isolationUnit.extrapolateMuons(internMuonsEmtfPos);
296  m_isolationUnit.extrapolateMuons(internMuonsOmtfNeg);
297  m_isolationUnit.extrapolateMuons(internMuonsOmtfPos);
298 
299  // the rank calculated here is used in the sort below
300  calculateRank(internMuonsBmtf);
301  calculateRank(internMuonsEmtfNeg);
302  calculateRank(internMuonsEmtfPos);
303  calculateRank(internMuonsOmtfNeg);
304  calculateRank(internMuonsOmtfPos);
305 
306  // The sort function both sorts and removes all but best "nSurvivors"
307  sortMuons(internMuonsBmtf, 8);
308  sortMuons(internMuonsOmtfPos, 4);
309  sortMuons(internMuonsOmtfNeg, 4);
310  sortMuons(internMuonsEmtfPos, 4);
311  sortMuons(internMuonsEmtfNeg, 4);
312 
313  // This combines the 5 streams into one InternalMuon collection for
314  // the final global sort.
316  addMuonsToCollections(internMuonsEmtfPos, internalMuons, imdMuonsEMTFPos, bx);
317  addMuonsToCollections(internMuonsOmtfPos, internalMuons, imdMuonsOMTFPos, bx);
318  addMuonsToCollections(internMuonsBmtf, internalMuons, imdMuonsBMTF, bx);
319  addMuonsToCollections(internMuonsOmtfNeg, internalMuons, imdMuonsOMTFNeg, bx);
320  addMuonsToCollections(internMuonsEmtfNeg, internalMuons, imdMuonsEMTFNeg, bx);
321 
322  // sort internal muons and delete all but best 8
323  sortMuons(internalMuons, 8);
324 
325  m_isolationUnit.isolatePreSummed(internalMuons);
326  // copy muons to output collection...
327  for (const auto& mu : internalMuons) {
328  if (mu->hwPt() > 0) {
330  (mu->hwPt() - 1) * 0.5, mu->hwEta() * 0.010875, mu->hwGlobalPhi() * 0.010908, 0.0};
331  int iso = mu->hwAbsIso() + (mu->hwRelIso() << 1);
332  int outMuQual = MicroGMTConfiguration::setOutputMuonQuality(
333  mu->hwQual(), mu->trackFinderType(), mu->hwHF(), microGMTParamsHelper->fwVersion());
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(
359  hwPtUnconstrained == 0
360  ? 0
361  : (hwPtUnconstrained - 1)); // Don't want negative pT, unconstr. pT has LSB of 1 GeV.
362  outMu.setHwPtUnconstrained(hwPtUnconstrained);
363  outMu.setHwDXY(mu->hwDXY());
364 
365  if (mu->hwSignValid()) {
366  outMu.setCharge(1 - 2 * mu->hwSign());
367  } else {
368  outMu.setCharge(0);
369  }
370  m_debugOut << mu->hwCaloPhi() << " " << mu->hwCaloEta() << std::endl;
371  outMuons->push_back(bx, outMu);
372  }
373  }
374  }
375 
376  iEvent.put(std::move(outMuons));
377  iEvent.put(std::move(imdMuonsBMTF), "imdMuonsBMTF");
378  iEvent.put(std::move(imdMuonsEMTFPos), "imdMuonsEMTFPos");
379  iEvent.put(std::move(imdMuonsEMTFNeg), "imdMuonsEMTFNeg");
380  iEvent.put(std::move(imdMuonsOMTFPos), "imdMuonsOMTFPos");
381  iEvent.put(std::move(imdMuonsOMTFNeg), "imdMuonsOMTFNeg");
382 }
383 
384 bool L1TMuonProducer::compareMuons(const std::shared_ptr<MicroGMTConfiguration::InterMuon>& mu1,
385  const std::shared_ptr<MicroGMTConfiguration::InterMuon>& mu2) {
386  return (mu1->hwWins() >= mu2->hwWins());
387 }
388 
390  MicroGMTConfiguration::InterMuonList::iterator mu1;
391  // reset from previous sort stage
392  for (mu1 = muons.begin(); mu1 != muons.end(); ++mu1) {
393  (*mu1)->setHwWins(0);
394  }
395 
396  for (mu1 = muons.begin(); mu1 != muons.end(); ++mu1) {
397  int mu1CancelBit = (*mu1)->hwCancelBit();
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(
439  mu->hwQual(), mu->trackFinderType(), mu->hwHF(), microGMTParamsHelper->fwVersion());
440  // set tfMuonIndex and iso to 0 like in the FW
441  Muon outMu{vec,
442  mu->hwPt(),
443  mu->hwEta(),
444  mu->hwGlobalPhi(),
445  outMuQual,
446  mu->hwSign(),
447  mu->hwSignValid(),
448  0,
449  0,
450  0,
451  true,
452  0,
453  mu->hwDPhi(),
454  mu->hwDEta(),
455  mu->hwRank()};
456 
457  int hwPtUnconstrained{mu->hwPtUnconstrained()};
458  outMu.setPtUnconstrained(hwPtUnconstrained == 0
459  ? 0
460  : (hwPtUnconstrained - 1)); // Don't want negative pT, unconstr. pT has LSB of 1 GeV.
461  outMu.setHwPtUnconstrained(hwPtUnconstrained);
462  outMu.setHwDXY(mu->hwDXY());
463 
464  if (mu->hwSignValid()) {
465  outMu.setCharge(1 - 2 * mu->hwSign());
466  } else {
467  outMu.setCharge(0);
468  }
469 
470  out->push_back(bx, outMu);
471  }
472 }
473 
477  GMTInternalWedges& wedges_pos,
478  GMTInternalWedges& wedges_neg,
479  int bx) const {
480  // initialize the wedge collections:
481  for (int i = 0; i < 6; ++i) {
482  wedges_pos[i] = std::vector<std::shared_ptr<GMTInternalMuon>>();
483  wedges_pos[i].reserve(3);
484  wedges_neg[i] = std::vector<std::shared_ptr<GMTInternalMuon>>();
485  wedges_neg[i].reserve(3);
486  }
487  if (bx < in->getFirstBX() || bx > in->getLastBX())
488  return;
489  int muIdxAuto = 0;
490  int currentLink = 0;
491  for (size_t i = 0; i < in->size(bx); ++i, ++muIdxAuto) {
492  if (in->at(bx, i).hwPt() > 0) {
493  int link = in->at(bx, i).link();
494  if (m_inputsToDisable.test(link) || m_maskedInputs.test(link)) {
495  continue; // only process if input link is enabled and not masked
496  }
497  if (currentLink != link) {
498  muIdxAuto = 0;
499  currentLink = link;
500  }
501  int gPhi = MicroGMTConfiguration::calcGlobalPhi(
502  in->at(bx, i).hwPhi(), in->at(bx, i).trackFinderType(), in->at(bx, i).processor());
503  int tfMuonIdx{computeMuonIdx(in->at(bx, i), currentLink, muIdxAuto)};
504  std::shared_ptr<GMTInternalMuon> out = std::make_shared<GMTInternalMuon>(in->at(bx, i), gPhi, tfMuonIdx);
505  if (in->at(bx, i).hwEta() > 0) {
506  out_pos.push_back(out);
507  wedges_pos[in->at(bx, i).processor()].push_back(out);
508  } else {
509  out_neg.emplace_back(out);
510  wedges_neg[in->at(bx, i).processor()].push_back(out);
511  }
512  }
513  }
514  for (int i = 0; i < 6; ++i) {
515  if (wedges_pos[i].size() > 3)
516  edm::LogWarning("Input Mismatch") << " too many inputs per processor for emtf+ / omtf+. Wedge " << i << ": Size "
517  << wedges_pos[i].size() << std::endl;
518  if (wedges_neg[i].size() > 3)
519  edm::LogWarning("Input Mismatch") << " too many inputs per processor for emtf- / omtf-. Wedge " << i << ": Size "
520  << wedges_neg[i].size() << std::endl;
521  }
522 }
523 
526  GMTInternalWedges& wedges,
527  int bx) const {
528  // initialize the wedge collection:
529  for (int i = 0; i < 12; ++i) {
530  wedges[i] = std::vector<std::shared_ptr<GMTInternalMuon>>();
531  wedges[i].reserve(3);
532  }
533  if (bx < in->getFirstBX() || bx > in->getLastBX()) {
534  return;
535  }
536  int muIdxAuto = 0;
537  int currentLink = 0;
538  for (size_t i = 0; i < in->size(bx); ++i, ++muIdxAuto) {
539  if (in->at(bx, i).hwPt() > 0) {
540  int link = in->at(bx, i).link();
541  if (m_inputsToDisable.test(link) || m_maskedInputs.test(link)) {
542  continue; // only process if input link is enabled and not masked
543  }
544  if (currentLink != link) {
545  muIdxAuto = 0;
546  currentLink = link;
547  }
548  int gPhi = MicroGMTConfiguration::calcGlobalPhi(
549  in->at(bx, i).hwPhi(), in->at(bx, i).trackFinderType(), in->at(bx, i).processor());
550  int tfMuonIdx{computeMuonIdx(in->at(bx, i), currentLink, muIdxAuto)};
551  std::shared_ptr<GMTInternalMuon> outMu = std::make_shared<GMTInternalMuon>(in->at(bx, i), gPhi, tfMuonIdx);
552  out.emplace_back(outMu);
553  wedges[in->at(bx, i).processor()].push_back(outMu);
554  }
555  }
556  for (int i = 0; i < 12; ++i) {
557  if (wedges[i].size() > 3) {
558  edm::LogWarning("Input Mismatch") << " too many inputs per processor for barrel. Wedge " << i << ": Size "
559  << wedges[i].size() << std::endl;
560  }
561  }
562 }
563 
564 int L1TMuonProducer::computeMuonIdx(const RegionalMuonCand& mu, int currentLink, int muIdxAuto) const {
565  // If the muon index was set in the data format we should use that. Otherwise we use the value computed from the position in the vector.
566  if (mu.muIdx() != -1) {
567  return 3 * (currentLink - 36) + mu.muIdx();
568  } else {
569  return 3 * (currentLink - 36) + muIdxAuto;
570  }
571 }
572 
573 // ------------ method called when starting to processes a run ------------
576 
577  std::unique_ptr<L1TMuonGlobalParams_PUBLIC> microGMTParams(
579  if (microGMTParams->pnodes_.empty()) {
581  microGMTParamsHelper = std::make_unique<L1TMuonGlobalParamsHelper>(*o2oProtoHandle.product());
582  } else
584  std::make_unique<L1TMuonGlobalParamsHelper>(cast_to_L1TMuonGlobalParams(*microGMTParams.get()));
585 
586  //microGMTParamsHelper->print(std::cout);
587  m_inputsToDisable = microGMTParamsHelper->inputsToDisable();
588  edm::LogVerbatim("L1TMuonProducer")
589  << "uGMT inputsToDisable: " << m_inputsToDisable
590  << "\n EMTF-|OMTF-| BMTF |OMTF+|EMTF+| CALO | res 0";
591  m_caloInputsToDisable = microGMTParamsHelper->caloInputsToDisable();
592  m_bmtfInputsToDisable = microGMTParamsHelper->bmtfInputsToDisable();
593  m_omtfInputsToDisable = microGMTParamsHelper->omtfInputsToDisable();
594  m_emtfInputsToDisable = microGMTParamsHelper->emtfInputsToDisable();
595  m_maskedInputs = microGMTParamsHelper->maskedInputs();
596  edm::LogVerbatim("L1TMuonProducer")
597  << "uGMT maskedInputs: " << m_maskedInputs
598  << "\n EMTF-|OMTF-| BMTF |OMTF+|EMTF+| CALO | res 0";
599  m_maskedCaloInputs = microGMTParamsHelper->maskedCaloInputs();
600  m_maskedBmtfInputs = microGMTParamsHelper->maskedBmtfInputs();
601  m_maskedOmtfInputs = microGMTParamsHelper->maskedOmtfInputs();
602  m_maskedEmtfInputs = microGMTParamsHelper->maskedEmtfInputs();
607 
608  if (m_autoCancelMode) {
609  if (microGMTParamsHelper->fwVersion() >= 0x6000000) {
611  }
612  // TODO: No decision yet on when to use EMTF track addresses for cancel-out.
613  // if (microGMTParamsHelper->fwVersion() > 0x5000000) {
614  // m_emtfCancelMode = cancelmode::tracks;
615  // }
616  }
617 }
618 
619 // ------------ method fills 'descriptions' with the allowed parameters for the module ------------
621  //The following says we do not know what parameters are allowed so do no validation
622  // Please change this to state exactly what you do use, even if it is no parameters
624  desc.setUnknown();
625  descriptions.addDefault(desc);
626 }
627 
628 //define this as a plug-in
size
Write out results.
const L1TMuonGlobalParams & cast_to_L1TMuonGlobalParams(const L1TMuonGlobalParams_PUBLIC &x)
int getLastBX() const
Log< level::Info, true > LogVerbatim
void beginRun(edm::Run const &, edm::EventSetup const &) override
void setCancelOutBitsOverlapEndcap(GMTInternalWedges &, GMTInternalWedges &, cancelmode)
Cancel-out between overlap and endcap track finders.
int getFirstBX() const
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
T getParameter(std::string const &) const
Definition: ParameterSet.h:307
void extrapolateMuons(MicroGMTConfiguration::InterMuonList &) const
void initialise(L1TMuonGlobalParamsHelper *)
Initialisation from ES record.
std::ofstream m_debugOut
void setCancelOutBitsOverlapBarrel(GMTInternalWedges &, GMTInternalWedges &, cancelmode)
Cancel-out between overlap and barrel track finders.
edm::EDGetTokenT< MicroGMTConfiguration::InputCollection > m_endcapTfInputToken
std::unique_ptr< L1TMuonGlobalParamsHelper > microGMTParamsHelper
std::bitset< 12 > m_bmtfInputsToDisable
void convertMuons(edm::Handle< MicroGMTConfiguration::InputCollection > const &in, MicroGMTConfiguration::InterMuonList &out, GMTInternalWedges &wedges, int bx) const
void setTowerSums(const MicroGMTConfiguration::CaloInputCollection &inputs, int bx)
int computeMuonIdx(const RegionalMuonCand &mu, int currentLink, int muIdxAuto) const
edm::EDGetTokenT< MicroGMTConfiguration::InputCollection > m_overlapTfInputToken
edm::EDGetTokenT< MicroGMTConfiguration::CaloInputCollection > m_caloTowerInputToken
MicroGMTIsolationUnit m_isolationUnit
delete x;
Definition: CaloConfig.h:22
muons
the two sets of parameters below are mutually exclusive, depending if RECO or ALCARECO is used the us...
Definition: DiMuonV_cfg.py:214
l1t::cancelmode m_emtfCancelMode
edm::ESGetToken< L1TMuonGlobalParams, L1TMuonGlobalParamsO2ORcd > m_o2oProtoToken
void calculateRank(MicroGMTConfiguration::InterMuonList &muons) const
std::shared_ptr< MicroGMTRankPtQualLUT > m_rankPtQualityLUT
void isolatePreSummed(MicroGMTConfiguration::InterMuonList &muons) const
void sortMuons(MicroGMTConfiguration::InterMuonList &, unsigned) const
PtEtaPhiMLorentzVectorD PtEtaPhiMLorentzVector
Lorentz vector with cartesian internal representation.
Definition: LorentzVector.h:25
static ReturnType create(const std::string &filename, const int fwVersion, const unsigned ptFactor, const unsigned qualFactor)
edm::InputTag m_overlapTfInputTag
std::bitset< 12 > m_emtfInputsToDisable
int iEvent
Definition: GenABIO.cc:224
T const * product() const
Definition: ESHandle.h:86
void addDefault(ParameterSetDescription const &psetDescription)
Definition: Muon.py:1
void addMuonsToCollections(MicroGMTConfiguration::InterMuonList &coll, MicroGMTConfiguration::InterMuonList &interout, std::unique_ptr< MuonBxCollection > &out, int bx) const
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:16
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
GMTInternalMuonList InterMuonList
edm::InputTag m_barrelTfInputTag
ESHandle< T > getHandle(const ESGetToken< T, R > &iToken) const
Definition: EventSetup.h:130
edm::InputTag m_endcapTfInputTag
void produce(edm::Event &, const edm::EventSetup &) override
std::bitset< 12 > m_maskedBmtfInputs
BXVector< Muon > MuonBxCollection
Definition: Muon.h:11
void setCancelOutBits(GMTInternalWedges &, tftype, cancelmode)
Cancel out between sectors/wedges in one track finder.
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
~L1TMuonProducer() override
edm::ESGetToken< L1TMuonGlobalParams, L1TMuonGlobalParamsRcd > m_microGMTParamsToken
edm::EDGetTokenT< MicroGMTConfiguration::InputCollection > m_barrelTfInputToken
HLT enums.
std::bitset< 12 > m_maskedEmtfInputs
const L1TMuonGlobalParams_PUBLIC & cast_to_L1TMuonGlobalParams_PUBLIC(const L1TMuonGlobalParams &x)
l1t::cancelmode m_bmtfCancelMode
static bool compareMuons(const std::shared_ptr< MicroGMTConfiguration::InterMuon > &mu1, const std::shared_ptr< MicroGMTConfiguration::InterMuon > &mu2)
std::map< int, std::vector< std::shared_ptr< GMTInternalMuon > > > GMTInternalWedges
std::bitset< 72 > m_maskedInputs
std::bitset< 12 > m_maskedOmtfInputs
std::bitset< 72 > m_inputsToDisable
std::bitset< 28 > m_caloInputsToDisable
L1TMuonProducer(const edm::ParameterSet &)
std::bitset< 12 > m_omtfInputsToDisable
Log< level::Warning, false > LogWarning
MicroGMTCancelOutUnit m_cancelOutUnit
void initialise(L1TMuonGlobalParamsHelper *)
Initialisation from ES record.
edm::InputTag m_trigTowerTag
def move(src, dest)
Definition: eostools.py:511
Definition: Run.h:45
std::bitset< 28 > m_maskedCaloInputs