Skip to content

Commit

Permalink
Merge pull request cms-sw#26 from dinyar/elliptic_cancel_out_window
Browse files Browse the repository at this point in the history
merged
thomreis committed May 9, 2016
2 parents 6437d21 + fb32612 commit f392c83
Showing 10 changed files with 107 additions and 58 deletions.
41 changes: 30 additions & 11 deletions L1Trigger/L1TMuon/interface/L1TMuonGlobalParamsHelper.h
Original file line number Diff line number Diff line change
@@ -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; }
2 changes: 1 addition & 1 deletion L1Trigger/L1TMuon/interface/MicroGMTLUTFactories.h
Original file line number Diff line number Diff line change
@@ -30,7 +30,7 @@ namespace l1t {

typedef std::shared_ptr<MicroGMTMatchQualLUT> 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);
};

4 changes: 3 additions & 1 deletion L1Trigger/L1TMuon/interface/MicroGMTMatchQualLUT.h
Original file line number Diff line number Diff line change
@@ -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;
};
16 changes: 8 additions & 8 deletions L1Trigger/L1TMuon/plugins/L1TMicroGMTLUTDumper.cc
Original file line number Diff line number Diff line change
@@ -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
33 changes: 17 additions & 16 deletions L1Trigger/L1TMuon/plugins/L1TMuonGlobalParamsESProducer.cc
Original file line number Diff line number Diff line change
@@ -154,14 +154,14 @@ L1TMuonGlobalParamsESProducer::L1TMuonGlobalParamsESProducer(const edm::Paramete
m_params_helper.setMaskedEmtfnInputs(emtfnMasked);

// LUTs
m_params_helper.setFwdPosSingleMatchQualLUTMaxDR(iConfig.getParameter<double>("FwdPosSingleMatchQualLUTMaxDR"));
m_params_helper.setFwdNegSingleMatchQualLUTMaxDR(iConfig.getParameter<double>("FwdNegSingleMatchQualLUTMaxDR"));
m_params_helper.setOvlPosSingleMatchQualLUTMaxDR(iConfig.getParameter<double>("OvlPosSingleMatchQualLUTMaxDR"));
m_params_helper.setOvlNegSingleMatchQualLUTMaxDR(iConfig.getParameter<double>("OvlNegSingleMatchQualLUTMaxDR"));
m_params_helper.setBOPosMatchQualLUTMaxDR(iConfig.getParameter<double>("BOPosMatchQualLUTMaxDR"), iConfig.getParameter<double>("BOPosMatchQualLUTMaxDREtaFine"));
m_params_helper.setBONegMatchQualLUTMaxDR(iConfig.getParameter<double>("BONegMatchQualLUTMaxDR"), iConfig.getParameter<double>("BONegMatchQualLUTMaxDREtaFine"));
m_params_helper.setFOPosMatchQualLUTMaxDR(iConfig.getParameter<double>("FOPosMatchQualLUTMaxDR"));
m_params_helper.setFONegMatchQualLUTMaxDR(iConfig.getParameter<double>("FONegMatchQualLUTMaxDR"));
m_params_helper.setFwdPosSingleMatchQualLUTMaxDR(iConfig.getParameter<double>("FwdPosSingleMatchQualLUTMaxDR"), iConfig.getParameter<double>("FwdPosSingleMatchQualLUTfEta"), iConfig.getParameter<double>("FwdPosSingleMatchQualLUTfPhi"));
m_params_helper.setFwdNegSingleMatchQualLUTMaxDR(iConfig.getParameter<double>("FwdNegSingleMatchQualLUTMaxDR"), iConfig.getParameter<double>("FwdNegSingleMatchQualLUTfEta"), iConfig.getParameter<double>("FwdNegSingleMatchQualLUTfPhi"));
m_params_helper.setOvlPosSingleMatchQualLUTMaxDR(iConfig.getParameter<double>("OvlPosSingleMatchQualLUTMaxDR"), iConfig.getParameter<double>("OvlPosSingleMatchQualLUTfEta"), iConfig.getParameter<double>("OvlPosSingleMatchQualLUTfPhi"));
m_params_helper.setOvlNegSingleMatchQualLUTMaxDR(iConfig.getParameter<double>("OvlNegSingleMatchQualLUTMaxDR"), iConfig.getParameter<double>("OvlNegSingleMatchQualLUTfEta"), iConfig.getParameter<double>("OvlNegSingleMatchQualLUTfPhi"));
m_params_helper.setBOPosMatchQualLUTMaxDR(iConfig.getParameter<double>("BOPosMatchQualLUTMaxDR"), iConfig.getParameter<double>("BOPosMatchQualLUTfEta"), iConfig.getParameter<double>("BOPosMatchQualLUTfEtaCoarse"), iConfig.getParameter<double>("BOPosMatchQualLUTfPhi"));
m_params_helper.setBONegMatchQualLUTMaxDR(iConfig.getParameter<double>("BONegMatchQualLUTMaxDR"), iConfig.getParameter<double>("BONegMatchQualLUTfEta"), iConfig.getParameter<double>("BONegMatchQualLUTfEtaCoarse"), iConfig.getParameter<double>("BONegMatchQualLUTfPhi"));
m_params_helper.setFOPosMatchQualLUTMaxDR(iConfig.getParameter<double>("FOPosMatchQualLUTMaxDR"), iConfig.getParameter<double>("FOPosMatchQualLUTfEta"), iConfig.getParameter<double>("FOPosMatchQualLUTfPhi"));
m_params_helper.setFONegMatchQualLUTMaxDR(iConfig.getParameter<double>("FONegMatchQualLUTMaxDR"), iConfig.getParameter<double>("FONegMatchQualLUTfEta"), iConfig.getParameter<double>("FONegMatchQualLUTfPhi"));

unsigned sortRankLUTPtFactor = iConfig.getParameter<unsigned>("SortRankLUTPtFactor");
unsigned sortRankLUTQualFactor = iConfig.getParameter<unsigned>("SortRankLUTQualFactor");
@@ -171,14 +171,15 @@ L1TMuonGlobalParamsESProducer::L1TMuonGlobalParamsESProducer(const edm::Paramete
auto relIsoCheckMemLUT = l1t::MicroGMTRelativeIsolationCheckLUTFactory::create (iConfig.getParameter<std::string>("RelIsoCheckMemLUTPath"), fwVersion);
auto idxSelMemPhiLUT = l1t::MicroGMTCaloIndexSelectionLUTFactory::create (iConfig.getParameter<std::string>("IdxSelMemPhiLUTPath"), l1t::MicroGMTConfiguration::PHI, fwVersion);
auto idxSelMemEtaLUT = l1t::MicroGMTCaloIndexSelectionLUTFactory::create (iConfig.getParameter<std::string>("IdxSelMemEtaLUTPath"), l1t::MicroGMTConfiguration::ETA, fwVersion);
auto fwdPosSingleMatchQualLUT = l1t::MicroGMTMatchQualLUTFactory::create (iConfig.getParameter<std::string>("FwdPosSingleMatchQualLUTPath"), iConfig.getParameter<double>("FwdPosSingleMatchQualLUTMaxDR"), l1t::cancel_t::emtf_emtf_pos, fwVersion);
auto fwdNegSingleMatchQualLUT = l1t::MicroGMTMatchQualLUTFactory::create (iConfig.getParameter<std::string>("FwdNegSingleMatchQualLUTPath"), iConfig.getParameter<double>("FwdNegSingleMatchQualLUTMaxDR"), l1t::cancel_t::emtf_emtf_neg, fwVersion);
auto ovlPosSingleMatchQualLUT = l1t::MicroGMTMatchQualLUTFactory::create (iConfig.getParameter<std::string>("OvlPosSingleMatchQualLUTPath"), iConfig.getParameter<double>("OvlPosSingleMatchQualLUTMaxDR"), l1t::cancel_t::omtf_omtf_pos, fwVersion);
auto ovlNegSingleMatchQualLUT = l1t::MicroGMTMatchQualLUTFactory::create (iConfig.getParameter<std::string>("OvlNegSingleMatchQualLUTPath"), iConfig.getParameter<double>("OvlNegSingleMatchQualLUTMaxDR"), l1t::cancel_t::omtf_omtf_neg, fwVersion);
auto bOPosMatchQualLUT = l1t::MicroGMTMatchQualLUTFactory::create (iConfig.getParameter<std::string>("BOPosMatchQualLUTPath"), iConfig.getParameter<double>("BOPosMatchQualLUTMaxDR"), l1t::cancel_t::omtf_bmtf_pos, fwVersion);
auto bONegMatchQualLUT = l1t::MicroGMTMatchQualLUTFactory::create (iConfig.getParameter<std::string>("BONegMatchQualLUTPath"), iConfig.getParameter<double>("BONegMatchQualLUTMaxDR"), l1t::cancel_t::omtf_bmtf_neg, fwVersion);
auto fOPosMatchQualLUT = l1t::MicroGMTMatchQualLUTFactory::create (iConfig.getParameter<std::string>("FOPosMatchQualLUTPath"), iConfig.getParameter<double>("FOPosMatchQualLUTMaxDR"), l1t::cancel_t::omtf_emtf_pos, fwVersion);
auto fONegMatchQualLUT = l1t::MicroGMTMatchQualLUTFactory::create (iConfig.getParameter<std::string>("FONegMatchQualLUTPath"), iConfig.getParameter<double>("FONegMatchQualLUTMaxDR"), l1t::cancel_t::omtf_emtf_neg, fwVersion);
// TODO: Create different LUTs if etaFine bit is used
auto fwdPosSingleMatchQualLUT = l1t::MicroGMTMatchQualLUTFactory::create (iConfig.getParameter<std::string>("FwdPosSingleMatchQualLUTPath"), iConfig.getParameter<double>("FwdPosSingleMatchQualLUTMaxDR"), iConfig.getParameter<double>("FwdPosSingleMatchQualLUTfEta"), iConfig.getParameter<double>("FwdPosSingleMatchQualLUTfPhi"), l1t::cancel_t::emtf_emtf_pos, fwVersion);
auto fwdNegSingleMatchQualLUT = l1t::MicroGMTMatchQualLUTFactory::create (iConfig.getParameter<std::string>("FwdNegSingleMatchQualLUTPath"), iConfig.getParameter<double>("FwdNegSingleMatchQualLUTMaxDR"), iConfig.getParameter<double>("FwdNegSingleMatchQualLUTfEta"), iConfig.getParameter<double>("FwdNegSingleMatchQualLUTfPhi"), l1t::cancel_t::emtf_emtf_neg, fwVersion);
auto ovlPosSingleMatchQualLUT = l1t::MicroGMTMatchQualLUTFactory::create (iConfig.getParameter<std::string>("OvlPosSingleMatchQualLUTPath"), iConfig.getParameter<double>("OvlPosSingleMatchQualLUTMaxDR"), iConfig.getParameter<double>("OvlPosSingleMatchQualLUTfEta"), iConfig.getParameter<double>("OvlPosSingleMatchQualLUTfPhi"), l1t::cancel_t::omtf_omtf_pos, fwVersion);
auto ovlNegSingleMatchQualLUT = l1t::MicroGMTMatchQualLUTFactory::create (iConfig.getParameter<std::string>("OvlNegSingleMatchQualLUTPath"), iConfig.getParameter<double>("OvlNegSingleMatchQualLUTMaxDR"), iConfig.getParameter<double>("OvlNegSingleMatchQualLUTfEta"), iConfig.getParameter<double>("OvlNegSingleMatchQualLUTfPhi"), l1t::cancel_t::omtf_omtf_neg, fwVersion);
auto bOPosMatchQualLUT = l1t::MicroGMTMatchQualLUTFactory::create (iConfig.getParameter<std::string>("BOPosMatchQualLUTPath"), iConfig.getParameter<double>("BOPosMatchQualLUTMaxDR"), iConfig.getParameter<double>("BOPosMatchQualLUTfEta"), iConfig.getParameter<double>("BOPosMatchQualLUTfPhi"), l1t::cancel_t::omtf_bmtf_pos, fwVersion);
auto bONegMatchQualLUT = l1t::MicroGMTMatchQualLUTFactory::create (iConfig.getParameter<std::string>("BONegMatchQualLUTPath"), iConfig.getParameter<double>("BONegMatchQualLUTMaxDR"), iConfig.getParameter<double>("BONegMatchQualLUTfEta"), iConfig.getParameter<double>("BONegMatchQualLUTfPhi"), l1t::cancel_t::omtf_bmtf_neg, fwVersion);
auto fOPosMatchQualLUT = l1t::MicroGMTMatchQualLUTFactory::create (iConfig.getParameter<std::string>("FOPosMatchQualLUTPath"), iConfig.getParameter<double>("FOPosMatchQualLUTMaxDR"), iConfig.getParameter<double>("FOPosMatchQualLUTfEta"), iConfig.getParameter<double>("FOPosMatchQualLUTfPhi"), l1t::cancel_t::omtf_emtf_pos, fwVersion);
auto fONegMatchQualLUT = l1t::MicroGMTMatchQualLUTFactory::create (iConfig.getParameter<std::string>("FONegMatchQualLUTPath"), iConfig.getParameter<double>("FONegMatchQualLUTMaxDR"), iConfig.getParameter<double>("FONegMatchQualLUTfEta"), iConfig.getParameter<double>("FONegMatchQualLUTfPhi"), l1t::cancel_t::omtf_emtf_neg, fwVersion);
auto bPhiExtrapolationLUT = l1t::MicroGMTExtrapolationLUTFactory::create (iConfig.getParameter<std::string>("BPhiExtrapolationLUTPath"), l1t::MicroGMTConfiguration::PHI_OUT, fwVersion);
auto oPhiExtrapolationLUT = l1t::MicroGMTExtrapolationLUTFactory::create (iConfig.getParameter<std::string>("OPhiExtrapolationLUTPath"), l1t::MicroGMTConfiguration::PHI_OUT, fwVersion);
auto fPhiExtrapolationLUT = l1t::MicroGMTExtrapolationLUTFactory::create (iConfig.getParameter<std::string>("FPhiExtrapolationLUTPath"), l1t::MicroGMTConfiguration::PHI_OUT, fwVersion);
40 changes: 32 additions & 8 deletions L1Trigger/L1TMuon/python/fakeGmtParams_cff.py
Original file line number Diff line number Diff line change
@@ -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,39 @@
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),
FwdPosSingleMatchQualLUTMaxDR = cms.double(0.01),
FwdPosSingleMatchQualLUTfEta = cms.double(1),
FwdPosSingleMatchQualLUTfPhi = cms.double(1),

FwdNegSingleMatchQualLUTMaxDR = cms.double(0.01),
FwdNegSingleMatchQualLUTfEta = cms.double(1),
FwdNegSingleMatchQualLUTfPhi = cms.double(1),

OvlPosSingleMatchQualLUTMaxDR = cms.double(0.15),
OvlPosSingleMatchQualLUTfEta = cms.double(1),
OvlPosSingleMatchQualLUTfPhi = cms.double(3),

OvlNegSingleMatchQualLUTMaxDR = cms.double(0.15),
OvlNegSingleMatchQualLUTfEta = cms.double(1),
OvlNegSingleMatchQualLUTfPhi = cms.double(3),

BOPosMatchQualLUTMaxDR = cms.double(0.1),
BOPosMatchQualLUTfEta = cms.double(1./3),
BOPosMatchQualLUTfEtaCoarse = cms.double(1./3),
BOPosMatchQualLUTfPhi = cms.double(2),

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./3),
BONegMatchQualLUTfEtaCoarse = cms.double(1./3),
BONegMatchQualLUTfPhi = cms.double(2),

FOPosMatchQualLUTMaxDR = cms.double(0.2),
FOPosMatchQualLUTfEta = cms.double(1),
FOPosMatchQualLUTfPhi = cms.double(4),

FONegMatchQualLUTMaxDR = cms.double(0.2),
FONegMatchQualLUTfEta = cms.double(1),
FONegMatchQualLUTfPhi = cms.double(4),

SortRankLUTPtFactor = cms.uint32(1), # can be 0 or 1
SortRankLUTQualFactor = cms.uint32(4), # can be 0 to 34
4 changes: 2 additions & 2 deletions L1Trigger/L1TMuon/src/L1TMuonGlobalParamsHelper.cc
Original file line number Diff line number Diff line change
@@ -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;
2 changes: 1 addition & 1 deletion L1Trigger/L1TMuon/src/MicroGMTCancelOutUnit.cc
Original file line number Diff line number Diff line change
@@ -160,7 +160,7 @@ MicroGMTCancelOutUnit::getCoordinateCancelBits(std::vector<std::shared_ptr<GMTIn
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);
8 changes: 4 additions & 4 deletions L1Trigger/L1TMuon/src/MicroGMTMatchQualLUT.cc
Original file line number Diff line number Diff line change
@@ -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:
15 changes: 9 additions & 6 deletions L1Trigger/L1TMuon/src/MicroGMTMatchQualLUTFactory.cc
Original file line number Diff line number Diff line change
@@ -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;
}

0 comments on commit f392c83

Please sign in to comment.