CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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 
23 public:
24  enum { Version = 1 };
25 
26  class Node {
27  public:
29  unsigned version_;
31  std::vector<double> dparams_;
32  std::vector<unsigned> uparams_;
33  std::vector<int> iparams_;
34  std::vector<std::string> sparams_;
35  Node(){ type_="unspecified"; version_=0; }
37  };
38 
39  enum {absIsoCheckMem=0,
59  //brlSingleMatchQual=4,
60  //fwdPosSingleMatchQual=5,
61  //fwdNegSingleMatchQual=6,
62  //ovlPosSingleMatchQual=7,
63  //ovlNegSingleMatchQual=8,
64  //bOPosMatchQual=9,
65  //bONegMatchQual=10,
66  //fOPosMatchQual=11,
67  //fONegMatchQual=12,
68  //bPhiExtrapolation=13,
69  //oPhiExtrapolation=14,
70  //fPhiExtrapolation=15,
71  //bEtaExtrapolation=16,
72  //oEtaExtrapolation=17,
73  //fEtaExtrapolation=18,
74  //sortRank=19,
75  //NUM_GMTPARAMNODES=20
76  };
77 
78  // string parameters indices
79  enum spIdx {fname=0};
80 
81  // unsigned parameters indices
82  enum upIdx {ptFactor=0, qualFactor=1};
83 
84  // double parameters indices
85  enum dpIdx {maxdr=0, maxdrEtaFine=1};
86 
89 
90  // FW version
91  unsigned fwVersion() const { return fwVersion_; }
93 
94  // BX range
95  int bxMin() const { return bxMin_; }
96  int bxMax() const { return bxMax_; }
97  void setBxMin(int bxMin) { bxMin_ = bxMin; }
98  void setBxMax(int bxMax) { bxMax_ = bxMax; }
99 
100  // LUTs
105  //l1t::LUT* brlSingleMatchQualLUT() { return &pnodes_[brlSingleMatchQual].LUT_; }
120  l1t::LUT* sortRankLUT() { return &pnodes_[sortRank].LUT_; }
121  void setAbsIsoCheckMemLUT (const l1t::LUT & lut) { pnodes_[absIsoCheckMem].type_ = "LUT"; pnodes_[absIsoCheckMem].LUT_ = lut; }
122  void setRelIsoCheckMemLUT (const l1t::LUT & lut) { pnodes_[relIsoCheckMem].type_ = "LUT"; pnodes_[relIsoCheckMem].LUT_ = lut; }
123  void setIdxSelMemPhiLUT (const l1t::LUT & lut) { pnodes_[idxSelMemPhi].type_ = "LUT"; pnodes_[idxSelMemPhi].LUT_ = lut; }
124  void setIdxSelMemEtaLUT (const l1t::LUT & lut) { pnodes_[idxSelMemEta].type_ = "LUT"; pnodes_[idxSelMemEta].LUT_ = lut; }
125  //void setBrlSingleMatchQualLUT (const l1t::LUT & lut) { pnodes_[brlSingleMatchQual].type_ = "LUT"; pnodes_[brlSingleMatchQual].LUT_ = lut; }
130  void setBOPosMatchQualLUT (const l1t::LUT & lut) { pnodes_[bOPosMatchQual].type_ = "LUT"; pnodes_[bOPosMatchQual].LUT_ = lut; }
131  void setBONegMatchQualLUT (const l1t::LUT & lut) { pnodes_[bONegMatchQual].type_ = "LUT"; pnodes_[bONegMatchQual].LUT_ = lut; }
132  void setFOPosMatchQualLUT (const l1t::LUT & lut) { pnodes_[fOPosMatchQual].type_ = "LUT"; pnodes_[fOPosMatchQual].LUT_ = lut; }
133  void setFONegMatchQualLUT (const l1t::LUT & lut) { pnodes_[fONegMatchQual].type_ = "LUT"; pnodes_[fONegMatchQual].LUT_ = lut; }
140  void setSortRankLUT (const l1t::LUT & lut) { pnodes_[sortRank].type_ = "LUT"; pnodes_[sortRank].LUT_ = lut; }
141 
142  // LUT paths
145  std::string idxSelMemPhiLUTPath() const { return pnodes_[idxSelMemPhi].sparams_.size() > spIdx::fname ? pnodes_[idxSelMemPhi].sparams_[spIdx::fname] : ""; }
146  std::string idxSelMemEtaLUTPath() const { return pnodes_[idxSelMemEta].sparams_.size() > spIdx::fname ? pnodes_[idxSelMemEta].sparams_[spIdx::fname] : ""; }
147  //std::string brlSingleMatchQualLUTPath() const { return pnodes_[brlSingleMatchQual].sparams_.size() > spIdx::fname ? pnodes_[brlSingleMatchQual].sparams_[spIdx::fname] : ""; }
162  std::string sortRankLUTPath() const { return pnodes_[sortRank].sparams_.size() > spIdx::fname ? pnodes_[sortRank].sparams_[spIdx::fname] : ""; }
163  void setAbsIsoCheckMemLUTPath (std::string path) { pnodes_[absIsoCheckMem].sparams_.push_back(path); }
164  void setRelIsoCheckMemLUTPath (std::string path) { pnodes_[relIsoCheckMem].sparams_.push_back(path); }
165  void setIdxSelMemPhiLUTPath (std::string path) { pnodes_[idxSelMemPhi].sparams_.push_back(path); }
166  void setIdxSelMemEtaLUTPath (std::string path) { pnodes_[idxSelMemEta].sparams_.push_back(path); }
167  //void setBrlSingleMatchQualLUTPath (std::string path) { pnodes_[brlSingleMatchQual].sparams_.push_back(path); }
172  void setBOPosMatchQualLUTPath (std::string path) { pnodes_[bOPosMatchQual].sparams_.push_back(path); }
173  void setBONegMatchQualLUTPath (std::string path) { pnodes_[bONegMatchQual].sparams_.push_back(path); }
174  void setFOPosMatchQualLUTPath (std::string path) { pnodes_[fOPosMatchQual].sparams_.push_back(path); }
175  void setFONegMatchQualLUTPath (std::string path) { pnodes_[fONegMatchQual].sparams_.push_back(path); }
182  void setSortRankLUTPath (std::string path) { pnodes_[sortRank].sparams_.push_back(path); }
183 
184  // Cancel out LUT max dR
185  //double brlSingleMatchQualLUTMaxDR() const { return pnodes_[brlSingleMatchQual].dparams_.size() > dpIdx::maxdr ? pnodes_[brlSingleMatchQual].dparams_[dpIdx::maxdr] : 0.; }
186  double fwdPosSingleMatchQualLUTMaxDR() const { return pnodes_[fwdPosSingleMatchQual].dparams_.size() > dpIdx::maxdr ? pnodes_[fwdPosSingleMatchQual].dparams_[dpIdx::maxdr] : 0.; }
187  double fwdNegSingleMatchQualLUTMaxDR() const { return pnodes_[fwdNegSingleMatchQual].dparams_.size() > dpIdx::maxdr ? pnodes_[fwdNegSingleMatchQual].dparams_[dpIdx::maxdr] : 0.; }
188  double ovlPosSingleMatchQualLUTMaxDR() const { return pnodes_[ovlPosSingleMatchQual].dparams_.size() > dpIdx::maxdr ? pnodes_[ovlPosSingleMatchQual].dparams_[dpIdx::maxdr] : 0.; }
189  double ovlNegSingleMatchQualLUTMaxDR() const { return pnodes_[ovlNegSingleMatchQual].dparams_.size() > dpIdx::maxdr ? pnodes_[ovlNegSingleMatchQual].dparams_[dpIdx::maxdr] : 0.; }
190  double bOPosMatchQualLUTMaxDR() const { return pnodes_[bOPosMatchQual].dparams_.size() > dpIdx::maxdr ? pnodes_[bOPosMatchQual].dparams_[dpIdx::maxdr] : 0.; }
191  double bONegMatchQualLUTMaxDR() const { return pnodes_[bONegMatchQual].dparams_.size() > dpIdx::maxdr ? pnodes_[bONegMatchQual].dparams_[dpIdx::maxdr] : 0.; }
192  double bOPosMatchQualLUTMaxDREtaFine() const { return pnodes_[bOPosMatchQual].dparams_.size() > dpIdx::maxdrEtaFine ? pnodes_[bOPosMatchQual].dparams_[dpIdx::maxdrEtaFine] : 0.; }
193  double bONegMatchQualLUTMaxDREtaFine() const { return pnodes_[bONegMatchQual].dparams_.size() > dpIdx::maxdrEtaFine ? pnodes_[bONegMatchQual].dparams_[dpIdx::maxdrEtaFine] : 0.; }
194  double fOPosMatchQualLUTMaxDR() const { return pnodes_[fOPosMatchQual].dparams_.size() > dpIdx::maxdr ? pnodes_[fOPosMatchQual].dparams_[dpIdx::maxdr] : 0.; }
195  double fONegMatchQualLUTMaxDR() const { return pnodes_[fONegMatchQual].dparams_.size() > dpIdx::maxdr ? pnodes_[fONegMatchQual].dparams_[dpIdx::maxdr] : 0.; }
196  //void setBrlSingleMatchQualLUTMaxDR (double maxDR) { pnodes_[brlSingleMatchQual].dparams_.push_back(maxDR); }
197  void setFwdPosSingleMatchQualLUTMaxDR (double maxDR) { pnodes_[fwdPosSingleMatchQual].dparams_.push_back(maxDR); }
198  void setFwdNegSingleMatchQualLUTMaxDR (double maxDR) { pnodes_[fwdNegSingleMatchQual].dparams_.push_back(maxDR); }
199  void setOvlPosSingleMatchQualLUTMaxDR (double maxDR) { pnodes_[ovlPosSingleMatchQual].dparams_.push_back(maxDR); }
200  void setOvlNegSingleMatchQualLUTMaxDR (double maxDR) { pnodes_[ovlNegSingleMatchQual].dparams_.push_back(maxDR); }
201  void setBOPosMatchQualLUTMaxDR (double maxDR, double maxDREtaFine) { pnodes_[bOPosMatchQual].dparams_.push_back(maxDR); pnodes_[bOPosMatchQual].dparams_.push_back(maxDREtaFine); }
202  void setBONegMatchQualLUTMaxDR (double maxDR, double maxDREtaFine) { pnodes_[bONegMatchQual].dparams_.push_back(maxDR); pnodes_[bONegMatchQual].dparams_.push_back(maxDREtaFine); }
203  void setFOPosMatchQualLUTMaxDR (double maxDR) { pnodes_[fOPosMatchQual].dparams_.push_back(maxDR); }
204  void setFONegMatchQualLUTMaxDR (double maxDR) { pnodes_[fONegMatchQual].dparams_.push_back(maxDR); }
205 
206  // Sort rank LUT factors for pT and quality
207  unsigned sortRankLUTPtFactor() const { return pnodes_[sortRank].uparams_.size() > upIdx::ptFactor ? pnodes_[sortRank].uparams_[upIdx::ptFactor] : 0; }
208  unsigned sortRankLUTQualFactor() const { return pnodes_[sortRank].uparams_.size() > upIdx::qualFactor ? pnodes_[sortRank].uparams_[upIdx::qualFactor] : 0; }
209  void setSortRankLUTFactors(unsigned ptFactor, unsigned qualFactor) { pnodes_[sortRank].uparams_.push_back(ptFactor); pnodes_[sortRank].uparams_.push_back(qualFactor); }
210 
211  // print parameters to stream:
212  void print(std::ostream&) const;
213  friend std::ostream& operator<<(std::ostream& o, const L1TMuonGlobalParams & p) { p.print(o); return o; }
214 
215 private:
216  unsigned version_;
217  unsigned fwVersion_;
218 
219  int bxMin_;
220  int bxMax_;
221 
222  std::vector<Node> pnodes_;
223 
225 };
226 #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
tuple lut
Definition: lumiPlot.py:244
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:37
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)