From 80d663fd504bfee19eede84fc6b8d69e8d536f9f Mon Sep 17 00:00:00 2001 From: Dinyar Rabady Date: Mon, 2 May 2016 09:17:01 +0200 Subject: [PATCH 1/4] Improvements to cancel-out units. Increased possible dEta window to 0.31, allowed use of parameters fPhi and fEta to make cancel-out window oblong, and layed groundwork to use eta fine bit. Conflicts: L1Trigger/L1TMuon/plugins/L1TMuonGlobalParamsESProducer.cc L1Trigger/L1TMuon/src/MicroGMTCancelOutUnit.cc L1Trigger/L1TMuon/src/MicroGMTMatchQualLUT.cc --- .../interface/L1TMuonGlobalParamsHelper.h | 41 +++++++++++++----- .../L1TMuon/interface/MicroGMTLUTFactories.h | 2 +- .../L1TMuon/interface/MicroGMTMatchQualLUT.h | 4 +- .../L1TMuon/plugins/L1TMicroGMTLUTDumper.cc | 16 +++---- .../plugins/L1TMuonGlobalParamsESProducer.cc | 33 +++++++------- L1Trigger/L1TMuon/python/fakeGmtParams_cff.py | 43 +++++++++++++++---- .../L1TMuon/src/L1TMuonGlobalParamsHelper.cc | 4 +- .../L1TMuon/src/MicroGMTCancelOutUnit.cc | 9 ++-- L1Trigger/L1TMuon/src/MicroGMTMatchQualLUT.cc | 8 ++-- .../src/MicroGMTMatchQualLUTFactory.cc | 15 ++++--- 10 files changed, 114 insertions(+), 61 deletions(-) diff --git a/L1Trigger/L1TMuon/interface/L1TMuonGlobalParamsHelper.h b/L1Trigger/L1TMuon/interface/L1TMuonGlobalParamsHelper.h index 8dd2e473de50f..e52e7c69d9560 100644 --- a/L1Trigger/L1TMuon/interface/L1TMuonGlobalParamsHelper.h +++ b/L1Trigger/L1TMuon/interface/L1TMuonGlobalParamsHelper.h @@ -53,7 +53,7 @@ class L1TMuonGlobalParamsHelper : public L1TMuonGlobalParams_PUBLIC { enum upIdx {ptFactor=0, qualFactor=1, FWVERSION_IDX=0, CALOINPUTS=0, BMTFINPUTS=1, OMTFINPUTS=2, EMTFINPUTS=3}; // double parameters indices - enum dpIdx {maxdr=0, maxdrEtaFine=1}; + enum dpIdx {maxdr=0, fEta=1, fEtaCoarse=2, fPhi=3}; // input enable indices enum linkNr {CALOLINK1=8, EMTFPLINK1=36, OMTFPLINK1=42, BMTFLINK1=48, OMTFNLINK1=60, EMTFNLINK1=66}; // link numbers start at 0 @@ -189,18 +189,37 @@ class L1TMuonGlobalParamsHelper : public L1TMuonGlobalParams_PUBLIC { double ovlNegSingleMatchQualLUTMaxDR() const { return pnodes_[ovlNegSingleMatchQual].dparams_.size() > dpIdx::maxdr ? pnodes_[ovlNegSingleMatchQual].dparams_[dpIdx::maxdr] : 0.; } double bOPosMatchQualLUTMaxDR() const { return pnodes_[bOPosMatchQual].dparams_.size() > dpIdx::maxdr ? pnodes_[bOPosMatchQual].dparams_[dpIdx::maxdr] : 0.; } double bONegMatchQualLUTMaxDR() const { return pnodes_[bONegMatchQual].dparams_.size() > dpIdx::maxdr ? pnodes_[bONegMatchQual].dparams_[dpIdx::maxdr] : 0.; } - double bOPosMatchQualLUTMaxDREtaFine() const { return pnodes_[bOPosMatchQual].dparams_.size() > dpIdx::maxdrEtaFine ? pnodes_[bOPosMatchQual].dparams_[dpIdx::maxdrEtaFine] : 0.; } - double bONegMatchQualLUTMaxDREtaFine() const { return pnodes_[bONegMatchQual].dparams_.size() > dpIdx::maxdrEtaFine ? pnodes_[bONegMatchQual].dparams_[dpIdx::maxdrEtaFine] : 0.; } double fOPosMatchQualLUTMaxDR() const { return pnodes_[fOPosMatchQual].dparams_.size() > dpIdx::maxdr ? pnodes_[fOPosMatchQual].dparams_[dpIdx::maxdr] : 0.; } double fONegMatchQualLUTMaxDR() const { return pnodes_[fONegMatchQual].dparams_.size() > dpIdx::maxdr ? pnodes_[fONegMatchQual].dparams_[dpIdx::maxdr] : 0.; } - void setFwdPosSingleMatchQualLUTMaxDR (double maxDR) { pnodes_[fwdPosSingleMatchQual].dparams_.push_back(maxDR); } - void setFwdNegSingleMatchQualLUTMaxDR (double maxDR) { pnodes_[fwdNegSingleMatchQual].dparams_.push_back(maxDR); } - void setOvlPosSingleMatchQualLUTMaxDR (double maxDR) { pnodes_[ovlPosSingleMatchQual].dparams_.push_back(maxDR); } - void setOvlNegSingleMatchQualLUTMaxDR (double maxDR) { pnodes_[ovlNegSingleMatchQual].dparams_.push_back(maxDR); } - void setBOPosMatchQualLUTMaxDR (double maxDR, double maxDREtaFine) { pnodes_[bOPosMatchQual].dparams_.push_back(maxDR); pnodes_[bOPosMatchQual].dparams_.push_back(maxDREtaFine); } - void setBONegMatchQualLUTMaxDR (double maxDR, double maxDREtaFine) { pnodes_[bONegMatchQual].dparams_.push_back(maxDR); pnodes_[bONegMatchQual].dparams_.push_back(maxDREtaFine); } - void setFOPosMatchQualLUTMaxDR (double maxDR) { pnodes_[fOPosMatchQual].dparams_.push_back(maxDR); } - void setFONegMatchQualLUTMaxDR (double maxDR) { pnodes_[fONegMatchQual].dparams_.push_back(maxDR); } + + double fwdPosSingleMatchQualLUTfEta() const { return pnodes_[fwdPosSingleMatchQual].dparams_.size() > dpIdx::fEta ? pnodes_[fwdPosSingleMatchQual].dparams_[dpIdx::fEta] : 0.; } + double fwdNegSingleMatchQualLUTfEta() const { return pnodes_[fwdNegSingleMatchQual].dparams_.size() > dpIdx::fEta ? pnodes_[fwdNegSingleMatchQual].dparams_[dpIdx::fEta] : 0.; } + double ovlPosSingleMatchQualLUTfEta() const { return pnodes_[ovlPosSingleMatchQual].dparams_.size() > dpIdx::fEta ? pnodes_[ovlPosSingleMatchQual].dparams_[dpIdx::fEta] : 0.; } + double ovlNegSingleMatchQualLUTfEta() const { return pnodes_[ovlNegSingleMatchQual].dparams_.size() > dpIdx::fEta ? pnodes_[ovlNegSingleMatchQual].dparams_[dpIdx::fEta] : 0.; } + double bOPosMatchQualLUTfEta() const { return pnodes_[bOPosMatchQual].dparams_.size() > dpIdx::fEta ? pnodes_[bOPosMatchQual].dparams_[dpIdx::fEta] : 0.; } + double bONegMatchQualLUTfEta() const { return pnodes_[bONegMatchQual].dparams_.size() > dpIdx::fEta ? pnodes_[bONegMatchQual].dparams_[dpIdx::fEta] : 0.; } + double bOPosMatchQualLUTfEtaCoarse() const { return pnodes_[bOPosMatchQual].dparams_.size() > dpIdx::fEtaCoarse ? pnodes_[bOPosMatchQual].dparams_[dpIdx::fEtaCoarse] : 0.; } + double bONegMatchQualLUTfEtaCoarse() const { return pnodes_[bONegMatchQual].dparams_.size() > dpIdx::fEtaCoarse ? pnodes_[bONegMatchQual].dparams_[dpIdx::fEtaCoarse] : 0.; } + double fOPosMatchQualLUTfEta() const { return pnodes_[fOPosMatchQual].dparams_.size() > dpIdx::fEta ? pnodes_[fOPosMatchQual].dparams_[dpIdx::fEta] : 0.; } + double fONegMatchQualLUTfEta() const { return pnodes_[fONegMatchQual].dparams_.size() > dpIdx::fEta ? pnodes_[fONegMatchQual].dparams_[dpIdx::fEta] : 0.; } + double fwdPosSingleMatchQualLUTfPhi() const { return pnodes_[fwdPosSingleMatchQual].dparams_.size() > dpIdx::fPhi ? pnodes_[fwdPosSingleMatchQual].dparams_[dpIdx::fPhi] : 0.; } + double fwdNegSingleMatchQualLUTfPhi() const { return pnodes_[fwdNegSingleMatchQual].dparams_.size() > dpIdx::fPhi ? pnodes_[fwdNegSingleMatchQual].dparams_[dpIdx::fPhi] : 0.; } + double ovlPosSingleMatchQualLUTfPhi() const { return pnodes_[ovlPosSingleMatchQual].dparams_.size() > dpIdx::fPhi ? pnodes_[ovlPosSingleMatchQual].dparams_[dpIdx::fPhi] : 0.; } + double ovlNegSingleMatchQualLUTfPhi() const { return pnodes_[ovlNegSingleMatchQual].dparams_.size() > dpIdx::fPhi ? pnodes_[ovlNegSingleMatchQual].dparams_[dpIdx::fPhi] : 0.; } + double bOPosMatchQualLUTfPhi() const { return pnodes_[bOPosMatchQual].dparams_.size() > dpIdx::fPhi ? pnodes_[bOPosMatchQual].dparams_[dpIdx::fPhi] : 0.; } + double bONegMatchQualLUTfPhi() const { return pnodes_[bONegMatchQual].dparams_.size() > dpIdx::fPhi ? pnodes_[bONegMatchQual].dparams_[dpIdx::fPhi] : 0.; } + double fOPosMatchQualLUTfPhi() const { return pnodes_[fOPosMatchQual].dparams_.size() > dpIdx::fPhi ? pnodes_[fOPosMatchQual].dparams_[dpIdx::fPhi] : 0.; } + double fONegMatchQualLUTfPhi() const { return pnodes_[fONegMatchQual].dparams_.size() > dpIdx::fPhi ? pnodes_[fONegMatchQual].dparams_[dpIdx::fPhi] : 0.; } + + void setFwdPosSingleMatchQualLUTMaxDR (double maxDR, double fEta, double fPhi) { pnodes_[fwdPosSingleMatchQual].dparams_.push_back(maxDR); pnodes_[fwdPosSingleMatchQual].dparams_.push_back(fEta); pnodes_[fwdPosSingleMatchQual].dparams_.push_back(fEta); pnodes_[fwdPosSingleMatchQual].dparams_.push_back(fPhi); } + void setFwdNegSingleMatchQualLUTMaxDR (double maxDR, double fEta, double fPhi) { pnodes_[fwdNegSingleMatchQual].dparams_.push_back(maxDR); pnodes_[fwdNegSingleMatchQual].dparams_.push_back(fEta); pnodes_[fwdNegSingleMatchQual].dparams_.push_back(fEta); pnodes_[fwdNegSingleMatchQual].dparams_.push_back(fPhi); } + void setOvlPosSingleMatchQualLUTMaxDR (double maxDR, double fEta, double fPhi) { pnodes_[ovlPosSingleMatchQual].dparams_.push_back(maxDR); pnodes_[ovlPosSingleMatchQual].dparams_.push_back(fEta); pnodes_[ovlPosSingleMatchQual].dparams_.push_back(fEta); pnodes_[ovlPosSingleMatchQual].dparams_.push_back(fPhi); } + void setOvlNegSingleMatchQualLUTMaxDR (double maxDR, double fEta, double fPhi) { pnodes_[ovlNegSingleMatchQual].dparams_.push_back(maxDR); pnodes_[ovlNegSingleMatchQual].dparams_.push_back(fEta); pnodes_[ovlNegSingleMatchQual].dparams_.push_back(fEta); pnodes_[ovlNegSingleMatchQual].dparams_.push_back(fPhi); } + void setBOPosMatchQualLUTMaxDR (double maxDR, double fEta, double fEtaCoarse, double fPhi) { pnodes_[bOPosMatchQual].dparams_.push_back(maxDR); pnodes_[bOPosMatchQual].dparams_.push_back(fEta); pnodes_[bOPosMatchQual].dparams_.push_back(fEtaCoarse); pnodes_[bOPosMatchQual].dparams_.push_back(fPhi); } + void setBONegMatchQualLUTMaxDR (double maxDR, double fEta, double fEtaCoarse, double fPhi) { pnodes_[bONegMatchQual].dparams_.push_back(maxDR); pnodes_[bONegMatchQual].dparams_.push_back(fEta); pnodes_[bONegMatchQual].dparams_.push_back(fEtaCoarse); pnodes_[bONegMatchQual].dparams_.push_back(fPhi); } + void setFOPosMatchQualLUTMaxDR (double maxDR, double fEta, double fPhi) { pnodes_[fOPosMatchQual].dparams_.push_back(maxDR); pnodes_[fOPosMatchQual].dparams_.push_back(fEta); pnodes_[fOPosMatchQual].dparams_.push_back(fEta); pnodes_[fOPosMatchQual].dparams_.push_back(fPhi); } + void setFONegMatchQualLUTMaxDR (double maxDR, double fEta, double fPhi) { pnodes_[fONegMatchQual].dparams_.push_back(maxDR); pnodes_[fONegMatchQual].dparams_.push_back(fEta); pnodes_[fONegMatchQual].dparams_.push_back(fEta); pnodes_[fONegMatchQual].dparams_.push_back(fPhi); } + // Sort rank LUT factors for pT and quality unsigned sortRankLUTPtFactor() const { return pnodes_[sortRank].uparams_.size() > upIdx::ptFactor ? pnodes_[sortRank].uparams_[upIdx::ptFactor] : 0; } diff --git a/L1Trigger/L1TMuon/interface/MicroGMTLUTFactories.h b/L1Trigger/L1TMuon/interface/MicroGMTLUTFactories.h index c7670a4bdee81..deb7a916039dd 100644 --- a/L1Trigger/L1TMuon/interface/MicroGMTLUTFactories.h +++ b/L1Trigger/L1TMuon/interface/MicroGMTLUTFactories.h @@ -30,7 +30,7 @@ namespace l1t { typedef std::shared_ptr ReturnType; - static ReturnType create(const std::string& filename, const double maxDR, cancel_t cancelType, const int fwVersion); + static ReturnType create(const std::string& filename, const double maxDR, const double fEta, const double fPhi, cancel_t cancelType, const int fwVersion); static ReturnType create(l1t::LUT* lut, cancel_t cancelType, const int fwVersion); }; diff --git a/L1Trigger/L1TMuon/interface/MicroGMTMatchQualLUT.h b/L1Trigger/L1TMuon/interface/MicroGMTMatchQualLUT.h index c07fbd37edf77..7443a2eaacd51 100644 --- a/L1Trigger/L1TMuon/interface/MicroGMTMatchQualLUT.h +++ b/L1Trigger/L1TMuon/interface/MicroGMTMatchQualLUT.h @@ -15,7 +15,7 @@ namespace l1t { class MicroGMTMatchQualLUT : public MicroGMTLUT { public: MicroGMTMatchQualLUT() {}; - explicit MicroGMTMatchQualLUT(const std::string&, const double, cancel_t cancelType); + explicit MicroGMTMatchQualLUT(const std::string&, const double maxDR, const double fEta, const double fPhi, cancel_t cancelType); explicit MicroGMTMatchQualLUT(l1t::LUT* lut, cancel_t cancelType); virtual ~MicroGMTMatchQualLUT() {}; @@ -36,6 +36,8 @@ namespace l1t { double m_phiScale; double m_maxDR; + double m_fEta; + double m_fPhi; cancel_t m_cancelType; }; diff --git a/L1Trigger/L1TMuon/plugins/L1TMicroGMTLUTDumper.cc b/L1Trigger/L1TMuon/plugins/L1TMicroGMTLUTDumper.cc index e9c97c30fb4ef..b8ac7f2536a55 100644 --- a/L1Trigger/L1TMuon/plugins/L1TMicroGMTLUTDumper.cc +++ b/L1Trigger/L1TMuon/plugins/L1TMicroGMTLUTDumper.cc @@ -190,15 +190,15 @@ L1TMicroGMTLUTDumper::beginRun(edm::Run const& run, edm::EventSetup const& iSetu m_oEtaExtrapolationLUT = MicroGMTExtrapolationLUTFactory::create(microGMTParamsHelper->oEtaExtrapolationLUTPath(), l1t::MicroGMTConfiguration::ETA_OUT, fwVersion); m_fEtaExtrapolationLUT = MicroGMTExtrapolationLUTFactory::create(microGMTParamsHelper->fEtaExtrapolationLUTPath(), l1t::MicroGMTConfiguration::ETA_OUT, fwVersion); - m_boPosMatchQualLUT = l1t::MicroGMTMatchQualLUTFactory::create(microGMTParamsHelper->bOPosMatchQualLUTPath(), microGMTParamsHelper->bOPosMatchQualLUTMaxDR(), cancel_t::omtf_bmtf_pos, fwVersion); - m_boNegMatchQualLUT = l1t::MicroGMTMatchQualLUTFactory::create(microGMTParamsHelper->bONegMatchQualLUTPath(), microGMTParamsHelper->bONegMatchQualLUTMaxDR(), cancel_t::omtf_bmtf_neg, fwVersion); - m_foPosMatchQualLUT = l1t::MicroGMTMatchQualLUTFactory::create(microGMTParamsHelper->fOPosMatchQualLUTPath(), microGMTParamsHelper->fOPosMatchQualLUTMaxDR(), cancel_t::omtf_emtf_pos, fwVersion); - m_foNegMatchQualLUT = l1t::MicroGMTMatchQualLUTFactory::create(microGMTParamsHelper->fONegMatchQualLUTPath(), microGMTParamsHelper->fONegMatchQualLUTMaxDR(), cancel_t::omtf_emtf_neg, fwVersion); + m_boPosMatchQualLUT = l1t::MicroGMTMatchQualLUTFactory::create(microGMTParamsHelper->bOPosMatchQualLUTPath(), microGMTParamsHelper->bOPosMatchQualLUTMaxDR(), microGMTParamsHelper->bOPosMatchQualLUTfEta(), microGMTParamsHelper->bOPosMatchQualLUTfPhi(), cancel_t::omtf_bmtf_pos, fwVersion); + m_boNegMatchQualLUT = l1t::MicroGMTMatchQualLUTFactory::create(microGMTParamsHelper->bONegMatchQualLUTPath(), microGMTParamsHelper->bONegMatchQualLUTMaxDR(), microGMTParamsHelper->bONegMatchQualLUTfEta(), microGMTParamsHelper->bONegMatchQualLUTfPhi(), cancel_t::omtf_bmtf_neg, fwVersion); + m_foPosMatchQualLUT = l1t::MicroGMTMatchQualLUTFactory::create(microGMTParamsHelper->fOPosMatchQualLUTPath(), microGMTParamsHelper->fOPosMatchQualLUTMaxDR(), microGMTParamsHelper->fOPosMatchQualLUTfEta(), microGMTParamsHelper->fOPosMatchQualLUTfPhi(), cancel_t::omtf_emtf_pos, fwVersion); + m_foNegMatchQualLUT = l1t::MicroGMTMatchQualLUTFactory::create(microGMTParamsHelper->fONegMatchQualLUTPath(), microGMTParamsHelper->fONegMatchQualLUTMaxDR(), microGMTParamsHelper->fONegMatchQualLUTfEta(), microGMTParamsHelper->fONegMatchQualLUTfPhi(), cancel_t::omtf_emtf_neg, fwVersion); //m_brlSingleMatchQualLUT = l1t::MicroGMTMatchQualLUTFactory::create(microGMTParamsHelper->brlSingleMatchQualLUTPath(), microGMTParamsHelper->brlSingleMatchQualLUTMaxDR(), cancel_t::bmtf_bmtf, fwVersion); - m_ovlPosSingleMatchQualLUT = l1t::MicroGMTMatchQualLUTFactory::create(microGMTParamsHelper->ovlPosSingleMatchQualLUTPath(), microGMTParamsHelper->ovlPosSingleMatchQualLUTMaxDR(), cancel_t::omtf_omtf_pos, fwVersion); - m_ovlNegSingleMatchQualLUT = l1t::MicroGMTMatchQualLUTFactory::create(microGMTParamsHelper->ovlNegSingleMatchQualLUTPath(), microGMTParamsHelper->ovlNegSingleMatchQualLUTMaxDR(), cancel_t::omtf_omtf_neg, fwVersion); - m_fwdPosSingleMatchQualLUT = l1t::MicroGMTMatchQualLUTFactory::create(microGMTParamsHelper->fwdPosSingleMatchQualLUTPath(), microGMTParamsHelper->fwdPosSingleMatchQualLUTMaxDR(), cancel_t::emtf_emtf_pos, fwVersion); - m_fwdNegSingleMatchQualLUT = l1t::MicroGMTMatchQualLUTFactory::create(microGMTParamsHelper->fwdNegSingleMatchQualLUTPath(), microGMTParamsHelper->fwdNegSingleMatchQualLUTMaxDR(), cancel_t::emtf_emtf_neg, fwVersion); + m_ovlPosSingleMatchQualLUT = l1t::MicroGMTMatchQualLUTFactory::create(microGMTParamsHelper->ovlPosSingleMatchQualLUTPath(), microGMTParamsHelper->ovlPosSingleMatchQualLUTMaxDR(), microGMTParamsHelper->ovlPosSingleMatchQualLUTfEta(), microGMTParamsHelper->ovlPosSingleMatchQualLUTfPhi(), cancel_t::omtf_omtf_pos, fwVersion); + m_ovlNegSingleMatchQualLUT = l1t::MicroGMTMatchQualLUTFactory::create(microGMTParamsHelper->ovlNegSingleMatchQualLUTPath(), microGMTParamsHelper->ovlNegSingleMatchQualLUTMaxDR(), microGMTParamsHelper->ovlNegSingleMatchQualLUTfEta(), microGMTParamsHelper->ovlNegSingleMatchQualLUTfPhi(), cancel_t::omtf_omtf_neg, fwVersion); + m_fwdPosSingleMatchQualLUT = l1t::MicroGMTMatchQualLUTFactory::create(microGMTParamsHelper->fwdPosSingleMatchQualLUTPath(), microGMTParamsHelper->fwdPosSingleMatchQualLUTMaxDR(), microGMTParamsHelper->fwdPosSingleMatchQualLUTfEta(), microGMTParamsHelper->fwdPosSingleMatchQualLUTfPhi(), cancel_t::emtf_emtf_pos, fwVersion); + m_fwdNegSingleMatchQualLUT = l1t::MicroGMTMatchQualLUTFactory::create(microGMTParamsHelper->fwdNegSingleMatchQualLUTPath(), microGMTParamsHelper->fwdNegSingleMatchQualLUTMaxDR(), microGMTParamsHelper->fwdNegSingleMatchQualLUTfEta(), microGMTParamsHelper->fwdNegSingleMatchQualLUTfPhi(), cancel_t::emtf_emtf_neg, fwVersion); } //define this as a plug-in diff --git a/L1Trigger/L1TMuon/plugins/L1TMuonGlobalParamsESProducer.cc b/L1Trigger/L1TMuon/plugins/L1TMuonGlobalParamsESProducer.cc index 44e36f203e673..ee9d55aa4b8ba 100644 --- a/L1Trigger/L1TMuon/plugins/L1TMuonGlobalParamsESProducer.cc +++ b/L1Trigger/L1TMuon/plugins/L1TMuonGlobalParamsESProducer.cc @@ -154,14 +154,14 @@ L1TMuonGlobalParamsESProducer::L1TMuonGlobalParamsESProducer(const edm::Paramete m_params_helper.setMaskedEmtfnInputs(emtfnMasked); // LUTs - m_params_helper.setFwdPosSingleMatchQualLUTMaxDR(iConfig.getParameter("FwdPosSingleMatchQualLUTMaxDR")); - m_params_helper.setFwdNegSingleMatchQualLUTMaxDR(iConfig.getParameter("FwdNegSingleMatchQualLUTMaxDR")); - m_params_helper.setOvlPosSingleMatchQualLUTMaxDR(iConfig.getParameter("OvlPosSingleMatchQualLUTMaxDR")); - m_params_helper.setOvlNegSingleMatchQualLUTMaxDR(iConfig.getParameter("OvlNegSingleMatchQualLUTMaxDR")); - m_params_helper.setBOPosMatchQualLUTMaxDR(iConfig.getParameter("BOPosMatchQualLUTMaxDR"), iConfig.getParameter("BOPosMatchQualLUTMaxDREtaFine")); - m_params_helper.setBONegMatchQualLUTMaxDR(iConfig.getParameter("BONegMatchQualLUTMaxDR"), iConfig.getParameter("BONegMatchQualLUTMaxDREtaFine")); - m_params_helper.setFOPosMatchQualLUTMaxDR(iConfig.getParameter("FOPosMatchQualLUTMaxDR")); - m_params_helper.setFONegMatchQualLUTMaxDR(iConfig.getParameter("FONegMatchQualLUTMaxDR")); + m_params_helper.setFwdPosSingleMatchQualLUTMaxDR(iConfig.getParameter("FwdPosSingleMatchQualLUTMaxDR"), iConfig.getParameter("FwdPosSingleMatchQualLUTfEta"), iConfig.getParameter("FwdPosSingleMatchQualLUTfPhi")); + m_params_helper.setFwdNegSingleMatchQualLUTMaxDR(iConfig.getParameter("FwdNegSingleMatchQualLUTMaxDR"), iConfig.getParameter("FwdNegSingleMatchQualLUTfEta"), iConfig.getParameter("FwdNegSingleMatchQualLUTfPhi")); + m_params_helper.setOvlPosSingleMatchQualLUTMaxDR(iConfig.getParameter("OvlPosSingleMatchQualLUTMaxDR"), iConfig.getParameter("OvlPosSingleMatchQualLUTfEta"), iConfig.getParameter("OvlPosSingleMatchQualLUTfPhi")); + m_params_helper.setOvlNegSingleMatchQualLUTMaxDR(iConfig.getParameter("OvlNegSingleMatchQualLUTMaxDR"), iConfig.getParameter("OvlNegSingleMatchQualLUTfEta"), iConfig.getParameter("OvlNegSingleMatchQualLUTfPhi")); + m_params_helper.setBOPosMatchQualLUTMaxDR(iConfig.getParameter("BOPosMatchQualLUTMaxDR"), iConfig.getParameter("BOPosMatchQualLUTfEta"), iConfig.getParameter("BOPosMatchQualLUTfEtaCoarse"), iConfig.getParameter("BOPosMatchQualLUTfPhi")); + m_params_helper.setBONegMatchQualLUTMaxDR(iConfig.getParameter("BONegMatchQualLUTMaxDR"), iConfig.getParameter("BONegMatchQualLUTfEta"), iConfig.getParameter("BONegMatchQualLUTfEtaCoarse"), iConfig.getParameter("BONegMatchQualLUTfPhi")); + m_params_helper.setFOPosMatchQualLUTMaxDR(iConfig.getParameter("FOPosMatchQualLUTMaxDR"), iConfig.getParameter("FOPosMatchQualLUTfEta"), iConfig.getParameter("FOPosMatchQualLUTfPhi")); + m_params_helper.setFONegMatchQualLUTMaxDR(iConfig.getParameter("FONegMatchQualLUTMaxDR"), iConfig.getParameter("FONegMatchQualLUTfEta"), iConfig.getParameter("FONegMatchQualLUTfPhi")); unsigned sortRankLUTPtFactor = iConfig.getParameter("SortRankLUTPtFactor"); unsigned sortRankLUTQualFactor = iConfig.getParameter("SortRankLUTQualFactor"); @@ -171,14 +171,15 @@ L1TMuonGlobalParamsESProducer::L1TMuonGlobalParamsESProducer(const edm::Paramete auto relIsoCheckMemLUT = l1t::MicroGMTRelativeIsolationCheckLUTFactory::create (iConfig.getParameter("RelIsoCheckMemLUTPath"), fwVersion); auto idxSelMemPhiLUT = l1t::MicroGMTCaloIndexSelectionLUTFactory::create (iConfig.getParameter("IdxSelMemPhiLUTPath"), l1t::MicroGMTConfiguration::PHI, fwVersion); auto idxSelMemEtaLUT = l1t::MicroGMTCaloIndexSelectionLUTFactory::create (iConfig.getParameter("IdxSelMemEtaLUTPath"), l1t::MicroGMTConfiguration::ETA, fwVersion); - auto fwdPosSingleMatchQualLUT = l1t::MicroGMTMatchQualLUTFactory::create (iConfig.getParameter("FwdPosSingleMatchQualLUTPath"), iConfig.getParameter("FwdPosSingleMatchQualLUTMaxDR"), l1t::cancel_t::emtf_emtf_pos, fwVersion); - auto fwdNegSingleMatchQualLUT = l1t::MicroGMTMatchQualLUTFactory::create (iConfig.getParameter("FwdNegSingleMatchQualLUTPath"), iConfig.getParameter("FwdNegSingleMatchQualLUTMaxDR"), l1t::cancel_t::emtf_emtf_neg, fwVersion); - auto ovlPosSingleMatchQualLUT = l1t::MicroGMTMatchQualLUTFactory::create (iConfig.getParameter("OvlPosSingleMatchQualLUTPath"), iConfig.getParameter("OvlPosSingleMatchQualLUTMaxDR"), l1t::cancel_t::omtf_omtf_pos, fwVersion); - auto ovlNegSingleMatchQualLUT = l1t::MicroGMTMatchQualLUTFactory::create (iConfig.getParameter("OvlNegSingleMatchQualLUTPath"), iConfig.getParameter("OvlNegSingleMatchQualLUTMaxDR"), l1t::cancel_t::omtf_omtf_neg, fwVersion); - auto bOPosMatchQualLUT = l1t::MicroGMTMatchQualLUTFactory::create (iConfig.getParameter("BOPosMatchQualLUTPath"), iConfig.getParameter("BOPosMatchQualLUTMaxDR"), l1t::cancel_t::omtf_bmtf_pos, fwVersion); - auto bONegMatchQualLUT = l1t::MicroGMTMatchQualLUTFactory::create (iConfig.getParameter("BONegMatchQualLUTPath"), iConfig.getParameter("BONegMatchQualLUTMaxDR"), l1t::cancel_t::omtf_bmtf_neg, fwVersion); - auto fOPosMatchQualLUT = l1t::MicroGMTMatchQualLUTFactory::create (iConfig.getParameter("FOPosMatchQualLUTPath"), iConfig.getParameter("FOPosMatchQualLUTMaxDR"), l1t::cancel_t::omtf_emtf_pos, fwVersion); - auto fONegMatchQualLUT = l1t::MicroGMTMatchQualLUTFactory::create (iConfig.getParameter("FONegMatchQualLUTPath"), iConfig.getParameter("FONegMatchQualLUTMaxDR"), l1t::cancel_t::omtf_emtf_neg, fwVersion); + // TODO: Create different LUTs if etaFine bit is used + auto fwdPosSingleMatchQualLUT = l1t::MicroGMTMatchQualLUTFactory::create (iConfig.getParameter("FwdPosSingleMatchQualLUTPath"), iConfig.getParameter("FwdPosSingleMatchQualLUTMaxDR"), iConfig.getParameter("FwdPosSingleMatchQualLUTfEta"), iConfig.getParameter("FwdPosSingleMatchQualLUTfPhi"), l1t::cancel_t::emtf_emtf_pos, fwVersion); + auto fwdNegSingleMatchQualLUT = l1t::MicroGMTMatchQualLUTFactory::create (iConfig.getParameter("FwdNegSingleMatchQualLUTPath"), iConfig.getParameter("FwdNegSingleMatchQualLUTMaxDR"), iConfig.getParameter("FwdNegSingleMatchQualLUTfEta"), iConfig.getParameter("FwdNegSingleMatchQualLUTfPhi"), l1t::cancel_t::emtf_emtf_neg, fwVersion); + auto ovlPosSingleMatchQualLUT = l1t::MicroGMTMatchQualLUTFactory::create (iConfig.getParameter("OvlPosSingleMatchQualLUTPath"), iConfig.getParameter("OvlPosSingleMatchQualLUTMaxDR"), iConfig.getParameter("OvlPosSingleMatchQualLUTfEta"), iConfig.getParameter("OvlPosSingleMatchQualLUTfPhi"), l1t::cancel_t::omtf_omtf_pos, fwVersion); + auto ovlNegSingleMatchQualLUT = l1t::MicroGMTMatchQualLUTFactory::create (iConfig.getParameter("OvlNegSingleMatchQualLUTPath"), iConfig.getParameter("OvlNegSingleMatchQualLUTMaxDR"), iConfig.getParameter("OvlNegSingleMatchQualLUTfEta"), iConfig.getParameter("OvlNegSingleMatchQualLUTfPhi"), l1t::cancel_t::omtf_omtf_neg, fwVersion); + auto bOPosMatchQualLUT = l1t::MicroGMTMatchQualLUTFactory::create (iConfig.getParameter("BOPosMatchQualLUTPath"), iConfig.getParameter("BOPosMatchQualLUTMaxDR"), iConfig.getParameter("BOPosMatchQualLUTfEta"), iConfig.getParameter("BOPosMatchQualLUTfPhi"), l1t::cancel_t::omtf_bmtf_pos, fwVersion); + auto bONegMatchQualLUT = l1t::MicroGMTMatchQualLUTFactory::create (iConfig.getParameter("BONegMatchQualLUTPath"), iConfig.getParameter("BONegMatchQualLUTMaxDR"), iConfig.getParameter("BONegMatchQualLUTfEta"), iConfig.getParameter("BONegMatchQualLUTfPhi"), l1t::cancel_t::omtf_bmtf_neg, fwVersion); + auto fOPosMatchQualLUT = l1t::MicroGMTMatchQualLUTFactory::create (iConfig.getParameter("FOPosMatchQualLUTPath"), iConfig.getParameter("FOPosMatchQualLUTMaxDR"), iConfig.getParameter("FOPosMatchQualLUTfEta"), iConfig.getParameter("FOPosMatchQualLUTfPhi"), l1t::cancel_t::omtf_emtf_pos, fwVersion); + auto fONegMatchQualLUT = l1t::MicroGMTMatchQualLUTFactory::create (iConfig.getParameter("FONegMatchQualLUTPath"), iConfig.getParameter("FONegMatchQualLUTMaxDR"), iConfig.getParameter("FONegMatchQualLUTfEta"), iConfig.getParameter("FONegMatchQualLUTfPhi"), l1t::cancel_t::omtf_emtf_neg, fwVersion); auto bPhiExtrapolationLUT = l1t::MicroGMTExtrapolationLUTFactory::create (iConfig.getParameter("BPhiExtrapolationLUTPath"), l1t::MicroGMTConfiguration::PHI_OUT, fwVersion); auto oPhiExtrapolationLUT = l1t::MicroGMTExtrapolationLUTFactory::create (iConfig.getParameter("OPhiExtrapolationLUTPath"), l1t::MicroGMTConfiguration::PHI_OUT, fwVersion); auto fPhiExtrapolationLUT = l1t::MicroGMTExtrapolationLUTFactory::create (iConfig.getParameter("FPhiExtrapolationLUTPath"), l1t::MicroGMTConfiguration::PHI_OUT, fwVersion); diff --git a/L1Trigger/L1TMuon/python/fakeGmtParams_cff.py b/L1Trigger/L1TMuon/python/fakeGmtParams_cff.py index 46c8194d5de49..d45e0d3dd0403 100644 --- a/L1Trigger/L1TMuon/python/fakeGmtParams_cff.py +++ b/L1Trigger/L1TMuon/python/fakeGmtParams_cff.py @@ -33,6 +33,7 @@ RelIsoCheckMemLUTPath = cms.string(os.path.join(lut_dir, 'RelIsoCheckMem.txt')), IdxSelMemPhiLUTPath = cms.string(os.path.join(lut_dir, 'IdxSelMemPhi.txt')), IdxSelMemEtaLUTPath = cms.string(os.path.join(lut_dir, 'IdxSelMemEta.txt')), + #BrlSingleMatchQualLUTPath = cms.string(''), FwdPosSingleMatchQualLUTPath = cms.string(''), FwdNegSingleMatchQualLUTPath = cms.string(''), OvlPosSingleMatchQualLUTPath = cms.string(''), @@ -49,16 +50,42 @@ FEtaExtrapolationLUTPath = cms.string(os.path.join(lut_dir, 'EEtaExtrapolation.txt')), SortRankLUTPath = cms.string(os.path.join(lut_dir, 'SortRank.txt')), - FwdPosSingleMatchQualLUTMaxDR = cms.double(0.1), - FwdNegSingleMatchQualLUTMaxDR = cms.double(0.1), - OvlPosSingleMatchQualLUTMaxDR = cms.double(0.1), - OvlNegSingleMatchQualLUTMaxDR = cms.double(0.1), + #BrlSingleMatchQualLUTMaxDR = cms.double(0.1), + FwdPosSingleMatchQualLUTMaxDR = cms.double(0.05), + FwdPosSingleMatchQualLUTfEta = cms.double(1), + FwdPosSingleMatchQualLUTfPhi = cms.double(1), + + FwdNegSingleMatchQualLUTMaxDR = cms.double(0.05), + FwdNegSingleMatchQualLUTfEta = cms.double(1), + FwdNegSingleMatchQualLUTfPhi = cms.double(1), + + OvlPosSingleMatchQualLUTMaxDR = cms.double(0.2), + OvlPosSingleMatchQualLUTfEta = cms.double(1), + OvlPosSingleMatchQualLUTfPhi = cms.double(4), + + OvlNegSingleMatchQualLUTMaxDR = cms.double(0.2), + OvlNegSingleMatchQualLUTfEta = cms.double(1), + OvlNegSingleMatchQualLUTfPhi = cms.double(4), + BOPosMatchQualLUTMaxDR = cms.double(0.1), + BOPosMatchQualLUTfEta = cms.double(1), + BOPosMatchQualLUTfEtaCoarse = cms.double(1./3), + BOPosMatchQualLUTfPhi = cms.double(2), + #BOPosMatchQualLUTMaxDREtaFine = cms.double(0.1), + BONegMatchQualLUTMaxDR = cms.double(0.1), - BOPosMatchQualLUTMaxDREtaFine = cms.double(0.1), - BONegMatchQualLUTMaxDREtaFine = cms.double(0.1), - FOPosMatchQualLUTMaxDR = cms.double(0.1), - FONegMatchQualLUTMaxDR = cms.double(0.1), + BONegMatchQualLUTfEta = cms.double(1), + BONegMatchQualLUTfEtaCoarse = cms.double(1./3), + BONegMatchQualLUTfPhi = cms.double(2), + #BONegMatchQualLUTMaxDREtaFine = cms.double(0.1), + + FOPosMatchQualLUTMaxDR = cms.double(0.15), + FOPosMatchQualLUTfEta = cms.double(1), + FOPosMatchQualLUTfPhi = cms.double(3), + + FONegMatchQualLUTMaxDR = cms.double(0.15), + FONegMatchQualLUTfEta = cms.double(1), + FONegMatchQualLUTfPhi = cms.double(3), SortRankLUTPtFactor = cms.uint32(1), # can be 0 or 1 SortRankLUTQualFactor = cms.uint32(4), # can be 0 to 34 diff --git a/L1Trigger/L1TMuon/src/L1TMuonGlobalParamsHelper.cc b/L1Trigger/L1TMuon/src/L1TMuonGlobalParamsHelper.cc index 04e95d162f0a1..06ca11d57507a 100644 --- a/L1Trigger/L1TMuon/src/L1TMuonGlobalParamsHelper.cc +++ b/L1Trigger/L1TMuon/src/L1TMuonGlobalParamsHelper.cc @@ -140,8 +140,8 @@ void L1TMuonGlobalParamsHelper::print(std::ostream& out) const { out << " Forward neg MatchQual LUT path: " << this->fwdNegSingleMatchQualLUTPath() << ", max dR (Used when LUT path empty): " << this->fwdNegSingleMatchQualLUTMaxDR() << std::endl; out << " Overlap pos MatchQual LUT path: " << this->ovlPosSingleMatchQualLUTPath() << ", max dR (Used when LUT path empty): " << this->ovlPosSingleMatchQualLUTMaxDR() << std::endl; out << " Overlap neg MatchQual LUT path: " << this->ovlNegSingleMatchQualLUTPath() << ", max dR (Used when LUT path empty): " << this->ovlNegSingleMatchQualLUTMaxDR() << std::endl; - out << " Barrel-Overlap pos MatchQual LUT path: " << this->bOPosMatchQualLUTPath() << ", max dR (Used when LUT path empty): " << this->bOPosMatchQualLUTMaxDR() << ", max dR when eta-fine bit set: " << this->bOPosMatchQualLUTMaxDREtaFine() << std::endl; - out << " Barrel-Overlap neg MatchQual LUT path: " << this->bONegMatchQualLUTPath() << ", max dR (Used when LUT path empty): " << this->bONegMatchQualLUTMaxDR() << ", max dR when eta-fine bit set: " << this->bONegMatchQualLUTMaxDREtaFine() << std::endl; + out << " Barrel-Overlap pos MatchQual LUT path: " << this->bOPosMatchQualLUTPath() << ", max dR (Used when LUT path empty): " << this->bOPosMatchQualLUTMaxDR() << ", fEta: " << this->bOPosMatchQualLUTfEta() << ", fEta when eta-fine bit isn't set: " << this->bOPosMatchQualLUTfEtaCoarse() << ", fPhi: " << this->bOPosMatchQualLUTfEta() << std::endl; + out << " Barrel-Overlap neg MatchQual LUT path: " << this->bONegMatchQualLUTPath() << ", max dR (Used when LUT path empty): " << this->bONegMatchQualLUTMaxDR() << ", fEta: " << this->bONegMatchQualLUTfEta() << ", fEta when eta-fine bit isn't set: " << this->bONegMatchQualLUTfEtaCoarse() << ", fPhi: " << this->bONegMatchQualLUTfPhi() << std::endl; out << " Forward-Overlap pos MatchQual LUT path: " << this->fOPosMatchQualLUTPath() << ", max dR (Used when LUT path empty): " << this->fOPosMatchQualLUTMaxDR() << std::endl; out << " Forward-Overlap neg MatchQual LUT path: " << this->fONegMatchQualLUTPath() << ", max dR (Used when LUT path empty): " << this->fONegMatchQualLUTMaxDR() << std::endl; out << " Barrel phi extrapolation LUT path: " << this->bPhiExtrapolationLUTPath() << std::endl; diff --git a/L1Trigger/L1TMuon/src/MicroGMTCancelOutUnit.cc b/L1Trigger/L1TMuon/src/MicroGMTCancelOutUnit.cc index 471fe11b10a71..ccaf1524bc922 100644 --- a/L1Trigger/L1TMuon/src/MicroGMTCancelOutUnit.cc +++ b/L1Trigger/L1TMuon/src/MicroGMTCancelOutUnit.cc @@ -24,6 +24,7 @@ MicroGMTCancelOutUnit::initialise(L1TMuonGlobalParamsHelper* microGMTParamsHelpe m_fwdPosSingleMatchQualLUT = l1t::MicroGMTMatchQualLUTFactory::create(microGMTParamsHelper->fwdPosSingleMatchQualLUT(), cancel_t::emtf_emtf_pos, fwVersion); m_fwdNegSingleMatchQualLUT = l1t::MicroGMTMatchQualLUTFactory::create(microGMTParamsHelper->fwdNegSingleMatchQualLUT(), cancel_t::emtf_emtf_neg, fwVersion); + //m_lutDict[tftype::bmtf+tftype::bmtf*10] = m_brlSingleMatchQualLUT; m_lutDict[tftype::omtf_neg+tftype::bmtf*10] = m_boNegMatchQualLUT; m_lutDict[tftype::omtf_pos+tftype::bmtf*10] = m_boPosMatchQualLUT; m_lutDict[tftype::omtf_pos+tftype::omtf_pos*10] = m_ovlPosSingleMatchQualLUT; @@ -55,7 +56,7 @@ MicroGMTCancelOutUnit::setCancelOutBits(GMTInternalWedges& wedges, tftype trackF coll2.push_back(mu); } if (mode == cancelmode::coordinate) { - getCoordinateCancelBits(coll2, coll1); // in case of a tie coll1 muon wins + getCoordinateCancelBits(coll1, coll2); } else { getTrackAddrCancelBits(coll1, coll2); } @@ -154,13 +155,13 @@ MicroGMTCancelOutUnit::getCoordinateCancelBits(std::vectorgetDeltaPhiWidth()) - 1; int dEtaMask = (1 << matchLUT->getDeltaEtaWidth()) - 1; + // temporary fix to take processor offset into account... int dPhi = (*mu_w1)->hwGlobalPhi() - (*mu_w2)->hwGlobalPhi(); - dPhi = std::abs(dPhi); if (dPhi > 338) dPhi -= 576; // shifts dPhi to [-pi, pi) in integer scale dPhi = std::abs(dPhi); int dEta = std::abs((*mu_w1)->hwEta() - (*mu_w2)->hwEta()); // check first if the delta is within the LSBs that the LUT takes, otherwise the distance - // is greater than what we want to cancel -> e.g. 15(int) is max => 15*0.01 = 0.15 (rad) + // is greater than what we want to cancel -> e.g. 31(int) is max => 31*0.01 = 0.31 (rad) // LUT takes 5 LSB for dEta and 3 LSB for dPhi if (dEta <= dEtaMask && dPhi <= dPhiMask) { int match = matchLUT->lookup(dEta & dEtaMask, dPhi & dPhiMask); @@ -253,7 +254,7 @@ MicroGMTCancelOutUnit::getTrackAddrCancelBits(std::vector 0) { - if ((*mu_w1)->origin().hwQual() >= (*mu_w2)->origin().hwQual()) { + if ((*mu_w1)->origin().hwQual() > (*mu_w2)->origin().hwQual()) { (*mu_w2)->setHwCancelBit(1); } else { (*mu_w1)->setHwCancelBit(1); diff --git a/L1Trigger/L1TMuon/src/MicroGMTMatchQualLUT.cc b/L1Trigger/L1TMuon/src/MicroGMTMatchQualLUT.cc index 794c695bc82e8..162106f7b212a 100644 --- a/L1Trigger/L1TMuon/src/MicroGMTMatchQualLUT.cc +++ b/L1Trigger/L1TMuon/src/MicroGMTMatchQualLUT.cc @@ -1,7 +1,7 @@ #include "../interface/MicroGMTMatchQualLUT.h" #include "TMath.h" -l1t::MicroGMTMatchQualLUT::MicroGMTMatchQualLUT (const std::string& fname, const double maxDR, cancel_t cancelType) : MicroGMTLUT(), m_dEtaRedMask(0), m_dPhiRedMask(0), m_dEtaRedInWidth(5), m_dPhiRedInWidth(3), m_etaScale(0), m_phiScale(0), m_maxDR(maxDR), m_cancelType(cancelType) +l1t::MicroGMTMatchQualLUT::MicroGMTMatchQualLUT (const std::string& fname, const double maxDR, const double fEta, const double fPhi, cancel_t cancelType) : MicroGMTLUT(), m_dEtaRedMask(0), m_dPhiRedMask(0), m_dEtaRedInWidth(5), m_dPhiRedInWidth(3), m_etaScale(0), m_phiScale(0), m_maxDR(maxDR), m_fEta(fEta), m_fPhi(fPhi), m_cancelType(cancelType) { m_totalInWidth = m_dPhiRedInWidth + m_dEtaRedInWidth; m_outWidth = 1; @@ -46,12 +46,12 @@ l1t::MicroGMTMatchQualLUT::lookup(int dEtaRed, int dPhiRed) const if (m_initialized) { return data((unsigned)hashInput(checkedInput(dEtaRed, m_dEtaRedInWidth), checkedInput(dPhiRed, m_dPhiRedInWidth))); } - double dEta = dEtaRed*m_etaScale; - double dPhi = dPhiRed*m_phiScale; + double dEta = m_fEta*dEtaRed*m_etaScale; + double dPhi = m_fPhi*dPhiRed*m_phiScale; double dR = std::sqrt(dEta*dEta + dPhi*dPhi); - int retVal = dR < m_maxDR ? 1 : 0; + int retVal = dR <= m_maxDR ? 1 : 0; // should we need customisation for the different track finder cancellations: // switch (m_cancelType) { // case bmtf_bmtf: diff --git a/L1Trigger/L1TMuon/src/MicroGMTMatchQualLUTFactory.cc b/L1Trigger/L1TMuon/src/MicroGMTMatchQualLUTFactory.cc index f6c3975f9342e..197aa873387a5 100644 --- a/L1Trigger/L1TMuon/src/MicroGMTMatchQualLUTFactory.cc +++ b/L1Trigger/L1TMuon/src/MicroGMTMatchQualLUTFactory.cc @@ -4,7 +4,7 @@ /// \author: Thomas Reis /// // -// This class implements the MatchQualLUT factory. Based on the firmware +// This class implements the MatchQualLUT factory. Based on the firmware // version it selects the appropriate concrete implementation. // @@ -15,16 +15,19 @@ using namespace edm; namespace l1t { - MicroGMTMatchQualLUTFactory::ReturnType - MicroGMTMatchQualLUTFactory::create(const std::string& filename, const double maxDR, cancel_t cancelType, const int fwVersion) { + MicroGMTMatchQualLUTFactory::ReturnType MicroGMTMatchQualLUTFactory::create( + const std::string& filename, const double maxDR, const double fEta, + const double fPhi, cancel_t cancelType, const int fwVersion) { ReturnType p; - + switch (fwVersion) { case 1: - p = ReturnType(new MicroGMTMatchQualLUT(filename, maxDR, cancelType)); + p = ReturnType(new MicroGMTMatchQualLUT( + filename, maxDR, fEta, fPhi, cancelType)); break; default: - LogError("MicroGMTMatchQualLUTFactory") << "Invalid firmware version requested: " << fwVersion; + LogError("MicroGMTMatchQualLUTFactory") + << "Invalid firmware version requested: " << fwVersion; } return p; } From 15363fb9677abbd659aaf148b7c68e8f23c8fa84 Mon Sep 17 00:00:00 2001 From: Dinyar Rabady Date: Mon, 9 May 2016 16:00:06 +0200 Subject: [PATCH 2/4] Preliminary cancel-out parameters. --- L1Trigger/L1TMuon/python/fakeGmtParams_cff.py | 27 +++++++++---------- 1 file changed, 12 insertions(+), 15 deletions(-) diff --git a/L1Trigger/L1TMuon/python/fakeGmtParams_cff.py b/L1Trigger/L1TMuon/python/fakeGmtParams_cff.py index d45e0d3dd0403..4eaa9a27c6ab2 100644 --- a/L1Trigger/L1TMuon/python/fakeGmtParams_cff.py +++ b/L1Trigger/L1TMuon/python/fakeGmtParams_cff.py @@ -50,42 +50,39 @@ FEtaExtrapolationLUTPath = cms.string(os.path.join(lut_dir, 'EEtaExtrapolation.txt')), SortRankLUTPath = cms.string(os.path.join(lut_dir, 'SortRank.txt')), - #BrlSingleMatchQualLUTMaxDR = cms.double(0.1), - FwdPosSingleMatchQualLUTMaxDR = cms.double(0.05), + FwdPosSingleMatchQualLUTMaxDR = cms.double(0.01), FwdPosSingleMatchQualLUTfEta = cms.double(1), FwdPosSingleMatchQualLUTfPhi = cms.double(1), - FwdNegSingleMatchQualLUTMaxDR = cms.double(0.05), + FwdNegSingleMatchQualLUTMaxDR = cms.double(0.01), FwdNegSingleMatchQualLUTfEta = cms.double(1), FwdNegSingleMatchQualLUTfPhi = cms.double(1), - OvlPosSingleMatchQualLUTMaxDR = cms.double(0.2), + OvlPosSingleMatchQualLUTMaxDR = cms.double(0.15), OvlPosSingleMatchQualLUTfEta = cms.double(1), - OvlPosSingleMatchQualLUTfPhi = cms.double(4), + OvlPosSingleMatchQualLUTfPhi = cms.double(3), - OvlNegSingleMatchQualLUTMaxDR = cms.double(0.2), + OvlNegSingleMatchQualLUTMaxDR = cms.double(0.15), OvlNegSingleMatchQualLUTfEta = cms.double(1), - OvlNegSingleMatchQualLUTfPhi = cms.double(4), + OvlNegSingleMatchQualLUTfPhi = cms.double(3), BOPosMatchQualLUTMaxDR = cms.double(0.1), - BOPosMatchQualLUTfEta = cms.double(1), + BOPosMatchQualLUTfEta = cms.double(1./3), BOPosMatchQualLUTfEtaCoarse = cms.double(1./3), BOPosMatchQualLUTfPhi = cms.double(2), - #BOPosMatchQualLUTMaxDREtaFine = cms.double(0.1), BONegMatchQualLUTMaxDR = cms.double(0.1), - BONegMatchQualLUTfEta = cms.double(1), + BONegMatchQualLUTfEta = cms.double(1./3), BONegMatchQualLUTfEtaCoarse = cms.double(1./3), BONegMatchQualLUTfPhi = cms.double(2), - #BONegMatchQualLUTMaxDREtaFine = cms.double(0.1), - FOPosMatchQualLUTMaxDR = cms.double(0.15), + FOPosMatchQualLUTMaxDR = cms.double(0.2), FOPosMatchQualLUTfEta = cms.double(1), - FOPosMatchQualLUTfPhi = cms.double(3), + FOPosMatchQualLUTfPhi = cms.double(4), - FONegMatchQualLUTMaxDR = cms.double(0.15), + FONegMatchQualLUTMaxDR = cms.double(0.2), FONegMatchQualLUTfEta = cms.double(1), - FONegMatchQualLUTfPhi = cms.double(3), + FONegMatchQualLUTfPhi = cms.double(4), SortRankLUTPtFactor = cms.uint32(1), # can be 0 or 1 SortRankLUTQualFactor = cms.uint32(4), # can be 0 to 34 From c33280ba3b33530cc78fa8177254bb35b30fd89d Mon Sep 17 00:00:00 2001 From: Dinyar Rabady Date: Mon, 9 May 2016 16:13:48 +0200 Subject: [PATCH 3/4] Adding Thomas' fixes. --- L1Trigger/L1TMuon/src/MicroGMTCancelOutUnit.cc | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/L1Trigger/L1TMuon/src/MicroGMTCancelOutUnit.cc b/L1Trigger/L1TMuon/src/MicroGMTCancelOutUnit.cc index ccaf1524bc922..b40e41cf0f203 100644 --- a/L1Trigger/L1TMuon/src/MicroGMTCancelOutUnit.cc +++ b/L1Trigger/L1TMuon/src/MicroGMTCancelOutUnit.cc @@ -24,7 +24,6 @@ MicroGMTCancelOutUnit::initialise(L1TMuonGlobalParamsHelper* microGMTParamsHelpe m_fwdPosSingleMatchQualLUT = l1t::MicroGMTMatchQualLUTFactory::create(microGMTParamsHelper->fwdPosSingleMatchQualLUT(), cancel_t::emtf_emtf_pos, fwVersion); m_fwdNegSingleMatchQualLUT = l1t::MicroGMTMatchQualLUTFactory::create(microGMTParamsHelper->fwdNegSingleMatchQualLUT(), cancel_t::emtf_emtf_neg, fwVersion); - //m_lutDict[tftype::bmtf+tftype::bmtf*10] = m_brlSingleMatchQualLUT; m_lutDict[tftype::omtf_neg+tftype::bmtf*10] = m_boNegMatchQualLUT; m_lutDict[tftype::omtf_pos+tftype::bmtf*10] = m_boPosMatchQualLUT; m_lutDict[tftype::omtf_pos+tftype::omtf_pos*10] = m_ovlPosSingleMatchQualLUT; @@ -56,7 +55,7 @@ MicroGMTCancelOutUnit::setCancelOutBits(GMTInternalWedges& wedges, tftype trackF coll2.push_back(mu); } if (mode == cancelmode::coordinate) { - getCoordinateCancelBits(coll1, coll2); + getCoordinateCancelBits(coll2, coll1); } else { getTrackAddrCancelBits(coll1, coll2); } @@ -155,8 +154,8 @@ MicroGMTCancelOutUnit::getCoordinateCancelBits(std::vectorgetDeltaPhiWidth()) - 1; int dEtaMask = (1 << matchLUT->getDeltaEtaWidth()) - 1; - // temporary fix to take processor offset into account... int dPhi = (*mu_w1)->hwGlobalPhi() - (*mu_w2)->hwGlobalPhi(); + dPhi = std::abs(dPhi) if (dPhi > 338) dPhi -= 576; // shifts dPhi to [-pi, pi) in integer scale dPhi = std::abs(dPhi); int dEta = std::abs((*mu_w1)->hwEta() - (*mu_w2)->hwEta()); @@ -254,7 +253,7 @@ MicroGMTCancelOutUnit::getTrackAddrCancelBits(std::vector 0) { - if ((*mu_w1)->origin().hwQual() > (*mu_w2)->origin().hwQual()) { + if ((*mu_w1)->origin().hwQual() >= (*mu_w2)->origin().hwQual()) { (*mu_w2)->setHwCancelBit(1); } else { (*mu_w1)->setHwCancelBit(1); From fb32612530ab393f9f77004032a7c2596e4df150 Mon Sep 17 00:00:00 2001 From: Dinyar Rabady Date: Mon, 9 May 2016 16:25:54 +0200 Subject: [PATCH 4/4] Small fixes. --- L1Trigger/L1TMuon/src/MicroGMTCancelOutUnit.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/L1Trigger/L1TMuon/src/MicroGMTCancelOutUnit.cc b/L1Trigger/L1TMuon/src/MicroGMTCancelOutUnit.cc index b40e41cf0f203..f859702da308b 100644 --- a/L1Trigger/L1TMuon/src/MicroGMTCancelOutUnit.cc +++ b/L1Trigger/L1TMuon/src/MicroGMTCancelOutUnit.cc @@ -55,7 +55,7 @@ MicroGMTCancelOutUnit::setCancelOutBits(GMTInternalWedges& wedges, tftype trackF coll2.push_back(mu); } if (mode == cancelmode::coordinate) { - getCoordinateCancelBits(coll2, coll1); + getCoordinateCancelBits(coll2, coll1); // in case of a tie coll1 muon wins } else { getTrackAddrCancelBits(coll1, coll2); } @@ -155,7 +155,7 @@ MicroGMTCancelOutUnit::getCoordinateCancelBits(std::vectorgetDeltaEtaWidth()) - 1; int dPhi = (*mu_w1)->hwGlobalPhi() - (*mu_w2)->hwGlobalPhi(); - dPhi = std::abs(dPhi) + dPhi = std::abs(dPhi); if (dPhi > 338) dPhi -= 576; // shifts dPhi to [-pi, pi) in integer scale dPhi = std::abs(dPhi); int dEta = std::abs((*mu_w1)->hwEta() - (*mu_w2)->hwEta());