CMS 3D CMS Logo

L1TMuonGlobalParams.h
Go to the documentation of this file.
1 
11 #ifndef L1TGMTParams_h
12 #define L1TGMTParams_h
13 
14 #include <memory>
15 #include <iostream>
16 #include <vector>
17 
20 
22 public:
23  enum { Version = 1 };
24 
25  class Node {
26  public:
28  unsigned version_;
30  std::vector<double> dparams_;
31  std::vector<unsigned> uparams_;
32  std::vector<int> iparams_;
33  std::vector<std::string> sparams_;
34  Node() {
35  type_ = "unspecified";
36  version_ = 0;
37  }
39  };
40 
41  enum {
60  sortRank = 18,
62  //brlSingleMatchQual=4,
63  //fwdPosSingleMatchQual=5,
64  //fwdNegSingleMatchQual=6,
65  //ovlPosSingleMatchQual=7,
66  //ovlNegSingleMatchQual=8,
67  //bOPosMatchQual=9,
68  //bONegMatchQual=10,
69  //fOPosMatchQual=11,
70  //fONegMatchQual=12,
71  //bPhiExtrapolation=13,
72  //oPhiExtrapolation=14,
73  //fPhiExtrapolation=15,
74  //bEtaExtrapolation=16,
75  //oEtaExtrapolation=17,
76  //fEtaExtrapolation=18,
77  //sortRank=19,
78  //NUM_GMTPARAMNODES=20
79  };
80 
81  // string parameters indices
82  enum spIdx { fname = 0 };
83 
84  // unsigned parameters indices
85  enum upIdx { ptFactor = 0, qualFactor = 1 };
86 
87  // double parameters indices
88  enum dpIdx { maxdr = 0, maxdrEtaFine = 1 };
89 
91  version_ = Version;
92  fwVersion_ = 0;
93  bxMin_ = 0;
94  bxMax_ = 0;
95  pnodes_.resize(NUM_GMTPARAMNODES);
96  }
98 
99  // FW version
100  unsigned fwVersion() const { return fwVersion_; }
102 
103  // BX range
104  int bxMin() const { return bxMin_; }
105  int bxMax() const { return bxMax_; }
106  void setBxMin(int bxMin) { bxMin_ = bxMin; }
107  void setBxMax(int bxMax) { bxMax_ = bxMax; }
108 
109  // LUTs
114  //l1t::LUT* brlSingleMatchQualLUT() { return &pnodes_[brlSingleMatchQual].LUT_; }
129  l1t::LUT* sortRankLUT() { return &pnodes_[sortRank].LUT_; }
130  void setAbsIsoCheckMemLUT(const l1t::LUT& lut) {
131  pnodes_[absIsoCheckMem].type_ = "LUT";
132  pnodes_[absIsoCheckMem].LUT_ = lut;
133  }
134  void setRelIsoCheckMemLUT(const l1t::LUT& lut) {
135  pnodes_[relIsoCheckMem].type_ = "LUT";
136  pnodes_[relIsoCheckMem].LUT_ = lut;
137  }
138  void setIdxSelMemPhiLUT(const l1t::LUT& lut) {
139  pnodes_[idxSelMemPhi].type_ = "LUT";
140  pnodes_[idxSelMemPhi].LUT_ = lut;
141  }
142  void setIdxSelMemEtaLUT(const l1t::LUT& lut) {
143  pnodes_[idxSelMemEta].type_ = "LUT";
144  pnodes_[idxSelMemEta].LUT_ = lut;
145  }
146  //void setBrlSingleMatchQualLUT (const l1t::LUT & lut) { pnodes_[brlSingleMatchQual].type_ = "LUT"; pnodes_[brlSingleMatchQual].LUT_ = lut; }
148  pnodes_[fwdPosSingleMatchQual].type_ = "LUT";
149  pnodes_[fwdPosSingleMatchQual].LUT_ = lut;
150  }
152  pnodes_[fwdNegSingleMatchQual].type_ = "LUT";
153  pnodes_[fwdNegSingleMatchQual].LUT_ = lut;
154  }
156  pnodes_[ovlPosSingleMatchQual].type_ = "LUT";
157  pnodes_[ovlPosSingleMatchQual].LUT_ = lut;
158  }
160  pnodes_[ovlNegSingleMatchQual].type_ = "LUT";
161  pnodes_[ovlNegSingleMatchQual].LUT_ = lut;
162  }
163  void setBOPosMatchQualLUT(const l1t::LUT& lut) {
164  pnodes_[bOPosMatchQual].type_ = "LUT";
165  pnodes_[bOPosMatchQual].LUT_ = lut;
166  }
167  void setBONegMatchQualLUT(const l1t::LUT& lut) {
168  pnodes_[bONegMatchQual].type_ = "LUT";
169  pnodes_[bONegMatchQual].LUT_ = lut;
170  }
171  void setFOPosMatchQualLUT(const l1t::LUT& lut) {
172  pnodes_[fOPosMatchQual].type_ = "LUT";
173  pnodes_[fOPosMatchQual].LUT_ = lut;
174  }
175  void setFONegMatchQualLUT(const l1t::LUT& lut) {
176  pnodes_[fONegMatchQual].type_ = "LUT";
177  pnodes_[fONegMatchQual].LUT_ = lut;
178  }
180  pnodes_[bPhiExtrapolation].type_ = "LUT";
181  pnodes_[bPhiExtrapolation].LUT_ = lut;
182  }
184  pnodes_[oPhiExtrapolation].type_ = "LUT";
185  pnodes_[oPhiExtrapolation].LUT_ = lut;
186  }
188  pnodes_[fPhiExtrapolation].type_ = "LUT";
189  pnodes_[fPhiExtrapolation].LUT_ = lut;
190  }
192  pnodes_[bEtaExtrapolation].type_ = "LUT";
193  pnodes_[bEtaExtrapolation].LUT_ = lut;
194  }
196  pnodes_[oEtaExtrapolation].type_ = "LUT";
197  pnodes_[oEtaExtrapolation].LUT_ = lut;
198  }
200  pnodes_[fEtaExtrapolation].type_ = "LUT";
201  pnodes_[fEtaExtrapolation].LUT_ = lut;
202  }
203  void setSortRankLUT(const l1t::LUT& lut) {
204  pnodes_[sortRank].type_ = "LUT";
205  pnodes_[sortRank].LUT_ = lut;
206  }
207 
208  // LUT paths
210  return pnodes_[absIsoCheckMem].sparams_.size() > spIdx::fname ? pnodes_[absIsoCheckMem].sparams_[spIdx::fname] : "";
211  }
213  return pnodes_[relIsoCheckMem].sparams_.size() > spIdx::fname ? pnodes_[relIsoCheckMem].sparams_[spIdx::fname] : "";
214  }
216  return pnodes_[idxSelMemPhi].sparams_.size() > spIdx::fname ? pnodes_[idxSelMemPhi].sparams_[spIdx::fname] : "";
217  }
219  return pnodes_[idxSelMemEta].sparams_.size() > spIdx::fname ? pnodes_[idxSelMemEta].sparams_[spIdx::fname] : "";
220  }
221  //std::string brlSingleMatchQualLUTPath() const { return pnodes_[brlSingleMatchQual].sparams_.size() > spIdx::fname ? pnodes_[brlSingleMatchQual].sparams_[spIdx::fname] : ""; }
223  return pnodes_[fwdPosSingleMatchQual].sparams_.size() > spIdx::fname
225  : "";
226  }
228  return pnodes_[fwdNegSingleMatchQual].sparams_.size() > spIdx::fname
230  : "";
231  }
233  return pnodes_[ovlPosSingleMatchQual].sparams_.size() > spIdx::fname
235  : "";
236  }
238  return pnodes_[ovlNegSingleMatchQual].sparams_.size() > spIdx::fname
240  : "";
241  }
243  return pnodes_[bOPosMatchQual].sparams_.size() > spIdx::fname ? pnodes_[bOPosMatchQual].sparams_[spIdx::fname] : "";
244  }
246  return pnodes_[bONegMatchQual].sparams_.size() > spIdx::fname ? pnodes_[bONegMatchQual].sparams_[spIdx::fname] : "";
247  }
249  return pnodes_[fOPosMatchQual].sparams_.size() > spIdx::fname ? pnodes_[fOPosMatchQual].sparams_[spIdx::fname] : "";
250  }
252  return pnodes_[fONegMatchQual].sparams_.size() > spIdx::fname ? pnodes_[fONegMatchQual].sparams_[spIdx::fname] : "";
253  }
255  return pnodes_[bPhiExtrapolation].sparams_.size() > spIdx::fname ? pnodes_[bPhiExtrapolation].sparams_[spIdx::fname]
256  : "";
257  }
259  return pnodes_[oPhiExtrapolation].sparams_.size() > spIdx::fname ? pnodes_[oPhiExtrapolation].sparams_[spIdx::fname]
260  : "";
261  }
263  return pnodes_[fPhiExtrapolation].sparams_.size() > spIdx::fname ? pnodes_[fPhiExtrapolation].sparams_[spIdx::fname]
264  : "";
265  }
267  return pnodes_[bEtaExtrapolation].sparams_.size() > spIdx::fname ? pnodes_[bEtaExtrapolation].sparams_[spIdx::fname]
268  : "";
269  }
271  return pnodes_[oEtaExtrapolation].sparams_.size() > spIdx::fname ? pnodes_[oEtaExtrapolation].sparams_[spIdx::fname]
272  : "";
273  }
275  return pnodes_[fEtaExtrapolation].sparams_.size() > spIdx::fname ? pnodes_[fEtaExtrapolation].sparams_[spIdx::fname]
276  : "";
277  }
279  return pnodes_[sortRank].sparams_.size() > spIdx::fname ? pnodes_[sortRank].sparams_[spIdx::fname] : "";
280  }
281  void setAbsIsoCheckMemLUTPath(std::string path) { pnodes_[absIsoCheckMem].sparams_.push_back(path); }
282  void setRelIsoCheckMemLUTPath(std::string path) { pnodes_[relIsoCheckMem].sparams_.push_back(path); }
283  void setIdxSelMemPhiLUTPath(std::string path) { pnodes_[idxSelMemPhi].sparams_.push_back(path); }
284  void setIdxSelMemEtaLUTPath(std::string path) { pnodes_[idxSelMemEta].sparams_.push_back(path); }
285  //void setBrlSingleMatchQualLUTPath (std::string path) { pnodes_[brlSingleMatchQual].sparams_.push_back(path); }
290  void setBOPosMatchQualLUTPath(std::string path) { pnodes_[bOPosMatchQual].sparams_.push_back(path); }
291  void setBONegMatchQualLUTPath(std::string path) { pnodes_[bONegMatchQual].sparams_.push_back(path); }
292  void setFOPosMatchQualLUTPath(std::string path) { pnodes_[fOPosMatchQual].sparams_.push_back(path); }
293  void setFONegMatchQualLUTPath(std::string path) { pnodes_[fONegMatchQual].sparams_.push_back(path); }
300  void setSortRankLUTPath(std::string path) { pnodes_[sortRank].sparams_.push_back(path); }
301 
302  // Cancel out LUT max dR
303  //double brlSingleMatchQualLUTMaxDR() const { return pnodes_[brlSingleMatchQual].dparams_.size() > dpIdx::maxdr ? pnodes_[brlSingleMatchQual].dparams_[dpIdx::maxdr] : 0.; }
305  return pnodes_[fwdPosSingleMatchQual].dparams_.size() > dpIdx::maxdr
307  : 0.;
308  }
310  return pnodes_[fwdNegSingleMatchQual].dparams_.size() > dpIdx::maxdr
312  : 0.;
313  }
315  return pnodes_[ovlPosSingleMatchQual].dparams_.size() > dpIdx::maxdr
317  : 0.;
318  }
320  return pnodes_[ovlNegSingleMatchQual].dparams_.size() > dpIdx::maxdr
322  : 0.;
323  }
324  double bOPosMatchQualLUTMaxDR() const {
325  return pnodes_[bOPosMatchQual].dparams_.size() > dpIdx::maxdr ? pnodes_[bOPosMatchQual].dparams_[dpIdx::maxdr] : 0.;
326  }
327  double bONegMatchQualLUTMaxDR() const {
328  return pnodes_[bONegMatchQual].dparams_.size() > dpIdx::maxdr ? pnodes_[bONegMatchQual].dparams_[dpIdx::maxdr] : 0.;
329  }
331  return pnodes_[bOPosMatchQual].dparams_.size() > dpIdx::maxdrEtaFine
332  ? pnodes_[bOPosMatchQual].dparams_[dpIdx::maxdrEtaFine]
333  : 0.;
334  }
336  return pnodes_[bONegMatchQual].dparams_.size() > dpIdx::maxdrEtaFine
337  ? pnodes_[bONegMatchQual].dparams_[dpIdx::maxdrEtaFine]
338  : 0.;
339  }
340  double fOPosMatchQualLUTMaxDR() const {
341  return pnodes_[fOPosMatchQual].dparams_.size() > dpIdx::maxdr ? pnodes_[fOPosMatchQual].dparams_[dpIdx::maxdr] : 0.;
342  }
343  double fONegMatchQualLUTMaxDR() const {
344  return pnodes_[fONegMatchQual].dparams_.size() > dpIdx::maxdr ? pnodes_[fONegMatchQual].dparams_[dpIdx::maxdr] : 0.;
345  }
346  //void setBrlSingleMatchQualLUTMaxDR (double maxDR) { pnodes_[brlSingleMatchQual].dparams_.push_back(maxDR); }
347  void setFwdPosSingleMatchQualLUTMaxDR(double maxDR) { pnodes_[fwdPosSingleMatchQual].dparams_.push_back(maxDR); }
348  void setFwdNegSingleMatchQualLUTMaxDR(double maxDR) { pnodes_[fwdNegSingleMatchQual].dparams_.push_back(maxDR); }
349  void setOvlPosSingleMatchQualLUTMaxDR(double maxDR) { pnodes_[ovlPosSingleMatchQual].dparams_.push_back(maxDR); }
350  void setOvlNegSingleMatchQualLUTMaxDR(double maxDR) { pnodes_[ovlNegSingleMatchQual].dparams_.push_back(maxDR); }
351  void setBOPosMatchQualLUTMaxDR(double maxDR, double maxDREtaFine) {
352  pnodes_[bOPosMatchQual].dparams_.push_back(maxDR);
353  pnodes_[bOPosMatchQual].dparams_.push_back(maxDREtaFine);
354  }
355  void setBONegMatchQualLUTMaxDR(double maxDR, double maxDREtaFine) {
356  pnodes_[bONegMatchQual].dparams_.push_back(maxDR);
357  pnodes_[bONegMatchQual].dparams_.push_back(maxDREtaFine);
358  }
359  void setFOPosMatchQualLUTMaxDR(double maxDR) { pnodes_[fOPosMatchQual].dparams_.push_back(maxDR); }
360  void setFONegMatchQualLUTMaxDR(double maxDR) { pnodes_[fONegMatchQual].dparams_.push_back(maxDR); }
361 
362  // Sort rank LUT factors for pT and quality
363  unsigned sortRankLUTPtFactor() const {
364  return pnodes_[sortRank].uparams_.size() > upIdx::ptFactor ? pnodes_[sortRank].uparams_[upIdx::ptFactor] : 0;
365  }
366  unsigned sortRankLUTQualFactor() const {
367  return pnodes_[sortRank].uparams_.size() > upIdx::qualFactor ? pnodes_[sortRank].uparams_[upIdx::qualFactor] : 0;
368  }
369  void setSortRankLUTFactors(unsigned ptFactor, unsigned qualFactor) {
370  pnodes_[sortRank].uparams_.push_back(ptFactor);
371  pnodes_[sortRank].uparams_.push_back(qualFactor);
372  }
373 
374  // print parameters to stream:
375  void print(std::ostream&) const;
376  friend std::ostream& operator<<(std::ostream& o, const L1TMuonGlobalParams& p) {
377  p.print(o);
378  return o;
379  }
380 
381 private:
382  unsigned version_;
383  unsigned fwVersion_;
384 
385  int bxMin_;
386  int bxMax_;
387 
388  std::vector<Node> pnodes_;
389 
391 };
392 #endif
void setSortRankLUTFactors(unsigned ptFactor, unsigned qualFactor)
std::string fOPosMatchQualLUTPath() const
void setOvlPosSingleMatchQualLUT(const l1t::LUT &lut)
double fOPosMatchQualLUTMaxDR() const
std::string fwdPosSingleMatchQualLUTPath() const
std::string relIsoCheckMemLUTPath() const
void setOEtaExtrapolationLUT(const l1t::LUT &lut)
l1t::LUT * oPhiExtrapolationLUT()
l1t::LUT * ovlNegSingleMatchQualLUT()
void setFPhiExtrapolationLUT(const l1t::LUT &lut)
void setOvlPosSingleMatchQualLUTMaxDR(double maxDR)
std::string absIsoCheckMemLUTPath() const
l1t::LUT * bONegMatchQualLUT()
void setBEtaExtrapolationLUT(const l1t::LUT &lut)
void setOvlPosSingleMatchQualLUTPath(std::string path)
double ovlPosSingleMatchQualLUTMaxDR() const
void setFOPosMatchQualLUT(const l1t::LUT &lut)
void print(std::ostream &) const
unsigned sortRankLUTQualFactor() const
friend std::ostream & operator<<(std::ostream &o, const L1TMuonGlobalParams &p)
l1t::LUT * bOPosMatchQualLUT()
void setIdxSelMemEtaLUT(const l1t::LUT &lut)
void setIdxSelMemPhiLUTPath(std::string path)
std::string fONegMatchQualLUTPath() const
std::string ovlPosSingleMatchQualLUTPath() const
void setBPhiExtrapolationLUTPath(std::string path)
std::vector< unsigned > uparams_
double bOPosMatchQualLUTMaxDREtaFine() const
void setFPhiExtrapolationLUTPath(std::string path)
std::vector< std::string > sparams_
void setOEtaExtrapolationLUTPath(std::string path)
void setFOPosMatchQualLUTMaxDR(double maxDR)
double bOPosMatchQualLUTMaxDR() const
double ovlNegSingleMatchQualLUTMaxDR() const
void setFwdNegSingleMatchQualLUTPath(std::string path)
double bONegMatchQualLUTMaxDREtaFine() const
unsigned fwVersion() const
l1t::LUT * fwdPosSingleMatchQualLUT()
void setRelIsoCheckMemLUT(const l1t::LUT &lut)
void setOvlNegSingleMatchQualLUT(const l1t::LUT &lut)
void setFONegMatchQualLUTPath(std::string path)
l1t::LUT * fOPosMatchQualLUT()
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)
l1t::LUT * fONegMatchQualLUT()
void setFwdNegSingleMatchQualLUTMaxDR(double maxDR)
double fwdPosSingleMatchQualLUTMaxDR() const
std::string bEtaExtrapolationLUTPath() const
l1t::LUT * bEtaExtrapolationLUT()
void setBONegMatchQualLUT(const l1t::LUT &lut)
std::string fPhiExtrapolationLUTPath() const
void setFOPosMatchQualLUTPath(std::string path)
std::string fwdNegSingleMatchQualLUTPath() const
void setOvlNegSingleMatchQualLUTMaxDR(double maxDR)
l1t::LUT * ovlPosSingleMatchQualLUT()
void setSortRankLUT(const l1t::LUT &lut)
l1t::LUT * relIsoCheckMemLUT()
l1t::LUT * fEtaExtrapolationLUT()
void setBEtaExtrapolationLUTPath(std::string path)
std::string idxSelMemPhiLUTPath() const
l1t::LUT * fPhiExtrapolationLUT()
l1t::LUT * bPhiExtrapolationLUT()
l1t::LUT * fwdNegSingleMatchQualLUT()
Definition: LUT.h:29
std::string ovlNegSingleMatchQualLUTPath() const
void setFwdPosSingleMatchQualLUTMaxDR(double maxDR)
void setOPhiExtrapolationLUTPath(std::string path)
void setFwVersion(unsigned fwVersion)
l1t::LUT * absIsoCheckMemLUT()
void setAbsIsoCheckMemLUTPath(std::string path)
std::string fEtaExtrapolationLUTPath() const
std::vector< double > dparams_
#define COND_SERIALIZABLE
Definition: Serializable.h:38
l1t::LUT * oEtaExtrapolationLUT()
void setBOPosMatchQualLUTMaxDR(double maxDR, double maxDREtaFine)
string fname
main script
std::string bONegMatchQualLUTPath() const
void setOPhiExtrapolationLUT(const l1t::LUT &lut)
unsigned sortRankLUTPtFactor() const
double fwdNegSingleMatchQualLUTMaxDR() const
void setBOPosMatchQualLUTPath(std::string path)
std::string oEtaExtrapolationLUTPath() const
double bONegMatchQualLUTMaxDR() const
void setIdxSelMemPhiLUT(const l1t::LUT &lut)
std::string bPhiExtrapolationLUTPath() const
double fONegMatchQualLUTMaxDR() const
void setBPhiExtrapolationLUT(const l1t::LUT &lut)
std::vector< Node > pnodes_
void setBONegMatchQualLUTMaxDR(double maxDR, double maxDREtaFine)
std::string idxSelMemEtaLUTPath() const
void setAbsIsoCheckMemLUT(const l1t::LUT &lut)
void setFONegMatchQualLUTMaxDR(double maxDR)
void setFEtaExtrapolationLUTPath(std::string path)
void setFwdNegSingleMatchQualLUT(const l1t::LUT &lut)
std::string oPhiExtrapolationLUTPath() const
void setRelIsoCheckMemLUTPath(std::string path)
std::string sortRankLUTPath() const
std::string bOPosMatchQualLUTPath() const
void setFEtaExtrapolationLUT(const l1t::LUT &lut)
void setBONegMatchQualLUTPath(std::string path)
void setSortRankLUTPath(std::string path)
void setOvlNegSingleMatchQualLUTPath(std::string path)
void setFwdPosSingleMatchQualLUT(const l1t::LUT &lut)
void setBxMax(int bxMax)