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