91 string defaultPath =
"L1Trigger/";
92 string eau_dir =
"L1TMuon/data/bmtf_luts/LUTs_Ass/";
96 for (
int sp = 0; sp < 6; sp++ ) {
98 emu_str=
"QualPatternList_SP"+std::to_string(sp+1);
106 if ( file.
open() != 0 )
return -1;
111 int skip2=getIgnoredLines(file);
115 while ( file.
good() ) {
118 if ( !file.
good() )
break;
120 if ( !file.
good() )
break;
122 if ( !file.
good() )
break;
124 vector<short> patternlist;
125 patternlist.reserve(num);
127 for (
int i = 0;
i <
num;
i++ ) {
129 patternlist.push_back(pattern);
132 m_lut[make_pair(sp+1,
id)] = make_pair(eta,patternlist);
134 if ( !file.
good() ) { file.
close();
break; }
152 cout <<
"L1 barrel Track Finder Qual Pattern look-up tables :" << endl;
153 cout <<
"====================================================" << endl;
158 LUT::const_iterator iter = m_lut.begin();
159 while ( iter != m_lut.end() ) {
160 int sp = (*iter).first.first;
163 cout <<
"Qualified Patterns for Sector Processor " << setw(1) << sp <<
" :" << endl;
164 cout <<
"===========================================" << endl;
168 cout << setw(2) << (*iter).first.second <<
" " 169 << setw(3) << (*iter).second.first <<
" " 170 << setw(5) << (*iter).second.second.size() <<
" : ";
171 const vector<short>& patternlist = (*iter).second.second;
172 vector<short>::const_iterator it;
173 for ( it = patternlist.begin(); it != patternlist.end(); it++ ) {
174 cout << setw(5) << (*it) <<
" ";
190 LUT::const_iterator it = m_lut.find(make_pair(sp,adr));
191 if ( it == m_lut.end() ) {
192 edm::LogError (
"L1MuBMTQualPatternLut") <<
"Error: L1MuBMTQualPatternLut: no coarse eta found for address " << adr << endl;
195 return (*it).second.first;
205 LUT::const_iterator it = m_lut.find(make_pair(sp,adr));
206 if ( it == m_lut.end() ) {
207 edm::LogError (
"L1MuBMTQualPatternLut") <<
"Error: L1MuBMTQualPatternLut: no pattern list found for address " << adr << endl;
209 return (*it).second.second;
214 if ( file.
open() != 0 )
return -1;
216 while ( file.
good() ) {
219 if (str.find(
"#")==0) skip+=1;
221 if ( !file.
good() ) { file.
close();
break; }
const std::vector< short > & getQualifiedPatterns(int sp, int adr) const
get list of qualified patterns for a given sector processor [1-6] and address [1-22] ...
int getCoarseEta(int sp, int adr) const
get coarse eta value for a given sector processor [1-6] and address [1-22]
int load()
load look-up tables
bool good()
return status of file stream
virtual ~L1MuBMTQualPatternLut()
destructor
void print() const
print look-up tables
void ignoreLines(int n)
read and ignore n lines from file
int getIgnoredLines(L1TriggerLutFile file) const
void reset()
reset look-up tables
std::string readString()
read one string from file
int readInteger()
read one integer from file
L1MuBMTQualPatternLut()
constructor
std::string fullPath() const