CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
L1TMuonGlobalParamsHelper.cc
Go to the documentation of this file.
2 
4 {
5  if (pnodes_.size() != NUM_GMTPARAMNODES) {
7  }
8 }
9 
10 
11 std::bitset<72> L1TMuonGlobalParamsHelper::inputFlags(const int &nodeIdx) const
12 {
13  std::bitset<72> inputFlags;
14  if (pnodes_[nodeIdx].uparams_.size() != 4) {
15  return inputFlags;
16  }
17 
18  for (size_t i = 0; i < 28; ++i) {
19  inputFlags[CALOLINK1 + i] = ((pnodes_[nodeIdx].uparams_[CALOINPUTS] >> i) & 0x1);
20  if (i < CALOLINK1) {
21  // disable unused inputs
22  inputFlags[i] = 0x1;
23  }
24  if (i < 12) {
25  inputFlags[BMTFLINK1 + i] = ((pnodes_[nodeIdx].uparams_[BMTFINPUTS] >> i) & 0x1);
26  if (i < 6) {
27  inputFlags[EMTFPLINK1 + i] = ((pnodes_[nodeIdx].uparams_[EMTFINPUTS] >> i) & 0x1);
28  inputFlags[OMTFPLINK1 + i] = ((pnodes_[nodeIdx].uparams_[OMTFINPUTS] >> i) & 0x1);
29  inputFlags[OMTFNLINK1 + i] = ((pnodes_[nodeIdx].uparams_[OMTFINPUTS] >> (i + 6)) & 0x1);
30  inputFlags[EMTFNLINK1 + i] = ((pnodes_[nodeIdx].uparams_[EMTFINPUTS] >> (i + 6)) & 0x1);
31  }
32  }
33  }
34  return inputFlags;
35 }
36 
37 
38 std::bitset<28> L1TMuonGlobalParamsHelper::caloInputFlags(const int &nodeIdx) const
39 {
40  if (pnodes_[nodeIdx].uparams_.size() == 4) {
41  return std::bitset<28>(pnodes_[nodeIdx].uparams_[CALOINPUTS]);
42  } else {
43  return std::bitset<28>();
44  }
45 }
46 
47 
48 std::bitset<12> L1TMuonGlobalParamsHelper::tfInputFlags(const int &nodeIdx, const int &tfIdx) const
49 {
50  if (pnodes_[nodeIdx].uparams_.size() == 4) {
51  return std::bitset<12>(pnodes_[nodeIdx].uparams_[tfIdx]);
52  } else {
53  return std::bitset<12>();
54  }
55 }
56 
57 
58 std::bitset<6> L1TMuonGlobalParamsHelper::eomtfInputFlags(const int &nodeIdx, const size_t &startIdx, const int &tfIdx) const
59 {
60  std::bitset<6> inputFlags;
61  if (pnodes_[nodeIdx].uparams_.size() == 4) {
62  for (size_t i = 0; i < 6; ++i) {
63  inputFlags[i] = ((pnodes_[nodeIdx].uparams_[tfIdx] >> (i + startIdx)) & 0x1);
64  }
65  }
66  return inputFlags;
67 }
68 
69 
71 {
72  pnodes_[FWVERSION].uparams_.resize(1);
74 }
75 
76 
77 void L1TMuonGlobalParamsHelper::setInputFlags(const int &nodeIdx, const std::bitset<72> &inputFlags)
78 {
79  pnodes_[nodeIdx].uparams_.resize(4);
80  for (size_t i = 0; i < 28; ++i) {
81  pnodes_[nodeIdx].uparams_[CALOINPUTS] += (inputFlags.test(CALOLINK1 + i) << i);
82  if (i < 12) {
83  pnodes_[nodeIdx].uparams_[BMTFINPUTS] += (inputFlags.test(BMTFLINK1 + i) << i);
84  if (i < 6) {
85  pnodes_[nodeIdx].uparams_[OMTFINPUTS] += (inputFlags.test(OMTFPLINK1 + i) << i);
86  pnodes_[nodeIdx].uparams_[OMTFINPUTS] += (inputFlags.test(OMTFNLINK1 + i) << (i + 6));
87  pnodes_[nodeIdx].uparams_[EMTFINPUTS] += (inputFlags.test(EMTFPLINK1 + i) << i);
88  pnodes_[nodeIdx].uparams_[EMTFINPUTS] += (inputFlags.test(EMTFNLINK1 + i) << (i + 6));
89  }
90  }
91  }
92 }
93 
94 
95 void L1TMuonGlobalParamsHelper::setCaloInputFlags(const int &nodeIdx, const std::bitset<28> &inputFlags)
96 {
97  pnodes_[nodeIdx].uparams_.resize(4);
98  for (size_t i = 0; i < 28; ++i) {
99  pnodes_[nodeIdx].uparams_[CALOINPUTS] += (inputFlags.test(i) << i);
100  }
101 }
102 
103 
104 void L1TMuonGlobalParamsHelper::setTfInputFlags(const int &nodeIdx, const int &tfIdx, const std::bitset<12> &inputFlags)
105 {
106  pnodes_[nodeIdx].uparams_.resize(4);
107  for (size_t i = 0; i < 12; ++i) {
108  pnodes_[nodeIdx].uparams_[tfIdx] += (inputFlags.test(i) << i);
109  }
110 }
111 
112 
113 void L1TMuonGlobalParamsHelper::setEOmtfInputFlags(const int &nodeIdx, const size_t &startIdx, const int &tfIdx, const std::bitset<6> &inputFlags)
114 {
115  pnodes_[nodeIdx].uparams_.resize(4);
116  for (size_t i = 0; i < 6; ++i) {
117  pnodes_[nodeIdx].uparams_[tfIdx] += (inputFlags.test(i) << (i + startIdx));
118  }
119 }
120 
121 
122 void L1TMuonGlobalParamsHelper::print(std::ostream& out) const {
123 
124  out << "L1 MicroGMT Parameters" << std::endl;
125 
126  out << "Firmware version: " << this->fwVersion() << std::endl;
127 
128  out << "InputsToDisable: " << this->inputsToDisable() << std::endl;
129  out << " EMTF-|OMTF-| BMTF |OMTF+|EMTF+| CALO | res 0" << std::endl;
130 
131  out << "Masked Inputs: " << this->maskedInputs() << std::endl;
132  out << " EMTF-|OMTF-| BMTF |OMTF+|EMTF+| CALO | res 0" << std::endl;
133 
134  out << "LUT paths (LUTs are generated analytically if path is empty)" << std::endl;
135  out << " Abs isolation checkMem LUT path: " << this->absIsoCheckMemLUTPath() << std::endl;
136  out << " Rel isolation checkMem LUT path: " << this->relIsoCheckMemLUTPath() << std::endl;
137  out << " Index selMem phi LUT path: " << this->idxSelMemPhiLUTPath() << std::endl;
138  out << " Index selMem eta LUT path: " << this->idxSelMemEtaLUTPath() << std::endl;
139  out << " Forward pos MatchQual LUT path: " << this->fwdPosSingleMatchQualLUTPath() << ", max dR (Used when LUT path empty): " << this->fwdPosSingleMatchQualLUTMaxDR() << std::endl;
140  out << " Forward neg MatchQual LUT path: " << this->fwdNegSingleMatchQualLUTPath() << ", max dR (Used when LUT path empty): " << this->fwdNegSingleMatchQualLUTMaxDR() << std::endl;
141  out << " Overlap pos MatchQual LUT path: " << this->ovlPosSingleMatchQualLUTPath() << ", max dR (Used when LUT path empty): " << this->ovlPosSingleMatchQualLUTMaxDR() << std::endl;
142  out << " Overlap neg MatchQual LUT path: " << this->ovlNegSingleMatchQualLUTPath() << ", max dR (Used when LUT path empty): " << this->ovlNegSingleMatchQualLUTMaxDR() << std::endl;
143  out << " Barrel-Overlap pos MatchQual LUT path: " << this->bOPosMatchQualLUTPath() << ", max dR (Used when LUT path empty): " << this->bOPosMatchQualLUTMaxDR() << ", max dR when eta-fine bit set: " << this->bOPosMatchQualLUTMaxDREtaFine() << std::endl;
144  out << " Barrel-Overlap neg MatchQual LUT path: " << this->bONegMatchQualLUTPath() << ", max dR (Used when LUT path empty): " << this->bONegMatchQualLUTMaxDR() << ", max dR when eta-fine bit set: " << this->bONegMatchQualLUTMaxDREtaFine() << std::endl;
145  out << " Forward-Overlap pos MatchQual LUT path: " << this->fOPosMatchQualLUTPath() << ", max dR (Used when LUT path empty): " << this->fOPosMatchQualLUTMaxDR() << std::endl;
146  out << " Forward-Overlap neg MatchQual LUT path: " << this->fONegMatchQualLUTPath() << ", max dR (Used when LUT path empty): " << this->fONegMatchQualLUTMaxDR() << std::endl;
147  out << " Barrel phi extrapolation LUT path: " << this->bPhiExtrapolationLUTPath() << std::endl;
148  out << " Overlap phi extrapolation LUT path: " << this->oPhiExtrapolationLUTPath() << std::endl;
149  out << " Forward phi extrapolation LUT path: " << this->fPhiExtrapolationLUTPath() << std::endl;
150  out << " Barrel eta extrapolation LUT path: " << this->bEtaExtrapolationLUTPath() << std::endl;
151  out << " Overlap eta extrapolation LUT path: " << this->oEtaExtrapolationLUTPath() << std::endl;
152  out << " Forward eta extrapolation LUT path: " << this->fEtaExtrapolationLUTPath() << std::endl;
153  out << " Sort rank LUT path: " << this->sortRankLUTPath() << ", pT and quality factors (Used when LUT path empty): pT factor: " << this->sortRankLUTPtFactor() << ", quality factor: " << this->sortRankLUTQualFactor() << std::endl;
154 }
int i
Definition: DBlmapReader.cc:9
void setInputFlags(const int &nodeIdx, const std::bitset< 72 > &flags)
std::string oEtaExtrapolationLUTPath() const
std::string fEtaExtrapolationLUTPath() const
std::string fONegMatchQualLUTPath() const
std::string idxSelMemPhiLUTPath() const
std::string relIsoCheckMemLUTPath() const
std::bitset< 6 > eomtfInputFlags(const int &nodeIdx, const size_t &startIdx, const int &tfIdx) const
void setTfInputFlags(const int &nodeIdx, const int &tfIdx, const std::bitset< 12 > &flags)
std::string fwdPosSingleMatchQualLUTPath() const
void setEOmtfInputFlags(const int &nodeIdx, const size_t &startIdx, const int &tfIdx, const std::bitset< 6 > &flags)
std::bitset< 72 > inputsToDisable() const
std::string absIsoCheckMemLUTPath() const
std::string oPhiExtrapolationLUTPath() const
std::string ovlPosSingleMatchQualLUTPath() const
std::string bPhiExtrapolationLUTPath() const
void setCaloInputFlags(const int &nodeIdx, const std::bitset< 28 > &flags)
std::string bONegMatchQualLUTPath() const
std::string fOPosMatchQualLUTPath() const
std::string bEtaExtrapolationLUTPath() const
void setFwVersion(unsigned fwVersion)
std::string fPhiExtrapolationLUTPath() const
std::bitset< 72 > maskedInputs() const
std::bitset< 12 > tfInputFlags(const int &nodeIdx, const int &tfIdx) const
void print(std::ostream &) const
std::string idxSelMemEtaLUTPath() const
std::string bOPosMatchQualLUTPath() const
const L1TMuonGlobalParams_PUBLIC & cast_to_L1TMuonGlobalParams_PUBLIC(const L1TMuonGlobalParams &x)
std::bitset< 28 > caloInputFlags(const int &nodeIdx) const
std::string fwdNegSingleMatchQualLUTPath() const
std::string ovlNegSingleMatchQualLUTPath() const
std::bitset< 72 > inputFlags(const int &nodeIdx) const