71 int nbit_phi = l1tbmparams->get_PT_Assignment_nbits_Phi();
74 cout <<
"L1 barrel Track Finder Pt-Assignment look-up tables :" << endl;
75 cout <<
"=====================================================" << endl;
77 cout <<
"Precision : " << endl;
78 cout <<
'\t' << setw(2) << nbit_phi <<
" bits are used for phi " << endl;
84 cout <<
"============================" << endl;
87 cout <<
"\t Threshold : " << getPtLutThreshold(pam / 2) << endl << endl;
89 int maxbits = nbit_phi;
90 if (pam >= MAX_PTASSMETHA)
91 maxbits = nbit_phi - 2;
94 for (
int i = 0;
i < maxbits;
i++)
96 cout <<
" value" << endl;
97 for (
int i = 0;
i < maxbits;
i++)
99 cout <<
"-------------------------" << endl;
100 std::vector<L1TMuonBarrelParams::LUT> pta_lut = l1tbmparams->pta_lut();
102 L1TMuonBarrelParams::LUT::const_iterator iter = pta_lut[pam].begin();
103 while (iter != pta_lut[pam].end()) {
104 int address = (*iter).first;
105 int value = (*iter).second;
113 cout.setf(ios::right, ios::adjustfield);
114 cout <<
" " << setbase(10) << setw(9) << address <<
" (";
115 for (
int i = maxbits - 1;
i >= 0;
i--)
116 cout << b_address[
i];
117 cout <<
") " << setw(3) <<
value <<
" (";
132 std::vector<L1TMuonBarrelParams::LUT> pta_lut = l1tbmparams->pta_lut();
134 L1TMuonBarrelParams::LUT::const_iterator iter = pta_lut[pta_ind].find(address);
135 if (iter != pta_lut[pta_ind].end()) {
138 return (*iter).second;
140 cerr <<
"PtaLut::getPt : can not find address " << address << endl;
149 std::vector<int> pta_threshold = l1tbmparams->pta_threshold();
151 return pta_threshold[pta_ind];
153 cerr <<
"PtaLut::getPtLutThreshold : can not find threshold " << pta_ind << endl;
162 std::vector<L1TMuonBarrelParams::LUT> phi_lut = l1tbmparams->phi_lut();
163 L1TMuonBarrelParams::LUT::const_iterator iter = phi_lut[
idx].find(address);
164 if (iter != phi_lut[
idx].end()) {
165 return (*iter).second;
167 cerr <<
"PhiLut::getDeltaPhi : can not find address " << address << endl;
176 return pair<unsigned short, unsigned short>(l1tbmparams->get_PHI_Assignment_nbits_Phi(),
177 l1tbmparams->get_PHI_Assignment_nbits_PhiB());
183 unsigned short int nbit_phi = l1tbmparams->get_PHI_Assignment_nbits_Phi();
184 unsigned short int nbit_phib = l1tbmparams->get_PHI_Assignment_nbits_PhiB();
187 cout <<
"L1 barrel Track Finder Phi-Assignment look-up tables :" << endl;
188 cout <<
"======================================================" << endl;
190 cout <<
"Precision : " << endl;
191 cout <<
'\t' << setw(2) << nbit_phi <<
" bits are used for phi " << endl;
192 cout <<
'\t' << setw(2) << nbit_phib <<
" bits are used for phib " << endl;
198 cout <<
"Phi-Assignment Method : " 201 cout <<
"Phi-Assignment Method : " 203 cout <<
"=============================" << endl;
207 for (
int i = 0;
i < nbit_phib;
i++)
209 cout <<
" value" << endl;
210 for (
int i = 0;
i < nbit_phi + nbit_phib;
i++)
212 cout <<
"----------------------" << endl;
213 std::vector<L1TMuonBarrelParams::LUT> phi_lut = l1tbmparams->phi_lut();
215 L1TMuonBarrelParams::LUT::const_iterator iter = phi_lut[
idx].begin();
216 while (iter != phi_lut[
idx].end()) {
217 int address = (*iter).first;
218 int value = (*iter).second;
228 cout.setf(ios::right, ios::adjustfield);
229 cout <<
" " << setbase(10) << setw(5) << address <<
" (";
230 for (
int i = nbit_phib - 1;
i >= 0;
i--)
231 cout << b_address[
i];
232 cout <<
") " << setw(5) <<
value <<
" (";
233 for (
int i = nbit_phi - 1;
i >= 0;
i--)
235 cout <<
") " << endl;
248 std::vector<L1TMuonBarrelParams::LUTParams::extLUT> ext_lut = l1tbmparams->ext_lut();
249 L1TMuonBarrelParams::LUT::const_iterator iter = ext_lut[ext_ind].low.find(address);
250 if (iter != ext_lut[ext_ind].
low.end()) {
251 return (*iter).second;
253 cerr <<
"ExtLut::getLow : can not find address " << address << endl;
262 std::vector<L1TMuonBarrelParams::LUTParams::extLUT> ext_lut = l1tbmparams->ext_lut();
263 L1TMuonBarrelParams::LUT::const_iterator iter = ext_lut[ext_ind].high.find(address);
264 if (iter != ext_lut[ext_ind].
high.end()) {
265 return (*iter).second;
267 cerr <<
"ExtLut::getHigh : can not find address " << address << endl;
276 unsigned short int nbit_phi = l1tbmparams->get_PHI_Assignment_nbits_Phi();
277 unsigned short int nbit_phib = l1tbmparams->get_PHI_Assignment_nbits_PhiB();
279 cout <<
"L1 barrel Track Finder Extrapolation look-up tables :" << endl;
280 cout <<
"=====================================================" << endl;
282 cout <<
"Precision : " << endl;
283 cout <<
'\t' << setw(2) << nbit_phi <<
" bits are used for phi " << endl;
284 cout <<
'\t' << setw(2) << nbit_phib <<
" bits are used for phib " << endl;
290 cout <<
"====================" << endl;
294 for (
int i = 0;
i < nbit_phib;
i++)
296 cout <<
" low-value";
297 for (
int i = 0;
i < nbit_phi;
i++)
299 cout <<
" high-value " << endl;
300 for (
int i = 0;
i < 2 * nbit_phi + nbit_phib;
i++)
302 cout <<
"---------------------------------" << endl;
303 std::vector<L1TMuonBarrelParams::LUTParams::extLUT> ext_lut = l1tbmparams->ext_lut();
304 L1TMuonBarrelParams::LUT::const_iterator iter = ext_lut[
ext].low.begin();
305 L1TMuonBarrelParams::LUT::const_iterator iter1;
306 while (iter != ext_lut[
ext].
low.end()) {
307 int address = (*iter).first;
308 int low = (*iter).second;
309 iter1 = ext_lut[
ext].high.find(address);
310 int high = (*iter1).second;
323 cout.setf(ios::right, ios::adjustfield);
324 cout <<
" " << setbase(10) << setw(5) << address <<
" (";
325 for (
int i = nbit_phib - 1;
i >= 0;
i--)
326 cout << b_address[
i];
327 cout <<
") " << setw(5) <<
low <<
" (";
328 for (
int i = nbit_phi - 1;
i >= 0;
i--)
330 cout <<
") " << setw(5) <<
high <<
" (";
331 for (
int i = nbit_phi - 1;
i >= 0;
i--)
333 cout <<
") " << endl;
virtual ~L1MuBMLUTHandler()
destructor
std::ostream & print(std::ostream &o=std::cout) const
void print_pta_lut() const
print pt-assignment look-up tables
L1MuBMLUTHandler(const L1TMuonBarrelParams &l1params)
constructor
Abs< T >::type abs(const T &t)
int getPt(int pta_ind, int address) const
get pt-value for a given address
void print_ext_lut() const
print extrapolation look-up tables
int getHigh(int ext_ind, int address) const
get high_value for a given address
int getLow(int ext_ind, int address) const
get low_value for a given address
int getPtLutThreshold(int pta_ind) const
get pt-assignment LUT threshold
int getDeltaPhi(int idx, int address) const
get delta-phi for a given address (bend-angle)
DTTFBitArray< N > twoComplement() const
std::pair< unsigned short, unsigned short > getPrecision() const
get precision for look-up tables
void print_phi_lut() const
print phi-assignment look-up tables