66 vector<LUT>::iterator iter;
67 for (iter = phi_lut.begin(); iter != phi_lut.end(); iter++) {
88 string defaultPath =
"L1TriggerConfig/DTTrackFinder/parameters/";
89 string phi_dir =
"L1TriggerData/DTTrackFinder/Ass/";
95 int sh_phi = 12 - nbit_phi;
96 int sh_phib = 10 - nbit_phib;
117 if (
file.open() != 0)
125 int adr_old = -512 >> sh_phib;
129 while (
file.good()) {
130 int adr = (
file.readInteger()) >> sh_phib;
131 int phi =
file.readInteger();
135 if (adr != adr_old) {
137 tmplut.insert(make_pair(adr_old, ((sum_phi /
number) >> sh_phi)));
151 phi_lut.push_back(tmplut);
161 cout <<
"L1 barrel Track Finder Phi-Assignment look-up tables :" << endl;
162 cout <<
"======================================================" << endl;
164 cout <<
"Precision : " << endl;
165 cout <<
'\t' << setw(2) << nbit_phi <<
" bits are used for phi " << endl;
166 cout <<
'\t' << setw(2) << nbit_phib <<
" bits are used for phib " << endl;
172 cout <<
"Phi-Assignment Method : " 175 cout <<
"Phi-Assignment Method : " 177 cout <<
"=============================" << endl;
181 for (
int i = 0;
i < nbit_phib;
i++)
183 cout <<
" value" << endl;
184 for (
int i = 0;
i < nbit_phi + nbit_phib;
i++)
186 cout <<
"----------------------" << endl;
188 LUT::const_iterator iter = phi_lut[
idx].begin();
189 while (iter != phi_lut[
idx].
end()) {
190 int address = (*iter).first;
191 int value = (*iter).second;
201 cout.setf(ios::right, ios::adjustfield);
202 cout <<
" " << setbase(10) << setw(5) << address <<
" (";
203 for (
int i = nbit_phib - 1;
i >= 0;
i--)
204 cout << b_address[
i];
205 cout <<
") " << setw(5) <<
value <<
" (";
206 for (
int i = nbit_phi - 1;
i >= 0;
i--)
208 cout <<
") " << endl;
221 LUT::const_iterator iter = phi_lut[
idx].find(address);
222 if (iter != phi_lut[
idx].
end()) {
223 return (*iter).second;
225 cerr <<
"PhiLut::getDeltaPhi : can not find address " << address << endl;
242 return pair<unsigned short, unsigned short>(nbit_phi, nbit_phib);
std::string fullPath() const
void print() const
print phi-assignment look-up tables
L1MuDTPhiLut()
constructor
int getDeltaPhi(int idx, int address) const
get delta-phi for a given address (bend-angle)
std::map< short, short, std::less< short > > LUT
virtual ~L1MuDTPhiLut()
destructor
std::pair< unsigned short, unsigned short > getPrecision() const
get precision for look-up tables
Abs< T >::type abs(const T &t)
int load()
load phi-assignment look-up tables
DTTFBitArray< N > twoComplement() const
void setPrecision()
set precision for look-up tables
void reset()
reset phi-assignment look-up tables