70 vector<LUT>::iterator iter;
71 for ( iter = phi_lut.begin(); iter != phi_lut.end(); iter++ ) {
100 string defaultPath =
"L1TriggerConfig/DTTrackFinder/parameters/";
101 string phi_dir =
"L1TriggerData/DTTrackFinder/Ass/";
107 int sh_phi = 12 - nbit_phi;
108 int sh_phib = 10 - nbit_phib;
111 for (
int idx = 0; idx < 2; idx++ ) {
113 case 0 : { phi_str =
"phi12";
break; }
114 case 1 : { phi_str =
"phi42";
break; }
123 if ( file.
open() != 0 )
return -1;
130 int adr_old = -512 >> sh_phib;
134 while ( file.
good() ) {
141 if ( adr != adr_old ) {
142 tmplut.insert(make_pair( adr_old, ((sum_phi/number) >> sh_phi) ));
156 phi_lut.push_back(tmplut);
169 cout <<
"L1 barrel Track Finder Phi-Assignment look-up tables :" << endl;
170 cout <<
"======================================================" << endl;
172 cout <<
"Precision : " << endl;
173 cout <<
'\t' << setw(2) << nbit_phi <<
" bits are used for phi " << endl;
174 cout <<
'\t' << setw(2) << nbit_phib <<
" bits are used for phib " << endl;
177 for (
int idx = 0; idx < 2; idx++ ) {
180 if ( idx == 0 )
cout <<
"Phi-Assignment Method : " <<
"PHI12" << endl;
181 if ( idx == 1 )
cout <<
"Phi-Assignment Method : " <<
"PHI42" << endl;
182 cout <<
"=============================" << endl;
186 for (
int i = 0;
i < nbit_phib;
i++ )
cout <<
' ';
187 cout <<
" value" << endl;
188 for (
int i = 0;
i < nbit_phi + nbit_phib;
i++ )
cout <<
'-';
189 cout <<
"----------------------" << endl;
191 LUT::const_iterator iter = phi_lut[idx].begin();
192 while ( iter != phi_lut[idx].
end() ) {
194 int value = (*iter).second;
202 cout.setf(ios::right,ios::adjustfield);
203 cout <<
" " << setbase(10) << setw(5) << address <<
" (";
204 for (
int i = nbit_phib-1;
i >= 0;
i-- )
cout << b_address[
i];
205 cout <<
") " << setw(5) << value <<
" (";
206 for (
int i = nbit_phi-1;
i >= 0;
i-- )
cout << b_value[
i];
207 cout <<
") " << endl;
224 LUT::const_iterator iter = phi_lut[idx].find(address);
225 if ( iter != phi_lut[idx].
end() ) {
226 return (*iter).second;
229 cerr <<
"PhiLut::getDeltaPhi : can not find address " << address << endl;
252 return pair<unsigned short, unsigned short>(nbit_phi,nbit_phib);
DTTFBitArray< N > twoComplement() const
L1MuDTPhiLut()
constructor
bool good()
return status of file stream
std::map< short, short, std::less< short > > LUT
virtual ~L1MuDTPhiLut()
destructor
int getDeltaPhi(int idx, int address) const
get delta-phi for a given address (bend-angle)
void print() const
print phi-assignment look-up tables
int load()
load phi-assignment look-up tables
int readInteger()
read one integer from file
void setPrecision()
set precision for look-up tables
std::pair< unsigned short, unsigned short > getPrecision() const
get precision for look-up tables
std::string fullPath() const
void reset()
reset phi-assignment look-up tables