File indexing completed on 2021-02-14 12:51:18
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011 #ifndef L1TGMTParams_h
0012 #define L1TGMTParams_h
0013
0014 #include <memory>
0015 #include <iostream>
0016 #include <vector>
0017
0018 #include "CondFormats/Serialization/interface/Serializable.h"
0019 #include "CondFormats/L1TObjects/interface/LUT.h"
0020
0021 class L1TMuonGlobalParams {
0022 public:
0023 enum { Version = 1 };
0024
0025 class Node {
0026 public:
0027 std::string type_;
0028 unsigned version_;
0029 l1t::LUT LUT_;
0030 std::vector<double> dparams_;
0031 std::vector<unsigned> uparams_;
0032 std::vector<int> iparams_;
0033 std::vector<std::string> sparams_;
0034 Node() {
0035 type_ = "unspecified";
0036 version_ = 0;
0037 }
0038 COND_SERIALIZABLE;
0039 };
0040
0041 enum {
0042 absIsoCheckMem = 0,
0043 relIsoCheckMem = 1,
0044 idxSelMemPhi = 2,
0045 idxSelMemEta = 3,
0046 fwdPosSingleMatchQual = 4,
0047 fwdNegSingleMatchQual = 5,
0048 ovlPosSingleMatchQual = 6,
0049 ovlNegSingleMatchQual = 7,
0050 bOPosMatchQual = 8,
0051 bONegMatchQual = 9,
0052 fOPosMatchQual = 10,
0053 fONegMatchQual = 11,
0054 bPhiExtrapolation = 12,
0055 oPhiExtrapolation = 13,
0056 fPhiExtrapolation = 14,
0057 bEtaExtrapolation = 15,
0058 oEtaExtrapolation = 16,
0059 fEtaExtrapolation = 17,
0060 sortRank = 18,
0061 NUM_GMTPARAMNODES = 19
0062
0063
0064
0065
0066
0067
0068
0069
0070
0071
0072
0073
0074
0075
0076
0077
0078
0079 };
0080
0081
0082 enum spIdx { fname = 0 };
0083
0084
0085 enum upIdx { ptFactor = 0, qualFactor = 1 };
0086
0087
0088 enum dpIdx { maxdr = 0, maxdrEtaFine = 1 };
0089
0090 L1TMuonGlobalParams() {
0091 version_ = Version;
0092 fwVersion_ = 0;
0093 bxMin_ = 0;
0094 bxMax_ = 0;
0095 pnodes_.resize(NUM_GMTPARAMNODES);
0096 }
0097 ~L1TMuonGlobalParams() {}
0098
0099
0100 unsigned fwVersion() const { return fwVersion_; }
0101 void setFwVersion(unsigned fwVersion) { fwVersion_ = fwVersion; }
0102
0103
0104 int bxMin() const { return bxMin_; }
0105 int bxMax() const { return bxMax_; }
0106 void setBxMin(int bxMin) { bxMin_ = bxMin; }
0107 void setBxMax(int bxMax) { bxMax_ = bxMax; }
0108
0109
0110 l1t::LUT* absIsoCheckMemLUT() { return &pnodes_[absIsoCheckMem].LUT_; }
0111 l1t::LUT* relIsoCheckMemLUT() { return &pnodes_[relIsoCheckMem].LUT_; }
0112 l1t::LUT* idxSelMemPhiLUT() { return &pnodes_[idxSelMemPhi].LUT_; }
0113 l1t::LUT* idxSelMemEtaLUT() { return &pnodes_[idxSelMemEta].LUT_; }
0114
0115 l1t::LUT* fwdPosSingleMatchQualLUT() { return &pnodes_[fwdPosSingleMatchQual].LUT_; }
0116 l1t::LUT* fwdNegSingleMatchQualLUT() { return &pnodes_[fwdNegSingleMatchQual].LUT_; }
0117 l1t::LUT* ovlPosSingleMatchQualLUT() { return &pnodes_[ovlPosSingleMatchQual].LUT_; }
0118 l1t::LUT* ovlNegSingleMatchQualLUT() { return &pnodes_[ovlNegSingleMatchQual].LUT_; }
0119 l1t::LUT* bOPosMatchQualLUT() { return &pnodes_[bOPosMatchQual].LUT_; }
0120 l1t::LUT* bONegMatchQualLUT() { return &pnodes_[bONegMatchQual].LUT_; }
0121 l1t::LUT* fOPosMatchQualLUT() { return &pnodes_[fOPosMatchQual].LUT_; }
0122 l1t::LUT* fONegMatchQualLUT() { return &pnodes_[fONegMatchQual].LUT_; }
0123 l1t::LUT* bPhiExtrapolationLUT() { return &pnodes_[bPhiExtrapolation].LUT_; }
0124 l1t::LUT* oPhiExtrapolationLUT() { return &pnodes_[oPhiExtrapolation].LUT_; }
0125 l1t::LUT* fPhiExtrapolationLUT() { return &pnodes_[fPhiExtrapolation].LUT_; }
0126 l1t::LUT* bEtaExtrapolationLUT() { return &pnodes_[bEtaExtrapolation].LUT_; }
0127 l1t::LUT* oEtaExtrapolationLUT() { return &pnodes_[oEtaExtrapolation].LUT_; }
0128 l1t::LUT* fEtaExtrapolationLUT() { return &pnodes_[fEtaExtrapolation].LUT_; }
0129 l1t::LUT* sortRankLUT() { return &pnodes_[sortRank].LUT_; }
0130 void setAbsIsoCheckMemLUT(const l1t::LUT& lut) {
0131 pnodes_[absIsoCheckMem].type_ = "LUT";
0132 pnodes_[absIsoCheckMem].LUT_ = lut;
0133 }
0134 void setRelIsoCheckMemLUT(const l1t::LUT& lut) {
0135 pnodes_[relIsoCheckMem].type_ = "LUT";
0136 pnodes_[relIsoCheckMem].LUT_ = lut;
0137 }
0138 void setIdxSelMemPhiLUT(const l1t::LUT& lut) {
0139 pnodes_[idxSelMemPhi].type_ = "LUT";
0140 pnodes_[idxSelMemPhi].LUT_ = lut;
0141 }
0142 void setIdxSelMemEtaLUT(const l1t::LUT& lut) {
0143 pnodes_[idxSelMemEta].type_ = "LUT";
0144 pnodes_[idxSelMemEta].LUT_ = lut;
0145 }
0146
0147 void setFwdPosSingleMatchQualLUT(const l1t::LUT& lut) {
0148 pnodes_[fwdPosSingleMatchQual].type_ = "LUT";
0149 pnodes_[fwdPosSingleMatchQual].LUT_ = lut;
0150 }
0151 void setFwdNegSingleMatchQualLUT(const l1t::LUT& lut) {
0152 pnodes_[fwdNegSingleMatchQual].type_ = "LUT";
0153 pnodes_[fwdNegSingleMatchQual].LUT_ = lut;
0154 }
0155 void setOvlPosSingleMatchQualLUT(const l1t::LUT& lut) {
0156 pnodes_[ovlPosSingleMatchQual].type_ = "LUT";
0157 pnodes_[ovlPosSingleMatchQual].LUT_ = lut;
0158 }
0159 void setOvlNegSingleMatchQualLUT(const l1t::LUT& lut) {
0160 pnodes_[ovlNegSingleMatchQual].type_ = "LUT";
0161 pnodes_[ovlNegSingleMatchQual].LUT_ = lut;
0162 }
0163 void setBOPosMatchQualLUT(const l1t::LUT& lut) {
0164 pnodes_[bOPosMatchQual].type_ = "LUT";
0165 pnodes_[bOPosMatchQual].LUT_ = lut;
0166 }
0167 void setBONegMatchQualLUT(const l1t::LUT& lut) {
0168 pnodes_[bONegMatchQual].type_ = "LUT";
0169 pnodes_[bONegMatchQual].LUT_ = lut;
0170 }
0171 void setFOPosMatchQualLUT(const l1t::LUT& lut) {
0172 pnodes_[fOPosMatchQual].type_ = "LUT";
0173 pnodes_[fOPosMatchQual].LUT_ = lut;
0174 }
0175 void setFONegMatchQualLUT(const l1t::LUT& lut) {
0176 pnodes_[fONegMatchQual].type_ = "LUT";
0177 pnodes_[fONegMatchQual].LUT_ = lut;
0178 }
0179 void setBPhiExtrapolationLUT(const l1t::LUT& lut) {
0180 pnodes_[bPhiExtrapolation].type_ = "LUT";
0181 pnodes_[bPhiExtrapolation].LUT_ = lut;
0182 }
0183 void setOPhiExtrapolationLUT(const l1t::LUT& lut) {
0184 pnodes_[oPhiExtrapolation].type_ = "LUT";
0185 pnodes_[oPhiExtrapolation].LUT_ = lut;
0186 }
0187 void setFPhiExtrapolationLUT(const l1t::LUT& lut) {
0188 pnodes_[fPhiExtrapolation].type_ = "LUT";
0189 pnodes_[fPhiExtrapolation].LUT_ = lut;
0190 }
0191 void setBEtaExtrapolationLUT(const l1t::LUT& lut) {
0192 pnodes_[bEtaExtrapolation].type_ = "LUT";
0193 pnodes_[bEtaExtrapolation].LUT_ = lut;
0194 }
0195 void setOEtaExtrapolationLUT(const l1t::LUT& lut) {
0196 pnodes_[oEtaExtrapolation].type_ = "LUT";
0197 pnodes_[oEtaExtrapolation].LUT_ = lut;
0198 }
0199 void setFEtaExtrapolationLUT(const l1t::LUT& lut) {
0200 pnodes_[fEtaExtrapolation].type_ = "LUT";
0201 pnodes_[fEtaExtrapolation].LUT_ = lut;
0202 }
0203 void setSortRankLUT(const l1t::LUT& lut) {
0204 pnodes_[sortRank].type_ = "LUT";
0205 pnodes_[sortRank].LUT_ = lut;
0206 }
0207
0208
0209 std::string absIsoCheckMemLUTPath() const {
0210 return pnodes_[absIsoCheckMem].sparams_.size() > spIdx::fname ? pnodes_[absIsoCheckMem].sparams_[spIdx::fname] : "";
0211 }
0212 std::string relIsoCheckMemLUTPath() const {
0213 return pnodes_[relIsoCheckMem].sparams_.size() > spIdx::fname ? pnodes_[relIsoCheckMem].sparams_[spIdx::fname] : "";
0214 }
0215 std::string idxSelMemPhiLUTPath() const {
0216 return pnodes_[idxSelMemPhi].sparams_.size() > spIdx::fname ? pnodes_[idxSelMemPhi].sparams_[spIdx::fname] : "";
0217 }
0218 std::string idxSelMemEtaLUTPath() const {
0219 return pnodes_[idxSelMemEta].sparams_.size() > spIdx::fname ? pnodes_[idxSelMemEta].sparams_[spIdx::fname] : "";
0220 }
0221
0222 std::string fwdPosSingleMatchQualLUTPath() const {
0223 return pnodes_[fwdPosSingleMatchQual].sparams_.size() > spIdx::fname
0224 ? pnodes_[fwdPosSingleMatchQual].sparams_[spIdx::fname]
0225 : "";
0226 }
0227 std::string fwdNegSingleMatchQualLUTPath() const {
0228 return pnodes_[fwdNegSingleMatchQual].sparams_.size() > spIdx::fname
0229 ? pnodes_[fwdNegSingleMatchQual].sparams_[spIdx::fname]
0230 : "";
0231 }
0232 std::string ovlPosSingleMatchQualLUTPath() const {
0233 return pnodes_[ovlPosSingleMatchQual].sparams_.size() > spIdx::fname
0234 ? pnodes_[ovlPosSingleMatchQual].sparams_[spIdx::fname]
0235 : "";
0236 }
0237 std::string ovlNegSingleMatchQualLUTPath() const {
0238 return pnodes_[ovlNegSingleMatchQual].sparams_.size() > spIdx::fname
0239 ? pnodes_[ovlNegSingleMatchQual].sparams_[spIdx::fname]
0240 : "";
0241 }
0242 std::string bOPosMatchQualLUTPath() const {
0243 return pnodes_[bOPosMatchQual].sparams_.size() > spIdx::fname ? pnodes_[bOPosMatchQual].sparams_[spIdx::fname] : "";
0244 }
0245 std::string bONegMatchQualLUTPath() const {
0246 return pnodes_[bONegMatchQual].sparams_.size() > spIdx::fname ? pnodes_[bONegMatchQual].sparams_[spIdx::fname] : "";
0247 }
0248 std::string fOPosMatchQualLUTPath() const {
0249 return pnodes_[fOPosMatchQual].sparams_.size() > spIdx::fname ? pnodes_[fOPosMatchQual].sparams_[spIdx::fname] : "";
0250 }
0251 std::string fONegMatchQualLUTPath() const {
0252 return pnodes_[fONegMatchQual].sparams_.size() > spIdx::fname ? pnodes_[fONegMatchQual].sparams_[spIdx::fname] : "";
0253 }
0254 std::string bPhiExtrapolationLUTPath() const {
0255 return pnodes_[bPhiExtrapolation].sparams_.size() > spIdx::fname ? pnodes_[bPhiExtrapolation].sparams_[spIdx::fname]
0256 : "";
0257 }
0258 std::string oPhiExtrapolationLUTPath() const {
0259 return pnodes_[oPhiExtrapolation].sparams_.size() > spIdx::fname ? pnodes_[oPhiExtrapolation].sparams_[spIdx::fname]
0260 : "";
0261 }
0262 std::string fPhiExtrapolationLUTPath() const {
0263 return pnodes_[fPhiExtrapolation].sparams_.size() > spIdx::fname ? pnodes_[fPhiExtrapolation].sparams_[spIdx::fname]
0264 : "";
0265 }
0266 std::string bEtaExtrapolationLUTPath() const {
0267 return pnodes_[bEtaExtrapolation].sparams_.size() > spIdx::fname ? pnodes_[bEtaExtrapolation].sparams_[spIdx::fname]
0268 : "";
0269 }
0270 std::string oEtaExtrapolationLUTPath() const {
0271 return pnodes_[oEtaExtrapolation].sparams_.size() > spIdx::fname ? pnodes_[oEtaExtrapolation].sparams_[spIdx::fname]
0272 : "";
0273 }
0274 std::string fEtaExtrapolationLUTPath() const {
0275 return pnodes_[fEtaExtrapolation].sparams_.size() > spIdx::fname ? pnodes_[fEtaExtrapolation].sparams_[spIdx::fname]
0276 : "";
0277 }
0278 std::string sortRankLUTPath() const {
0279 return pnodes_[sortRank].sparams_.size() > spIdx::fname ? pnodes_[sortRank].sparams_[spIdx::fname] : "";
0280 }
0281 void setAbsIsoCheckMemLUTPath(std::string path) { pnodes_[absIsoCheckMem].sparams_.push_back(path); }
0282 void setRelIsoCheckMemLUTPath(std::string path) { pnodes_[relIsoCheckMem].sparams_.push_back(path); }
0283 void setIdxSelMemPhiLUTPath(std::string path) { pnodes_[idxSelMemPhi].sparams_.push_back(path); }
0284 void setIdxSelMemEtaLUTPath(std::string path) { pnodes_[idxSelMemEta].sparams_.push_back(path); }
0285
0286 void setFwdPosSingleMatchQualLUTPath(std::string path) { pnodes_[fwdPosSingleMatchQual].sparams_.push_back(path); }
0287 void setFwdNegSingleMatchQualLUTPath(std::string path) { pnodes_[fwdNegSingleMatchQual].sparams_.push_back(path); }
0288 void setOvlPosSingleMatchQualLUTPath(std::string path) { pnodes_[ovlPosSingleMatchQual].sparams_.push_back(path); }
0289 void setOvlNegSingleMatchQualLUTPath(std::string path) { pnodes_[ovlNegSingleMatchQual].sparams_.push_back(path); }
0290 void setBOPosMatchQualLUTPath(std::string path) { pnodes_[bOPosMatchQual].sparams_.push_back(path); }
0291 void setBONegMatchQualLUTPath(std::string path) { pnodes_[bONegMatchQual].sparams_.push_back(path); }
0292 void setFOPosMatchQualLUTPath(std::string path) { pnodes_[fOPosMatchQual].sparams_.push_back(path); }
0293 void setFONegMatchQualLUTPath(std::string path) { pnodes_[fONegMatchQual].sparams_.push_back(path); }
0294 void setBPhiExtrapolationLUTPath(std::string path) { pnodes_[bPhiExtrapolation].sparams_.push_back(path); }
0295 void setOPhiExtrapolationLUTPath(std::string path) { pnodes_[oPhiExtrapolation].sparams_.push_back(path); }
0296 void setFPhiExtrapolationLUTPath(std::string path) { pnodes_[fPhiExtrapolation].sparams_.push_back(path); }
0297 void setBEtaExtrapolationLUTPath(std::string path) { pnodes_[bEtaExtrapolation].sparams_.push_back(path); }
0298 void setOEtaExtrapolationLUTPath(std::string path) { pnodes_[oEtaExtrapolation].sparams_.push_back(path); }
0299 void setFEtaExtrapolationLUTPath(std::string path) { pnodes_[fEtaExtrapolation].sparams_.push_back(path); }
0300 void setSortRankLUTPath(std::string path) { pnodes_[sortRank].sparams_.push_back(path); }
0301
0302
0303
0304 double fwdPosSingleMatchQualLUTMaxDR() const {
0305 return pnodes_[fwdPosSingleMatchQual].dparams_.size() > dpIdx::maxdr
0306 ? pnodes_[fwdPosSingleMatchQual].dparams_[dpIdx::maxdr]
0307 : 0.;
0308 }
0309 double fwdNegSingleMatchQualLUTMaxDR() const {
0310 return pnodes_[fwdNegSingleMatchQual].dparams_.size() > dpIdx::maxdr
0311 ? pnodes_[fwdNegSingleMatchQual].dparams_[dpIdx::maxdr]
0312 : 0.;
0313 }
0314 double ovlPosSingleMatchQualLUTMaxDR() const {
0315 return pnodes_[ovlPosSingleMatchQual].dparams_.size() > dpIdx::maxdr
0316 ? pnodes_[ovlPosSingleMatchQual].dparams_[dpIdx::maxdr]
0317 : 0.;
0318 }
0319 double ovlNegSingleMatchQualLUTMaxDR() const {
0320 return pnodes_[ovlNegSingleMatchQual].dparams_.size() > dpIdx::maxdr
0321 ? pnodes_[ovlNegSingleMatchQual].dparams_[dpIdx::maxdr]
0322 : 0.;
0323 }
0324 double bOPosMatchQualLUTMaxDR() const {
0325 return pnodes_[bOPosMatchQual].dparams_.size() > dpIdx::maxdr ? pnodes_[bOPosMatchQual].dparams_[dpIdx::maxdr] : 0.;
0326 }
0327 double bONegMatchQualLUTMaxDR() const {
0328 return pnodes_[bONegMatchQual].dparams_.size() > dpIdx::maxdr ? pnodes_[bONegMatchQual].dparams_[dpIdx::maxdr] : 0.;
0329 }
0330 double bOPosMatchQualLUTMaxDREtaFine() const {
0331 return pnodes_[bOPosMatchQual].dparams_.size() > dpIdx::maxdrEtaFine
0332 ? pnodes_[bOPosMatchQual].dparams_[dpIdx::maxdrEtaFine]
0333 : 0.;
0334 }
0335 double bONegMatchQualLUTMaxDREtaFine() const {
0336 return pnodes_[bONegMatchQual].dparams_.size() > dpIdx::maxdrEtaFine
0337 ? pnodes_[bONegMatchQual].dparams_[dpIdx::maxdrEtaFine]
0338 : 0.;
0339 }
0340 double fOPosMatchQualLUTMaxDR() const {
0341 return pnodes_[fOPosMatchQual].dparams_.size() > dpIdx::maxdr ? pnodes_[fOPosMatchQual].dparams_[dpIdx::maxdr] : 0.;
0342 }
0343 double fONegMatchQualLUTMaxDR() const {
0344 return pnodes_[fONegMatchQual].dparams_.size() > dpIdx::maxdr ? pnodes_[fONegMatchQual].dparams_[dpIdx::maxdr] : 0.;
0345 }
0346
0347 void setFwdPosSingleMatchQualLUTMaxDR(double maxDR) { pnodes_[fwdPosSingleMatchQual].dparams_.push_back(maxDR); }
0348 void setFwdNegSingleMatchQualLUTMaxDR(double maxDR) { pnodes_[fwdNegSingleMatchQual].dparams_.push_back(maxDR); }
0349 void setOvlPosSingleMatchQualLUTMaxDR(double maxDR) { pnodes_[ovlPosSingleMatchQual].dparams_.push_back(maxDR); }
0350 void setOvlNegSingleMatchQualLUTMaxDR(double maxDR) { pnodes_[ovlNegSingleMatchQual].dparams_.push_back(maxDR); }
0351 void setBOPosMatchQualLUTMaxDR(double maxDR, double maxDREtaFine) {
0352 pnodes_[bOPosMatchQual].dparams_.push_back(maxDR);
0353 pnodes_[bOPosMatchQual].dparams_.push_back(maxDREtaFine);
0354 }
0355 void setBONegMatchQualLUTMaxDR(double maxDR, double maxDREtaFine) {
0356 pnodes_[bONegMatchQual].dparams_.push_back(maxDR);
0357 pnodes_[bONegMatchQual].dparams_.push_back(maxDREtaFine);
0358 }
0359 void setFOPosMatchQualLUTMaxDR(double maxDR) { pnodes_[fOPosMatchQual].dparams_.push_back(maxDR); }
0360 void setFONegMatchQualLUTMaxDR(double maxDR) { pnodes_[fONegMatchQual].dparams_.push_back(maxDR); }
0361
0362
0363 unsigned sortRankLUTPtFactor() const {
0364 return pnodes_[sortRank].uparams_.size() > upIdx::ptFactor ? pnodes_[sortRank].uparams_[upIdx::ptFactor] : 0;
0365 }
0366 unsigned sortRankLUTQualFactor() const {
0367 return pnodes_[sortRank].uparams_.size() > upIdx::qualFactor ? pnodes_[sortRank].uparams_[upIdx::qualFactor] : 0;
0368 }
0369 void setSortRankLUTFactors(unsigned ptFactor, unsigned qualFactor) {
0370 pnodes_[sortRank].uparams_.push_back(ptFactor);
0371 pnodes_[sortRank].uparams_.push_back(qualFactor);
0372 }
0373
0374
0375 void print(std::ostream&) const;
0376 friend std::ostream& operator<<(std::ostream& o, const L1TMuonGlobalParams& p) {
0377 p.print(o);
0378 return o;
0379 }
0380
0381 private:
0382 unsigned version_;
0383 unsigned fwVersion_;
0384
0385 int bxMin_;
0386 int bxMax_;
0387
0388 std::vector<Node> pnodes_;
0389
0390 COND_SERIALIZABLE;
0391 };
0392 #endif