diff --git a/CondFormats/L1TObjects/interface/L1TMuonGlobalParams.h b/CondFormats/L1TObjects/interface/L1TMuonGlobalParams.h index d26f21a88b21b..caadd4fcacd43 100644 --- a/CondFormats/L1TObjects/interface/L1TMuonGlobalParams.h +++ b/CondFormats/L1TObjects/interface/L1TMuonGlobalParams.h @@ -8,8 +8,8 @@ /// \author: Thomas Reis /// -#ifndef L1TGMTParams_h -#define L1TGMTParams_h +#ifndef L1TMuonGlobalParams_h +#define L1TMuonGlobalParams_h #include #include @@ -56,23 +56,6 @@ class L1TMuonGlobalParams { fEtaExtrapolation=17, sortRank=18, NUM_GMTPARAMNODES=19 - //brlSingleMatchQual=4, - //fwdPosSingleMatchQual=5, - //fwdNegSingleMatchQual=6, - //ovlPosSingleMatchQual=7, - //ovlNegSingleMatchQual=8, - //bOPosMatchQual=9, - //bONegMatchQual=10, - //fOPosMatchQual=11, - //fONegMatchQual=12, - //bPhiExtrapolation=13, - //oPhiExtrapolation=14, - //fPhiExtrapolation=15, - //bEtaExtrapolation=16, - //oEtaExtrapolation=17, - //fEtaExtrapolation=18, - //sortRank=19, - //NUM_GMTPARAMNODES=20 }; // string parameters indices @@ -84,6 +67,9 @@ class L1TMuonGlobalParams { // double parameters indices enum dpIdx {maxdr=0, maxdrEtaFine=1}; + // input enable indices + enum linkNr {CALOLINK1=8, EMTFPLINK1=36, OMTFPLINK1=42, BMTFLINK1=48, OMTFNLINK1=60, EMTFNLINK1=66}; // link numbers start at 0 + L1TMuonGlobalParams() { version_=Version; pnodes_.resize(NUM_GMTPARAMNODES); } ~L1TMuonGlobalParams() {} @@ -97,12 +83,29 @@ class L1TMuonGlobalParams { void setBxMin(int bxMin) { bxMin_ = bxMin; } void setBxMax(int bxMax) { bxMax_ = bxMax; } + // Input enables + std::bitset<72> inputEnables() { return inputEnables_; }; + std::bitset<28> caloInputEnables(); + std::bitset<6> emtfpInputEnables() { return eomtfInputEnables(EMTFPLINK1); }; + std::bitset<6> omtfpInputEnables() { return eomtfInputEnables(OMTFPLINK1); }; + std::bitset<12> bmtfInputEnables(); + std::bitset<6> omtfnInputEnables() { return eomtfInputEnables(OMTFNLINK1); }; + std::bitset<6> emtfnInputEnables() { return eomtfInputEnables(EMTFNLINK1); }; + bool inputEnable(size_t link) { return inputEnables_.test(link-1); }; + void setInputEnables(const std::bitset<72> &enables) { inputEnables_ = enables; }; + void setCaloInputEnables(const std::bitset<28> &enables); + void setEmtfpInputEnables(const std::bitset<6> &enables) { setEOmtfInputEnables(EMTFPLINK1, enables); }; + void setOmtfpInputEnables(const std::bitset<6> &enables) { setEOmtfInputEnables(OMTFPLINK1, enables); }; + void setBmtfInputEnables(const std::bitset<12> &enables); + void setOmtfnInputEnables(const std::bitset<6> &enables) { setEOmtfInputEnables(OMTFNLINK1, enables); }; + void setEmtfnInputEnables(const std::bitset<6> &enables) { setEOmtfInputEnables(EMTFNLINK1, enables); }; + void setInputEnable(size_t link, bool enable) { inputEnables_.set(link, enable); }; + // LUTs l1t::LUT* absIsoCheckMemLUT() { return &pnodes_[absIsoCheckMem].LUT_; } l1t::LUT* relIsoCheckMemLUT() { return &pnodes_[relIsoCheckMem].LUT_; } l1t::LUT* idxSelMemPhiLUT() { return &pnodes_[idxSelMemPhi].LUT_; } l1t::LUT* idxSelMemEtaLUT() { return &pnodes_[idxSelMemEta].LUT_; } - //l1t::LUT* brlSingleMatchQualLUT() { return &pnodes_[brlSingleMatchQual].LUT_; } l1t::LUT* fwdPosSingleMatchQualLUT() { return &pnodes_[fwdPosSingleMatchQual].LUT_; } l1t::LUT* fwdNegSingleMatchQualLUT() { return &pnodes_[fwdNegSingleMatchQual].LUT_; } l1t::LUT* ovlPosSingleMatchQualLUT() { return &pnodes_[ovlPosSingleMatchQual].LUT_; } @@ -122,7 +125,6 @@ class L1TMuonGlobalParams { void setRelIsoCheckMemLUT (const l1t::LUT & lut) { pnodes_[relIsoCheckMem].type_ = "LUT"; pnodes_[relIsoCheckMem].LUT_ = lut; } void setIdxSelMemPhiLUT (const l1t::LUT & lut) { pnodes_[idxSelMemPhi].type_ = "LUT"; pnodes_[idxSelMemPhi].LUT_ = lut; } void setIdxSelMemEtaLUT (const l1t::LUT & lut) { pnodes_[idxSelMemEta].type_ = "LUT"; pnodes_[idxSelMemEta].LUT_ = lut; } - //void setBrlSingleMatchQualLUT (const l1t::LUT & lut) { pnodes_[brlSingleMatchQual].type_ = "LUT"; pnodes_[brlSingleMatchQual].LUT_ = lut; } void setFwdPosSingleMatchQualLUT (const l1t::LUT & lut) { pnodes_[fwdPosSingleMatchQual].type_ = "LUT"; pnodes_[fwdPosSingleMatchQual].LUT_ = lut; } void setFwdNegSingleMatchQualLUT (const l1t::LUT & lut) { pnodes_[fwdNegSingleMatchQual].type_ = "LUT"; pnodes_[fwdNegSingleMatchQual].LUT_ = lut; } void setOvlPosSingleMatchQualLUT (const l1t::LUT & lut) { pnodes_[ovlPosSingleMatchQual].type_ = "LUT"; pnodes_[ovlPosSingleMatchQual].LUT_ = lut; } @@ -144,7 +146,6 @@ class L1TMuonGlobalParams { std::string relIsoCheckMemLUTPath() const { return pnodes_[relIsoCheckMem].sparams_.size() > spIdx::fname ? pnodes_[relIsoCheckMem].sparams_[spIdx::fname] : ""; } std::string idxSelMemPhiLUTPath() const { return pnodes_[idxSelMemPhi].sparams_.size() > spIdx::fname ? pnodes_[idxSelMemPhi].sparams_[spIdx::fname] : ""; } std::string idxSelMemEtaLUTPath() const { return pnodes_[idxSelMemEta].sparams_.size() > spIdx::fname ? pnodes_[idxSelMemEta].sparams_[spIdx::fname] : ""; } - //std::string brlSingleMatchQualLUTPath() const { return pnodes_[brlSingleMatchQual].sparams_.size() > spIdx::fname ? pnodes_[brlSingleMatchQual].sparams_[spIdx::fname] : ""; } std::string fwdPosSingleMatchQualLUTPath() const { return pnodes_[fwdPosSingleMatchQual].sparams_.size() > spIdx::fname ? pnodes_[fwdPosSingleMatchQual].sparams_[spIdx::fname] : ""; } std::string fwdNegSingleMatchQualLUTPath() const { return pnodes_[fwdNegSingleMatchQual].sparams_.size() > spIdx::fname ? pnodes_[fwdNegSingleMatchQual].sparams_[spIdx::fname] : ""; } std::string ovlPosSingleMatchQualLUTPath() const { return pnodes_[ovlPosSingleMatchQual].sparams_.size() > spIdx::fname ? pnodes_[ovlPosSingleMatchQual].sparams_[spIdx::fname] : ""; } @@ -164,7 +165,6 @@ class L1TMuonGlobalParams { void setRelIsoCheckMemLUTPath (std::string path) { pnodes_[relIsoCheckMem].sparams_.push_back(path); } void setIdxSelMemPhiLUTPath (std::string path) { pnodes_[idxSelMemPhi].sparams_.push_back(path); } void setIdxSelMemEtaLUTPath (std::string path) { pnodes_[idxSelMemEta].sparams_.push_back(path); } - //void setBrlSingleMatchQualLUTPath (std::string path) { pnodes_[brlSingleMatchQual].sparams_.push_back(path); } void setFwdPosSingleMatchQualLUTPath (std::string path) { pnodes_[fwdPosSingleMatchQual].sparams_.push_back(path); } void setFwdNegSingleMatchQualLUTPath (std::string path) { pnodes_[fwdNegSingleMatchQual].sparams_.push_back(path); } void setOvlPosSingleMatchQualLUTPath (std::string path) { pnodes_[ovlPosSingleMatchQual].sparams_.push_back(path); } @@ -182,7 +182,6 @@ class L1TMuonGlobalParams { void setSortRankLUTPath (std::string path) { pnodes_[sortRank].sparams_.push_back(path); } // Cancel out LUT max dR - //double brlSingleMatchQualLUTMaxDR() const { return pnodes_[brlSingleMatchQual].dparams_.size() > dpIdx::maxdr ? pnodes_[brlSingleMatchQual].dparams_[dpIdx::maxdr] : 0.; } double fwdPosSingleMatchQualLUTMaxDR() const { return pnodes_[fwdPosSingleMatchQual].dparams_.size() > dpIdx::maxdr ? pnodes_[fwdPosSingleMatchQual].dparams_[dpIdx::maxdr] : 0.; } double fwdNegSingleMatchQualLUTMaxDR() const { return pnodes_[fwdNegSingleMatchQual].dparams_.size() > dpIdx::maxdr ? pnodes_[fwdNegSingleMatchQual].dparams_[dpIdx::maxdr] : 0.; } double ovlPosSingleMatchQualLUTMaxDR() const { return pnodes_[ovlPosSingleMatchQual].dparams_.size() > dpIdx::maxdr ? pnodes_[ovlPosSingleMatchQual].dparams_[dpIdx::maxdr] : 0.; } @@ -193,7 +192,6 @@ class L1TMuonGlobalParams { 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 setBrlSingleMatchQualLUTMaxDR (double maxDR) { pnodes_[brlSingleMatchQual].dparams_.push_back(maxDR); } 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); } @@ -221,6 +219,12 @@ class L1TMuonGlobalParams { std::vector pnodes_; + // each bit represents one uGMT input link + std::bitset<72> inputEnables_; + + std::bitset<6> eomtfInputEnables(const int &startLink); + void setEOmtfInputEnables(const int &startLink, const std::bitset<6> &enables); + COND_SERIALIZABLE; }; #endif diff --git a/CondFormats/L1TObjects/src/L1TMuonGlobalParams.cc b/CondFormats/L1TObjects/src/L1TMuonGlobalParams.cc index cb84c5166aa78..28efea16418b9 100644 --- a/CondFormats/L1TObjects/src/L1TMuonGlobalParams.cc +++ b/CondFormats/L1TObjects/src/L1TMuonGlobalParams.cc @@ -1,5 +1,62 @@ #include "CondFormats/L1TObjects/interface/L1TMuonGlobalParams.h" +std::bitset<28> L1TMuonGlobalParams::caloInputEnables() +{ + std::bitset<28> subset; + size_t sum = 0; + for (int link = CALOLINK1; link < CALOLINK1 + 28; ++link, ++sum) { + subset.set(sum, inputEnables_.test(link-1)); + } + return subset; +} + + +std::bitset<6> L1TMuonGlobalParams::eomtfInputEnables(const int &startLink) +{ + std::bitset<6> subset; + size_t proc = 0; + for (int link = startLink; link < startLink + 6; ++link, ++proc) { + subset.set(proc, inputEnables_.test(link-1)); + } + return subset; +} + + +std::bitset<12> L1TMuonGlobalParams::bmtfInputEnables() +{ + std::bitset<12> subset; + size_t proc = 0; + for (int link = BMTFLINK1; link < BMTFLINK1 + 12; ++link, ++proc) { + subset.set(proc, inputEnables_.test(link-1)); + } + return subset; +} + + +void L1TMuonGlobalParams::setCaloInputEnables(const std::bitset<28> &enables) +{ + for (size_t sum = 0; sum < 28; ++sum) { + inputEnables_.set(CALOLINK1 + sum, enables[sum]); + } +} + + +void L1TMuonGlobalParams::setEOmtfInputEnables(const int &startLink, const std::bitset<6> &enables) +{ + for (size_t proc = 0; proc < 6; ++proc) { + inputEnables_.set(startLink + proc, enables[proc]); + } +} + + +void L1TMuonGlobalParams::setBmtfInputEnables(const std::bitset<12> &enables) +{ + for (size_t proc = 0; proc < 12; ++proc) { + inputEnables_.set(BMTFLINK1 + proc, enables[proc]); + } +} + + void L1TMuonGlobalParams::print(std::ostream& out) const { out << "L1 MicroGMT Parameters" << std::endl; @@ -8,12 +65,14 @@ void L1TMuonGlobalParams::print(std::ostream& out) const { out << "Output BX range from " << bxMin_ << " to " << bxMax_ << std::endl; + out << "InputEnables: " << inputEnables_ << std::endl; + out << " EMTF-|OMTF-| BMTF |OMTF+|EMTF+| CALO | res 0" << std::endl; + out << "LUT paths (LUTs are generated analytically if path is empty)" << std::endl; out << " Abs isolation checkMem LUT path: " << this->absIsoCheckMemLUTPath() << std::endl; out << " Rel isolation checkMem LUT path: " << this->relIsoCheckMemLUTPath() << std::endl; out << " Index selMem phi LUT path: " << this->idxSelMemPhiLUTPath() << std::endl; out << " Index selMem eta LUT path: " << this->idxSelMemEtaLUTPath() << std::endl; - //out << " Barrel Single MatchQual LUT path: " << this->brlSingleMatchQualLUTPath() << ", max dR (Used when LUT path empty): " << this->brlSingleMatchQualLUTMaxDR() << std::endl; out << " Forward pos MatchQual LUT path: " << this->fwdPosSingleMatchQualLUTPath() << ", max dR (Used when LUT path empty): " << this->fwdPosSingleMatchQualLUTMaxDR() << std::endl; 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; diff --git a/L1Trigger/L1TMuon/plugins/L1TMuonGlobalParamsESProducer.cc b/L1Trigger/L1TMuon/plugins/L1TMuonGlobalParamsESProducer.cc index f247cbf492a22..ca7ac6f878547 100644 --- a/L1Trigger/L1TMuon/plugins/L1TMuonGlobalParamsESProducer.cc +++ b/L1Trigger/L1TMuon/plugins/L1TMuonGlobalParamsESProducer.cc @@ -79,7 +79,47 @@ L1TMuonGlobalParamsESProducer::L1TMuonGlobalParamsESProducer(const edm::Paramete m_params.setBxMax(bxMax); } - //m_params.setBrlSingleMatchQualLUTMaxDR(iConfig.getParameter("BrlSingleMatchQualLUTMaxDR")); + bool caloInputEnable = iConfig.getParameter("caloInputEnable"); + if (caloInputEnable) { + m_params.setCaloInputEnables(std::bitset<28>(0xFFFFFFF)); + } else { + m_params.setCaloInputEnables(std::bitset<28>()); + } + + std::vector bmtfInputEnables = iConfig.getParameter >("bmtfInputEnables"); + std::bitset<12> bmtfEnables; + for (size_t i = 0; i < bmtfInputEnables.size(); ++i) { + bmtfEnables.set(i, bmtfInputEnables[i] > 0); + } + m_params.setBmtfInputEnables(bmtfEnables); + + std::vector omtfInputEnables = iConfig.getParameter >("omtfInputEnables"); + std::bitset<6> omtfpEnables; + std::bitset<6> omtfnEnables; + for (size_t i = 0; i < omtfInputEnables.size(); ++i) { + if (i < 6) { + omtfpEnables.set(i, omtfInputEnables[i] > 0); + } else { + omtfnEnables.set(i-6, omtfInputEnables[i] > 0); + } + } + m_params.setOmtfpInputEnables(omtfpEnables); + m_params.setOmtfnInputEnables(omtfnEnables); + + std::vector emtfInputEnables = iConfig.getParameter >("emtfInputEnables"); + std::bitset<6> emtfpEnables; + std::bitset<6> emtfnEnables; + for (size_t i = 0; i < emtfInputEnables.size(); ++i) { + if (i < 6) { + emtfpEnables.set(i, emtfInputEnables[i] > 0); + } else { + emtfnEnables.set(i-6, emtfInputEnables[i] > 0); + } + } + m_params.setEmtfpInputEnables(emtfpEnables); + m_params.setEmtfnInputEnables(emtfnEnables); + + m_params.setFwdPosSingleMatchQualLUTMaxDR(iConfig.getParameter("FwdPosSingleMatchQualLUTMaxDR")); m_params.setFwdNegSingleMatchQualLUTMaxDR(iConfig.getParameter("FwdNegSingleMatchQualLUTMaxDR")); m_params.setOvlPosSingleMatchQualLUTMaxDR(iConfig.getParameter("OvlPosSingleMatchQualLUTMaxDR")); @@ -97,7 +137,6 @@ 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 brlSingleMatchQualLUT = l1t::MicroGMTMatchQualLUTFactory::create (iConfig.getParameter("BrlSingleMatchQualLUTPath"), iConfig.getParameter("BrlSingleMatchQualLUTMaxDR"), l1t::cancel_t::bmtf_bmtf, 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); @@ -117,7 +156,6 @@ L1TMuonGlobalParamsESProducer::L1TMuonGlobalParamsESProducer(const edm::Paramete m_params.setRelIsoCheckMemLUT(*relIsoCheckMemLUT); m_params.setIdxSelMemPhiLUT(*idxSelMemPhiLUT); m_params.setIdxSelMemEtaLUT(*idxSelMemEtaLUT); - //m_params.setBrlSingleMatchQualLUT(*brlSingleMatchQualLUT); m_params.setFwdPosSingleMatchQualLUT(*fwdPosSingleMatchQualLUT); m_params.setFwdNegSingleMatchQualLUT(*fwdNegSingleMatchQualLUT); m_params.setOvlPosSingleMatchQualLUT(*ovlPosSingleMatchQualLUT); @@ -139,7 +177,6 @@ L1TMuonGlobalParamsESProducer::L1TMuonGlobalParamsESProducer(const edm::Paramete m_params.setRelIsoCheckMemLUTPath (iConfig.getParameter("RelIsoCheckMemLUTPath")); m_params.setIdxSelMemPhiLUTPath (iConfig.getParameter("IdxSelMemPhiLUTPath")); m_params.setIdxSelMemEtaLUTPath (iConfig.getParameter("IdxSelMemEtaLUTPath")); - //m_params.setBrlSingleMatchQualLUTPath (iConfig.getParameter("BrlSingleMatchQualLUTPath")); m_params.setFwdPosSingleMatchQualLUTPath (iConfig.getParameter("FwdPosSingleMatchQualLUTPath")); m_params.setFwdNegSingleMatchQualLUTPath (iConfig.getParameter("FwdNegSingleMatchQualLUTPath")); m_params.setOvlPosSingleMatchQualLUTPath (iConfig.getParameter("OvlPosSingleMatchQualLUTPath")); diff --git a/L1Trigger/L1TMuon/plugins/L1TMuonProducer.cc b/L1Trigger/L1TMuon/plugins/L1TMuonProducer.cc index 7dfc19b2ed620..7d9fff0cbc9aa 100644 --- a/L1Trigger/L1TMuon/plugins/L1TMuonProducer.cc +++ b/L1Trigger/L1TMuon/plugins/L1TMuonProducer.cc @@ -98,6 +98,7 @@ using namespace l1t; // ----------member data --------------------------- int m_bxMin; int m_bxMax; + std::bitset<72> m_inputEnables; std::unique_ptr microGMTParams; edm::InputTag m_barrelTfInputTag; edm::InputTag m_overlapTfInputTag; @@ -392,9 +393,11 @@ L1TMuonProducer::splitAndConvertMuons(const edm::Handlesize(bx); ++i, ++muIdx) { - if (currentLink != in->at(bx, i).link()) { + int link = in->at(bx, i).link(); + if (!m_inputEnables.test(link)) continue; // only process if input link is enabled + if (currentLink != link) { muIdx = 0; - currentLink = in->at(bx, i).link(); + currentLink = link; } int gPhi = MicroGMTConfiguration::calcGlobalPhi(in->at(bx, i).hwPhi(), in->at(bx, i).trackFinderType(), in->at(bx, i).processor()); int tfMuonIdx = 3 * (currentLink - 36) + muIdx; @@ -427,9 +430,11 @@ L1TMuonProducer::convertMuons(const edm::Handlesize(bx); ++i, ++muIdx) { - if (currentLink != in->at(bx, i).link()) { + int link = in->at(bx, i).link(); + if (!m_inputEnables.test(link)) continue; // only process if input link is enabled + if (currentLink != link) { muIdx = 0; - currentLink = in->at(bx, i).link(); + currentLink = link; } int gPhi = MicroGMTConfiguration::calcGlobalPhi(in->at(bx, i).hwPhi(), in->at(bx, i).trackFinderType(), in->at(bx, i).processor()); int tfMuonIdx = 3 * (currentLink - 36) + muIdx; @@ -469,6 +474,7 @@ L1TMuonProducer::beginRun(edm::Run const& run, edm::EventSetup const& iSetup) //microGMTParams->print(std::cout); m_bxMin = microGMTParams->bxMin(); m_bxMax = microGMTParams->bxMax(); + m_inputEnables = microGMTParams->inputEnables(); m_rankPtQualityLUT = l1t::MicroGMTRankPtQualLUTFactory::create(microGMTParams->sortRankLUTPath(), microGMTParams->fwVersion(), microGMTParams->sortRankLUTPtFactor(), microGMTParams->sortRankLUTQualFactor()); m_isolationUnit.initialise(microGMTParams.get()); m_cancelOutUnit.initialise(microGMTParams.get()); diff --git a/L1Trigger/L1TMuon/plugins/L1TMuonQualityAdjuster.cc b/L1Trigger/L1TMuon/plugins/L1TMuonQualityAdjuster.cc index 84183e023539c..c1210125cba3b 100644 --- a/L1Trigger/L1TMuon/plugins/L1TMuonQualityAdjuster.cc +++ b/L1Trigger/L1TMuon/plugins/L1TMuonQualityAdjuster.cc @@ -120,7 +120,7 @@ L1TMuonQualityAdjuster::produce(edm::Event& iEvent, const edm::EventSetup& iSetu filteredBMTFMuons->setBXRange(bmtfMuons->getFirstBX(), bmtfMuons->getLastBX()); for (int bx = bmtfMuons->getFirstBX(); bx <= bmtfMuons->getLastBX(); ++bx) { for (auto mu = bmtfMuons->begin(bx); mu != bmtfMuons->end(bx); ++mu) { - int newqual = 1; + int newqual = 12; l1t::RegionalMuonCand newMu((*mu)); newMu.setHwQual(newqual); filteredBMTFMuons->push_back(bx+m_bmtfBxOffset, newMu); @@ -135,7 +135,7 @@ L1TMuonQualityAdjuster::produce(edm::Event& iEvent, const edm::EventSetup& iSetu for (int bx = emtfMuons->getFirstBX(); bx <= emtfMuons->getLastBX(); ++bx) { for (auto mu = emtfMuons->begin(bx); mu != emtfMuons->end(bx); ++mu) { int newqual = 0; - if (mu->hwQual() == 11 || mu->hwQual() > 12) newqual=1; + if (mu->hwQual() == 11 || mu->hwQual() > 12) newqual=12; l1t::RegionalMuonCand newMu((*mu)); newMu.setHwQual(newqual); filteredEMTFMuons->push_back(bx, newMu); @@ -150,7 +150,7 @@ L1TMuonQualityAdjuster::produce(edm::Event& iEvent, const edm::EventSetup& iSetu for (int bx = omtfMuons->getFirstBX(); bx <= omtfMuons->getLastBX(); ++bx) { for (auto mu = omtfMuons->begin(bx); mu != omtfMuons->end(bx); ++mu) { int newqual = 0; - if (mu->hwQual() > 0) newqual = 1; + if (mu->hwQual() > 0) newqual = 12; l1t::RegionalMuonCand newMu((*mu)); newMu.setHwQual(newqual); filteredOMTFMuons->push_back(bx, newMu); diff --git a/L1Trigger/L1TMuon/python/fakeGmtParams_cff.py b/L1Trigger/L1TMuon/python/fakeGmtParams_cff.py index 72925793cdb53..a07bb6e6c0ffa 100644 --- a/L1Trigger/L1TMuon/python/fakeGmtParams_cff.py +++ b/L1Trigger/L1TMuon/python/fakeGmtParams_cff.py @@ -18,11 +18,16 @@ bxMin = cms.int32(-2), bxMax = cms.int32(2), + # enable uGMT inputs + caloInputEnable = cms.bool(True), + bmtfInputEnables = cms.vuint32(1,1,1,1,1,1,1,1,1,1,1,1), # BMTF 0-11 + omtfInputEnables = cms.vuint32(1,1,1,1,1,1,1,1,1,1,1,1), # OMTF+0-5, OMTF-0-5 + emtfInputEnables = cms.vuint32(1,1,1,1,1,1,1,1,1,1,1,1), # EMTF+0-5, EMTF-0-5 + AbsIsoCheckMemLUTPath = cms.string(os.path.join(lut_dir, 'AbsIsoCheckMem.txt')), 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(''), @@ -39,7 +44,6 @@ 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.1), FwdNegSingleMatchQualLUTMaxDR = cms.double(0.1), OvlPosSingleMatchQualLUTMaxDR = cms.double(0.1), diff --git a/L1Trigger/L1TMuon/src/MicroGMTCancelOutUnit.cc b/L1Trigger/L1TMuon/src/MicroGMTCancelOutUnit.cc index 6f7fe9c42bea2..0ae405991cca0 100644 --- a/L1Trigger/L1TMuon/src/MicroGMTCancelOutUnit.cc +++ b/L1Trigger/L1TMuon/src/MicroGMTCancelOutUnit.cc @@ -19,13 +19,11 @@ MicroGMTCancelOutUnit::initialise(L1TMuonGlobalParams* microGMTParams) { m_boNegMatchQualLUT = l1t::MicroGMTMatchQualLUTFactory::create(microGMTParams->bONegMatchQualLUTPath(), microGMTParams->bONegMatchQualLUTMaxDR(), cancel_t::omtf_bmtf_neg, fwVersion); m_foPosMatchQualLUT = l1t::MicroGMTMatchQualLUTFactory::create(microGMTParams->fOPosMatchQualLUTPath(), microGMTParams->fOPosMatchQualLUTMaxDR(), cancel_t::omtf_emtf_pos, fwVersion); m_foNegMatchQualLUT = l1t::MicroGMTMatchQualLUTFactory::create(microGMTParams->fONegMatchQualLUTPath(), microGMTParams->fONegMatchQualLUTMaxDR(), cancel_t::omtf_emtf_neg, fwVersion); - //m_brlSingleMatchQualLUT = l1t::MicroGMTMatchQualLUTFactory::create(microGMTParams->brlSingleMatchQualLUTPath(), microGMTParams->brlSingleMatchQualLUTMaxDR(), cancel_t::bmtf_bmtf, fwVersion); m_ovlPosSingleMatchQualLUT = l1t::MicroGMTMatchQualLUTFactory::create(microGMTParams->ovlPosSingleMatchQualLUTPath(), microGMTParams->ovlPosSingleMatchQualLUTMaxDR(), cancel_t::omtf_omtf_pos, fwVersion); m_ovlNegSingleMatchQualLUT = l1t::MicroGMTMatchQualLUTFactory::create(microGMTParams->ovlNegSingleMatchQualLUTPath(), microGMTParams->ovlNegSingleMatchQualLUTMaxDR(), cancel_t::omtf_omtf_neg, fwVersion); m_fwdPosSingleMatchQualLUT = l1t::MicroGMTMatchQualLUTFactory::create(microGMTParams->fwdPosSingleMatchQualLUTPath(), microGMTParams->fwdPosSingleMatchQualLUTMaxDR(), cancel_t::emtf_emtf_pos, fwVersion); m_fwdNegSingleMatchQualLUT = l1t::MicroGMTMatchQualLUTFactory::create(microGMTParams->fwdNegSingleMatchQualLUTPath(), microGMTParams->fwdNegSingleMatchQualLUTMaxDR(), 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; @@ -57,7 +55,7 @@ MicroGMTCancelOutUnit::setCancelOutBits(GMTInternalWedges& wedges, tftype trackF coll2.push_back(mu); } if (mode == cancelmode::coordinate) { - getCoordinateCancelBits(coll1, coll2); + getCoordinateCancelBits(coll2, coll1); // in case of a tie coll1 muon wins } else { getTrackAddrCancelBits(coll1, coll2); } @@ -156,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()); @@ -255,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);