CMS 3D CMS Logo

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
L1TMuonGlobalParamsESProducer.cc
Go to the documentation of this file.
1 // -*- C++ -*-
2 //
3 // Package: L1Trigger/L1TMuonGlobalParamsESProducer
4 // Class: L1TMuonGlobalParamsESProducer
5 //
13 //
14 // Original Author: Thomas Reis
15 // Created: Mon, 21 Sep 2015 13:28:49 GMT
16 //
17 //
18 
19 
20 // system include files
21 #include <memory>
22 #include "boost/shared_ptr.hpp"
23 
24 // user include files
29 
34 
35 //
36 // class declaration
37 //
38 
40  public:
43 
44  typedef boost::shared_ptr<L1TMuonGlobalParams> ReturnType;
45 
47  private:
49 };
50 
51 //
52 // constants, enums and typedefs
53 //
54 
55 //
56 // static data member definitions
57 //
58 
59 //
60 // constructors and destructor
61 //
63 {
64  //the following line is needed to tell the framework what
65  // data is being produced
66  setWhatProduced(this);
67 
68  L1TMuonGlobalParamsHelper m_params_helper;
69 
70  // Firmware version
71  unsigned fwVersion = iConfig.getParameter<unsigned>("fwVersion");
72  m_params_helper.setFwVersion(fwVersion);
73 
74  // uGMT disabled inputs
75  bool disableCaloInputs = iConfig.getParameter<bool>("caloInputsDisable");
76  if (disableCaloInputs) {
77  m_params_helper.setCaloInputsToDisable(std::bitset<28>(0xFFFFFFF));
78  } else {
79  m_params_helper.setCaloInputsToDisable(std::bitset<28>());
80  }
81 
82  std::vector<unsigned> bmtfInputsToDisable = iConfig.getParameter<std::vector<unsigned> >("bmtfInputsToDisable");
83  std::bitset<12> bmtfDisables;
84  for (size_t i = 0; i < bmtfInputsToDisable.size(); ++i) {
85  bmtfDisables.set(i, bmtfInputsToDisable[i] > 0);
86  }
87  m_params_helper.setBmtfInputsToDisable(bmtfDisables);
88 
89  std::vector<unsigned> omtfInputsToDisable = iConfig.getParameter<std::vector<unsigned> >("omtfInputsToDisable");
90  std::bitset<6> omtfpDisables;
91  std::bitset<6> omtfnDisables;
92  for (size_t i = 0; i < omtfInputsToDisable.size(); ++i) {
93  if (i < 6) {
94  omtfpDisables.set(i, omtfInputsToDisable[i] > 0);
95  } else {
96  omtfnDisables.set(i-6, omtfInputsToDisable[i] > 0);
97  }
98  }
99  m_params_helper.setOmtfpInputsToDisable(omtfpDisables);
100  m_params_helper.setOmtfnInputsToDisable(omtfnDisables);
101 
102  std::vector<unsigned> emtfInputsToDisable = iConfig.getParameter<std::vector<unsigned> >("emtfInputsToDisable");
103  std::bitset<6> emtfpDisables;
104  std::bitset<6> emtfnDisables;
105  for (size_t i = 0; i < emtfInputsToDisable.size(); ++i) {
106  if (i < 6) {
107  emtfpDisables.set(i, emtfInputsToDisable[i] > 0);
108  } else {
109  emtfnDisables.set(i-6, emtfInputsToDisable[i] > 0);
110  }
111  }
112  m_params_helper.setEmtfpInputsToDisable(emtfpDisables);
113  m_params_helper.setEmtfnInputsToDisable(emtfnDisables);
114 
115  // masked inputs
116  bool caloInputsMasked = iConfig.getParameter<bool>("caloInputsMasked");
117  if (caloInputsMasked) {
118  m_params_helper.setMaskedCaloInputs(std::bitset<28>(0xFFFFFFF));
119  } else {
120  m_params_helper.setMaskedCaloInputs(std::bitset<28>());
121  }
122 
123  std::vector<unsigned> maskedBmtfInputs = iConfig.getParameter<std::vector<unsigned> >("maskedBmtfInputs");
124  std::bitset<12> bmtfMasked;
125  for (size_t i = 0; i < maskedBmtfInputs.size(); ++i) {
126  bmtfMasked.set(i, maskedBmtfInputs[i] > 0);
127  }
128  m_params_helper.setMaskedBmtfInputs(bmtfMasked);
129 
130  std::vector<unsigned> maskedOmtfInputs = iConfig.getParameter<std::vector<unsigned> >("maskedOmtfInputs");
131  std::bitset<6> omtfpMasked;
132  std::bitset<6> omtfnMasked;
133  for (size_t i = 0; i < maskedOmtfInputs.size(); ++i) {
134  if (i < 6) {
135  omtfpMasked.set(i, maskedOmtfInputs[i] > 0);
136  } else {
137  omtfnMasked.set(i-6, maskedOmtfInputs[i] > 0);
138  }
139  }
140  m_params_helper.setMaskedOmtfpInputs(omtfpMasked);
141  m_params_helper.setMaskedOmtfnInputs(omtfnMasked);
142 
143  std::vector<unsigned> maskedEmtfInputs = iConfig.getParameter<std::vector<unsigned> >("maskedEmtfInputs");
144  std::bitset<6> emtfpMasked;
145  std::bitset<6> emtfnMasked;
146  for (size_t i = 0; i < maskedEmtfInputs.size(); ++i) {
147  if (i < 6) {
148  emtfpMasked.set(i, maskedEmtfInputs[i] > 0);
149  } else {
150  emtfnMasked.set(i-6, maskedEmtfInputs[i] > 0);
151  }
152  }
153  m_params_helper.setMaskedEmtfpInputs(emtfpMasked);
154  m_params_helper.setMaskedEmtfnInputs(emtfnMasked);
155 
156  // LUTs
157  m_params_helper.setFwdPosSingleMatchQualLUTMaxDR(iConfig.getParameter<double>("FwdPosSingleMatchQualLUTMaxDR"));
158  m_params_helper.setFwdNegSingleMatchQualLUTMaxDR(iConfig.getParameter<double>("FwdNegSingleMatchQualLUTMaxDR"));
159  m_params_helper.setOvlPosSingleMatchQualLUTMaxDR(iConfig.getParameter<double>("OvlPosSingleMatchQualLUTMaxDR"));
160  m_params_helper.setOvlNegSingleMatchQualLUTMaxDR(iConfig.getParameter<double>("OvlNegSingleMatchQualLUTMaxDR"));
161  m_params_helper.setBOPosMatchQualLUTMaxDR(iConfig.getParameter<double>("BOPosMatchQualLUTMaxDR"), iConfig.getParameter<double>("BOPosMatchQualLUTMaxDREtaFine"));
162  m_params_helper.setBONegMatchQualLUTMaxDR(iConfig.getParameter<double>("BONegMatchQualLUTMaxDR"), iConfig.getParameter<double>("BONegMatchQualLUTMaxDREtaFine"));
163  m_params_helper.setFOPosMatchQualLUTMaxDR(iConfig.getParameter<double>("FOPosMatchQualLUTMaxDR"));
164  m_params_helper.setFONegMatchQualLUTMaxDR(iConfig.getParameter<double>("FONegMatchQualLUTMaxDR"));
165 
166  unsigned sortRankLUTPtFactor = iConfig.getParameter<unsigned>("SortRankLUTPtFactor");
167  unsigned sortRankLUTQualFactor = iConfig.getParameter<unsigned>("SortRankLUTQualFactor");
168  m_params_helper.setSortRankLUTFactors(sortRankLUTPtFactor, sortRankLUTQualFactor);
169 
170  auto absIsoCheckMemLUT = l1t::MicroGMTAbsoluteIsolationCheckLUTFactory::create (iConfig.getParameter<std::string>("AbsIsoCheckMemLUTPath"), fwVersion);
171  auto relIsoCheckMemLUT = l1t::MicroGMTRelativeIsolationCheckLUTFactory::create (iConfig.getParameter<std::string>("RelIsoCheckMemLUTPath"), fwVersion);
172  auto idxSelMemPhiLUT = l1t::MicroGMTCaloIndexSelectionLUTFactory::create (iConfig.getParameter<std::string>("IdxSelMemPhiLUTPath"), l1t::MicroGMTConfiguration::PHI, fwVersion);
173  auto idxSelMemEtaLUT = l1t::MicroGMTCaloIndexSelectionLUTFactory::create (iConfig.getParameter<std::string>("IdxSelMemEtaLUTPath"), l1t::MicroGMTConfiguration::ETA, fwVersion);
174  auto fwdPosSingleMatchQualLUT = l1t::MicroGMTMatchQualLUTFactory::create (iConfig.getParameter<std::string>("FwdPosSingleMatchQualLUTPath"), iConfig.getParameter<double>("FwdPosSingleMatchQualLUTMaxDR"), l1t::cancel_t::emtf_emtf_pos, fwVersion);
175  auto fwdNegSingleMatchQualLUT = l1t::MicroGMTMatchQualLUTFactory::create (iConfig.getParameter<std::string>("FwdNegSingleMatchQualLUTPath"), iConfig.getParameter<double>("FwdNegSingleMatchQualLUTMaxDR"), l1t::cancel_t::emtf_emtf_neg, fwVersion);
176  auto ovlPosSingleMatchQualLUT = l1t::MicroGMTMatchQualLUTFactory::create (iConfig.getParameter<std::string>("OvlPosSingleMatchQualLUTPath"), iConfig.getParameter<double>("OvlPosSingleMatchQualLUTMaxDR"), l1t::cancel_t::omtf_omtf_pos, fwVersion);
177  auto ovlNegSingleMatchQualLUT = l1t::MicroGMTMatchQualLUTFactory::create (iConfig.getParameter<std::string>("OvlNegSingleMatchQualLUTPath"), iConfig.getParameter<double>("OvlNegSingleMatchQualLUTMaxDR"), l1t::cancel_t::omtf_omtf_neg, fwVersion);
178  auto bOPosMatchQualLUT = l1t::MicroGMTMatchQualLUTFactory::create (iConfig.getParameter<std::string>("BOPosMatchQualLUTPath"), iConfig.getParameter<double>("BOPosMatchQualLUTMaxDR"), l1t::cancel_t::omtf_bmtf_pos, fwVersion);
179  auto bONegMatchQualLUT = l1t::MicroGMTMatchQualLUTFactory::create (iConfig.getParameter<std::string>("BONegMatchQualLUTPath"), iConfig.getParameter<double>("BONegMatchQualLUTMaxDR"), l1t::cancel_t::omtf_bmtf_neg, fwVersion);
180  auto fOPosMatchQualLUT = l1t::MicroGMTMatchQualLUTFactory::create (iConfig.getParameter<std::string>("FOPosMatchQualLUTPath"), iConfig.getParameter<double>("FOPosMatchQualLUTMaxDR"), l1t::cancel_t::omtf_emtf_pos, fwVersion);
181  auto fONegMatchQualLUT = l1t::MicroGMTMatchQualLUTFactory::create (iConfig.getParameter<std::string>("FONegMatchQualLUTPath"), iConfig.getParameter<double>("FONegMatchQualLUTMaxDR"), l1t::cancel_t::omtf_emtf_neg, fwVersion);
182  auto bPhiExtrapolationLUT = l1t::MicroGMTExtrapolationLUTFactory::create (iConfig.getParameter<std::string>("BPhiExtrapolationLUTPath"), l1t::MicroGMTConfiguration::PHI_OUT, fwVersion);
183  auto oPhiExtrapolationLUT = l1t::MicroGMTExtrapolationLUTFactory::create (iConfig.getParameter<std::string>("OPhiExtrapolationLUTPath"), l1t::MicroGMTConfiguration::PHI_OUT, fwVersion);
184  auto fPhiExtrapolationLUT = l1t::MicroGMTExtrapolationLUTFactory::create (iConfig.getParameter<std::string>("FPhiExtrapolationLUTPath"), l1t::MicroGMTConfiguration::PHI_OUT, fwVersion);
185  auto bEtaExtrapolationLUT = l1t::MicroGMTExtrapolationLUTFactory::create (iConfig.getParameter<std::string>("BEtaExtrapolationLUTPath"), l1t::MicroGMTConfiguration::ETA_OUT, fwVersion);
186  auto oEtaExtrapolationLUT = l1t::MicroGMTExtrapolationLUTFactory::create (iConfig.getParameter<std::string>("OEtaExtrapolationLUTPath"), l1t::MicroGMTConfiguration::ETA_OUT, fwVersion);
187  auto fEtaExtrapolationLUT = l1t::MicroGMTExtrapolationLUTFactory::create (iConfig.getParameter<std::string>("FEtaExtrapolationLUTPath"), l1t::MicroGMTConfiguration::ETA_OUT, fwVersion);
188  auto rankPtQualityLUT = l1t::MicroGMTRankPtQualLUTFactory::create (iConfig.getParameter<std::string>("SortRankLUTPath"), fwVersion, sortRankLUTPtFactor, sortRankLUTQualFactor);
189  m_params_helper.setAbsIsoCheckMemLUT(*absIsoCheckMemLUT);
190  m_params_helper.setRelIsoCheckMemLUT(*relIsoCheckMemLUT);
191  m_params_helper.setIdxSelMemPhiLUT(*idxSelMemPhiLUT);
192  m_params_helper.setIdxSelMemEtaLUT(*idxSelMemEtaLUT);
193  m_params_helper.setFwdPosSingleMatchQualLUT(*fwdPosSingleMatchQualLUT);
194  m_params_helper.setFwdNegSingleMatchQualLUT(*fwdNegSingleMatchQualLUT);
195  m_params_helper.setOvlPosSingleMatchQualLUT(*ovlPosSingleMatchQualLUT);
196  m_params_helper.setOvlNegSingleMatchQualLUT(*ovlNegSingleMatchQualLUT);
197  m_params_helper.setBOPosMatchQualLUT(*bOPosMatchQualLUT);
198  m_params_helper.setBONegMatchQualLUT(*bONegMatchQualLUT);
199  m_params_helper.setFOPosMatchQualLUT(*fOPosMatchQualLUT);
200  m_params_helper.setFONegMatchQualLUT(*fONegMatchQualLUT);
201  m_params_helper.setBPhiExtrapolationLUT(*bPhiExtrapolationLUT);
202  m_params_helper.setOPhiExtrapolationLUT(*oPhiExtrapolationLUT);
203  m_params_helper.setFPhiExtrapolationLUT(*fPhiExtrapolationLUT);
204  m_params_helper.setBEtaExtrapolationLUT(*bEtaExtrapolationLUT);
205  m_params_helper.setOEtaExtrapolationLUT(*oEtaExtrapolationLUT);
206  m_params_helper.setFEtaExtrapolationLUT(*fEtaExtrapolationLUT);
207  m_params_helper.setSortRankLUT(*rankPtQualityLUT);
208 
209  // LUT paths
210  m_params_helper.setAbsIsoCheckMemLUTPath (iConfig.getParameter<std::string>("AbsIsoCheckMemLUTPath"));
211  m_params_helper.setRelIsoCheckMemLUTPath (iConfig.getParameter<std::string>("RelIsoCheckMemLUTPath"));
212  m_params_helper.setIdxSelMemPhiLUTPath (iConfig.getParameter<std::string>("IdxSelMemPhiLUTPath"));
213  m_params_helper.setIdxSelMemEtaLUTPath (iConfig.getParameter<std::string>("IdxSelMemEtaLUTPath"));
214  m_params_helper.setFwdPosSingleMatchQualLUTPath (iConfig.getParameter<std::string>("FwdPosSingleMatchQualLUTPath"));
215  m_params_helper.setFwdNegSingleMatchQualLUTPath (iConfig.getParameter<std::string>("FwdNegSingleMatchQualLUTPath"));
216  m_params_helper.setOvlPosSingleMatchQualLUTPath (iConfig.getParameter<std::string>("OvlPosSingleMatchQualLUTPath"));
217  m_params_helper.setOvlNegSingleMatchQualLUTPath (iConfig.getParameter<std::string>("OvlNegSingleMatchQualLUTPath"));
218  m_params_helper.setBOPosMatchQualLUTPath (iConfig.getParameter<std::string>("BOPosMatchQualLUTPath"));
219  m_params_helper.setBONegMatchQualLUTPath (iConfig.getParameter<std::string>("BONegMatchQualLUTPath"));
220  m_params_helper.setFOPosMatchQualLUTPath (iConfig.getParameter<std::string>("FOPosMatchQualLUTPath"));
221  m_params_helper.setFONegMatchQualLUTPath (iConfig.getParameter<std::string>("FONegMatchQualLUTPath"));
222  m_params_helper.setBPhiExtrapolationLUTPath (iConfig.getParameter<std::string>("BPhiExtrapolationLUTPath"));
223  m_params_helper.setOPhiExtrapolationLUTPath (iConfig.getParameter<std::string>("OPhiExtrapolationLUTPath"));
224  m_params_helper.setFPhiExtrapolationLUTPath (iConfig.getParameter<std::string>("FPhiExtrapolationLUTPath"));
225  m_params_helper.setBEtaExtrapolationLUTPath (iConfig.getParameter<std::string>("BEtaExtrapolationLUTPath"));
226  m_params_helper.setOEtaExtrapolationLUTPath (iConfig.getParameter<std::string>("OEtaExtrapolationLUTPath"));
227  m_params_helper.setFEtaExtrapolationLUTPath (iConfig.getParameter<std::string>("FEtaExtrapolationLUTPath"));
228  m_params_helper.setSortRankLUTPath (iConfig.getParameter<std::string>("SortRankLUTPath"));
229 
230  // temp hack to avoid ALCA/DB signoff:
232 }
233 
234 
236 {
237 }
238 
239 
240 //
241 // member functions
242 //
243 
244 // ------------ method called to produce the data ------------
247 {
248  using namespace edm::es;
249  boost::shared_ptr<L1TMuonGlobalParams> pMicroGMTParams;
250 
251  pMicroGMTParams = boost::shared_ptr<L1TMuonGlobalParams>(new L1TMuonGlobalParams(m_params));
252  return pMicroGMTParams;
253 }
254 
255 //define this as a plug-in
void setFwdPosSingleMatchQualLUTMaxDR(double maxDR)
const L1TMuonGlobalParams & cast_to_L1TMuonGlobalParams(const L1TMuonGlobalParams_PUBLIC &x)
L1TMuonGlobalParamsESProducer(const edm::ParameterSet &)
T getParameter(std::string const &) const
int i
Definition: DBlmapReader.cc:9
void setMaskedCaloInputs(const std::bitset< 28 > &masked)
void setBOPosMatchQualLUTPath(std::string path)
void setIdxSelMemEtaLUT(const l1t::LUT &lut)
void setOvlNegSingleMatchQualLUTMaxDR(double maxDR)
void setOPhiExtrapolationLUT(const l1t::LUT &lut)
void setBEtaExtrapolationLUT(const l1t::LUT &lut)
void setFwdPosSingleMatchQualLUT(const l1t::LUT &lut)
void setBmtfInputsToDisable(const std::bitset< 12 > &disables)
void setBONegMatchQualLUTPath(std::string path)
void setFEtaExtrapolationLUT(const l1t::LUT &lut)
void setIdxSelMemEtaLUTPath(std::string path)
boost::shared_ptr< L1TMuonGlobalParams > ReturnType
void setFPhiExtrapolationLUT(const l1t::LUT &lut)
void setFONegMatchQualLUTPath(std::string path)
void setOmtfpInputsToDisable(const std::bitset< 6 > &disables)
void setOEtaExtrapolationLUT(const l1t::LUT &lut)
void setSortRankLUTFactors(unsigned ptFactor, unsigned qualFactor)
static ReturnType create(const std::string &filename, const int fwVersion)
void setAbsIsoCheckMemLUTPath(std::string path)
void setFONegMatchQualLUTMaxDR(double maxDR)
void setIdxSelMemPhiLUT(const l1t::LUT &lut)
void setWhatProduced(T *iThis, const es::Label &iLabel=es::Label())
Definition: ESProducer.h:115
static ReturnType create(const std::string &filename, const int type, const int fwVersion)
void setFwdNegSingleMatchQualLUTMaxDR(double maxDR)
void setBPhiExtrapolationLUT(const l1t::LUT &lut)
void setOPhiExtrapolationLUTPath(std::string path)
static ReturnType create(const std::string &filename, const double maxDR, cancel_t cancelType, const int fwVersion)
void setFwdPosSingleMatchQualLUTPath(std::string path)
void setBONegMatchQualLUTMaxDR(double maxDR, double maxDREtaFine)
static ReturnType create(const std::string &filename, const int fwVersion, const unsigned ptFactor, const unsigned qualFactor)
void setFOPosMatchQualLUT(const l1t::LUT &lut)
void setBONegMatchQualLUT(const l1t::LUT &lut)
static ReturnType create(const std::string &filename, const int fwVersion)
void setSortRankLUTPath(std::string path)
void setFOPosMatchQualLUTPath(std::string path)
void setMaskedOmtfpInputs(const std::bitset< 6 > &masked)
void setRelIsoCheckMemLUTPath(std::string path)
void setFONegMatchQualLUT(const l1t::LUT &lut)
void setOvlNegSingleMatchQualLUTPath(std::string path)
void setRelIsoCheckMemLUT(const l1t::LUT &lut)
void setFPhiExtrapolationLUTPath(std::string path)
void setEmtfnInputsToDisable(const std::bitset< 6 > &disables)
void setFEtaExtrapolationLUTPath(std::string path)
void setAbsIsoCheckMemLUT(const l1t::LUT &lut)
void setOvlPosSingleMatchQualLUT(const l1t::LUT &lut)
void setFwVersion(unsigned fwVersion)
void setBEtaExtrapolationLUTPath(std::string path)
void setBOPosMatchQualLUT(const l1t::LUT &lut)
void setFwdNegSingleMatchQualLUTPath(std::string path)
void setFOPosMatchQualLUTMaxDR(double maxDR)
void setMaskedOmtfnInputs(const std::bitset< 6 > &masked)
void setOEtaExtrapolationLUTPath(std::string path)
void setCaloInputsToDisable(const std::bitset< 28 > &disables)
void setBOPosMatchQualLUTMaxDR(double maxDR, double maxDREtaFine)
void setIdxSelMemPhiLUTPath(std::string path)
void setMaskedBmtfInputs(const std::bitset< 12 > &masked)
#define DEFINE_FWK_EVENTSETUP_MODULE(type)
Definition: ModuleFactory.h:60
void setFwdNegSingleMatchQualLUT(const l1t::LUT &lut)
void setSortRankLUT(const l1t::LUT &lut)
void setMaskedEmtfpInputs(const std::bitset< 6 > &masked)
void setOvlPosSingleMatchQualLUTMaxDR(double maxDR)
ReturnType produce(const L1TMuonGlobalParamsRcd &)
void setMaskedEmtfnInputs(const std::bitset< 6 > &masked)
void setEmtfpInputsToDisable(const std::bitset< 6 > &disables)
void setBPhiExtrapolationLUTPath(std::string path)
void setOmtfnInputsToDisable(const std::bitset< 6 > &disables)
void setOvlPosSingleMatchQualLUTPath(std::string path)
void setOvlNegSingleMatchQualLUT(const l1t::LUT &lut)
static ReturnType create(const std::string &filename, const int type, const int fwVersion)