Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:20:46

0001 ///
0002 /// \class L1TMuonGlobalParamsHelper
0003 ///
0004 /// Description: Wrapper for L1TMuonGlobalParams
0005 ///
0006 /// Implementation:
0007 ///
0008 /// \author: Thomas Reis
0009 ///
0010 
0011 #ifndef L1TMuonGlobalParamsHelper_h
0012 #define L1TMuonGlobalParamsHelper_h
0013 
0014 #include <memory>
0015 #include <iostream>
0016 #include <vector>
0017 
0018 //this is temp hack to avoid ALCA/DB signoff requirement for now:
0019 #include "L1Trigger/L1TMuon/interface/L1TMuonGlobalParams_PUBLIC.h"
0020 #include "L1Trigger/L1TCommon/interface/TriggerSystem.h"
0021 #include "L1Trigger/L1TCommon/interface/Parameter.h"
0022 #include "L1Trigger/L1TCommon/interface/Mask.h"
0023 
0024 class L1TMuonGlobalParamsHelper : public L1TMuonGlobalParams_PUBLIC {
0025 public:
0026   enum {
0027     absIsoCheckMem = 0,
0028     relIsoCheckMem = 1,
0029     idxSelMemPhi = 2,
0030     idxSelMemEta = 3,
0031     fwdPosSingleMatchQual = 4,
0032     fwdNegSingleMatchQual = 5,
0033     ovlPosSingleMatchQual = 6,
0034     ovlNegSingleMatchQual = 7,
0035     bOPosMatchQual = 8,
0036     bONegMatchQual = 9,
0037     fOPosMatchQual = 10,
0038     fONegMatchQual = 11,
0039     bPhiExtrapolation = 12,
0040     oPhiExtrapolation = 13,
0041     fPhiExtrapolation = 14,
0042     bEtaExtrapolation = 15,
0043     oEtaExtrapolation = 16,
0044     fEtaExtrapolation = 17,
0045     sortRank = 18,
0046     FWVERSION = 19,
0047     INPUTS_TO_DISABLE = 20,
0048     MASKED_INPUTS = 21,
0049     NUM_GMTPARAMNODES = 22
0050   };
0051 
0052   // string parameters indices
0053   enum spIdx { fname = 0 };
0054 
0055   // unsigned parameters indices
0056   enum upIdx {
0057     ptFactor = 0,
0058     qualFactor = 1,
0059     FWVERSION_IDX = 0,
0060     CALOINPUTS = 0,
0061     BMTFINPUTS = 1,
0062     OMTFINPUTS = 2,
0063     EMTFINPUTS = 3
0064   };
0065 
0066   // double parameters indices
0067   enum dpIdx { maxdr = 0, fEta = 1, fEtaCoarse = 2, fPhi = 3 };
0068 
0069   // input enable indices
0070   enum linkNr {
0071     CALOLINK1 = 8,
0072     EMTFPLINK1 = 36,
0073     OMTFPLINK1 = 42,
0074     BMTFLINK1 = 48,
0075     OMTFNLINK1 = 60,
0076     EMTFNLINK1 = 66
0077   };  // link numbers start at 0
0078 
0079   L1TMuonGlobalParamsHelper() : L1TMuonGlobalParams_PUBLIC() { pnodes_.resize(NUM_GMTPARAMNODES); }
0080   L1TMuonGlobalParamsHelper(const L1TMuonGlobalParams &);
0081   ~L1TMuonGlobalParamsHelper() {}
0082 
0083   // FW version
0084   unsigned fwVersion() const {
0085     return pnodes_[FWVERSION].uparams_.size() > FWVERSION_IDX ? pnodes_[FWVERSION].uparams_[FWVERSION_IDX] : 0;
0086   }
0087   void setFwVersion(unsigned fwVersion);
0088 
0089   // Input disables
0090   std::bitset<72> inputsToDisable() const { return inputFlags(INPUTS_TO_DISABLE); };
0091   std::bitset<28> caloInputsToDisable() const { return caloInputFlags(INPUTS_TO_DISABLE); };
0092   std::bitset<12> bmtfInputsToDisable() const { return tfInputFlags(INPUTS_TO_DISABLE, BMTFINPUTS); };
0093   std::bitset<12> omtfInputsToDisable() const { return tfInputFlags(INPUTS_TO_DISABLE, OMTFINPUTS); };
0094   std::bitset<12> emtfInputsToDisable() const { return tfInputFlags(INPUTS_TO_DISABLE, EMTFINPUTS); };
0095   std::bitset<6> omtfpInputsToDisable() const { return eomtfInputFlags(INPUTS_TO_DISABLE, 0, OMTFINPUTS); };
0096   std::bitset<6> omtfnInputsToDisable() const { return eomtfInputFlags(INPUTS_TO_DISABLE, 6, OMTFINPUTS); };
0097   std::bitset<6> emtfpInputsToDisable() const { return eomtfInputFlags(INPUTS_TO_DISABLE, 0, EMTFINPUTS); };
0098   std::bitset<6> emtfnInputsToDisable() const { return eomtfInputFlags(INPUTS_TO_DISABLE, 6, EMTFINPUTS); };
0099   void setInputsToDisable(const std::bitset<72> &inputsToDisable) {
0100     setInputFlags(INPUTS_TO_DISABLE, inputsToDisable);
0101   };
0102   void setCaloInputsToDisable(const std::bitset<28> &disables) { setCaloInputFlags(INPUTS_TO_DISABLE, disables); };
0103   void setBmtfInputsToDisable(const std::bitset<12> &disables) {
0104     setTfInputFlags(INPUTS_TO_DISABLE, BMTFINPUTS, disables);
0105   };
0106   void setOmtfpInputsToDisable(const std::bitset<6> &disables) {
0107     setEOmtfInputFlags(INPUTS_TO_DISABLE, 0, OMTFINPUTS, disables);
0108   };
0109   void setOmtfnInputsToDisable(const std::bitset<6> &disables) {
0110     setEOmtfInputFlags(INPUTS_TO_DISABLE, 6, OMTFINPUTS, disables);
0111   };
0112   void setEmtfpInputsToDisable(const std::bitset<6> &disables) {
0113     setEOmtfInputFlags(INPUTS_TO_DISABLE, 0, EMTFINPUTS, disables);
0114   };
0115   void setEmtfnInputsToDisable(const std::bitset<6> &disables) {
0116     setEOmtfInputFlags(INPUTS_TO_DISABLE, 6, EMTFINPUTS, disables);
0117   };
0118 
0119   // masked inputs
0120   std::bitset<72> maskedInputs() const { return inputFlags(MASKED_INPUTS); };
0121   std::bitset<28> maskedCaloInputs() const { return caloInputFlags(MASKED_INPUTS); };
0122   std::bitset<12> maskedBmtfInputs() const { return tfInputFlags(MASKED_INPUTS, BMTFINPUTS); };
0123   std::bitset<12> maskedOmtfInputs() const { return tfInputFlags(MASKED_INPUTS, OMTFINPUTS); };
0124   std::bitset<12> maskedEmtfInputs() const { return tfInputFlags(MASKED_INPUTS, EMTFINPUTS); };
0125   std::bitset<6> maskedOmtfpInputs() const { return eomtfInputFlags(MASKED_INPUTS, 0, OMTFINPUTS); };
0126   std::bitset<6> maskedOmtfnInputs() const { return eomtfInputFlags(MASKED_INPUTS, 6, OMTFINPUTS); };
0127   std::bitset<6> maskedEmtfpInputs() const { return eomtfInputFlags(MASKED_INPUTS, 0, EMTFINPUTS); };
0128   std::bitset<6> maskedEmtfnInputs() const { return eomtfInputFlags(MASKED_INPUTS, 6, EMTFINPUTS); };
0129   void setMaskedInputs(const std::bitset<72> &masked) { setInputFlags(MASKED_INPUTS, masked); };
0130   void setMaskedCaloInputs(const std::bitset<28> &masked) { setCaloInputFlags(MASKED_INPUTS, masked); };
0131   void setMaskedBmtfInputs(const std::bitset<12> &masked) { setTfInputFlags(MASKED_INPUTS, BMTFINPUTS, masked); };
0132   void setMaskedOmtfpInputs(const std::bitset<6> &masked) { setEOmtfInputFlags(MASKED_INPUTS, 0, OMTFINPUTS, masked); };
0133   void setMaskedOmtfnInputs(const std::bitset<6> &masked) { setEOmtfInputFlags(MASKED_INPUTS, 6, OMTFINPUTS, masked); };
0134   void setMaskedEmtfpInputs(const std::bitset<6> &masked) { setEOmtfInputFlags(MASKED_INPUTS, 0, EMTFINPUTS, masked); };
0135   void setMaskedEmtfnInputs(const std::bitset<6> &masked) { setEOmtfInputFlags(MASKED_INPUTS, 6, EMTFINPUTS, masked); };
0136 
0137   // LUTs
0138   l1t::LUT *absIsoCheckMemLUT() { return &pnodes_[absIsoCheckMem].LUT_; }
0139   l1t::LUT *relIsoCheckMemLUT() { return &pnodes_[relIsoCheckMem].LUT_; }
0140   l1t::LUT *idxSelMemPhiLUT() { return &pnodes_[idxSelMemPhi].LUT_; }
0141   l1t::LUT *idxSelMemEtaLUT() { return &pnodes_[idxSelMemEta].LUT_; }
0142   l1t::LUT *fwdPosSingleMatchQualLUT() { return &pnodes_[fwdPosSingleMatchQual].LUT_; }
0143   l1t::LUT *fwdNegSingleMatchQualLUT() { return &pnodes_[fwdNegSingleMatchQual].LUT_; }
0144   l1t::LUT *ovlPosSingleMatchQualLUT() { return &pnodes_[ovlPosSingleMatchQual].LUT_; }
0145   l1t::LUT *ovlNegSingleMatchQualLUT() { return &pnodes_[ovlNegSingleMatchQual].LUT_; }
0146   l1t::LUT *bOPosMatchQualLUT() { return &pnodes_[bOPosMatchQual].LUT_; }
0147   l1t::LUT *bONegMatchQualLUT() { return &pnodes_[bONegMatchQual].LUT_; }
0148   l1t::LUT *fOPosMatchQualLUT() { return &pnodes_[fOPosMatchQual].LUT_; }
0149   l1t::LUT *fONegMatchQualLUT() { return &pnodes_[fONegMatchQual].LUT_; }
0150   l1t::LUT *bPhiExtrapolationLUT() { return &pnodes_[bPhiExtrapolation].LUT_; }
0151   l1t::LUT *oPhiExtrapolationLUT() { return &pnodes_[oPhiExtrapolation].LUT_; }
0152   l1t::LUT *fPhiExtrapolationLUT() { return &pnodes_[fPhiExtrapolation].LUT_; }
0153   l1t::LUT *bEtaExtrapolationLUT() { return &pnodes_[bEtaExtrapolation].LUT_; }
0154   l1t::LUT *oEtaExtrapolationLUT() { return &pnodes_[oEtaExtrapolation].LUT_; }
0155   l1t::LUT *fEtaExtrapolationLUT() { return &pnodes_[fEtaExtrapolation].LUT_; }
0156   l1t::LUT *sortRankLUT() { return &pnodes_[sortRank].LUT_; }
0157   void setAbsIsoCheckMemLUT(const l1t::LUT &lut) {
0158     pnodes_[absIsoCheckMem].type_ = "LUT";
0159     pnodes_[absIsoCheckMem].LUT_ = lut;
0160   }
0161   void setRelIsoCheckMemLUT(const l1t::LUT &lut) {
0162     pnodes_[relIsoCheckMem].type_ = "LUT";
0163     pnodes_[relIsoCheckMem].LUT_ = lut;
0164   }
0165   void setIdxSelMemPhiLUT(const l1t::LUT &lut) {
0166     pnodes_[idxSelMemPhi].type_ = "LUT";
0167     pnodes_[idxSelMemPhi].LUT_ = lut;
0168   }
0169   void setIdxSelMemEtaLUT(const l1t::LUT &lut) {
0170     pnodes_[idxSelMemEta].type_ = "LUT";
0171     pnodes_[idxSelMemEta].LUT_ = lut;
0172   }
0173   void setFwdPosSingleMatchQualLUT(const l1t::LUT &lut) {
0174     pnodes_[fwdPosSingleMatchQual].type_ = "LUT";
0175     pnodes_[fwdPosSingleMatchQual].LUT_ = lut;
0176   }
0177   void setFwdNegSingleMatchQualLUT(const l1t::LUT &lut) {
0178     pnodes_[fwdNegSingleMatchQual].type_ = "LUT";
0179     pnodes_[fwdNegSingleMatchQual].LUT_ = lut;
0180   }
0181   void setOvlPosSingleMatchQualLUT(const l1t::LUT &lut) {
0182     pnodes_[ovlPosSingleMatchQual].type_ = "LUT";
0183     pnodes_[ovlPosSingleMatchQual].LUT_ = lut;
0184   }
0185   void setOvlNegSingleMatchQualLUT(const l1t::LUT &lut) {
0186     pnodes_[ovlNegSingleMatchQual].type_ = "LUT";
0187     pnodes_[ovlNegSingleMatchQual].LUT_ = lut;
0188   }
0189   void setBOPosMatchQualLUT(const l1t::LUT &lut) {
0190     pnodes_[bOPosMatchQual].type_ = "LUT";
0191     pnodes_[bOPosMatchQual].LUT_ = lut;
0192   }
0193   void setBONegMatchQualLUT(const l1t::LUT &lut) {
0194     pnodes_[bONegMatchQual].type_ = "LUT";
0195     pnodes_[bONegMatchQual].LUT_ = lut;
0196   }
0197   void setFOPosMatchQualLUT(const l1t::LUT &lut) {
0198     pnodes_[fOPosMatchQual].type_ = "LUT";
0199     pnodes_[fOPosMatchQual].LUT_ = lut;
0200   }
0201   void setFONegMatchQualLUT(const l1t::LUT &lut) {
0202     pnodes_[fONegMatchQual].type_ = "LUT";
0203     pnodes_[fONegMatchQual].LUT_ = lut;
0204   }
0205   void setBPhiExtrapolationLUT(const l1t::LUT &lut) {
0206     pnodes_[bPhiExtrapolation].type_ = "LUT";
0207     pnodes_[bPhiExtrapolation].LUT_ = lut;
0208   }
0209   void setOPhiExtrapolationLUT(const l1t::LUT &lut) {
0210     pnodes_[oPhiExtrapolation].type_ = "LUT";
0211     pnodes_[oPhiExtrapolation].LUT_ = lut;
0212   }
0213   void setFPhiExtrapolationLUT(const l1t::LUT &lut) {
0214     pnodes_[fPhiExtrapolation].type_ = "LUT";
0215     pnodes_[fPhiExtrapolation].LUT_ = lut;
0216   }
0217   void setBEtaExtrapolationLUT(const l1t::LUT &lut) {
0218     pnodes_[bEtaExtrapolation].type_ = "LUT";
0219     pnodes_[bEtaExtrapolation].LUT_ = lut;
0220   }
0221   void setOEtaExtrapolationLUT(const l1t::LUT &lut) {
0222     pnodes_[oEtaExtrapolation].type_ = "LUT";
0223     pnodes_[oEtaExtrapolation].LUT_ = lut;
0224   }
0225   void setFEtaExtrapolationLUT(const l1t::LUT &lut) {
0226     pnodes_[fEtaExtrapolation].type_ = "LUT";
0227     pnodes_[fEtaExtrapolation].LUT_ = lut;
0228   }
0229   void setSortRankLUT(const l1t::LUT &lut) {
0230     pnodes_[sortRank].type_ = "LUT";
0231     pnodes_[sortRank].LUT_ = lut;
0232   }
0233 
0234   // LUT paths
0235   std::string absIsoCheckMemLUTPath() const {
0236     return pnodes_[absIsoCheckMem].sparams_.size() > spIdx::fname ? pnodes_[absIsoCheckMem].sparams_[spIdx::fname] : "";
0237   }
0238   std::string relIsoCheckMemLUTPath() const {
0239     return pnodes_[relIsoCheckMem].sparams_.size() > spIdx::fname ? pnodes_[relIsoCheckMem].sparams_[spIdx::fname] : "";
0240   }
0241   std::string idxSelMemPhiLUTPath() const {
0242     return pnodes_[idxSelMemPhi].sparams_.size() > spIdx::fname ? pnodes_[idxSelMemPhi].sparams_[spIdx::fname] : "";
0243   }
0244   std::string idxSelMemEtaLUTPath() const {
0245     return pnodes_[idxSelMemEta].sparams_.size() > spIdx::fname ? pnodes_[idxSelMemEta].sparams_[spIdx::fname] : "";
0246   }
0247   std::string fwdPosSingleMatchQualLUTPath() const {
0248     return pnodes_[fwdPosSingleMatchQual].sparams_.size() > spIdx::fname
0249                ? pnodes_[fwdPosSingleMatchQual].sparams_[spIdx::fname]
0250                : "";
0251   }
0252   std::string fwdNegSingleMatchQualLUTPath() const {
0253     return pnodes_[fwdNegSingleMatchQual].sparams_.size() > spIdx::fname
0254                ? pnodes_[fwdNegSingleMatchQual].sparams_[spIdx::fname]
0255                : "";
0256   }
0257   std::string ovlPosSingleMatchQualLUTPath() const {
0258     return pnodes_[ovlPosSingleMatchQual].sparams_.size() > spIdx::fname
0259                ? pnodes_[ovlPosSingleMatchQual].sparams_[spIdx::fname]
0260                : "";
0261   }
0262   std::string ovlNegSingleMatchQualLUTPath() const {
0263     return pnodes_[ovlNegSingleMatchQual].sparams_.size() > spIdx::fname
0264                ? pnodes_[ovlNegSingleMatchQual].sparams_[spIdx::fname]
0265                : "";
0266   }
0267   std::string bOPosMatchQualLUTPath() const {
0268     return pnodes_[bOPosMatchQual].sparams_.size() > spIdx::fname ? pnodes_[bOPosMatchQual].sparams_[spIdx::fname] : "";
0269   }
0270   std::string bONegMatchQualLUTPath() const {
0271     return pnodes_[bONegMatchQual].sparams_.size() > spIdx::fname ? pnodes_[bONegMatchQual].sparams_[spIdx::fname] : "";
0272   }
0273   std::string fOPosMatchQualLUTPath() const {
0274     return pnodes_[fOPosMatchQual].sparams_.size() > spIdx::fname ? pnodes_[fOPosMatchQual].sparams_[spIdx::fname] : "";
0275   }
0276   std::string fONegMatchQualLUTPath() const {
0277     return pnodes_[fONegMatchQual].sparams_.size() > spIdx::fname ? pnodes_[fONegMatchQual].sparams_[spIdx::fname] : "";
0278   }
0279   std::string bPhiExtrapolationLUTPath() const {
0280     return pnodes_[bPhiExtrapolation].sparams_.size() > spIdx::fname ? pnodes_[bPhiExtrapolation].sparams_[spIdx::fname]
0281                                                                      : "";
0282   }
0283   std::string oPhiExtrapolationLUTPath() const {
0284     return pnodes_[oPhiExtrapolation].sparams_.size() > spIdx::fname ? pnodes_[oPhiExtrapolation].sparams_[spIdx::fname]
0285                                                                      : "";
0286   }
0287   std::string fPhiExtrapolationLUTPath() const {
0288     return pnodes_[fPhiExtrapolation].sparams_.size() > spIdx::fname ? pnodes_[fPhiExtrapolation].sparams_[spIdx::fname]
0289                                                                      : "";
0290   }
0291   std::string bEtaExtrapolationLUTPath() const {
0292     return pnodes_[bEtaExtrapolation].sparams_.size() > spIdx::fname ? pnodes_[bEtaExtrapolation].sparams_[spIdx::fname]
0293                                                                      : "";
0294   }
0295   std::string oEtaExtrapolationLUTPath() const {
0296     return pnodes_[oEtaExtrapolation].sparams_.size() > spIdx::fname ? pnodes_[oEtaExtrapolation].sparams_[spIdx::fname]
0297                                                                      : "";
0298   }
0299   std::string fEtaExtrapolationLUTPath() const {
0300     return pnodes_[fEtaExtrapolation].sparams_.size() > spIdx::fname ? pnodes_[fEtaExtrapolation].sparams_[spIdx::fname]
0301                                                                      : "";
0302   }
0303   std::string sortRankLUTPath() const {
0304     return pnodes_[sortRank].sparams_.size() > spIdx::fname ? pnodes_[sortRank].sparams_[spIdx::fname] : "";
0305   }
0306   void setAbsIsoCheckMemLUTPath(const std::string &path) { pnodes_[absIsoCheckMem].sparams_.push_back(path); }
0307   void setRelIsoCheckMemLUTPath(const std::string &path) { pnodes_[relIsoCheckMem].sparams_.push_back(path); }
0308   void setIdxSelMemPhiLUTPath(const std::string &path) { pnodes_[idxSelMemPhi].sparams_.push_back(path); }
0309   void setIdxSelMemEtaLUTPath(const std::string &path) { pnodes_[idxSelMemEta].sparams_.push_back(path); }
0310   void setFwdPosSingleMatchQualLUTPath(const std::string &path) {
0311     pnodes_[fwdPosSingleMatchQual].sparams_.push_back(path);
0312   }
0313   void setFwdNegSingleMatchQualLUTPath(const std::string &path) {
0314     pnodes_[fwdNegSingleMatchQual].sparams_.push_back(path);
0315   }
0316   void setOvlPosSingleMatchQualLUTPath(const std::string &path) {
0317     pnodes_[ovlPosSingleMatchQual].sparams_.push_back(path);
0318   }
0319   void setOvlNegSingleMatchQualLUTPath(const std::string &path) {
0320     pnodes_[ovlNegSingleMatchQual].sparams_.push_back(path);
0321   }
0322   void setBOPosMatchQualLUTPath(const std::string &path) { pnodes_[bOPosMatchQual].sparams_.push_back(path); }
0323   void setBONegMatchQualLUTPath(const std::string &path) { pnodes_[bONegMatchQual].sparams_.push_back(path); }
0324   void setFOPosMatchQualLUTPath(const std::string &path) { pnodes_[fOPosMatchQual].sparams_.push_back(path); }
0325   void setFONegMatchQualLUTPath(const std::string &path) { pnodes_[fONegMatchQual].sparams_.push_back(path); }
0326   void setBPhiExtrapolationLUTPath(const std::string &path) { pnodes_[bPhiExtrapolation].sparams_.push_back(path); }
0327   void setOPhiExtrapolationLUTPath(const std::string &path) { pnodes_[oPhiExtrapolation].sparams_.push_back(path); }
0328   void setFPhiExtrapolationLUTPath(const std::string &path) { pnodes_[fPhiExtrapolation].sparams_.push_back(path); }
0329   void setBEtaExtrapolationLUTPath(const std::string &path) { pnodes_[bEtaExtrapolation].sparams_.push_back(path); }
0330   void setOEtaExtrapolationLUTPath(const std::string &path) { pnodes_[oEtaExtrapolation].sparams_.push_back(path); }
0331   void setFEtaExtrapolationLUTPath(const std::string &path) { pnodes_[fEtaExtrapolation].sparams_.push_back(path); }
0332   void setSortRankLUTPath(const std::string &path) { pnodes_[sortRank].sparams_.push_back(path); }
0333 
0334   // Cancel out LUT max dR
0335   double fwdPosSingleMatchQualLUTMaxDR() const {
0336     return pnodes_[fwdPosSingleMatchQual].dparams_.size() > dpIdx::maxdr
0337                ? pnodes_[fwdPosSingleMatchQual].dparams_[dpIdx::maxdr]
0338                : 0.;
0339   }
0340   double fwdNegSingleMatchQualLUTMaxDR() const {
0341     return pnodes_[fwdNegSingleMatchQual].dparams_.size() > dpIdx::maxdr
0342                ? pnodes_[fwdNegSingleMatchQual].dparams_[dpIdx::maxdr]
0343                : 0.;
0344   }
0345   double ovlPosSingleMatchQualLUTMaxDR() const {
0346     return pnodes_[ovlPosSingleMatchQual].dparams_.size() > dpIdx::maxdr
0347                ? pnodes_[ovlPosSingleMatchQual].dparams_[dpIdx::maxdr]
0348                : 0.;
0349   }
0350   double ovlNegSingleMatchQualLUTMaxDR() const {
0351     return pnodes_[ovlNegSingleMatchQual].dparams_.size() > dpIdx::maxdr
0352                ? pnodes_[ovlNegSingleMatchQual].dparams_[dpIdx::maxdr]
0353                : 0.;
0354   }
0355   double bOPosMatchQualLUTMaxDR() const {
0356     return pnodes_[bOPosMatchQual].dparams_.size() > dpIdx::maxdr ? pnodes_[bOPosMatchQual].dparams_[dpIdx::maxdr] : 0.;
0357   }
0358   double bONegMatchQualLUTMaxDR() const {
0359     return pnodes_[bONegMatchQual].dparams_.size() > dpIdx::maxdr ? pnodes_[bONegMatchQual].dparams_[dpIdx::maxdr] : 0.;
0360   }
0361   double fOPosMatchQualLUTMaxDR() const {
0362     return pnodes_[fOPosMatchQual].dparams_.size() > dpIdx::maxdr ? pnodes_[fOPosMatchQual].dparams_[dpIdx::maxdr] : 0.;
0363   }
0364   double fONegMatchQualLUTMaxDR() const {
0365     return pnodes_[fONegMatchQual].dparams_.size() > dpIdx::maxdr ? pnodes_[fONegMatchQual].dparams_[dpIdx::maxdr] : 0.;
0366   }
0367 
0368   double fwdPosSingleMatchQualLUTfEta() const {
0369     return pnodes_[fwdPosSingleMatchQual].dparams_.size() > dpIdx::fEta
0370                ? pnodes_[fwdPosSingleMatchQual].dparams_[dpIdx::fEta]
0371                : 0.;
0372   }
0373   double fwdNegSingleMatchQualLUTfEta() const {
0374     return pnodes_[fwdNegSingleMatchQual].dparams_.size() > dpIdx::fEta
0375                ? pnodes_[fwdNegSingleMatchQual].dparams_[dpIdx::fEta]
0376                : 0.;
0377   }
0378   double ovlPosSingleMatchQualLUTfEta() const {
0379     return pnodes_[ovlPosSingleMatchQual].dparams_.size() > dpIdx::fEta
0380                ? pnodes_[ovlPosSingleMatchQual].dparams_[dpIdx::fEta]
0381                : 0.;
0382   }
0383   double ovlNegSingleMatchQualLUTfEta() const {
0384     return pnodes_[ovlNegSingleMatchQual].dparams_.size() > dpIdx::fEta
0385                ? pnodes_[ovlNegSingleMatchQual].dparams_[dpIdx::fEta]
0386                : 0.;
0387   }
0388   double ovlPosSingleMatchQualLUTfEtaCoarse() const {
0389     return pnodes_[ovlPosSingleMatchQual].dparams_.size() > dpIdx::fEtaCoarse
0390                ? pnodes_[ovlPosSingleMatchQual].dparams_[dpIdx::fEtaCoarse]
0391                : 0.;
0392   }
0393   double ovlNegSingleMatchQualLUTfEtaCoarse() const {
0394     return pnodes_[ovlNegSingleMatchQual].dparams_.size() > dpIdx::fEtaCoarse
0395                ? pnodes_[ovlNegSingleMatchQual].dparams_[dpIdx::fEtaCoarse]
0396                : 0.;
0397   }
0398   double bOPosMatchQualLUTfEta() const {
0399     return pnodes_[bOPosMatchQual].dparams_.size() > dpIdx::fEta ? pnodes_[bOPosMatchQual].dparams_[dpIdx::fEta] : 0.;
0400   }
0401   double bONegMatchQualLUTfEta() const {
0402     return pnodes_[bONegMatchQual].dparams_.size() > dpIdx::fEta ? pnodes_[bONegMatchQual].dparams_[dpIdx::fEta] : 0.;
0403   }
0404   double bOPosMatchQualLUTfEtaCoarse() const {
0405     return pnodes_[bOPosMatchQual].dparams_.size() > dpIdx::fEtaCoarse
0406                ? pnodes_[bOPosMatchQual].dparams_[dpIdx::fEtaCoarse]
0407                : 0.;
0408   }
0409   double bONegMatchQualLUTfEtaCoarse() const {
0410     return pnodes_[bONegMatchQual].dparams_.size() > dpIdx::fEtaCoarse
0411                ? pnodes_[bONegMatchQual].dparams_[dpIdx::fEtaCoarse]
0412                : 0.;
0413   }
0414   double fOPosMatchQualLUTfEta() const {
0415     return pnodes_[fOPosMatchQual].dparams_.size() > dpIdx::fEta ? pnodes_[fOPosMatchQual].dparams_[dpIdx::fEta] : 0.;
0416   }
0417   double fONegMatchQualLUTfEta() const {
0418     return pnodes_[fONegMatchQual].dparams_.size() > dpIdx::fEta ? pnodes_[fONegMatchQual].dparams_[dpIdx::fEta] : 0.;
0419   }
0420   double fOPosMatchQualLUTfEtaCoarse() const {
0421     return pnodes_[fOPosMatchQual].dparams_.size() > dpIdx::fEtaCoarse
0422                ? pnodes_[fOPosMatchQual].dparams_[dpIdx::fEtaCoarse]
0423                : 0.;
0424   }
0425   double fONegMatchQualLUTfEtaCoarse() const {
0426     return pnodes_[fONegMatchQual].dparams_.size() > dpIdx::fEtaCoarse
0427                ? pnodes_[fONegMatchQual].dparams_[dpIdx::fEtaCoarse]
0428                : 0.;
0429   }
0430   double fwdPosSingleMatchQualLUTfPhi() const {
0431     return pnodes_[fwdPosSingleMatchQual].dparams_.size() > dpIdx::fPhi
0432                ? pnodes_[fwdPosSingleMatchQual].dparams_[dpIdx::fPhi]
0433                : 0.;
0434   }
0435   double fwdNegSingleMatchQualLUTfPhi() const {
0436     return pnodes_[fwdNegSingleMatchQual].dparams_.size() > dpIdx::fPhi
0437                ? pnodes_[fwdNegSingleMatchQual].dparams_[dpIdx::fPhi]
0438                : 0.;
0439   }
0440   double ovlPosSingleMatchQualLUTfPhi() const {
0441     return pnodes_[ovlPosSingleMatchQual].dparams_.size() > dpIdx::fPhi
0442                ? pnodes_[ovlPosSingleMatchQual].dparams_[dpIdx::fPhi]
0443                : 0.;
0444   }
0445   double ovlNegSingleMatchQualLUTfPhi() const {
0446     return pnodes_[ovlNegSingleMatchQual].dparams_.size() > dpIdx::fPhi
0447                ? pnodes_[ovlNegSingleMatchQual].dparams_[dpIdx::fPhi]
0448                : 0.;
0449   }
0450   double bOPosMatchQualLUTfPhi() const {
0451     return pnodes_[bOPosMatchQual].dparams_.size() > dpIdx::fPhi ? pnodes_[bOPosMatchQual].dparams_[dpIdx::fPhi] : 0.;
0452   }
0453   double bONegMatchQualLUTfPhi() const {
0454     return pnodes_[bONegMatchQual].dparams_.size() > dpIdx::fPhi ? pnodes_[bONegMatchQual].dparams_[dpIdx::fPhi] : 0.;
0455   }
0456   double fOPosMatchQualLUTfPhi() const {
0457     return pnodes_[fOPosMatchQual].dparams_.size() > dpIdx::fPhi ? pnodes_[fOPosMatchQual].dparams_[dpIdx::fPhi] : 0.;
0458   }
0459   double fONegMatchQualLUTfPhi() const {
0460     return pnodes_[fONegMatchQual].dparams_.size() > dpIdx::fPhi ? pnodes_[fONegMatchQual].dparams_[dpIdx::fPhi] : 0.;
0461   }
0462 
0463   void setFwdPosSingleMatchQualLUTMaxDR(double maxDR, double fEta, double fPhi);
0464   void setFwdNegSingleMatchQualLUTMaxDR(double maxDR, double fEta, double fPhi);
0465   void setOvlPosSingleMatchQualLUTMaxDR(double maxDR, double fEta, double fEtaCoarse, double fPhi);
0466   void setOvlNegSingleMatchQualLUTMaxDR(double maxDR, double fEta, double fEtaCoarse, double fPhi);
0467   void setBOPosMatchQualLUTMaxDR(double maxDR, double fEta, double fEtaCoarse, double fPhi);
0468   void setBONegMatchQualLUTMaxDR(double maxDR, double fEta, double fEtaCoarse, double fPhi);
0469   void setFOPosMatchQualLUTMaxDR(double maxDR, double fEta, double fEtaCoarse, double fPhi);
0470   void setFONegMatchQualLUTMaxDR(double maxDR, double fEta, double fEtaCoarse, double fPhi);
0471 
0472   // Sort rank LUT factors for pT and quality
0473   unsigned sortRankLUTPtFactor() const {
0474     return pnodes_[sortRank].uparams_.size() > upIdx::ptFactor ? pnodes_[sortRank].uparams_[upIdx::ptFactor] : 0;
0475   }
0476   unsigned sortRankLUTQualFactor() const {
0477     return pnodes_[sortRank].uparams_.size() > upIdx::qualFactor ? pnodes_[sortRank].uparams_[upIdx::qualFactor] : 0;
0478   }
0479   void setSortRankLUTFactors(unsigned ptFactor, unsigned qualFactor) {
0480     pnodes_[sortRank].uparams_.push_back(ptFactor);
0481     pnodes_[sortRank].uparams_.push_back(qualFactor);
0482   }
0483 
0484   // set parameters with a trigSystem object built from the online DB
0485   void loadFromOnline(l1t::TriggerSystem &trgSys, const std::string &processorId = "");
0486 
0487   // print parameters to stream:
0488   void print(std::ostream &) const;
0489   friend std::ostream &operator<<(std::ostream &o, const L1TMuonGlobalParamsHelper &p) {
0490     p.print(o);
0491     return o;
0492   }
0493 
0494 private:
0495   // Input disables
0496   std::bitset<72> inputFlags(const int &nodeIdx) const;
0497   std::bitset<28> caloInputFlags(const int &nodeIdx) const;
0498   std::bitset<12> tfInputFlags(const int &nodeIdx, const int &tfIdx) const;
0499   std::bitset<6> eomtfInputFlags(const int &nodeIdx, const size_t &startIdx, const int &tfIdx) const;
0500   void setInputFlags(const int &nodeIdx, const std::bitset<72> &flags);
0501   void setCaloInputFlags(const int &nodeIdx, const std::bitset<28> &flags);
0502   void setTfInputFlags(const int &nodeIdx, const int &tfIdx, const std::bitset<12> &flags);
0503   void setEOmtfInputFlags(const int &nodeIdx, const size_t &startIdx, const int &tfIdx, const std::bitset<6> &flags);
0504 };
0505 #endif