Back to home page

Project CMSSW displayed by LXR

 
 

    


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

0001 // -*- C++ -*-
0002 //
0003 // Package:    L1Trigger/L1TMuonGlobalParamsESProducer
0004 // Class:      L1TMuonGlobalParamsESProducer
0005 //
0006 /**\class L1TMuonGlobalParamsESProducer L1TMuonGlobalParamsESProducer.h L1Trigger/L1TMuonGlobalParamsESProducer/plugins/L1TMuonGlobalParamsESProducer.cc
0007 
0008  Description: [one line class summary]
0009 
0010  Implementation:
0011      [Notes on implementation]
0012 */
0013 //
0014 // Original Author:  Thomas Reis
0015 //         Created:  Mon, 21 Sep 2015 13:28:49 GMT
0016 //
0017 //
0018 
0019 // system include files
0020 #include <memory>
0021 
0022 // user include files
0023 #include "FWCore/Framework/interface/ModuleFactory.h"
0024 #include "FWCore/Framework/interface/ESProducer.h"
0025 #include "FWCore/Framework/interface/ESProducts.h"
0026 
0027 #include "CondFormats/L1TObjects/interface/L1TMuonGlobalParams.h"
0028 #include "CondFormats/DataRecord/interface/L1TMuonGlobalParamsRcd.h"
0029 #include "L1Trigger/L1TMuon/interface/L1TMuonGlobalParamsHelper.h"
0030 #include "L1Trigger/L1TMuon/interface/MicroGMTLUTFactories.h"
0031 #include "L1Trigger/L1TCommon/interface/TriggerSystem.h"
0032 #include "L1Trigger/L1TCommon/interface/Parameter.h"
0033 #include "L1Trigger/L1TCommon/interface/Mask.h"
0034 
0035 //
0036 // class declaration
0037 //
0038 
0039 class L1TMuonGlobalParamsESProducer : public edm::ESProducer {
0040 public:
0041   L1TMuonGlobalParamsESProducer(const edm::ParameterSet&);
0042   ~L1TMuonGlobalParamsESProducer() override;
0043 
0044   using ReturnType = std::unique_ptr<L1TMuonGlobalParams>;
0045 
0046   ReturnType produce(const L1TMuonGlobalParamsRcd&);
0047 
0048 private:
0049   L1TMuonGlobalParams m_params;
0050 };
0051 
0052 //
0053 // constants, enums and typedefs
0054 //
0055 
0056 //
0057 // static data member definitions
0058 //
0059 
0060 //
0061 // constructors and destructor
0062 //
0063 L1TMuonGlobalParamsESProducer::L1TMuonGlobalParamsESProducer(const edm::ParameterSet& iConfig) {
0064   //the following line is needed to tell the framework what
0065   // data is being produced
0066   setWhatProduced(this);
0067 
0068   L1TMuonGlobalParamsHelper m_params_helper;
0069 
0070   // get configuration from DB
0071   if (iConfig.getParameter<bool>("configFromXml")) {
0072     l1t::TriggerSystem trgSys;
0073     edm::FileInPath hwXmlFile(iConfig.getParameter<std::string>("hwXmlFile"));
0074     edm::FileInPath topCfgXmlFile(iConfig.getParameter<std::string>("topCfgXmlFile"));
0075     // These xml files are for testing the configuration from the online DB
0076     trgSys.configureSystemFromFiles(hwXmlFile.fullPath().c_str(),
0077                                     topCfgXmlFile.fullPath().c_str(),
0078                                     iConfig.getParameter<std::string>("xmlCfgKey").c_str());
0079 
0080     m_params_helper.loadFromOnline(trgSys, iConfig.getParameter<std::string>("uGmtProcessorId"));
0081   } else {
0082     // Firmware version
0083     unsigned fwVersion = iConfig.getParameter<unsigned>("fwVersion");
0084     m_params_helper.setFwVersion(fwVersion);
0085 
0086     // LUTs
0087     m_params_helper.setFwdPosSingleMatchQualLUTMaxDR(iConfig.getParameter<double>("FwdPosSingleMatchQualLUTMaxDR"),
0088                                                      iConfig.getParameter<double>("FwdPosSingleMatchQualLUTfEta"),
0089                                                      iConfig.getParameter<double>("FwdPosSingleMatchQualLUTfPhi"));
0090     m_params_helper.setFwdNegSingleMatchQualLUTMaxDR(iConfig.getParameter<double>("FwdNegSingleMatchQualLUTMaxDR"),
0091                                                      iConfig.getParameter<double>("FwdNegSingleMatchQualLUTfEta"),
0092                                                      iConfig.getParameter<double>("FwdNegSingleMatchQualLUTfPhi"));
0093     m_params_helper.setOvlPosSingleMatchQualLUTMaxDR(iConfig.getParameter<double>("OvlPosSingleMatchQualLUTMaxDR"),
0094                                                      iConfig.getParameter<double>("OvlPosSingleMatchQualLUTfEta"),
0095                                                      iConfig.getParameter<double>("OvlPosSingleMatchQualLUTfEtaCoarse"),
0096                                                      iConfig.getParameter<double>("OvlPosSingleMatchQualLUTfPhi"));
0097     m_params_helper.setOvlNegSingleMatchQualLUTMaxDR(iConfig.getParameter<double>("OvlNegSingleMatchQualLUTMaxDR"),
0098                                                      iConfig.getParameter<double>("OvlNegSingleMatchQualLUTfEta"),
0099                                                      iConfig.getParameter<double>("OvlNegSingleMatchQualLUTfEtaCoarse"),
0100                                                      iConfig.getParameter<double>("OvlNegSingleMatchQualLUTfPhi"));
0101     m_params_helper.setBOPosMatchQualLUTMaxDR(iConfig.getParameter<double>("BOPosMatchQualLUTMaxDR"),
0102                                               iConfig.getParameter<double>("BOPosMatchQualLUTfEta"),
0103                                               iConfig.getParameter<double>("BOPosMatchQualLUTfEtaCoarse"),
0104                                               iConfig.getParameter<double>("BOPosMatchQualLUTfPhi"));
0105     m_params_helper.setBONegMatchQualLUTMaxDR(iConfig.getParameter<double>("BONegMatchQualLUTMaxDR"),
0106                                               iConfig.getParameter<double>("BONegMatchQualLUTfEta"),
0107                                               iConfig.getParameter<double>("BONegMatchQualLUTfEtaCoarse"),
0108                                               iConfig.getParameter<double>("BONegMatchQualLUTfPhi"));
0109     m_params_helper.setFOPosMatchQualLUTMaxDR(iConfig.getParameter<double>("FOPosMatchQualLUTMaxDR"),
0110                                               iConfig.getParameter<double>("FOPosMatchQualLUTfEta"),
0111                                               iConfig.getParameter<double>("FOPosMatchQualLUTfEtaCoarse"),
0112                                               iConfig.getParameter<double>("FOPosMatchQualLUTfPhi"));
0113     m_params_helper.setFONegMatchQualLUTMaxDR(iConfig.getParameter<double>("FONegMatchQualLUTMaxDR"),
0114                                               iConfig.getParameter<double>("FONegMatchQualLUTfEta"),
0115                                               iConfig.getParameter<double>("FONegMatchQualLUTfEtaCoarse"),
0116                                               iConfig.getParameter<double>("FONegMatchQualLUTfPhi"));
0117 
0118     unsigned sortRankLUTPtFactor = iConfig.getParameter<unsigned>("SortRankLUTPtFactor");
0119     unsigned sortRankLUTQualFactor = iConfig.getParameter<unsigned>("SortRankLUTQualFactor");
0120     m_params_helper.setSortRankLUTFactors(sortRankLUTPtFactor, sortRankLUTQualFactor);
0121 
0122     auto absIsoCheckMemLUT = l1t::MicroGMTAbsoluteIsolationCheckLUTFactory::create(
0123         iConfig.getParameter<std::string>("AbsIsoCheckMemLUTPath"), fwVersion);
0124     auto relIsoCheckMemLUT = l1t::MicroGMTRelativeIsolationCheckLUTFactory::create(
0125         iConfig.getParameter<std::string>("RelIsoCheckMemLUTPath"), fwVersion);
0126     auto idxSelMemPhiLUT = l1t::MicroGMTCaloIndexSelectionLUTFactory::create(
0127         iConfig.getParameter<std::string>("IdxSelMemPhiLUTPath"), l1t::MicroGMTConfiguration::PHI, fwVersion);
0128     auto idxSelMemEtaLUT = l1t::MicroGMTCaloIndexSelectionLUTFactory::create(
0129         iConfig.getParameter<std::string>("IdxSelMemEtaLUTPath"), l1t::MicroGMTConfiguration::ETA, fwVersion);
0130     auto fwdPosSingleMatchQualLUT = l1t::MicroGMTMatchQualLUTFactory::create(
0131         iConfig.getParameter<std::string>("FwdPosSingleMatchQualLUTPath"),
0132         iConfig.getParameter<double>("FwdPosSingleMatchQualLUTMaxDR"),
0133         iConfig.getParameter<double>("FwdPosSingleMatchQualLUTfEta"),
0134         iConfig.getParameter<double>("FwdPosSingleMatchQualLUTfEta"),  // set the coarse eta factor = fine eta factor
0135         iConfig.getParameter<double>("FwdPosSingleMatchQualLUTfPhi"),
0136         l1t::cancel_t::emtf_emtf_pos,
0137         fwVersion);
0138     auto fwdNegSingleMatchQualLUT = l1t::MicroGMTMatchQualLUTFactory::create(
0139         iConfig.getParameter<std::string>("FwdNegSingleMatchQualLUTPath"),
0140         iConfig.getParameter<double>("FwdNegSingleMatchQualLUTMaxDR"),
0141         iConfig.getParameter<double>("FwdNegSingleMatchQualLUTfEta"),
0142         iConfig.getParameter<double>("FwdNegSingleMatchQualLUTfEta"),  // set the coarse eta factor = fine eta factor
0143         iConfig.getParameter<double>("FwdNegSingleMatchQualLUTfPhi"),
0144         l1t::cancel_t::emtf_emtf_neg,
0145         fwVersion);
0146     auto ovlPosSingleMatchQualLUT =
0147         l1t::MicroGMTMatchQualLUTFactory::create(iConfig.getParameter<std::string>("OvlPosSingleMatchQualLUTPath"),
0148                                                  iConfig.getParameter<double>("OvlPosSingleMatchQualLUTMaxDR"),
0149                                                  iConfig.getParameter<double>("OvlPosSingleMatchQualLUTfEta"),
0150                                                  iConfig.getParameter<double>("OvlPosSingleMatchQualLUTfEtaCoarse"),
0151                                                  iConfig.getParameter<double>("OvlPosSingleMatchQualLUTfPhi"),
0152                                                  l1t::cancel_t::omtf_omtf_pos,
0153                                                  fwVersion);
0154     auto ovlNegSingleMatchQualLUT =
0155         l1t::MicroGMTMatchQualLUTFactory::create(iConfig.getParameter<std::string>("OvlNegSingleMatchQualLUTPath"),
0156                                                  iConfig.getParameter<double>("OvlNegSingleMatchQualLUTMaxDR"),
0157                                                  iConfig.getParameter<double>("OvlNegSingleMatchQualLUTfEta"),
0158                                                  iConfig.getParameter<double>("OvlNegSingleMatchQualLUTfEtaCoarse"),
0159                                                  iConfig.getParameter<double>("OvlNegSingleMatchQualLUTfPhi"),
0160                                                  l1t::cancel_t::omtf_omtf_neg,
0161                                                  fwVersion);
0162     auto bOPosMatchQualLUT =
0163         l1t::MicroGMTMatchQualLUTFactory::create(iConfig.getParameter<std::string>("BOPosMatchQualLUTPath"),
0164                                                  iConfig.getParameter<double>("BOPosMatchQualLUTMaxDR"),
0165                                                  iConfig.getParameter<double>("BOPosMatchQualLUTfEta"),
0166                                                  iConfig.getParameter<double>("BOPosMatchQualLUTfEtaCoarse"),
0167                                                  iConfig.getParameter<double>("BOPosMatchQualLUTfPhi"),
0168                                                  l1t::cancel_t::omtf_bmtf_pos,
0169                                                  fwVersion);
0170     auto bONegMatchQualLUT =
0171         l1t::MicroGMTMatchQualLUTFactory::create(iConfig.getParameter<std::string>("BONegMatchQualLUTPath"),
0172                                                  iConfig.getParameter<double>("BONegMatchQualLUTMaxDR"),
0173                                                  iConfig.getParameter<double>("BONegMatchQualLUTfEta"),
0174                                                  iConfig.getParameter<double>("BONegMatchQualLUTfEtaCoarse"),
0175                                                  iConfig.getParameter<double>("BONegMatchQualLUTfPhi"),
0176                                                  l1t::cancel_t::omtf_bmtf_neg,
0177                                                  fwVersion);
0178     auto fOPosMatchQualLUT =
0179         l1t::MicroGMTMatchQualLUTFactory::create(iConfig.getParameter<std::string>("FOPosMatchQualLUTPath"),
0180                                                  iConfig.getParameter<double>("FOPosMatchQualLUTMaxDR"),
0181                                                  iConfig.getParameter<double>("FOPosMatchQualLUTfEta"),
0182                                                  iConfig.getParameter<double>("FOPosMatchQualLUTfEtaCoarse"),
0183                                                  iConfig.getParameter<double>("FOPosMatchQualLUTfPhi"),
0184                                                  l1t::cancel_t::omtf_emtf_pos,
0185                                                  fwVersion);
0186     auto fONegMatchQualLUT =
0187         l1t::MicroGMTMatchQualLUTFactory::create(iConfig.getParameter<std::string>("FONegMatchQualLUTPath"),
0188                                                  iConfig.getParameter<double>("FONegMatchQualLUTMaxDR"),
0189                                                  iConfig.getParameter<double>("FONegMatchQualLUTfEta"),
0190                                                  iConfig.getParameter<double>("FONegMatchQualLUTfEtaCoarse"),
0191                                                  iConfig.getParameter<double>("FONegMatchQualLUTfPhi"),
0192                                                  l1t::cancel_t::omtf_emtf_neg,
0193                                                  fwVersion);
0194     auto bPhiExtrapolationLUT = l1t::MicroGMTExtrapolationLUTFactory::create(
0195         iConfig.getParameter<std::string>("BPhiExtrapolationLUTPath"), l1t::MicroGMTConfiguration::PHI_OUT, fwVersion);
0196     auto oPhiExtrapolationLUT = l1t::MicroGMTExtrapolationLUTFactory::create(
0197         iConfig.getParameter<std::string>("OPhiExtrapolationLUTPath"), l1t::MicroGMTConfiguration::PHI_OUT, fwVersion);
0198     auto fPhiExtrapolationLUT = l1t::MicroGMTExtrapolationLUTFactory::create(
0199         iConfig.getParameter<std::string>("FPhiExtrapolationLUTPath"), l1t::MicroGMTConfiguration::PHI_OUT, fwVersion);
0200     auto bEtaExtrapolationLUT = l1t::MicroGMTExtrapolationLUTFactory::create(
0201         iConfig.getParameter<std::string>("BEtaExtrapolationLUTPath"), l1t::MicroGMTConfiguration::ETA_OUT, fwVersion);
0202     auto oEtaExtrapolationLUT = l1t::MicroGMTExtrapolationLUTFactory::create(
0203         iConfig.getParameter<std::string>("OEtaExtrapolationLUTPath"), l1t::MicroGMTConfiguration::ETA_OUT, fwVersion);
0204     auto fEtaExtrapolationLUT = l1t::MicroGMTExtrapolationLUTFactory::create(
0205         iConfig.getParameter<std::string>("FEtaExtrapolationLUTPath"), l1t::MicroGMTConfiguration::ETA_OUT, fwVersion);
0206     auto rankPtQualityLUT =
0207         l1t::MicroGMTRankPtQualLUTFactory::create(iConfig.getParameter<std::string>("SortRankLUTPath"),
0208                                                   fwVersion,
0209                                                   sortRankLUTPtFactor,
0210                                                   sortRankLUTQualFactor);  // LUTs defined from config file
0211     m_params_helper.setAbsIsoCheckMemLUT(*absIsoCheckMemLUT);
0212     m_params_helper.setRelIsoCheckMemLUT(*relIsoCheckMemLUT);
0213     m_params_helper.setIdxSelMemPhiLUT(*idxSelMemPhiLUT);
0214     m_params_helper.setIdxSelMemEtaLUT(*idxSelMemEtaLUT);
0215     m_params_helper.setFwdPosSingleMatchQualLUT(*fwdPosSingleMatchQualLUT);
0216     m_params_helper.setFwdNegSingleMatchQualLUT(*fwdNegSingleMatchQualLUT);
0217     m_params_helper.setOvlPosSingleMatchQualLUT(*ovlPosSingleMatchQualLUT);
0218     m_params_helper.setOvlNegSingleMatchQualLUT(*ovlNegSingleMatchQualLUT);
0219     m_params_helper.setBOPosMatchQualLUT(*bOPosMatchQualLUT);
0220     m_params_helper.setBONegMatchQualLUT(*bONegMatchQualLUT);
0221     m_params_helper.setFOPosMatchQualLUT(*fOPosMatchQualLUT);
0222     m_params_helper.setFONegMatchQualLUT(*fONegMatchQualLUT);
0223     m_params_helper.setBPhiExtrapolationLUT(*bPhiExtrapolationLUT);
0224     m_params_helper.setOPhiExtrapolationLUT(*oPhiExtrapolationLUT);
0225     m_params_helper.setFPhiExtrapolationLUT(*fPhiExtrapolationLUT);
0226     m_params_helper.setBEtaExtrapolationLUT(*bEtaExtrapolationLUT);
0227     m_params_helper.setOEtaExtrapolationLUT(*oEtaExtrapolationLUT);
0228     m_params_helper.setFEtaExtrapolationLUT(*fEtaExtrapolationLUT);
0229     m_params_helper.setSortRankLUT(*rankPtQualityLUT);
0230 
0231     // LUT paths
0232     m_params_helper.setAbsIsoCheckMemLUTPath(iConfig.getParameter<std::string>("AbsIsoCheckMemLUTPath"));
0233     m_params_helper.setRelIsoCheckMemLUTPath(iConfig.getParameter<std::string>("RelIsoCheckMemLUTPath"));
0234     m_params_helper.setIdxSelMemPhiLUTPath(iConfig.getParameter<std::string>("IdxSelMemPhiLUTPath"));
0235     m_params_helper.setIdxSelMemEtaLUTPath(iConfig.getParameter<std::string>("IdxSelMemEtaLUTPath"));
0236     m_params_helper.setFwdPosSingleMatchQualLUTPath(iConfig.getParameter<std::string>("FwdPosSingleMatchQualLUTPath"));
0237     m_params_helper.setFwdNegSingleMatchQualLUTPath(iConfig.getParameter<std::string>("FwdNegSingleMatchQualLUTPath"));
0238     m_params_helper.setOvlPosSingleMatchQualLUTPath(iConfig.getParameter<std::string>("OvlPosSingleMatchQualLUTPath"));
0239     m_params_helper.setOvlNegSingleMatchQualLUTPath(iConfig.getParameter<std::string>("OvlNegSingleMatchQualLUTPath"));
0240     m_params_helper.setBOPosMatchQualLUTPath(iConfig.getParameter<std::string>("BOPosMatchQualLUTPath"));
0241     m_params_helper.setBONegMatchQualLUTPath(iConfig.getParameter<std::string>("BONegMatchQualLUTPath"));
0242     m_params_helper.setFOPosMatchQualLUTPath(iConfig.getParameter<std::string>("FOPosMatchQualLUTPath"));
0243     m_params_helper.setFONegMatchQualLUTPath(iConfig.getParameter<std::string>("FONegMatchQualLUTPath"));
0244     m_params_helper.setBPhiExtrapolationLUTPath(iConfig.getParameter<std::string>("BPhiExtrapolationLUTPath"));
0245     m_params_helper.setOPhiExtrapolationLUTPath(iConfig.getParameter<std::string>("OPhiExtrapolationLUTPath"));
0246     m_params_helper.setFPhiExtrapolationLUTPath(iConfig.getParameter<std::string>("FPhiExtrapolationLUTPath"));
0247     m_params_helper.setBEtaExtrapolationLUTPath(iConfig.getParameter<std::string>("BEtaExtrapolationLUTPath"));
0248     m_params_helper.setOEtaExtrapolationLUTPath(iConfig.getParameter<std::string>("OEtaExtrapolationLUTPath"));
0249     m_params_helper.setFEtaExtrapolationLUTPath(iConfig.getParameter<std::string>("FEtaExtrapolationLUTPath"));
0250     m_params_helper.setSortRankLUTPath(iConfig.getParameter<std::string>("SortRankLUTPath"));
0251 
0252     // uGMT disabled inputs
0253     bool disableCaloInputs = iConfig.getParameter<bool>("caloInputsDisable");
0254     std::vector<unsigned> bmtfInputsToDisable = iConfig.getParameter<std::vector<unsigned> >("bmtfInputsToDisable");
0255     std::vector<unsigned> omtfInputsToDisable = iConfig.getParameter<std::vector<unsigned> >("omtfInputsToDisable");
0256     std::vector<unsigned> emtfInputsToDisable = iConfig.getParameter<std::vector<unsigned> >("emtfInputsToDisable");
0257 
0258     if (disableCaloInputs) {
0259       m_params_helper.setCaloInputsToDisable(std::bitset<28>(0xFFFFFFF));
0260     } else {
0261       m_params_helper.setCaloInputsToDisable(std::bitset<28>());
0262     }
0263 
0264     std::bitset<12> bmtfDisables;
0265     for (size_t i = 0; i < bmtfInputsToDisable.size(); ++i) {
0266       bmtfDisables.set(i, bmtfInputsToDisable[i] > 0);
0267     }
0268     m_params_helper.setBmtfInputsToDisable(bmtfDisables);
0269 
0270     std::bitset<6> omtfpDisables;
0271     std::bitset<6> omtfnDisables;
0272     for (size_t i = 0; i < omtfInputsToDisable.size(); ++i) {
0273       if (i < 6) {
0274         omtfpDisables.set(i, omtfInputsToDisable[i] > 0);
0275       } else {
0276         omtfnDisables.set(i - 6, omtfInputsToDisable[i] > 0);
0277       }
0278     }
0279     m_params_helper.setOmtfpInputsToDisable(omtfpDisables);
0280     m_params_helper.setOmtfnInputsToDisable(omtfnDisables);
0281 
0282     std::bitset<6> emtfpDisables;
0283     std::bitset<6> emtfnDisables;
0284     for (size_t i = 0; i < emtfInputsToDisable.size(); ++i) {
0285       if (i < 6) {
0286         emtfpDisables.set(i, emtfInputsToDisable[i] > 0);
0287       } else {
0288         emtfnDisables.set(i - 6, emtfInputsToDisable[i] > 0);
0289       }
0290     }
0291     m_params_helper.setEmtfpInputsToDisable(emtfpDisables);
0292     m_params_helper.setEmtfnInputsToDisable(emtfnDisables);
0293 
0294     // masked inputs
0295     bool caloInputsMasked = iConfig.getParameter<bool>("caloInputsMasked");
0296     std::vector<unsigned> maskedBmtfInputs = iConfig.getParameter<std::vector<unsigned> >("maskedBmtfInputs");
0297     std::vector<unsigned> maskedOmtfInputs = iConfig.getParameter<std::vector<unsigned> >("maskedOmtfInputs");
0298     std::vector<unsigned> maskedEmtfInputs = iConfig.getParameter<std::vector<unsigned> >("maskedEmtfInputs");
0299 
0300     if (caloInputsMasked) {
0301       m_params_helper.setMaskedCaloInputs(std::bitset<28>(0xFFFFFFF));
0302     } else {
0303       m_params_helper.setMaskedCaloInputs(std::bitset<28>());
0304     }
0305 
0306     std::bitset<12> bmtfMasked;
0307     for (size_t i = 0; i < maskedBmtfInputs.size(); ++i) {
0308       bmtfMasked.set(i, maskedBmtfInputs[i] > 0);
0309     }
0310     m_params_helper.setMaskedBmtfInputs(bmtfMasked);
0311 
0312     std::bitset<6> omtfpMasked;
0313     std::bitset<6> omtfnMasked;
0314     for (size_t i = 0; i < maskedOmtfInputs.size(); ++i) {
0315       if (i < 6) {
0316         omtfpMasked.set(i, maskedOmtfInputs[i] > 0);
0317       } else {
0318         omtfnMasked.set(i - 6, maskedOmtfInputs[i] > 0);
0319       }
0320     }
0321     m_params_helper.setMaskedOmtfpInputs(omtfpMasked);
0322     m_params_helper.setMaskedOmtfnInputs(omtfnMasked);
0323 
0324     std::bitset<6> emtfpMasked;
0325     std::bitset<6> emtfnMasked;
0326     for (size_t i = 0; i < maskedEmtfInputs.size(); ++i) {
0327       if (i < 6) {
0328         emtfpMasked.set(i, maskedEmtfInputs[i] > 0);
0329       } else {
0330         emtfnMasked.set(i - 6, maskedEmtfInputs[i] > 0);
0331       }
0332     }
0333     m_params_helper.setMaskedEmtfpInputs(emtfpMasked);
0334     m_params_helper.setMaskedEmtfnInputs(emtfnMasked);
0335   }
0336 
0337   // temp hack to avoid ALCA/DB signoff:
0338   m_params = cast_to_L1TMuonGlobalParams((L1TMuonGlobalParams_PUBLIC)m_params_helper);
0339 }
0340 
0341 L1TMuonGlobalParamsESProducer::~L1TMuonGlobalParamsESProducer() {}
0342 
0343 //
0344 // member functions
0345 //
0346 
0347 // ------------ method called to produce the data  ------------
0348 L1TMuonGlobalParamsESProducer::ReturnType L1TMuonGlobalParamsESProducer::produce(const L1TMuonGlobalParamsRcd& iRecord) {
0349   return std::make_unique<L1TMuonGlobalParams>(m_params);
0350 }
0351 
0352 //define this as a plug-in
0353 DEFINE_FWK_EVENTSETUP_MODULE(L1TMuonGlobalParamsESProducer);