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 
21 // system include files
22 #include <memory>
23 #include <fstream>
24 
25 // user include files
30 
33 
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 
88  void convertMuons(edm::Handle<MicroGMTConfiguration::InputCollection> const& in,
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;
123 
128 
129  };
130 
131 //
132 // constants, enums and typedefs
133 //
134 
135 
136 //
137 // static data member definitions
138 //
139 
140 //
141 // constructors and destructor
142 //
143 L1TMuonProducer::L1TMuonProducer(const edm::ParameterSet& iConfig) : m_debugOut("test/debug/iso_debug.dat"), m_emtfCancelMode(cancelmode::coordinate)
144 {
145  // edm::InputTag barrelTfInputTag = iConfig.getParameter<edm::InputTag>("barrelTFInput");
146  // edm::InputTag overlapTfInputTag = iConfig.getParameter<edm::InputTag>("overlapTFInput");
147  // edm::InputTag forwardTfInputTag = iConfig.getParameter<edm::InputTag>("forwardTFInput");
148 
149  m_barrelTfInputTag = iConfig.getParameter<edm::InputTag>("barrelTFInput");
150  m_overlapTfInputTag = iConfig.getParameter<edm::InputTag>("overlapTFInput");
151  m_endcapTfInputTag = iConfig.getParameter<edm::InputTag>("forwardTFInput");
152  m_trigTowerTag = iConfig.getParameter<edm::InputTag>("triggerTowerInput");
153 
154  m_autoBxRange = iConfig.getParameter<bool>("autoBxRange");
155  m_bxMin = iConfig.getParameter<int>("bxMin");
156  m_bxMax = iConfig.getParameter<int>("bxMax");
157 
158  m_autoCancelMode = iConfig.getParameter<bool>("autoCancelMode");
159  if (!m_autoCancelMode && iConfig.getParameter<std::string>("emtfCancelMode").find("tracks") == 0) {
161  }
162 
163  m_barrelTfInputToken = consumes<MicroGMTConfiguration::InputCollection>(m_barrelTfInputTag);
164  m_overlapTfInputToken = consumes<MicroGMTConfiguration::InputCollection>(m_overlapTfInputTag);
165  m_endcapTfInputToken = consumes<MicroGMTConfiguration::InputCollection>(m_endcapTfInputTag);
166  m_caloTowerInputToken = consumes<MicroGMTConfiguration::CaloInputCollection>(m_trigTowerTag);
167 
168  //register your products
169  produces<MuonBxCollection>();
170  produces<MuonBxCollection>("imdMuonsBMTF");
171  produces<MuonBxCollection>("imdMuonsEMTFPos");
172  produces<MuonBxCollection>("imdMuonsEMTFNeg");
173  produces<MuonBxCollection>("imdMuonsOMTFPos");
174  produces<MuonBxCollection>("imdMuonsOMTFNeg");
175 }
176 
178 {
179  m_debugOut.close();
180 }
181 
182 
183 //
184 // member functions
185 //
186 
187 
188 
189 // ------------ method called to produce the data ------------
190 void
192 {
193  using namespace edm;
194  std::unique_ptr<MuonBxCollection> outMuons (new MuonBxCollection());
195  std::unique_ptr<MuonBxCollection> imdMuonsBMTF (new MuonBxCollection());
196  std::unique_ptr<MuonBxCollection> imdMuonsEMTFPos (new MuonBxCollection());
197  std::unique_ptr<MuonBxCollection> imdMuonsEMTFNeg (new MuonBxCollection());
198  std::unique_ptr<MuonBxCollection> imdMuonsOMTFPos (new MuonBxCollection());
199  std::unique_ptr<MuonBxCollection> imdMuonsOMTFNeg (new MuonBxCollection());
200 
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) {
329  math::PtEtaPhiMLorentzVector vec{(mu->hwPt()-1)*0.5, mu->hwEta()*0.010875, mu->hwGlobalPhi()*0.010908, 0.0};
330  int iso = mu->hwAbsIso() + (mu->hwRelIso() << 1);
331  int outMuQual = MicroGMTConfiguration::setOutputMuonQuality(mu->hwQual(), mu->trackFinderType(), mu->hwHF());
332  Muon outMu{vec, mu->hwPt(), mu->hwEta(), mu->hwGlobalPhi(), outMuQual, mu->hwSign(), mu->hwSignValid(), iso, mu->tfMuonIndex(), 0, true, mu->hwIsoSum(), mu->hwDPhi(), mu->hwDEta(), mu->hwRank()};
333  if (mu->hwSignValid()) {
334  outMu.setCharge(1 - 2 * mu->hwSign());
335  } else {
336  outMu.setCharge(0);
337  }
338  // set the coordinates at the vertex
339  outMu.setHwEtaAtVtx(MicroGMTConfiguration::calcMuonHwEtaExtra(outMu));
340  outMu.setHwPhiAtVtx(MicroGMTConfiguration::calcMuonHwPhiExtra(outMu));
341  outMu.setEtaAtVtx(MicroGMTConfiguration::calcMuonEtaExtra(outMu));
342  outMu.setPhiAtVtx(MicroGMTConfiguration::calcMuonPhiExtra(outMu));
343  m_debugOut << mu->hwCaloPhi() << " " << mu->hwCaloEta() << std::endl;
344  outMuons->push_back(bx, outMu);
345  }
346  }
347  }
348 
349  iEvent.put(std::move(outMuons));
350  iEvent.put(std::move(imdMuonsBMTF), "imdMuonsBMTF");
351  iEvent.put(std::move(imdMuonsEMTFPos), "imdMuonsEMTFPos");
352  iEvent.put(std::move(imdMuonsEMTFNeg), "imdMuonsEMTFNeg");
353  iEvent.put(std::move(imdMuonsOMTFPos), "imdMuonsOMTFPos");
354  iEvent.put(std::move(imdMuonsOMTFNeg), "imdMuonsOMTFNeg");
355 }
356 
357 
358 bool
359 L1TMuonProducer::compareMuons(const std::shared_ptr<MicroGMTConfiguration::InterMuon>& mu1,
360  const std::shared_ptr<MicroGMTConfiguration::InterMuon>& mu2) {
361  return (mu1->hwWins() >= mu2->hwWins());
362 }
363 
364 void
366  MicroGMTConfiguration::InterMuonList::iterator mu1;
367  // reset from previous sort stage
368  for (mu1 = muons.begin(); mu1 != muons.end(); ++mu1) {
369  (*mu1)->setHwWins(0);
370  }
371 
372  int nCancelled = 0;
373  for (mu1 = muons.begin(); mu1 != muons.end(); ++mu1) {
374  int mu1CancelBit = (*mu1)->hwCancelBit();
375  nCancelled += mu1CancelBit;
376  auto mu2 = mu1;
377  mu2++;
378  for ( ; mu2 != muons.end(); ++mu2) {
379  if (mu1CancelBit != 1 && (*mu2)->hwCancelBit() != 1) {
380  if ((*mu1)->hwRank() >= (*mu2)->hwRank()) {
381  (*mu1)->increaseWins();
382  } else {
383  (*mu2)->increaseWins();
384  }
385  } else if (mu1CancelBit != 1) {
386  (*mu1)->increaseWins();
387  } else if ((*mu2)->hwCancelBit() != 1) {
388  (*mu2)->increaseWins();
389  }
390  }
391  }
392 
393  size_t nMuonsBefore = muons.size();
394  int minWins = nMuonsBefore - nSurvivors;
395 
396  // remove all muons that were cancelled or that do not have sufficient rank
397  // (reduces the container size to nSurvivors)
398  muons.remove_if([&minWins](auto muon) { return ((muon->hwWins() < minWins) || (muon->hwCancelBit() == 1)); });
399  muons.sort(L1TMuonProducer::compareMuons);
400 }
401 
402 
403 
404 void
406 {
407  for (auto& mu1 : muons) {
408  int rank = m_rankPtQualityLUT->lookup(mu1->hwPt(), mu1->hwQual());
409  mu1->setHwRank(rank);
410  }
411 }
412 
413 
414 void
417  std::unique_ptr<MuonBxCollection>& out, int bx) const
418 {
419  for (auto& mu : coll) {
420  interout.push_back(mu);
421  math::PtEtaPhiMLorentzVector vec{(mu->hwPt()-1)*0.5, mu->hwEta()*0.010875, mu->hwGlobalPhi()*0.010908, 0.0};
422  int outMuQual = MicroGMTConfiguration::setOutputMuonQuality(mu->hwQual(), mu->trackFinderType(), mu->hwHF());
423  // set tfMuonIndex and iso to 0 like in the FW
424  Muon outMu{vec, mu->hwPt(), mu->hwEta(), mu->hwGlobalPhi(), outMuQual, mu->hwSign(), mu->hwSignValid(), 0, 0, 0, true, 0, mu->hwDPhi(), mu->hwDEta(), mu->hwRank()};
425  if (mu->hwSignValid()) {
426  outMu.setCharge(1 - 2 * mu->hwSign());
427  } else {
428  outMu.setCharge(0);
429  }
430 
431  out->push_back(bx, outMu);
432  }
433 }
434 
435 void
439  GMTInternalWedges& wedges_pos,
440  GMTInternalWedges& wedges_neg,
441  int bx) const
442 {
443  // initialize the wedge collections:
444  for (int i = 0; i < 6; ++i) {
445  wedges_pos[i] = std::vector<std::shared_ptr<GMTInternalMuon>>();
446  wedges_pos[i].reserve(3);
447  wedges_neg[i] = std::vector<std::shared_ptr<GMTInternalMuon>>();
448  wedges_neg[i].reserve(3);
449  }
450  if (bx < in->getFirstBX() || bx > in->getLastBX()) return;
451  int muIdx = 0;
452  int currentLink = 0;
453  for (size_t i = 0; i < in->size(bx); ++i, ++muIdx) {
454  int link = in->at(bx, i).link();
455  if (m_inputsToDisable.test(link) || m_maskedInputs.test(link)) continue; // only process if input link is enabled and not masked
456  if (currentLink != link) {
457  muIdx = 0;
458  currentLink = link;
459  }
460  int gPhi = MicroGMTConfiguration::calcGlobalPhi(in->at(bx, i).hwPhi(), in->at(bx, i).trackFinderType(), in->at(bx, i).processor());
461  int tfMuonIdx = 3 * (currentLink - 36) + muIdx;
462  std::shared_ptr<GMTInternalMuon> out = std::make_shared<GMTInternalMuon>(in->at(bx, i), gPhi, tfMuonIdx);
463  if(in->at(bx, i).hwEta() > 0) {
464  out_pos.push_back(out);
465  wedges_pos[in->at(bx, i).processor()].push_back(out);
466  } else {
467  out_neg.emplace_back(out);
468  wedges_neg[in->at(bx, i).processor()].push_back(out);
469  }
470  }
471  for (int i = 0; i < 6; ++i) {
472  if(wedges_pos[i].size() > 3) edm::LogWarning("Input Mismatch") << " too many inputs per processor for emtf+ / omtf+. Wedge " << i << ": Size " << wedges_pos[i].size() << std::endl;
473  if(wedges_neg[i].size() > 3) edm::LogWarning("Input Mismatch") << " too many inputs per processor for emtf- / omtf-. Wedge " << i << ": Size " << wedges_neg[i].size() << std::endl;
474  }
475 }
476 
477 void
480  GMTInternalWedges& wedges, int bx) const
481 {
482  // initialize the wedge collection:
483  for (int i = 0; i < 12; ++i) {
484  wedges[i] = std::vector<std::shared_ptr<GMTInternalMuon>>();
485  wedges[i].reserve(3);
486  }
487  if (bx < in->getFirstBX() || bx > in->getLastBX()) return;
488  int muIdx = 0;
489  int currentLink = 0;
490  for (size_t i = 0; i < in->size(bx); ++i, ++muIdx) {
491  int link = in->at(bx, i).link();
492  if (m_inputsToDisable.test(link) || m_maskedInputs.test(link)) continue; // only process if input link is enabled and not masked
493  if (currentLink != link) {
494  muIdx = 0;
495  currentLink = link;
496  }
497  int gPhi = MicroGMTConfiguration::calcGlobalPhi(in->at(bx, i).hwPhi(), in->at(bx, i).trackFinderType(), in->at(bx, i).processor());
498  int tfMuonIdx = 3 * (currentLink - 36) + muIdx;
499  std::shared_ptr<GMTInternalMuon> outMu = std::make_shared<GMTInternalMuon>(in->at(bx, i), gPhi, tfMuonIdx);
500  out.emplace_back(outMu);
501  wedges[in->at(bx, i).processor()].push_back(outMu);
502  }
503  for (int i = 0; i < 12; ++i) {
504  if(wedges[i].size() > 3) edm::LogWarning("Input Mismatch") << " too many inputs per processor for barrel. Wedge " << i << ": Size " << wedges[i].size() << std::endl;
505  }
506 }
507 
508 // ------------ method called when starting to processes a run ------------
509 void
511 {
512  const L1TMuonGlobalParamsRcd& microGMTParamsRcd = iSetup.get<L1TMuonGlobalParamsRcd>();
513  edm::ESHandle<L1TMuonGlobalParams> microGMTParamsHandle;
514  microGMTParamsRcd.get(microGMTParamsHandle);
515 
516  std::unique_ptr<L1TMuonGlobalParams_PUBLIC> microGMTParams( new L1TMuonGlobalParams_PUBLIC( cast_to_L1TMuonGlobalParams_PUBLIC(*microGMTParamsHandle.product()) ) );
517  if( microGMTParams->pnodes_.empty() ){
518  edm::ESHandle<L1TMuonGlobalParams> o2oProtoHandle;
519  iSetup.get<L1TMuonGlobalParamsO2ORcd>().get(o2oProtoHandle);
520  microGMTParamsHelper = std::unique_ptr<L1TMuonGlobalParamsHelper>(new L1TMuonGlobalParamsHelper(*o2oProtoHandle.product()));
521  } else
523 
524  //microGMTParamsHelper->print(std::cout);
525  m_inputsToDisable = microGMTParamsHelper->inputsToDisable();
526  edm::LogVerbatim("L1TMuonProducer") << "uGMT inputsToDisable: " << m_inputsToDisable << "\n EMTF-|OMTF-| BMTF |OMTF+|EMTF+| CALO | res 0";
527  m_caloInputsToDisable = microGMTParamsHelper->caloInputsToDisable();
528  m_bmtfInputsToDisable = microGMTParamsHelper->bmtfInputsToDisable();
529  m_omtfInputsToDisable = microGMTParamsHelper->omtfInputsToDisable();
530  m_emtfInputsToDisable = microGMTParamsHelper->emtfInputsToDisable();
531  m_maskedInputs = microGMTParamsHelper->maskedInputs();
532  edm::LogVerbatim("L1TMuonProducer") << "uGMT maskedInputs: " << m_maskedInputs << "\n EMTF-|OMTF-| BMTF |OMTF+|EMTF+| CALO | res 0";
533  m_maskedCaloInputs = microGMTParamsHelper->maskedCaloInputs();
534  m_maskedBmtfInputs = microGMTParamsHelper->maskedBmtfInputs();
535  m_maskedOmtfInputs = microGMTParamsHelper->maskedOmtfInputs();
536  m_maskedEmtfInputs = microGMTParamsHelper->maskedEmtfInputs();
540 
541  if (m_autoCancelMode && microGMTParamsHelper->fwVersion() > 0x5000000) {
543  }
544 }
545 
546 // ------------ method called when ending the processing of a run ------------
547 void
549 {
550 }
551 
552 // ------------ method called when starting to processes a luminosity block ------------
553 void
555 {
556 }
557 
558 // ------------ method called when ending the processing of a luminosity block ------------
559 void
561 {
562 }
563 
564 // ------------ method fills 'descriptions' with the allowed parameters for the module ------------
565 void
567  //The following says we do not know what parameters are allowed so do no validation
568  // Please change this to state exactly what you do use, even if it is no parameters
570  desc.setUnknown();
571  descriptions.addDefault(desc);
572 }
573 
574 //define this as a plug-in
size
Write out results.
const L1TMuonGlobalParams & cast_to_L1TMuonGlobalParams(const L1TMuonGlobalParams_PUBLIC &x)
void beginRun(edm::Run const &, edm::EventSetup const &) override
T getParameter(std::string const &) const
void endLuminosityBlock(edm::LuminosityBlock const &, edm::EventSetup const &) override
void extrapolateMuons(MicroGMTConfiguration::InterMuonList &) const
void setCancelOutBitsOverlapEndcap(GMTInternalWedges &, GMTInternalWedges &, cancelmode)
Cancel-out between overlap and endcap track finders.
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
Definition: Event.h:137
void initialise(L1TMuonGlobalParamsHelper *)
Initialisation from ES record.
std::ofstream m_debugOut
unsigned size(int bx) const
void setCancelOutBitsOverlapBarrel(GMTInternalWedges &, GMTInternalWedges &, cancelmode)
Cancel-out between overlap and barrel track finders.
edm::EDGetTokenT< MicroGMTConfiguration::InputCollection > m_endcapTfInputToken
std::unique_ptr< L1TMuonGlobalParamsHelper > microGMTParamsHelper
void convertMuons(edm::Handle< MicroGMTConfiguration::InputCollection > const &in, MicroGMTConfiguration::InterMuonList &out, GMTInternalWedges &wedges, int bx) const
std::bitset< 12 > m_bmtfInputsToDisable
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:579
void setTowerSums(const MicroGMTConfiguration::CaloInputCollection &inputs, int bx)
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:17
edm::EDGetTokenT< MicroGMTConfiguration::InputCollection > m_overlapTfInputToken
edm::EDGetTokenT< MicroGMTConfiguration::CaloInputCollection > m_caloTowerInputToken
MicroGMTIsolationUnit m_isolationUnit
delete x;
Definition: CaloConfig.h:22
l1t::cancelmode m_emtfCancelMode
std::shared_ptr< MicroGMTRankPtQualLUT > m_rankPtQualityLUT
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:230
void addDefault(ParameterSetDescription const &psetDescription)
Definition: Muon.py:1
void calculateRank(MicroGMTConfiguration::InterMuonList &muons) const
void get(HolderT &iHolder) const
void sortMuons(MicroGMTConfiguration::InterMuonList &, unsigned) const
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
void endRun(edm::Run const &, edm::EventSetup const &) override
const int hwEta() const
Get compressed eta (returned int * 0.010875 = eta)
const int mu
Definition: Constants.h:22
T min(T a, T b)
Definition: MathUtil.h:58
GMTInternalMuonList InterMuonList
edm::InputTag m_barrelTfInputTag
const int hwPhi() const
Get compressed local phi (returned int * 2*pi/576 = local phi in rad)
edm::InputTag m_endcapTfInputTag
void produce(edm::Event &, const edm::EventSetup &) override
std::bitset< 12 > m_maskedBmtfInputs
const int link() const
Get link on which the MicroGMT receives the candidate.
const tftype trackFinderType() const
Get track-finder which found the muon (bmtf, emtf_pos/emtf_neg or omtf_pos/omtf_neg) ...
BXVector< Muon > MuonBxCollection
Definition: Muon.h:11
int getFirstBX() const
const int processor() const
Get processor ID on which the candidate was found (0..5 for OMTF/EMTF; 0..11 for BMTF) ...
void setCancelOutBits(GMTInternalWedges &, tftype, cancelmode)
Cancel out between sectors/wedges in one track finder.
JetCorrectorParametersCollection coll
Definition: classes.h:10
~L1TMuonProducer() override
void addMuonsToCollections(MicroGMTConfiguration::InterMuonList &coll, MicroGMTConfiguration::InterMuonList &interout, std::unique_ptr< MuonBxCollection > &out, int bx) const
edm::EDGetTokenT< MicroGMTConfiguration::InputCollection > m_barrelTfInputToken
HLT enums.
void beginLuminosityBlock(edm::LuminosityBlock const &, edm::EventSetup const &) override
std::bitset< 12 > m_maskedEmtfInputs
T get() const
Definition: EventSetup.h:63
int getLastBX() const
const L1TMuonGlobalParams_PUBLIC & cast_to_L1TMuonGlobalParams_PUBLIC(const L1TMuonGlobalParams &x)
static bool compareMuons(const std::shared_ptr< MicroGMTConfiguration::InterMuon > &mu1, const std::shared_ptr< MicroGMTConfiguration::InterMuon > &mu2)
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
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
MicroGMTCancelOutUnit m_cancelOutUnit
void initialise(L1TMuonGlobalParamsHelper *)
Initialisation from ES record.
edm::InputTag m_trigTowerTag
void isolatePreSummed(MicroGMTConfiguration::InterMuonList &muons) const
T const * product() const
Definition: ESHandle.h:86
def move(src, dest)
Definition: eostools.py:510
Definition: Run.h:44
std::bitset< 28 > m_maskedCaloInputs
const T & at(int bx, unsigned i) const