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;
94 if (pam >= MAX_PTASSMETHA) maxbits = nbit_phi-2;
97 for (
int i = 0;
i < maxbits;
i++ )
cout <<
' ';
98 cout <<
" value" << endl;
99 for (
int i = 0;
i < maxbits;
i++ )
cout <<
'-';
100 cout <<
"-------------------------" << endl;
101 std::vector<L1TMuonBarrelParams::LUT> pta_lut = l1tbmparams->pta_lut();
103 L1TMuonBarrelParams::LUT::const_iterator iter = pta_lut[pam].begin();
104 while ( iter != pta_lut[pam].
end() ) {
105 int address = (*iter).first;
106 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-- )
cout << b_address[
i];
116 cout <<
") " << setw(3) << value <<
" (";
135 std::vector<L1TMuonBarrelParams::LUT> pta_lut = l1tbmparams->pta_lut();
137 L1TMuonBarrelParams::LUT::const_iterator iter = pta_lut[pta_ind].find(address);
138 if ( iter != pta_lut[pta_ind].
end() ) {
141 return (*iter).second;
144 cerr <<
"PtaLut::getPt : can not find address " << address << endl;
155 std::vector<int> pta_threshold = l1tbmparams->pta_threshold();
157 return pta_threshold[pta_ind];
160 cerr <<
"PtaLut::getPtLutThreshold : can not find threshold " << pta_ind << endl;
170 std::vector<L1TMuonBarrelParams::LUT> phi_lut = l1tbmparams->phi_lut();
171 L1TMuonBarrelParams::LUT::const_iterator iter = phi_lut[
idx].find(address);
172 if ( iter != phi_lut[idx].
end() ) {
173 return (*iter).second;
176 cerr <<
"PhiLut::getDeltaPhi : can not find address " << address << endl;
187 return pair<unsigned short, unsigned short>(l1tbmparams->get_PHI_Assignment_nbits_Phi()
188 ,l1tbmparams->get_PHI_Assignment_nbits_PhiB());
198 unsigned short int nbit_phi = l1tbmparams->get_PHI_Assignment_nbits_Phi();
199 unsigned short int nbit_phib = l1tbmparams->get_PHI_Assignment_nbits_PhiB();
202 cout <<
"L1 barrel Track Finder Phi-Assignment look-up tables :" << endl;
203 cout <<
"======================================================" << endl;
205 cout <<
"Precision : " << endl;
206 cout <<
'\t' << setw(2) << nbit_phi <<
" bits are used for phi " << endl;
207 cout <<
'\t' << setw(2) << nbit_phib <<
" bits are used for phib " << endl;
213 if (
idx == 0 )
cout <<
"Phi-Assignment Method : " <<
"PHI12" << endl;
214 if (
idx == 1 )
cout <<
"Phi-Assignment Method : " <<
"PHI42" << endl;
215 cout <<
"=============================" << endl;
219 for (
int i = 0;
i < nbit_phib;
i++ )
cout <<
' ';
220 cout <<
" value" << endl;
221 for (
int i = 0;
i < nbit_phi + nbit_phib;
i++ )
cout <<
'-';
222 cout <<
"----------------------" << endl;
223 std::vector<L1TMuonBarrelParams::LUT> phi_lut = l1tbmparams->phi_lut();
225 L1TMuonBarrelParams::LUT::const_iterator iter = phi_lut[
idx].begin();
226 while ( iter != phi_lut[
idx].
end() ) {
227 int address = (*iter).first;
228 int value = (*iter).second;
236 cout.setf(ios::right,ios::adjustfield);
237 cout <<
" " << setbase(10) << setw(5) << address <<
" (";
238 for (
int i = nbit_phib-1;
i >= 0;
i-- )
cout << b_address[
i];
239 cout <<
") " << setw(5) << value <<
" (";
240 for (
int i = nbit_phi-1;
i >= 0;
i-- )
cout << b_value[
i];
241 cout <<
") " << endl;
259 std::vector<L1TMuonBarrelParams::LUTParams::extLUT> ext_lut = l1tbmparams->ext_lut();
260 L1TMuonBarrelParams::LUT::const_iterator iter = ext_lut[ext_ind].low.find(address);
261 if ( iter != ext_lut[ext_ind].low.end() ) {
262 return (*iter).second;
265 cerr <<
"ExtLut::getLow : can not find address " << address << endl;
276 std::vector<L1TMuonBarrelParams::LUTParams::extLUT> ext_lut = l1tbmparams->ext_lut();
277 L1TMuonBarrelParams::LUT::const_iterator iter = ext_lut[ext_ind].high.find(address);
278 if ( iter != ext_lut[ext_ind].high.end() ) {
279 return (*iter).second;
282 cerr <<
"ExtLut::getHigh : can not find address " << address << endl;
292 unsigned short int nbit_phi = l1tbmparams->get_PHI_Assignment_nbits_Phi();
293 unsigned short int nbit_phib = l1tbmparams->get_PHI_Assignment_nbits_PhiB();
295 cout <<
"L1 barrel Track Finder Extrapolation look-up tables :" << endl;
296 cout <<
"=====================================================" << endl;
298 cout <<
"Precision : " << endl;
299 cout <<
'\t' << setw(2) << nbit_phi <<
" bits are used for phi " << endl;
300 cout <<
'\t' << setw(2) << nbit_phib <<
" bits are used for phib " << endl;
307 cout <<
"====================" << endl;
311 for (
int i = 0;
i < nbit_phib;
i++ )
cout <<
' ';
312 cout <<
" low-value";
313 for (
int i = 0;
i < nbit_phi;
i++ )
cout <<
' ';
314 cout <<
" high-value " << endl;
315 for (
int i = 0;
i < 2*nbit_phi + nbit_phib;
i++ )
cout <<
'-';
316 cout <<
"---------------------------------" << endl;
317 std::vector<L1TMuonBarrelParams::LUTParams::extLUT> ext_lut = l1tbmparams->ext_lut();
318 L1TMuonBarrelParams::LUT::const_iterator iter = ext_lut[ext].low.begin();
319 L1TMuonBarrelParams::LUT::const_iterator iter1;
320 while ( iter != ext_lut[ext].low.end() ) {
321 int address = (*iter).first;
322 int low = (*iter).second;
323 iter1 = ext_lut[ext].high.find(address);
324 int high = (*iter1).second;
334 cout.setf(ios::right,ios::adjustfield);
335 cout <<
" " << setbase(10) << setw(5) << address <<
" (";
336 for (
int i = nbit_phib-1;
i >= 0;
i-- )
cout << b_address[
i];
337 cout <<
") " << setw(5) << low <<
" (";
338 for (
int i = nbit_phi-1;
i >= 0;
i-- )
cout << b_low[
i];
339 cout <<
") " << setw(5) << high <<
" (";
340 for (
int i = nbit_phi-1;
i >= 0;
i-- )
cout << b_high[
i];
341 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