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;
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;
121 
126 
127  };
128 
129 //
130 // constants, enums and typedefs
131 //
132 
133 
134 //
135 // static data member definitions
136 //
137 
138 //
139 // constructors and destructor
140 //
141 L1TMuonProducer::L1TMuonProducer(const edm::ParameterSet& iConfig) : m_debugOut("test/debug/iso_debug.dat")
142 {
143  // edm::InputTag barrelTfInputTag = iConfig.getParameter<edm::InputTag>("barrelTFInput");
144  // edm::InputTag overlapTfInputTag = iConfig.getParameter<edm::InputTag>("overlapTFInput");
145  // edm::InputTag forwardTfInputTag = iConfig.getParameter<edm::InputTag>("forwardTFInput");
146 
147  m_barrelTfInputTag = iConfig.getParameter<edm::InputTag>("barrelTFInput");
148  m_overlapTfInputTag = iConfig.getParameter<edm::InputTag>("overlapTFInput");
149  m_endcapTfInputTag = iConfig.getParameter<edm::InputTag>("forwardTFInput");
150  m_trigTowerTag = iConfig.getParameter<edm::InputTag>("triggerTowerInput");
151 
152  m_autoBxRange = iConfig.getParameter<bool>("autoBxRange");
153  m_bxMin = iConfig.getParameter<int>("bxMin");
154  m_bxMax = iConfig.getParameter<int>("bxMax");
155 
156  m_barrelTfInputToken = consumes<MicroGMTConfiguration::InputCollection>(m_barrelTfInputTag);
157  m_overlapTfInputToken = consumes<MicroGMTConfiguration::InputCollection>(m_overlapTfInputTag);
158  m_endcapTfInputToken = consumes<MicroGMTConfiguration::InputCollection>(m_endcapTfInputTag);
159  m_caloTowerInputToken = consumes<MicroGMTConfiguration::CaloInputCollection>(m_trigTowerTag);
160 
161  //register your products
162  produces<MuonBxCollection>();
163  produces<MuonBxCollection>("imdMuonsBMTF");
164  produces<MuonBxCollection>("imdMuonsEMTFPos");
165  produces<MuonBxCollection>("imdMuonsEMTFNeg");
166  produces<MuonBxCollection>("imdMuonsOMTFPos");
167  produces<MuonBxCollection>("imdMuonsOMTFNeg");
168 }
169 
171 {
172  m_debugOut.close();
173 }
174 
175 
176 //
177 // member functions
178 //
179 
180 
181 
182 // ------------ method called to produce the data ------------
183 void
185 {
186  using namespace edm;
187  std::unique_ptr<MuonBxCollection> outMuons (new MuonBxCollection());
188  std::unique_ptr<MuonBxCollection> imdMuonsBMTF (new MuonBxCollection());
189  std::unique_ptr<MuonBxCollection> imdMuonsEMTFPos (new MuonBxCollection());
190  std::unique_ptr<MuonBxCollection> imdMuonsEMTFNeg (new MuonBxCollection());
191  std::unique_ptr<MuonBxCollection> imdMuonsOMTFPos (new MuonBxCollection());
192  std::unique_ptr<MuonBxCollection> imdMuonsOMTFNeg (new MuonBxCollection());
193 
194 
199 
200  iEvent.getByToken(m_barrelTfInputToken, bmtfMuons);
201  iEvent.getByToken(m_endcapTfInputToken, emtfMuons);
202  iEvent.getByToken(m_overlapTfInputToken, omtfMuons);
203  iEvent.getByToken(m_caloTowerInputToken, trigTowers);
204 
205  // find out the BX range from the inputs
206  // the smallest BX window defines the output BX window
207  if (m_autoBxRange) {
208  int bxMin = -1000;
209  int bxMax = 1000;
210  if (!(m_caloInputsToDisable.all() || m_maskedCaloInputs.all())) {
211  bxMin = std::max(bxMin, trigTowers->getFirstBX());
212  bxMax = std::min(bxMax, trigTowers->getLastBX());
213  }
214  if (!(m_bmtfInputsToDisable.all() || m_maskedBmtfInputs.all())) {
215  bxMin = std::max(bxMin, bmtfMuons->getFirstBX());
216  bxMax = std::min(bxMax, bmtfMuons->getLastBX());
217  }
218  if (!(m_omtfInputsToDisable.all() || m_maskedOmtfInputs.all())) {
219  bxMin = std::max(bxMin, omtfMuons->getFirstBX());
220  bxMax = std::min(bxMax, omtfMuons->getLastBX());
221  }
222  if (!(m_emtfInputsToDisable.all() || m_maskedEmtfInputs.all())) {
223  bxMin = std::max(bxMin, emtfMuons->getFirstBX());
224  bxMax = std::min(bxMax, emtfMuons->getLastBX());
225  }
226  if (bxMin > 0) {
227  bxMin = 0;
228  }
229  if (bxMax < 0){
230  bxMax = 0;
231  }
232  if (bxMin > -1000) {
233  m_bxMin = bxMin;
234  } else {
235  m_bxMin = 0;
236  }
237  if (bxMax < 1000) {
238  m_bxMax = bxMax;
239  } else {
240  m_bxMax = 0;
241  }
242  }
243 
244  // set BX range for outputs
245  outMuons->setBXRange(m_bxMin, m_bxMax);
246  imdMuonsBMTF->setBXRange(m_bxMin, m_bxMax);
247  imdMuonsEMTFPos->setBXRange(m_bxMin, m_bxMax);
248  imdMuonsEMTFNeg->setBXRange(m_bxMin, m_bxMax);
249  imdMuonsOMTFPos->setBXRange(m_bxMin, m_bxMax);
250  imdMuonsOMTFNeg->setBXRange(m_bxMin, m_bxMax);
251 
252  for (int bx = m_bxMin; bx <= m_bxMax; ++bx) {
253  m_isolationUnit.setTowerSums(*trigTowers, bx);
254  MicroGMTConfiguration::InterMuonList internMuonsBmtf;
255  MicroGMTConfiguration::InterMuonList internMuonsEmtfPos;
256  MicroGMTConfiguration::InterMuonList internMuonsEmtfNeg;
257  MicroGMTConfiguration::InterMuonList internMuonsOmtfPos;
258  MicroGMTConfiguration::InterMuonList internMuonsOmtfNeg;
259 
260  // These wedges contain shared pointers to the ones in the InterMuonList
261  GMTInternalWedges omtfNegWedges;
262  GMTInternalWedges bmtfWedges;
263  GMTInternalWedges emtfPosWedges;
264  GMTInternalWedges emtfNegWedges;
265  GMTInternalWedges omtfPosWedges;
266 
267  // this converts the InputMuon type to the InternalMuon type and splits them into
268  // positive / negative eta collections necessary as LUTs may differ for pos / neg.
269  convertMuons(bmtfMuons, internMuonsBmtf, bmtfWedges, bx);
270  splitAndConvertMuons(emtfMuons, internMuonsEmtfPos, internMuonsEmtfNeg, emtfPosWedges, emtfNegWedges, bx);
271  splitAndConvertMuons(omtfMuons, internMuonsOmtfPos, internMuonsOmtfNeg, omtfPosWedges, omtfNegWedges, bx);
272 
273  // cancel out within the track finders:
277  // cancel-out for endcap will be done in the sorter
280 
281  // cancel out between track finder acceptance overlaps:
286 
287  m_isolationUnit.extrapolateMuons(internMuonsBmtf);
288  m_isolationUnit.extrapolateMuons(internMuonsEmtfNeg);
289  m_isolationUnit.extrapolateMuons(internMuonsEmtfPos);
290  m_isolationUnit.extrapolateMuons(internMuonsOmtfNeg);
291  m_isolationUnit.extrapolateMuons(internMuonsOmtfPos);
292 
293  // the rank calculated here is used in the sort below
294  calculateRank(internMuonsBmtf);
295  calculateRank(internMuonsEmtfNeg);
296  calculateRank(internMuonsEmtfPos);
297  calculateRank(internMuonsOmtfNeg);
298  calculateRank(internMuonsOmtfPos);
299 
300  // The sort function both sorts and removes all but best "nSurvivors"
301  sortMuons(internMuonsBmtf, 8);
302  sortMuons(internMuonsOmtfPos, 4);
303  sortMuons(internMuonsOmtfNeg, 4);
304  sortMuons(internMuonsEmtfPos, 4);
305  sortMuons(internMuonsEmtfNeg, 4);
306 
307  // This combines the 5 streams into one InternalMuon collection for
308  // the final global sort.
310  addMuonsToCollections(internMuonsEmtfPos, internalMuons, imdMuonsEMTFPos, bx);
311  addMuonsToCollections(internMuonsOmtfPos, internalMuons, imdMuonsOMTFPos, bx);
312  addMuonsToCollections(internMuonsBmtf, internalMuons, imdMuonsBMTF, bx);
313  addMuonsToCollections(internMuonsOmtfNeg, internalMuons, imdMuonsOMTFNeg, bx);
314  addMuonsToCollections(internMuonsEmtfNeg, internalMuons, imdMuonsEMTFNeg, bx);
315 
316  // sort internal muons and delete all but best 8
317  sortMuons(internalMuons, 8);
318 
319  m_isolationUnit.isolatePreSummed(internalMuons);
320  // copy muons to output collection...
321  for (const auto& mu : internalMuons) {
322  if (mu->hwPt() > 0) {
323  math::PtEtaPhiMLorentzVector vec{(mu->hwPt()-1)*0.5, mu->hwEta()*0.010875, mu->hwGlobalPhi()*0.010908, 0.0};
324  int iso = mu->hwAbsIso() + (mu->hwRelIso() << 1);
325  int outMuQual = MicroGMTConfiguration::setOutputMuonQuality(mu->hwQual(), mu->trackFinderType(), mu->hwHF());
326  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()};
327  if (mu->hwSignValid()) {
328  outMu.setCharge(1 - 2 * mu->hwSign());
329  } else {
330  outMu.setCharge(0);
331  }
332  // set the coordinates at the vertex
333  outMu.setHwEtaAtVtx(MicroGMTConfiguration::calcMuonHwEtaExtra(outMu));
334  outMu.setHwPhiAtVtx(MicroGMTConfiguration::calcMuonHwPhiExtra(outMu));
335  outMu.setEtaAtVtx(MicroGMTConfiguration::calcMuonEtaExtra(outMu));
336  outMu.setPhiAtVtx(MicroGMTConfiguration::calcMuonPhiExtra(outMu));
337  m_debugOut << mu->hwCaloPhi() << " " << mu->hwCaloEta() << std::endl;
338  outMuons->push_back(bx, outMu);
339  }
340  }
341  }
342 
343  iEvent.put(std::move(outMuons));
344  iEvent.put(std::move(imdMuonsBMTF), "imdMuonsBMTF");
345  iEvent.put(std::move(imdMuonsEMTFPos), "imdMuonsEMTFPos");
346  iEvent.put(std::move(imdMuonsEMTFNeg), "imdMuonsEMTFNeg");
347  iEvent.put(std::move(imdMuonsOMTFPos), "imdMuonsOMTFPos");
348  iEvent.put(std::move(imdMuonsOMTFNeg), "imdMuonsOMTFNeg");
349 }
350 
351 
352 bool
353 L1TMuonProducer::compareMuons(const std::shared_ptr<MicroGMTConfiguration::InterMuon>& mu1,
354  const std::shared_ptr<MicroGMTConfiguration::InterMuon>& mu2) {
355  return (mu1->hwWins() >= mu2->hwWins());
356 }
357 
358 void
360  MicroGMTConfiguration::InterMuonList::iterator mu1;
361  // reset from previous sort stage
362  for (mu1 = muons.begin(); mu1 != muons.end(); ++mu1) {
363  (*mu1)->setHwWins(0);
364  }
365 
366  int nCancelled = 0;
367  for (mu1 = muons.begin(); mu1 != muons.end(); ++mu1) {
368  int mu1CancelBit = (*mu1)->hwCancelBit();
369  nCancelled += mu1CancelBit;
370  auto mu2 = mu1;
371  mu2++;
372  for ( ; mu2 != muons.end(); ++mu2) {
373  if (mu1CancelBit != 1 && (*mu2)->hwCancelBit() != 1) {
374  if ((*mu1)->hwRank() >= (*mu2)->hwRank()) {
375  (*mu1)->increaseWins();
376  } else {
377  (*mu2)->increaseWins();
378  }
379  } else if (mu1CancelBit != 1) {
380  (*mu1)->increaseWins();
381  } else if ((*mu2)->hwCancelBit() != 1) {
382  (*mu2)->increaseWins();
383  }
384  }
385  }
386 
387  size_t nMuonsBefore = muons.size();
388  int minWins = nMuonsBefore - nSurvivors;
389 
390  // remove all muons that were cancelled or that do not have sufficient rank
391  // (reduces the container size to nSurvivors)
392  muons.remove_if([&minWins](auto muon) { return ((muon->hwWins() < minWins) || (muon->hwCancelBit() == 1)); });
393  muons.sort(L1TMuonProducer::compareMuons);
394 }
395 
396 
397 
398 void
400 {
401  for (auto& mu1 : muons) {
402  int rank = m_rankPtQualityLUT->lookup(mu1->hwPt(), mu1->hwQual());
403  mu1->setHwRank(rank);
404  }
405 }
406 
407 
408 void
411  std::unique_ptr<MuonBxCollection>& out, int bx) const
412 {
413  for (auto& mu : coll) {
414  interout.push_back(mu);
415  math::PtEtaPhiMLorentzVector vec{(mu->hwPt()-1)*0.5, mu->hwEta()*0.010875, mu->hwGlobalPhi()*0.010908, 0.0};
416  int outMuQual = MicroGMTConfiguration::setOutputMuonQuality(mu->hwQual(), mu->trackFinderType(), mu->hwHF());
417  // set tfMuonIndex and iso to 0 like in the FW
418  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()};
419  if (mu->hwSignValid()) {
420  outMu.setCharge(1 - 2 * mu->hwSign());
421  } else {
422  outMu.setCharge(0);
423  }
424 
425  out->push_back(bx, outMu);
426  }
427 }
428 
429 void
433  GMTInternalWedges& wedges_pos,
434  GMTInternalWedges& wedges_neg,
435  int bx) const
436 {
437  // initialize the wedge collections:
438  for (int i = 0; i < 6; ++i) {
439  wedges_pos[i] = std::vector<std::shared_ptr<GMTInternalMuon>>();
440  wedges_pos[i].reserve(3);
441  wedges_neg[i] = std::vector<std::shared_ptr<GMTInternalMuon>>();
442  wedges_neg[i].reserve(3);
443  }
444  if (bx < in->getFirstBX() || bx > in->getLastBX()) return;
445  int muIdx = 0;
446  int currentLink = 0;
447  for (size_t i = 0; i < in->size(bx); ++i, ++muIdx) {
448  int link = in->at(bx, i).link();
449  if (m_inputsToDisable.test(link) || m_maskedInputs.test(link)) continue; // only process if input link is enabled and not masked
450  if (currentLink != link) {
451  muIdx = 0;
452  currentLink = link;
453  }
454  int gPhi = MicroGMTConfiguration::calcGlobalPhi(in->at(bx, i).hwPhi(), in->at(bx, i).trackFinderType(), in->at(bx, i).processor());
455  int tfMuonIdx = 3 * (currentLink - 36) + muIdx;
456  std::shared_ptr<GMTInternalMuon> out = std::make_shared<GMTInternalMuon>(in->at(bx, i), gPhi, tfMuonIdx);
457  if(in->at(bx, i).hwEta() > 0) {
458  out_pos.push_back(out);
459  wedges_pos[in->at(bx, i).processor()].push_back(out);
460  } else {
461  out_neg.emplace_back(out);
462  wedges_neg[in->at(bx, i).processor()].push_back(out);
463  }
464  }
465  for (int i = 0; i < 6; ++i) {
466  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;
467  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;
468  }
469 }
470 
471 void
474  GMTInternalWedges& wedges, int bx) const
475 {
476  // initialize the wedge collection:
477  for (int i = 0; i < 12; ++i) {
478  wedges[i] = std::vector<std::shared_ptr<GMTInternalMuon>>();
479  wedges[i].reserve(3);
480  }
481  if (bx < in->getFirstBX() || bx > in->getLastBX()) return;
482  int muIdx = 0;
483  int currentLink = 0;
484  for (size_t i = 0; i < in->size(bx); ++i, ++muIdx) {
485  int link = in->at(bx, i).link();
486  if (m_inputsToDisable.test(link) || m_maskedInputs.test(link)) continue; // only process if input link is enabled and not masked
487  if (currentLink != link) {
488  muIdx = 0;
489  currentLink = link;
490  }
491  int gPhi = MicroGMTConfiguration::calcGlobalPhi(in->at(bx, i).hwPhi(), in->at(bx, i).trackFinderType(), in->at(bx, i).processor());
492  int tfMuonIdx = 3 * (currentLink - 36) + muIdx;
493  std::shared_ptr<GMTInternalMuon> outMu = std::make_shared<GMTInternalMuon>(in->at(bx, i), gPhi, tfMuonIdx);
494  out.emplace_back(outMu);
495  wedges[in->at(bx, i).processor()].push_back(outMu);
496  }
497  for (int i = 0; i < 12; ++i) {
498  if(wedges[i].size() > 3) edm::LogWarning("Input Mismatch") << " too many inputs per processor for barrel. Wedge " << i << ": Size " << wedges[i].size() << std::endl;
499  }
500 }
501 
502 // ------------ method called when starting to processes a run ------------
503 void
505 {
506  const L1TMuonGlobalParamsRcd& microGMTParamsRcd = iSetup.get<L1TMuonGlobalParamsRcd>();
507  edm::ESHandle<L1TMuonGlobalParams> microGMTParamsHandle;
508  microGMTParamsRcd.get(microGMTParamsHandle);
509 
510  std::unique_ptr<L1TMuonGlobalParams_PUBLIC> microGMTParams( new L1TMuonGlobalParams_PUBLIC( cast_to_L1TMuonGlobalParams_PUBLIC(*microGMTParamsHandle.product()) ) );
511  if( microGMTParams->pnodes_.empty() ){
512  edm::ESHandle<L1TMuonGlobalParams> o2oProtoHandle;
513  iSetup.get<L1TMuonGlobalParamsO2ORcd>().get(o2oProtoHandle);
514  microGMTParamsHelper = std::unique_ptr<L1TMuonGlobalParamsHelper>(new L1TMuonGlobalParamsHelper(*o2oProtoHandle.product()));
515  } else
517 
518  //microGMTParamsHelper->print(std::cout);
519  m_inputsToDisable = microGMTParamsHelper->inputsToDisable();
520  edm::LogVerbatim("L1TMuonProducer") << "uGMT inputsToDisable: " << m_inputsToDisable << "\n EMTF-|OMTF-| BMTF |OMTF+|EMTF+| CALO | res 0";
521  m_caloInputsToDisable = microGMTParamsHelper->caloInputsToDisable();
522  m_bmtfInputsToDisable = microGMTParamsHelper->bmtfInputsToDisable();
523  m_omtfInputsToDisable = microGMTParamsHelper->omtfInputsToDisable();
524  m_emtfInputsToDisable = microGMTParamsHelper->emtfInputsToDisable();
525  m_maskedInputs = microGMTParamsHelper->maskedInputs();
526  edm::LogVerbatim("L1TMuonProducer") << "uGMT maskedInputs: " << m_maskedInputs << "\n EMTF-|OMTF-| BMTF |OMTF+|EMTF+| CALO | res 0";
527  m_maskedCaloInputs = microGMTParamsHelper->maskedCaloInputs();
528  m_maskedBmtfInputs = microGMTParamsHelper->maskedBmtfInputs();
529  m_maskedOmtfInputs = microGMTParamsHelper->maskedOmtfInputs();
530  m_maskedEmtfInputs = microGMTParamsHelper->maskedEmtfInputs();
534 }
535 
536 // ------------ method called when ending the processing of a run ------------
537 void
539 {
540 }
541 
542 // ------------ method called when starting to processes a luminosity block ------------
543 void
545 {
546 }
547 
548 // ------------ method called when ending the processing of a luminosity block ------------
549 void
551 {
552 }
553 
554 // ------------ method fills 'descriptions' with the allowed parameters for the module ------------
555 void
557  //The following says we do not know what parameters are allowed so do no validation
558  // Please change this to state exactly what you do use, even if it is no parameters
560  desc.setUnknown();
561  descriptions.addDefault(desc);
562 }
563 
564 //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:136
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:519
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
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
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:10
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
const T & get() const
Definition: EventSetup.h:58
edm::EDGetTokenT< MicroGMTConfiguration::InputCollection > m_barrelTfInputToken
HLT enums.
void beginLuminosityBlock(edm::LuminosityBlock const &, edm::EventSetup const &) override
std::bitset< 12 > m_maskedEmtfInputs
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:43
std::bitset< 28 > m_maskedCaloInputs
const T & at(int bx, unsigned i) const