71 typedef vector<LUT>::iterator LI;
72 for ( LI iter = ext_lut.begin(); iter != ext_lut.end(); iter++ ) {
102 string defaultPath =
"L1TriggerConfig/DTTrackFinder/parameters/";
103 string ext_dir =
"L1TriggerData/DTTrackFinder/Ext/";
110 int sh_phi = 12 - nbit_phi;
111 int sh_phib = 10 - nbit_phib;
114 for (
int ext = 0; ext <
MAX_EXT; ext++ ) {
116 case EX12 : ext_str =
"ext12";
break;
117 case EX13 : ext_str =
"ext13";
break;
118 case EX14 : ext_str =
"ext14";
break;
119 case EX21 : ext_str =
"ext21";
break;
120 case EX23 : ext_str =
"ext23";
break;
121 case EX24 : ext_str =
"ext24";
break;
122 case EX34 : ext_str =
"ext34";
break;
123 case EX15 : ext_str =
"ext15";
break;
124 case EX16 : ext_str =
"ext16";
break;
125 case EX25 : ext_str =
"ext25";
break;
126 case EX26 : ext_str =
"ext26";
break;
127 case EX56 : ext_str =
"ext56";
break;
136 if ( file.
open() != 0 )
return -1;
143 int adr_old = -512 >> sh_phib;
148 while ( file.
good() ) {
156 if ( adr != adr_old ) {
158 tmplut.
low[adr_old] = sum_low >> sh_phi;
159 tmplut.
high[adr_old] = sum_high >> sh_phi;
168 if (number == 0) sum_low = low;
169 if (number == 0) sum_high = high;
175 ext_lut.push_back(tmplut);
188 cout <<
"L1 barrel Track Finder Extrapolation look-up tables :" << endl;
189 cout <<
"=====================================================" << endl;
191 cout <<
"Precision : " << endl;
192 cout <<
'\t' << setw(2) << nbit_phi <<
" bits are used for phi " << endl;
193 cout <<
'\t' << setw(2) << nbit_phib <<
" bits are used for phib " << endl;
196 for (
int ext = 0; ext <
MAX_EXT; ext++ ) {
200 cout <<
"====================" << endl;
204 for (
int i = 0;
i < nbit_phib;
i++ )
cout <<
' ';
205 cout <<
" low-value";
206 for (
int i = 0;
i < nbit_phi;
i++ )
cout <<
' ';
207 cout <<
" high-value " << endl;
208 for (
int i = 0;
i < 2*nbit_phi + nbit_phib;
i++ )
cout <<
'-';
209 cout <<
"---------------------------------" << endl;
211 LUT::LUTmap::const_iterator iter = ext_lut[ext].low.begin();
212 LUT::LUTmap::const_iterator iter1;
213 while ( iter != ext_lut[ext].low.end() ) {
215 int low = (*iter).second;
216 iter1 = ext_lut[ext].high.find(address);
217 int high = (*iter1).second;
227 cout.setf(ios::right,ios::adjustfield);
228 cout <<
" " << setbase(10) << setw(5) << address <<
" (";
229 for (
int i = nbit_phib-1;
i >= 0;
i-- )
cout << b_address[
i];
230 cout <<
") " << setw(5) << low <<
" (";
231 for (
int i = nbit_phi-1;
i >= 0;
i-- )
cout << b_low[
i];
232 cout <<
") " << setw(5) << high <<
" (";
233 for (
int i = nbit_phi-1;
i >= 0;
i-- )
cout << b_high[
i];
234 cout <<
") " << endl;
251 LUT::LUTmap::const_iterator iter = ext_lut[ext_ind].low.find(address);
252 if ( iter != ext_lut[ext_ind].low.end() ) {
253 return (*iter).second;
256 cerr <<
"ExtLut::getLow : can not find address " << address << endl;
267 LUT::LUTmap::const_iterator iter = ext_lut[ext_ind].high.find(address);
268 if ( iter != ext_lut[ext_ind].high.end() ) {
269 return (*iter).second;
272 cerr <<
"ExtLut::getHigh : can not find address " << address << endl;
DTTFBitArray< N > twoComplement() const
bool good()
return status of file stream
helper class for look-up tables
L1MuDTExtLut()
constructor
int load()
load extrapolation look-up tables
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
void print() const
print extrapolation look-up tables
void reset()
reset extrapolation look-up tables
void setPrecision()
set precision for look-up tables
int readInteger()
read one integer from file
virtual ~L1MuDTExtLut()
destructor
std::string fullPath() const