68 int nbit_phi = l1tbmparams->get_PT_Assignment_nbits_Phi();
71 cout <<
"L1 barrel Track Finder Pt-Assignment look-up tables :" << endl;
72 cout <<
"=====================================================" << endl;
74 cout <<
"Precision : " << endl;
75 cout <<
'\t' << setw(2) << nbit_phi <<
" bits are used for phi " << endl;
81 cout <<
"============================" << endl;
84 cout <<
"\t Threshold : " << getPtLutThreshold(pam / 2) << endl << endl;
86 int maxbits = nbit_phi;
87 if (pam >= MAX_PTASSMETHA)
88 maxbits = nbit_phi - 2;
91 for (
int i = 0;
i < maxbits;
i++)
93 cout <<
" value" << endl;
94 for (
int i = 0;
i < maxbits;
i++)
96 cout <<
"-------------------------" << endl;
97 std::vector<L1TMuonBarrelParams::LUT>
const& pta_lut = l1tbmparams->pta_lut();
99 L1TMuonBarrelParams::LUT::const_iterator iter = pta_lut[pam].begin();
100 while (iter != pta_lut[pam].end()) {
101 int address = (*iter).first;
102 int value = (*iter).second;
110 cout.setf(ios::right, ios::adjustfield);
111 cout <<
" " << setbase(10) << setw(9) << address <<
" (";
112 for (
int i = maxbits - 1;
i >= 0;
i--)
113 cout << b_address[
i];
114 cout <<
") " << setw(3) <<
value <<
" (";
129 std::vector<L1TMuonBarrelParams::LUT>
const& pta_lut = l1tbmparams->pta_lut();
131 L1TMuonBarrelParams::LUT::const_iterator iter = pta_lut[pta_ind].find(address);
132 if (iter != pta_lut[pta_ind].end()) {
135 return (*iter).second;
137 cerr <<
"PtaLut::getPt : can not find address " << address << endl;
146 std::vector<int>
const& pta_threshold = l1tbmparams->pta_threshold();
148 return pta_threshold[pta_ind];
150 cerr <<
"PtaLut::getPtLutThreshold : can not find threshold " << pta_ind << endl;
159 std::vector<L1TMuonBarrelParams::LUT>
const& phi_lut = l1tbmparams->phi_lut();
160 L1TMuonBarrelParams::LUT::const_iterator iter = phi_lut[
idx].find(address);
161 if (iter != phi_lut[
idx].end()) {
162 return (*iter).second;
164 cerr <<
"PhiLut::getDeltaPhi : can not find address " << address << endl;
173 return pair<unsigned short, unsigned short>(l1tbmparams->get_PHI_Assignment_nbits_Phi(),
174 l1tbmparams->get_PHI_Assignment_nbits_PhiB());
180 unsigned short int nbit_phi = l1tbmparams->get_PHI_Assignment_nbits_Phi();
181 unsigned short int nbit_phib = l1tbmparams->get_PHI_Assignment_nbits_PhiB();
184 cout <<
"L1 barrel Track Finder Phi-Assignment look-up tables :" << endl;
185 cout <<
"======================================================" << endl;
187 cout <<
"Precision : " << endl;
188 cout <<
'\t' << setw(2) << nbit_phi <<
" bits are used for phi " << endl;
189 cout <<
'\t' << setw(2) << nbit_phib <<
" bits are used for phib " << endl;
195 cout <<
"Phi-Assignment Method : " 198 cout <<
"Phi-Assignment Method : " 200 cout <<
"=============================" << endl;
204 for (
int i = 0;
i < nbit_phib;
i++)
206 cout <<
" value" << endl;
207 for (
int i = 0;
i < nbit_phi + nbit_phib;
i++)
209 cout <<
"----------------------" << endl;
210 std::vector<L1TMuonBarrelParams::LUT>
const& phi_lut = l1tbmparams->phi_lut();
212 L1TMuonBarrelParams::LUT::const_iterator iter = phi_lut[
idx].begin();
213 while (iter != phi_lut[
idx].end()) {
214 int address = (*iter).first;
215 int value = (*iter).second;
225 cout.setf(ios::right, ios::adjustfield);
226 cout <<
" " << setbase(10) << setw(5) << address <<
" (";
227 for (
int i = nbit_phib - 1;
i >= 0;
i--)
228 cout << b_address[
i];
229 cout <<
") " << setw(5) <<
value <<
" (";
230 for (
int i = nbit_phi - 1;
i >= 0;
i--)
232 cout <<
") " << endl;
245 std::vector<L1TMuonBarrelParams::LUTParams::extLUT>
const& ext_lut = l1tbmparams->ext_lut();
246 L1TMuonBarrelParams::LUT::const_iterator iter = ext_lut[ext_ind].low.find(address);
247 if (iter != ext_lut[ext_ind].
low.end()) {
248 return (*iter).second;
250 cerr <<
"ExtLut::getLow : can not find address " << address << endl;
259 std::vector<L1TMuonBarrelParams::LUTParams::extLUT>
const& ext_lut = l1tbmparams->ext_lut();
260 L1TMuonBarrelParams::LUT::const_iterator iter = ext_lut[ext_ind].high.find(address);
261 if (iter != ext_lut[ext_ind].
high.end()) {
262 return (*iter).second;
264 cerr <<
"ExtLut::getHigh : can not find address " << address << endl;
273 unsigned short int nbit_phi = l1tbmparams->get_PHI_Assignment_nbits_Phi();
274 unsigned short int nbit_phib = l1tbmparams->get_PHI_Assignment_nbits_PhiB();
276 cout <<
"L1 barrel Track Finder Extrapolation look-up tables :" << endl;
277 cout <<
"=====================================================" << endl;
279 cout <<
"Precision : " << endl;
280 cout <<
'\t' << setw(2) << nbit_phi <<
" bits are used for phi " << endl;
281 cout <<
'\t' << setw(2) << nbit_phib <<
" bits are used for phib " << endl;
287 cout <<
"====================" << endl;
291 for (
int i = 0;
i < nbit_phib;
i++)
293 cout <<
" low-value";
294 for (
int i = 0;
i < nbit_phi;
i++)
296 cout <<
" high-value " << endl;
297 for (
int i = 0;
i < 2 * nbit_phi + nbit_phib;
i++)
299 cout <<
"---------------------------------" << endl;
300 std::vector<L1TMuonBarrelParams::LUTParams::extLUT>
const& ext_lut = l1tbmparams->ext_lut();
301 L1TMuonBarrelParams::LUT::const_iterator iter = ext_lut[
ext].low.begin();
302 L1TMuonBarrelParams::LUT::const_iterator iter1;
303 while (iter != ext_lut[
ext].
low.end()) {
304 int address = (*iter).first;
305 int low = (*iter).second;
306 iter1 = ext_lut[
ext].high.find(address);
307 int high = (*iter1).second;
320 cout.setf(ios::right, ios::adjustfield);
321 cout <<
" " << setbase(10) << setw(5) << address <<
" (";
322 for (
int i = nbit_phib - 1;
i >= 0;
i--)
323 cout << b_address[
i];
324 cout <<
") " << setw(5) <<
low <<
" (";
325 for (
int i = nbit_phi - 1;
i >= 0;
i--)
327 cout <<
") " << setw(5) <<
high <<
" (";
328 for (
int i = nbit_phi - 1;
i >= 0;
i--)
330 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