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 // setters for cancel out LUT parameters
123 void L1TMuonGlobalParamsHelper::setFwdPosSingleMatchQualLUTMaxDR (double maxDR, double fEta, double fPhi)
124 {
125  pnodes_[fwdPosSingleMatchQual].dparams_.push_back(maxDR);
126  pnodes_[fwdPosSingleMatchQual].dparams_.push_back(fEta);
127  pnodes_[fwdPosSingleMatchQual].dparams_.push_back(fEta);
128  pnodes_[fwdPosSingleMatchQual].dparams_.push_back(fPhi);
129 }
130 
131 
132 void L1TMuonGlobalParamsHelper::setFwdNegSingleMatchQualLUTMaxDR (double maxDR, double fEta, double fPhi)
133 {
134  pnodes_[fwdNegSingleMatchQual].dparams_.push_back(maxDR);
135  pnodes_[fwdNegSingleMatchQual].dparams_.push_back(fEta);
136  pnodes_[fwdNegSingleMatchQual].dparams_.push_back(fEta);
137  pnodes_[fwdNegSingleMatchQual].dparams_.push_back(fPhi);
138 }
139 
140 
141 void L1TMuonGlobalParamsHelper::setOvlPosSingleMatchQualLUTMaxDR (double maxDR, double fEta, double fEtaCoarse, double fPhi)
142 {
143  pnodes_[ovlPosSingleMatchQual].dparams_.push_back(maxDR);
144  pnodes_[ovlPosSingleMatchQual].dparams_.push_back(fEta);
145  pnodes_[ovlPosSingleMatchQual].dparams_.push_back(fEtaCoarse);
146  pnodes_[ovlPosSingleMatchQual].dparams_.push_back(fPhi);
147 }
148 
149 
150 void L1TMuonGlobalParamsHelper::setOvlNegSingleMatchQualLUTMaxDR (double maxDR, double fEta, double fEtaCoarse, double fPhi)
151 {
152  pnodes_[ovlNegSingleMatchQual].dparams_.push_back(maxDR);
153  pnodes_[ovlNegSingleMatchQual].dparams_.push_back(fEta);
154  pnodes_[ovlNegSingleMatchQual].dparams_.push_back(fEtaCoarse);
155  pnodes_[ovlNegSingleMatchQual].dparams_.push_back(fPhi);
156 }
157 
158 
159 void L1TMuonGlobalParamsHelper::setBOPosMatchQualLUTMaxDR (double maxDR, double fEta, double fEtaCoarse, double fPhi)
160 {
161  pnodes_[bOPosMatchQual].dparams_.push_back(maxDR);
162  pnodes_[bOPosMatchQual].dparams_.push_back(fEta);
163  pnodes_[bOPosMatchQual].dparams_.push_back(fEtaCoarse);
164  pnodes_[bOPosMatchQual].dparams_.push_back(fPhi);
165 }
166 
167 
168 void L1TMuonGlobalParamsHelper::setBONegMatchQualLUTMaxDR (double maxDR, double fEta, double fEtaCoarse, double fPhi)
169 {
170  pnodes_[bONegMatchQual].dparams_.push_back(maxDR);
171  pnodes_[bONegMatchQual].dparams_.push_back(fEta);
172  pnodes_[bONegMatchQual].dparams_.push_back(fEtaCoarse);
173  pnodes_[bONegMatchQual].dparams_.push_back(fPhi);
174 }
175 
176 
177 void L1TMuonGlobalParamsHelper::setFOPosMatchQualLUTMaxDR (double maxDR, double fEta, double fEtaCoarse, double fPhi)
178 {
179  pnodes_[fOPosMatchQual].dparams_.push_back(maxDR);
180  pnodes_[fOPosMatchQual].dparams_.push_back(fEta);
181  pnodes_[fOPosMatchQual].dparams_.push_back(fEtaCoarse);
182  pnodes_[fOPosMatchQual].dparams_.push_back(fPhi);
183 }
184 
185 
186 void L1TMuonGlobalParamsHelper::setFONegMatchQualLUTMaxDR (double maxDR, double fEta, double fEtaCoarse, double fPhi)
187 {
188  pnodes_[fONegMatchQual].dparams_.push_back(maxDR);
189  pnodes_[fONegMatchQual].dparams_.push_back(fEta);
190  pnodes_[fONegMatchQual].dparams_.push_back(fEtaCoarse);
191  pnodes_[fONegMatchQual].dparams_.push_back(fPhi);
192 }
193 
194 
195 void L1TMuonGlobalParamsHelper::print(std::ostream& out) const {
196 
197  out << "L1 MicroGMT Parameters" << std::endl;
198 
199  out << "Firmware version: " << this->fwVersion() << std::endl;
200 
201  out << "InputsToDisable: " << this->inputsToDisable() << std::endl;
202  out << " EMTF-|OMTF-| BMTF |OMTF+|EMTF+| CALO | res 0" << std::endl;
203 
204  out << "Masked Inputs: " << this->maskedInputs() << std::endl;
205  out << " EMTF-|OMTF-| BMTF |OMTF+|EMTF+| CALO | res 0" << std::endl;
206 
207  out << "LUT paths (LUTs are generated analytically if path is empty)" << std::endl;
208  out << " Abs isolation checkMem LUT path: " << this->absIsoCheckMemLUTPath() << std::endl;
209  out << " Rel isolation checkMem LUT path: " << this->relIsoCheckMemLUTPath() << std::endl;
210  out << " Index selMem phi LUT path: " << this->idxSelMemPhiLUTPath() << std::endl;
211  out << " Index selMem eta LUT path: " << this->idxSelMemEtaLUTPath() << std::endl;
212  out << " Forward pos MatchQual LUT path: " << this->fwdPosSingleMatchQualLUTPath() << ", max dR (Used when LUT path empty): " << this->fwdPosSingleMatchQualLUTMaxDR() << std::endl;
213  out << " Forward neg MatchQual LUT path: " << this->fwdNegSingleMatchQualLUTPath() << ", max dR (Used when LUT path empty): " << this->fwdNegSingleMatchQualLUTMaxDR() << std::endl;
214  out << " Overlap pos MatchQual LUT path: " << this->ovlPosSingleMatchQualLUTPath() << ", max dR (Used when LUT path empty): " << this->ovlPosSingleMatchQualLUTMaxDR() << std::endl;
215  out << " Overlap neg MatchQual LUT path: " << this->ovlNegSingleMatchQualLUTPath() << ", max dR (Used when LUT path empty): " << this->ovlNegSingleMatchQualLUTMaxDR() << std::endl;
216  out << " Barrel-Overlap pos MatchQual LUT path: " << this->bOPosMatchQualLUTPath() << ", max dR (Used when LUT path empty): " << this->bOPosMatchQualLUTMaxDR() << ", fEta: " << this->bOPosMatchQualLUTfEta() << ", fEta when eta-fine bit isn't set: " << this->bOPosMatchQualLUTfEtaCoarse() << ", fPhi: " << this->bOPosMatchQualLUTfEta() << std::endl;
217  out << " Barrel-Overlap neg MatchQual LUT path: " << this->bONegMatchQualLUTPath() << ", max dR (Used when LUT path empty): " << this->bONegMatchQualLUTMaxDR() << ", fEta: " << this->bONegMatchQualLUTfEta() << ", fEta when eta-fine bit isn't set: " << this->bONegMatchQualLUTfEtaCoarse() << ", fPhi: " << this->bONegMatchQualLUTfPhi() << std::endl;
218  out << " Forward-Overlap pos MatchQual LUT path: " << this->fOPosMatchQualLUTPath() << ", max dR (Used when LUT path empty): " << this->fOPosMatchQualLUTMaxDR() << std::endl;
219  out << " Forward-Overlap neg MatchQual LUT path: " << this->fONegMatchQualLUTPath() << ", max dR (Used when LUT path empty): " << this->fONegMatchQualLUTMaxDR() << std::endl;
220  out << " Barrel phi extrapolation LUT path: " << this->bPhiExtrapolationLUTPath() << std::endl;
221  out << " Overlap phi extrapolation LUT path: " << this->oPhiExtrapolationLUTPath() << std::endl;
222  out << " Forward phi extrapolation LUT path: " << this->fPhiExtrapolationLUTPath() << std::endl;
223  out << " Barrel eta extrapolation LUT path: " << this->bEtaExtrapolationLUTPath() << std::endl;
224  out << " Overlap eta extrapolation LUT path: " << this->oEtaExtrapolationLUTPath() << std::endl;
225  out << " Forward eta extrapolation LUT path: " << this->fEtaExtrapolationLUTPath() << std::endl;
226  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;
227 }
void setFOPosMatchQualLUTMaxDR(double maxDR, double fEta, double fEtaCoarse, double fPhi)
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 setFwdPosSingleMatchQualLUTMaxDR(double maxDR, double fEta, double fPhi)
void setCaloInputFlags(const int &nodeIdx, const std::bitset< 28 > &flags)
std::string bONegMatchQualLUTPath() const
std::string fOPosMatchQualLUTPath() const
void setOvlPosSingleMatchQualLUTMaxDR(double maxDR, double fEta, double fEtaCoarse, double fPhi)
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 setBOPosMatchQualLUTMaxDR(double maxDR, double fEta, double fEtaCoarse, double fPhi)
void setFONegMatchQualLUTMaxDR(double maxDR, double fEta, double fEtaCoarse, double fPhi)
void print(std::ostream &) const
void setBONegMatchQualLUTMaxDR(double maxDR, double fEta, double fEtaCoarse, double fPhi)
std::string idxSelMemEtaLUTPath() const
void setOvlNegSingleMatchQualLUTMaxDR(double maxDR, double fEta, double fEtaCoarse, double fPhi)
std::string bOPosMatchQualLUTPath() const
const L1TMuonGlobalParams_PUBLIC & cast_to_L1TMuonGlobalParams_PUBLIC(const L1TMuonGlobalParams &x)
std::bitset< 28 > caloInputFlags(const int &nodeIdx) const
void setFwdNegSingleMatchQualLUTMaxDR(double maxDR, double fEta, double fPhi)
std::string fwdNegSingleMatchQualLUTPath() const
std::string ovlNegSingleMatchQualLUTPath() const
std::bitset< 72 > inputFlags(const int &nodeIdx) const