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 
33 
34 //
35 // class declaration
36 //
37 
39  public:
42 
43  typedef boost::shared_ptr<L1TMuonGlobalParams> ReturnType;
44 
46  private:
48 };
49 
50 //
51 // constants, enums and typedefs
52 //
53 
54 //
55 // static data member definitions
56 //
57 
58 //
59 // constructors and destructor
60 //
62 {
63  //the following line is needed to tell the framework what
64  // data is being produced
65  setWhatProduced(this);
66 
67  // Firmware version
68  unsigned fwVersion = iConfig.getParameter<unsigned>("fwVersion");
69 
70  m_params.setFwVersion(fwVersion);
71 
72  int bxMin = iConfig.getParameter<int>("bxMin");
73  int bxMax = iConfig.getParameter<int>("bxMax");
74  if (bxMin > bxMax) {
75  m_params.setBxMin(bxMax);
76  m_params.setBxMax(bxMin);
77  } else {
78  m_params.setBxMin(bxMin);
79  m_params.setBxMax(bxMax);
80  }
81 
82  //m_params.setBrlSingleMatchQualLUTMaxDR(iConfig.getParameter<double>("BrlSingleMatchQualLUTMaxDR"));
83  m_params.setFwdPosSingleMatchQualLUTMaxDR(iConfig.getParameter<double>("FwdPosSingleMatchQualLUTMaxDR"));
84  m_params.setFwdNegSingleMatchQualLUTMaxDR(iConfig.getParameter<double>("FwdNegSingleMatchQualLUTMaxDR"));
85  m_params.setOvlPosSingleMatchQualLUTMaxDR(iConfig.getParameter<double>("OvlPosSingleMatchQualLUTMaxDR"));
86  m_params.setOvlNegSingleMatchQualLUTMaxDR(iConfig.getParameter<double>("OvlNegSingleMatchQualLUTMaxDR"));
87  m_params.setBOPosMatchQualLUTMaxDR(iConfig.getParameter<double>("BOPosMatchQualLUTMaxDR"), iConfig.getParameter<double>("BOPosMatchQualLUTMaxDREtaFine"));
88  m_params.setBONegMatchQualLUTMaxDR(iConfig.getParameter<double>("BONegMatchQualLUTMaxDR"), iConfig.getParameter<double>("BONegMatchQualLUTMaxDREtaFine"));
89  m_params.setFOPosMatchQualLUTMaxDR(iConfig.getParameter<double>("FOPosMatchQualLUTMaxDR"));
90  m_params.setFONegMatchQualLUTMaxDR(iConfig.getParameter<double>("FONegMatchQualLUTMaxDR"));
91 
92  unsigned sortRankLUTPtFactor = iConfig.getParameter<unsigned>("SortRankLUTPtFactor");
93  unsigned sortRankLUTQualFactor = iConfig.getParameter<unsigned>("SortRankLUTQualFactor");
94  m_params.setSortRankLUTFactors(sortRankLUTPtFactor, sortRankLUTQualFactor);
95 
96  auto absIsoCheckMemLUT = l1t::MicroGMTAbsoluteIsolationCheckLUTFactory::create (iConfig.getParameter<std::string>("AbsIsoCheckMemLUTPath"), fwVersion);
97  auto relIsoCheckMemLUT = l1t::MicroGMTRelativeIsolationCheckLUTFactory::create (iConfig.getParameter<std::string>("RelIsoCheckMemLUTPath"), fwVersion);
98  auto idxSelMemPhiLUT = l1t::MicroGMTCaloIndexSelectionLUTFactory::create (iConfig.getParameter<std::string>("IdxSelMemPhiLUTPath"), l1t::MicroGMTConfiguration::PHI, fwVersion);
99  auto idxSelMemEtaLUT = l1t::MicroGMTCaloIndexSelectionLUTFactory::create (iConfig.getParameter<std::string>("IdxSelMemEtaLUTPath"), l1t::MicroGMTConfiguration::ETA, fwVersion);
100  //auto brlSingleMatchQualLUT = l1t::MicroGMTMatchQualLUTFactory::create (iConfig.getParameter<std::string>("BrlSingleMatchQualLUTPath"), iConfig.getParameter<double>("BrlSingleMatchQualLUTMaxDR"), l1t::cancel_t::bmtf_bmtf, fwVersion);
101  auto fwdPosSingleMatchQualLUT = l1t::MicroGMTMatchQualLUTFactory::create (iConfig.getParameter<std::string>("FwdPosSingleMatchQualLUTPath"), iConfig.getParameter<double>("FwdPosSingleMatchQualLUTMaxDR"), l1t::cancel_t::emtf_emtf_pos, fwVersion);
102  auto fwdNegSingleMatchQualLUT = l1t::MicroGMTMatchQualLUTFactory::create (iConfig.getParameter<std::string>("FwdNegSingleMatchQualLUTPath"), iConfig.getParameter<double>("FwdNegSingleMatchQualLUTMaxDR"), l1t::cancel_t::emtf_emtf_neg, fwVersion);
103  auto ovlPosSingleMatchQualLUT = l1t::MicroGMTMatchQualLUTFactory::create (iConfig.getParameter<std::string>("OvlPosSingleMatchQualLUTPath"), iConfig.getParameter<double>("OvlPosSingleMatchQualLUTMaxDR"), l1t::cancel_t::omtf_omtf_pos, fwVersion);
104  auto ovlNegSingleMatchQualLUT = l1t::MicroGMTMatchQualLUTFactory::create (iConfig.getParameter<std::string>("OvlNegSingleMatchQualLUTPath"), iConfig.getParameter<double>("OvlNegSingleMatchQualLUTMaxDR"), l1t::cancel_t::omtf_omtf_neg, fwVersion);
105  auto bOPosMatchQualLUT = l1t::MicroGMTMatchQualLUTFactory::create (iConfig.getParameter<std::string>("BOPosMatchQualLUTPath"), iConfig.getParameter<double>("BOPosMatchQualLUTMaxDR"), l1t::cancel_t::omtf_bmtf_pos, fwVersion);
106  auto bONegMatchQualLUT = l1t::MicroGMTMatchQualLUTFactory::create (iConfig.getParameter<std::string>("BONegMatchQualLUTPath"), iConfig.getParameter<double>("BONegMatchQualLUTMaxDR"), l1t::cancel_t::omtf_bmtf_neg, fwVersion);
107  auto fOPosMatchQualLUT = l1t::MicroGMTMatchQualLUTFactory::create (iConfig.getParameter<std::string>("FOPosMatchQualLUTPath"), iConfig.getParameter<double>("FOPosMatchQualLUTMaxDR"), l1t::cancel_t::omtf_emtf_pos, fwVersion);
108  auto fONegMatchQualLUT = l1t::MicroGMTMatchQualLUTFactory::create (iConfig.getParameter<std::string>("FONegMatchQualLUTPath"), iConfig.getParameter<double>("FONegMatchQualLUTMaxDR"), l1t::cancel_t::omtf_emtf_neg, fwVersion);
109  auto bPhiExtrapolationLUT = l1t::MicroGMTExtrapolationLUTFactory::create (iConfig.getParameter<std::string>("BPhiExtrapolationLUTPath"), l1t::MicroGMTConfiguration::PHI_OUT, fwVersion);
110  auto oPhiExtrapolationLUT = l1t::MicroGMTExtrapolationLUTFactory::create (iConfig.getParameter<std::string>("OPhiExtrapolationLUTPath"), l1t::MicroGMTConfiguration::PHI_OUT, fwVersion);
111  auto fPhiExtrapolationLUT = l1t::MicroGMTExtrapolationLUTFactory::create (iConfig.getParameter<std::string>("FPhiExtrapolationLUTPath"), l1t::MicroGMTConfiguration::PHI_OUT, fwVersion);
112  auto bEtaExtrapolationLUT = l1t::MicroGMTExtrapolationLUTFactory::create (iConfig.getParameter<std::string>("BEtaExtrapolationLUTPath"), l1t::MicroGMTConfiguration::ETA_OUT, fwVersion);
113  auto oEtaExtrapolationLUT = l1t::MicroGMTExtrapolationLUTFactory::create (iConfig.getParameter<std::string>("OEtaExtrapolationLUTPath"), l1t::MicroGMTConfiguration::ETA_OUT, fwVersion);
114  auto fEtaExtrapolationLUT = l1t::MicroGMTExtrapolationLUTFactory::create (iConfig.getParameter<std::string>("FEtaExtrapolationLUTPath"), l1t::MicroGMTConfiguration::ETA_OUT, fwVersion);
115  auto rankPtQualityLUT = l1t::MicroGMTRankPtQualLUTFactory::create (iConfig.getParameter<std::string>("SortRankLUTPath"), fwVersion, sortRankLUTPtFactor, sortRankLUTQualFactor);
116  m_params.setAbsIsoCheckMemLUT(*absIsoCheckMemLUT);
117  m_params.setRelIsoCheckMemLUT(*relIsoCheckMemLUT);
118  m_params.setIdxSelMemPhiLUT(*idxSelMemPhiLUT);
119  m_params.setIdxSelMemEtaLUT(*idxSelMemEtaLUT);
120  //m_params.setBrlSingleMatchQualLUT(*brlSingleMatchQualLUT);
121  m_params.setFwdPosSingleMatchQualLUT(*fwdPosSingleMatchQualLUT);
122  m_params.setFwdNegSingleMatchQualLUT(*fwdNegSingleMatchQualLUT);
123  m_params.setOvlPosSingleMatchQualLUT(*ovlPosSingleMatchQualLUT);
124  m_params.setOvlNegSingleMatchQualLUT(*ovlNegSingleMatchQualLUT);
125  m_params.setBOPosMatchQualLUT(*bOPosMatchQualLUT);
126  m_params.setBONegMatchQualLUT(*bONegMatchQualLUT);
127  m_params.setFOPosMatchQualLUT(*fOPosMatchQualLUT);
128  m_params.setFONegMatchQualLUT(*fONegMatchQualLUT);
129  m_params.setBPhiExtrapolationLUT(*bPhiExtrapolationLUT);
130  m_params.setOPhiExtrapolationLUT(*oPhiExtrapolationLUT);
131  m_params.setFPhiExtrapolationLUT(*fPhiExtrapolationLUT);
132  m_params.setBEtaExtrapolationLUT(*bEtaExtrapolationLUT);
133  m_params.setOEtaExtrapolationLUT(*oEtaExtrapolationLUT);
134  m_params.setFEtaExtrapolationLUT(*fEtaExtrapolationLUT);
135  m_params.setSortRankLUT(*rankPtQualityLUT);
136 
137  // LUT paths
138  m_params.setAbsIsoCheckMemLUTPath (iConfig.getParameter<std::string>("AbsIsoCheckMemLUTPath"));
139  m_params.setRelIsoCheckMemLUTPath (iConfig.getParameter<std::string>("RelIsoCheckMemLUTPath"));
140  m_params.setIdxSelMemPhiLUTPath (iConfig.getParameter<std::string>("IdxSelMemPhiLUTPath"));
141  m_params.setIdxSelMemEtaLUTPath (iConfig.getParameter<std::string>("IdxSelMemEtaLUTPath"));
142  //m_params.setBrlSingleMatchQualLUTPath (iConfig.getParameter<std::string>("BrlSingleMatchQualLUTPath"));
143  m_params.setFwdPosSingleMatchQualLUTPath (iConfig.getParameter<std::string>("FwdPosSingleMatchQualLUTPath"));
144  m_params.setFwdNegSingleMatchQualLUTPath (iConfig.getParameter<std::string>("FwdNegSingleMatchQualLUTPath"));
145  m_params.setOvlPosSingleMatchQualLUTPath (iConfig.getParameter<std::string>("OvlPosSingleMatchQualLUTPath"));
146  m_params.setOvlNegSingleMatchQualLUTPath (iConfig.getParameter<std::string>("OvlNegSingleMatchQualLUTPath"));
147  m_params.setBOPosMatchQualLUTPath (iConfig.getParameter<std::string>("BOPosMatchQualLUTPath"));
148  m_params.setBONegMatchQualLUTPath (iConfig.getParameter<std::string>("BONegMatchQualLUTPath"));
149  m_params.setFOPosMatchQualLUTPath (iConfig.getParameter<std::string>("FOPosMatchQualLUTPath"));
150  m_params.setFONegMatchQualLUTPath (iConfig.getParameter<std::string>("FONegMatchQualLUTPath"));
151  m_params.setBPhiExtrapolationLUTPath (iConfig.getParameter<std::string>("BPhiExtrapolationLUTPath"));
152  m_params.setOPhiExtrapolationLUTPath (iConfig.getParameter<std::string>("OPhiExtrapolationLUTPath"));
153  m_params.setFPhiExtrapolationLUTPath (iConfig.getParameter<std::string>("FPhiExtrapolationLUTPath"));
154  m_params.setBEtaExtrapolationLUTPath (iConfig.getParameter<std::string>("BEtaExtrapolationLUTPath"));
155  m_params.setOEtaExtrapolationLUTPath (iConfig.getParameter<std::string>("OEtaExtrapolationLUTPath"));
156  m_params.setFEtaExtrapolationLUTPath (iConfig.getParameter<std::string>("FEtaExtrapolationLUTPath"));
157  m_params.setSortRankLUTPath (iConfig.getParameter<std::string>("SortRankLUTPath"));
158 }
159 
160 
162 {
163 }
164 
165 
166 //
167 // member functions
168 //
169 
170 // ------------ method called to produce the data ------------
173 {
174  using namespace edm::es;
175  boost::shared_ptr<L1TMuonGlobalParams> pMicroGMTParams;
176 
177  pMicroGMTParams = boost::shared_ptr<L1TMuonGlobalParams>(new L1TMuonGlobalParams(m_params));
178  return pMicroGMTParams;
179 }
180 
181 //define this as a plug-in
void setSortRankLUTFactors(unsigned ptFactor, unsigned qualFactor)
void setOvlPosSingleMatchQualLUT(const l1t::LUT &lut)
L1TMuonGlobalParamsESProducer(const edm::ParameterSet &)
T getParameter(std::string const &) const
void setOEtaExtrapolationLUT(const l1t::LUT &lut)
void setFPhiExtrapolationLUT(const l1t::LUT &lut)
void setOvlPosSingleMatchQualLUTMaxDR(double maxDR)
void setBEtaExtrapolationLUT(const l1t::LUT &lut)
void setOvlPosSingleMatchQualLUTPath(std::string path)
void setFOPosMatchQualLUT(const l1t::LUT &lut)
boost::shared_ptr< L1TMuonGlobalParams > ReturnType
void setIdxSelMemEtaLUT(const l1t::LUT &lut)
void setIdxSelMemPhiLUTPath(std::string path)
void setBPhiExtrapolationLUTPath(std::string path)
static ReturnType create(const std::string &filename, const int fwVersion)
void setFPhiExtrapolationLUTPath(std::string path)
void setOEtaExtrapolationLUTPath(std::string path)
void setWhatProduced(T *iThis, const es::Label &iLabel=es::Label())
Definition: ESProducer.h:115
void setFOPosMatchQualLUTMaxDR(double maxDR)
static ReturnType create(const std::string &filename, const int type, const int fwVersion)
void setFwdNegSingleMatchQualLUTPath(std::string path)
static ReturnType create(const std::string &filename, const double maxDR, cancel_t cancelType, const int fwVersion)
static ReturnType create(const std::string &filename, const int fwVersion, const unsigned ptFactor, const unsigned qualFactor)
static ReturnType create(const std::string &filename, const int fwVersion)
void setRelIsoCheckMemLUT(const l1t::LUT &lut)
void setOvlNegSingleMatchQualLUT(const l1t::LUT &lut)
void setFONegMatchQualLUTPath(std::string path)
void setBOPosMatchQualLUT(const l1t::LUT &lut)
void setFwdPosSingleMatchQualLUTPath(std::string path)
void setBxMin(int bxMin)
void setFONegMatchQualLUT(const l1t::LUT &lut)
void setIdxSelMemEtaLUTPath(std::string path)
void setFwdNegSingleMatchQualLUTMaxDR(double maxDR)
void setBONegMatchQualLUT(const l1t::LUT &lut)
void setFOPosMatchQualLUTPath(std::string path)
void setOvlNegSingleMatchQualLUTMaxDR(double maxDR)
void setSortRankLUT(const l1t::LUT &lut)
void setBEtaExtrapolationLUTPath(std::string path)
void setFwdPosSingleMatchQualLUTMaxDR(double maxDR)
void setOPhiExtrapolationLUTPath(std::string path)
void setFwVersion(unsigned fwVersion)
void setAbsIsoCheckMemLUTPath(std::string path)
#define DEFINE_FWK_EVENTSETUP_MODULE(type)
Definition: ModuleFactory.h:60
void setBOPosMatchQualLUTMaxDR(double maxDR, double maxDREtaFine)
void setOPhiExtrapolationLUT(const l1t::LUT &lut)
void setBOPosMatchQualLUTPath(std::string path)
void setIdxSelMemPhiLUT(const l1t::LUT &lut)
void setBPhiExtrapolationLUT(const l1t::LUT &lut)
ReturnType produce(const L1TMuonGlobalParamsRcd &)
void setBONegMatchQualLUTMaxDR(double maxDR, double maxDREtaFine)
void setAbsIsoCheckMemLUT(const l1t::LUT &lut)
void setFONegMatchQualLUTMaxDR(double maxDR)
void setFEtaExtrapolationLUTPath(std::string path)
void setFwdNegSingleMatchQualLUT(const l1t::LUT &lut)
void setRelIsoCheckMemLUTPath(std::string path)
void setFEtaExtrapolationLUT(const l1t::LUT &lut)
void setBONegMatchQualLUTPath(std::string path)
static ReturnType create(const std::string &filename, const int type, const int fwVersion)
void setSortRankLUTPath(std::string path)
void setOvlNegSingleMatchQualLUTPath(std::string path)
void setFwdPosSingleMatchQualLUT(const l1t::LUT &lut)
void setBxMax(int bxMax)