54 l1tbmparams = &l1params;
74 int nbit_phi = l1tbmparams->get_PT_Assignment_nbits_Phi();
77 cout <<
"L1 barrel Track Finder Pt-Assignment look-up tables :" << endl;
78 cout <<
"=====================================================" << endl;
80 cout <<
"Precision : " << endl;
81 cout <<
'\t' << setw(2) << nbit_phi <<
" bits are used for phi " << endl;
88 cout <<
"============================" << endl;
91 cout <<
"\t Threshold : " << getPtLutThreshold(pam/2) << endl << endl;
93 int maxbits = nbit_phi;
96 for (
int i = 0;
i < maxbits;
i++ )
cout <<
' ';
97 cout <<
" value" << endl;
98 for (
int i = 0;
i < maxbits;
i++ )
cout <<
'-';
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;
112 cout.setf(ios::right,ios::adjustfield);
113 cout <<
" " << setbase(10) << setw(9) << address <<
" (";
114 for (
int i = maxbits-1;
i >= 0;
i-- )
cout << b_address[
i];
115 cout <<
") " << setw(3) << value <<
" (";
134 std::vector<L1TMuonBarrelParams::LUT> pta_lut = l1tbmparams->pta_lut();
136 L1TMuonBarrelParams::LUT::const_iterator iter = pta_lut[pta_ind].find(address);
137 if ( iter != pta_lut[pta_ind].
end() ) {
140 return (*iter).second;
143 cerr <<
"PtaLut::getPt : can not find address " << address << endl;
154 std::vector<int> pta_threshold = l1tbmparams->pta_threshold();
156 return pta_threshold[pta_ind];
159 cerr <<
"PtaLut::getPtLutThreshold : can not find threshold " << pta_ind << endl;
169 std::vector<L1TMuonBarrelParams::LUT> phi_lut = l1tbmparams->phi_lut();
170 L1TMuonBarrelParams::LUT::const_iterator iter = phi_lut[
idx].find(address);
171 if ( iter != phi_lut[idx].
end() ) {
172 return (*iter).second;
175 cerr <<
"PhiLut::getDeltaPhi : can not find address " << address << endl;
186 return pair<unsigned short, unsigned short>(l1tbmparams->get_PHI_Assignment_nbits_Phi()
187 ,l1tbmparams->get_PHI_Assignment_nbits_PhiB());
197 unsigned short int nbit_phi = l1tbmparams->get_PHI_Assignment_nbits_Phi();
198 unsigned short int nbit_phib = l1tbmparams->get_PHI_Assignment_nbits_PhiB();
201 cout <<
"L1 barrel Track Finder Phi-Assignment look-up tables :" << endl;
202 cout <<
"======================================================" << endl;
204 cout <<
"Precision : " << endl;
205 cout <<
'\t' << setw(2) << nbit_phi <<
" bits are used for phi " << endl;
206 cout <<
'\t' << setw(2) << nbit_phib <<
" bits are used for phib " << endl;
212 if (
idx == 0 )
cout <<
"Phi-Assignment Method : " <<
"PHI12" << endl;
213 if (
idx == 1 )
cout <<
"Phi-Assignment Method : " <<
"PHI42" << endl;
214 cout <<
"=============================" << endl;
218 for (
int i = 0;
i < nbit_phib;
i++ )
cout <<
' ';
219 cout <<
" value" << endl;
220 for (
int i = 0;
i < nbit_phi + nbit_phib;
i++ )
cout <<
'-';
221 cout <<
"----------------------" << endl;
222 std::vector<L1TMuonBarrelParams::LUT> phi_lut = l1tbmparams->phi_lut();
224 L1TMuonBarrelParams::LUT::const_iterator iter = phi_lut[
idx].begin();
225 while ( iter != phi_lut[
idx].
end() ) {
226 int address = (*iter).first;
227 int value = (*iter).second;
235 cout.setf(ios::right,ios::adjustfield);
236 cout <<
" " << setbase(10) << setw(5) << address <<
" (";
237 for (
int i = nbit_phib-1;
i >= 0;
i-- )
cout << b_address[
i];
238 cout <<
") " << setw(5) << value <<
" (";
239 for (
int i = nbit_phi-1;
i >= 0;
i-- )
cout << b_value[
i];
240 cout <<
") " << endl;
258 std::vector<L1TMuonBarrelParams::LUTParams::extLUT> ext_lut = l1tbmparams->ext_lut();
259 L1TMuonBarrelParams::LUT::const_iterator iter = ext_lut[ext_ind].low.find(address);
260 if ( iter != ext_lut[ext_ind].low.end() ) {
261 return (*iter).second;
264 cerr <<
"ExtLut::getLow : can not find address " << address << endl;
275 std::vector<L1TMuonBarrelParams::LUTParams::extLUT> ext_lut = l1tbmparams->ext_lut();
276 L1TMuonBarrelParams::LUT::const_iterator iter = ext_lut[ext_ind].high.find(address);
277 if ( iter != ext_lut[ext_ind].high.end() ) {
278 return (*iter).second;
281 cerr <<
"ExtLut::getHigh : can not find address " << address << endl;
291 unsigned short int nbit_phi = l1tbmparams->get_PHI_Assignment_nbits_Phi();
292 unsigned short int nbit_phib = l1tbmparams->get_PHI_Assignment_nbits_PhiB();
294 cout <<
"L1 barrel Track Finder Extrapolation look-up tables :" << endl;
295 cout <<
"=====================================================" << endl;
297 cout <<
"Precision : " << endl;
298 cout <<
'\t' << setw(2) << nbit_phi <<
" bits are used for phi " << endl;
299 cout <<
'\t' << setw(2) << nbit_phib <<
" bits are used for phib " << endl;
306 cout <<
"====================" << endl;
310 for (
int i = 0;
i < nbit_phib;
i++ )
cout <<
' ';
311 cout <<
" low-value";
312 for (
int i = 0;
i < nbit_phi;
i++ )
cout <<
' ';
313 cout <<
" high-value " << endl;
314 for (
int i = 0;
i < 2*nbit_phi + nbit_phib;
i++ )
cout <<
'-';
315 cout <<
"---------------------------------" << endl;
316 std::vector<L1TMuonBarrelParams::LUTParams::extLUT> ext_lut = l1tbmparams->ext_lut();
317 L1TMuonBarrelParams::LUT::const_iterator iter = ext_lut[ext].low.begin();
318 L1TMuonBarrelParams::LUT::const_iterator iter1;
319 while ( iter != ext_lut[ext].low.end() ) {
320 int address = (*iter).first;
321 int low = (*iter).second;
322 iter1 = ext_lut[ext].high.find(address);
323 int high = (*iter1).second;
333 cout.setf(ios::right,ios::adjustfield);
334 cout <<
" " << setbase(10) << setw(5) << address <<
" (";
335 for (
int i = nbit_phib-1;
i >= 0;
i-- )
cout << b_address[
i];
336 cout <<
") " << setw(5) << low <<
" (";
337 for (
int i = nbit_phi-1;
i >= 0;
i-- )
cout << b_low[
i];
338 cout <<
") " << setw(5) << high <<
" (";
339 for (
int i = nbit_phi-1;
i >= 0;
i-- )
cout << b_high[
i];
340 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
tuple idx
DEBUGGING if hasattr(process,"trackMonIterativeTracking2012"): print "trackMonIterativeTracking2012 D...
void print_ext_lut() const
print extrapolation look-up tables