76 int nbit_phi = l1tbmparams->get_PT_Assignment_nbits_Phi();
79 cout <<
"L1 barrel Track Finder Pt-Assignment look-up tables :" << endl;
80 cout <<
"=====================================================" << endl;
82 cout <<
"Precision : " << endl;
83 cout <<
'\t' << setw(2) << nbit_phi <<
" bits are used for phi " << endl;
90 cout <<
"============================" << endl;
93 cout <<
"\t Threshold : " << getPtLutThreshold(pam/2) << endl << endl;
95 int maxbits = nbit_phi;
96 if (pam >= MAX_PTASSMETHA) maxbits = nbit_phi-2;
99 for (
int i = 0;
i < maxbits;
i++ )
cout <<
' ';
100 cout <<
" value" << endl;
101 for (
int i = 0;
i < maxbits;
i++ )
cout <<
'-';
102 cout <<
"-------------------------" << endl;
103 std::vector<L1TMuonBarrelParams::LUT> pta_lut = l1tbmparams->pta_lut();
105 L1TMuonBarrelParams::LUT::const_iterator iter = pta_lut[pam].begin();
106 while ( iter != pta_lut[pam].
end() ) {
107 int address = (*iter).first;
108 int value = (*iter).second;
115 cout.setf(ios::right,ios::adjustfield);
116 cout <<
" " << setbase(10) << setw(9) << address <<
" (";
117 for (
int i = maxbits-1;
i >= 0;
i-- )
cout << b_address[
i];
118 cout <<
") " << setw(3) << value <<
" (";
137 std::vector<L1TMuonBarrelParams::LUT> pta_lut = l1tbmparams->pta_lut();
139 L1TMuonBarrelParams::LUT::const_iterator iter = pta_lut[pta_ind].find(address);
140 if ( iter != pta_lut[pta_ind].
end() ) {
143 return (*iter).second;
146 cerr <<
"PtaLut::getPt : can not find address " << address << endl;
157 std::vector<int> pta_threshold = l1tbmparams->pta_threshold();
159 return pta_threshold[pta_ind];
162 cerr <<
"PtaLut::getPtLutThreshold : can not find threshold " << pta_ind << endl;
172 std::vector<L1TMuonBarrelParams::LUT> phi_lut = l1tbmparams->phi_lut();
173 L1TMuonBarrelParams::LUT::const_iterator iter = phi_lut[
idx].find(address);
174 if ( iter != phi_lut[idx].
end() ) {
175 return (*iter).second;
178 cerr <<
"PhiLut::getDeltaPhi : can not find address " << address << endl;
189 return pair<unsigned short, unsigned short>(l1tbmparams->get_PHI_Assignment_nbits_Phi()
190 ,l1tbmparams->get_PHI_Assignment_nbits_PhiB());
200 unsigned short int nbit_phi = l1tbmparams->get_PHI_Assignment_nbits_Phi();
201 unsigned short int nbit_phib = l1tbmparams->get_PHI_Assignment_nbits_PhiB();
204 cout <<
"L1 barrel Track Finder Phi-Assignment look-up tables :" << endl;
205 cout <<
"======================================================" << endl;
207 cout <<
"Precision : " << endl;
208 cout <<
'\t' << setw(2) << nbit_phi <<
" bits are used for phi " << endl;
209 cout <<
'\t' << setw(2) << nbit_phib <<
" bits are used for phib " << endl;
215 if (
idx == 0 )
cout <<
"Phi-Assignment Method : " <<
"PHI12" << endl;
216 if (
idx == 1 )
cout <<
"Phi-Assignment Method : " <<
"PHI42" << endl;
217 cout <<
"=============================" << endl;
221 for (
int i = 0;
i < nbit_phib;
i++ )
cout <<
' ';
222 cout <<
" value" << endl;
223 for (
int i = 0;
i < nbit_phi + nbit_phib;
i++ )
cout <<
'-';
224 cout <<
"----------------------" << endl;
225 std::vector<L1TMuonBarrelParams::LUT> phi_lut = l1tbmparams->phi_lut();
227 L1TMuonBarrelParams::LUT::const_iterator iter = phi_lut[
idx].begin();
228 while ( iter != phi_lut[
idx].
end() ) {
229 int address = (*iter).first;
230 int value = (*iter).second;
238 cout.setf(ios::right,ios::adjustfield);
239 cout <<
" " << setbase(10) << setw(5) << address <<
" (";
240 for (
int i = nbit_phib-1;
i >= 0;
i-- )
cout << b_address[
i];
241 cout <<
") " << setw(5) << value <<
" (";
242 for (
int i = nbit_phi-1;
i >= 0;
i-- )
cout << b_value[
i];
243 cout <<
") " << endl;
261 std::vector<L1TMuonBarrelParams::LUTParams::extLUT> ext_lut = l1tbmparams->ext_lut();
262 L1TMuonBarrelParams::LUT::const_iterator iter = ext_lut[ext_ind].low.find(address);
263 if ( iter != ext_lut[ext_ind].low.end() ) {
264 return (*iter).second;
267 cerr <<
"ExtLut::getLow : can not find address " << address << endl;
278 std::vector<L1TMuonBarrelParams::LUTParams::extLUT> ext_lut = l1tbmparams->ext_lut();
279 L1TMuonBarrelParams::LUT::const_iterator iter = ext_lut[ext_ind].high.find(address);
280 if ( iter != ext_lut[ext_ind].high.end() ) {
281 return (*iter).second;
284 cerr <<
"ExtLut::getHigh : can not find address " << address << endl;
294 unsigned short int nbit_phi = l1tbmparams->get_PHI_Assignment_nbits_Phi();
295 unsigned short int nbit_phib = l1tbmparams->get_PHI_Assignment_nbits_PhiB();
297 cout <<
"L1 barrel Track Finder Extrapolation look-up tables :" << endl;
298 cout <<
"=====================================================" << endl;
300 cout <<
"Precision : " << endl;
301 cout <<
'\t' << setw(2) << nbit_phi <<
" bits are used for phi " << endl;
302 cout <<
'\t' << setw(2) << nbit_phib <<
" bits are used for phib " << endl;
309 cout <<
"====================" << endl;
313 for (
int i = 0;
i < nbit_phib;
i++ )
cout <<
' ';
314 cout <<
" low-value";
315 for (
int i = 0;
i < nbit_phi;
i++ )
cout <<
' ';
316 cout <<
" high-value " << endl;
317 for (
int i = 0;
i < 2*nbit_phi + nbit_phib;
i++ )
cout <<
'-';
318 cout <<
"---------------------------------" << endl;
319 std::vector<L1TMuonBarrelParams::LUTParams::extLUT> ext_lut = l1tbmparams->ext_lut();
320 L1TMuonBarrelParams::LUT::const_iterator iter = ext_lut[
ext].low.begin();
321 L1TMuonBarrelParams::LUT::const_iterator iter1;
322 while ( iter != ext_lut[
ext].low.end() ) {
323 int address = (*iter).first;
324 int low = (*iter).second;
325 iter1 = ext_lut[
ext].high.find(address);
326 int high = (*iter1).second;
336 cout.setf(ios::right,ios::adjustfield);
337 cout <<
" " << setbase(10) << setw(5) << address <<
" (";
338 for (
int i = nbit_phib-1;
i >= 0;
i-- )
cout << b_address[
i];
339 cout <<
") " << setw(5) << low <<
" (";
340 for (
int i = nbit_phi-1;
i >= 0;
i-- )
cout << b_low[
i];
341 cout <<
") " << setw(5) << high <<
" (";
342 for (
int i = nbit_phi-1;
i >= 0;
i-- )
cout << b_high[
i];
343 cout <<
") " << endl;
virtual ~L1MuBMLUTHandler()
destructor
std::ostream & print(std::ostream &o=std::cout) const
int getPt(int pta_ind, int address) const
get pt-value for a given address
DTTFBitArray< N > twoComplement() const
int getLow(int ext_ind, int address) const
get low_value for a given address
int getHigh(int ext_ind, int address) const
get high_value for a given address
int getPtLutThreshold(int pta_ind) const
get pt-assignment LUT threshold
L1MuBMLUTHandler(const L1TMuonBarrelParams &l1params)
constructor
Abs< T >::type abs(const T &t)
std::pair< unsigned short, unsigned short > getPrecision() const
get precision for look-up tables
int getDeltaPhi(int idx, int address) const
get delta-phi for a given address (bend-angle)
void print_pta_lut() const
print pt-assignment look-up tables
void print_phi_lut() const
print phi-assignment look-up tables
void print_ext_lut() const
print extrapolation look-up tables