CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Types | Public Member Functions | Private Attributes
L1MuDTQualPatternLut Class Reference

#include <L1MuDTQualPatternLut.h>

Public Types

typedef LUT::iterator EMULut_iter
 
typedef std::map< LUTID, LUTCONTLUT
 
typedef std::pair< short,
std::vector< short > > 
LUTCONT
 
typedef std::pair< short, short > LUTID
 

Public Member Functions

EMULut_iter begin ()
 return iterator which points to the first entry of the LUT More...
 
EMULut_iter end ()
 return iterator which points to the one-past-last entry of the LUT More...
 
int getCoarseEta (int sp, int adr) const
 get coarse eta value for a given sector processor [1-6] and address [1-22] More...
 
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] More...
 
 L1MuDTQualPatternLut ()
 constructor More...
 
int load ()
 load look-up tables More...
 
void print () const
 print look-up tables More...
 
void reset ()
 reset look-up tables More...
 
int size () const
 return number of entries in the LUT More...
 
virtual ~L1MuDTQualPatternLut ()
 destructor More...
 

Private Attributes

LUT m_lut
 

Detailed Description

Look-up tables for eta matching unit (EMU) stores lists of qualified patterns and coarse eta values

Date:
2008/04/09 15:22:31
Revision:
1.2

N. Neumeister CERN EP

Definition at line 41 of file L1MuDTQualPatternLut.h.

Member Typedef Documentation

typedef LUT::iterator L1MuDTQualPatternLut::EMULut_iter

Definition at line 48 of file L1MuDTQualPatternLut.h.

typedef std::map< LUTID, LUTCONT > L1MuDTQualPatternLut::LUT

Definition at line 47 of file L1MuDTQualPatternLut.h.

typedef std::pair< short, std::vector<short> > L1MuDTQualPatternLut::LUTCONT

Definition at line 46 of file L1MuDTQualPatternLut.h.

typedef std::pair< short, short > L1MuDTQualPatternLut::LUTID

Definition at line 45 of file L1MuDTQualPatternLut.h.

Constructor & Destructor Documentation

L1MuDTQualPatternLut::L1MuDTQualPatternLut ( )

constructor

Definition at line 50 of file L1MuDTQualPatternLut.cc.

50  {
51 
52  // if ( load() != 0 ) {
53  // cout << "Can not open files to load eta matching look-up tables for DTTrackFinder!" << endl;
54  // }
55 
56  // if ( L1MuDTTFConfig::Debug(6) ) print();
57 
58 }
L1MuDTQualPatternLut::~L1MuDTQualPatternLut ( )
virtual

destructor

Definition at line 65 of file L1MuDTQualPatternLut.cc.

65  {
66 
67  LUT::iterator iter = m_lut.begin();
68  while ( iter != m_lut.end() ) {
69  (*iter).second.second.clear();
70  iter++;
71  }
72 
73  m_lut.clear();
74 
75 }

Member Function Documentation

EMULut_iter L1MuDTQualPatternLut::begin ( void  )
inline

return iterator which points to the first entry of the LUT

Definition at line 75 of file L1MuDTQualPatternLut.h.

References m_lut.

75 { return m_lut.begin(); }
EMULut_iter L1MuDTQualPatternLut::end ( void  )
inline

return iterator which points to the one-past-last entry of the LUT

Definition at line 78 of file L1MuDTQualPatternLut.h.

References m_lut.

Referenced by Types.LuminosityBlockRange::cppID(), and Types.EventRange::cppID().

78 { return m_lut.end(); }
int L1MuDTQualPatternLut::getCoarseEta ( int  sp,
int  adr 
) const

get coarse eta value for a given sector processor [1-6] and address [1-22]

Definition at line 198 of file L1MuDTQualPatternLut.cc.

References dtNoiseDBValidation_cfg::cerr.

198  {
199 
200  LUT::const_iterator it = m_lut.find(make_pair(sp,adr));
201  if ( it == m_lut.end() ) {
202  cerr << "Error: L1MuDTQualPatternLut: no coarse eta found for address " << adr << endl;
203  return 0;
204  }
205  return (*it).second.first;
206 
207 }
const vector< short > & L1MuDTQualPatternLut::getQualifiedPatterns ( int  sp,
int  adr 
) const

get list of qualified patterns for a given sector processor [1-6] and address [1-22]

Definition at line 213 of file L1MuDTQualPatternLut.cc.

References dtNoiseDBValidation_cfg::cerr.

213  {
214 
215  LUT::const_iterator it = m_lut.find(make_pair(sp,adr));
216  if ( it == m_lut.end() ) {
217  cerr << "Error: L1MuDTQualPatternLut: no pattern list found for address " << adr << endl;
218  }
219  return (*it).second.second;
220 
221 }
int L1MuDTQualPatternLut::load ( )

load look-up tables

Definition at line 95 of file L1MuDTQualPatternLut.cc.

References L1TriggerLutFile::close(), eta(), mergeVDriftHistosByStation::file, edm::FileInPath::fullPath(), L1TriggerLutFile::good(), i, L1TriggerLutFile::ignoreLines(), L1TriggerLutFile::open(), listBenchmarks::pattern, and L1TriggerLutFile::readInteger().

Referenced by MatrixToProcess.MatrixToProcess::getProcess(), and MatrixToProcess.MatrixToProcess::listAll().

95  {
96 
97  // get directory name
98  string defaultPath = "L1TriggerConfig/DTTrackFinder/parameters/";
99  string eau_dir = "L1TriggerData/DTTrackFinder/Eau/";
100  string emu_str = "";
101 
102  // loop over all sector processors
103  for ( int sp = 0; sp < 6; sp++ ) {
104  switch ( sp ) {
105  case 0 : { emu_str = "QualPatternList_SP1"; break; }
106  case 1 : { emu_str = "QualPatternList_SP2"; break; }
107  case 2 : { emu_str = "QualPatternList_SP3"; break; }
108  case 3 : { emu_str = "QualPatternList_SP4"; break; }
109  case 4 : { emu_str = "QualPatternList_SP5"; break; }
110  case 5 : { emu_str = "QualPatternList_SP6"; break; }
111  }
112 
113  // assemble file name
114  edm::FileInPath lut_f = edm::FileInPath(string(defaultPath + eau_dir + emu_str + ".lut"));
115  string emu_file = lut_f.fullPath();
116 
117  // open file
118  L1TriggerLutFile file(emu_file);
119  if ( file.open() != 0 ) return -1;
120  // if ( L1MuDTTFConfig::Debug(1) ) cout << "Reading file : "
121  // << file.getName() << endl;
122 
123  // ignore comment lines
124  file.ignoreLines(14);
125 
126  // read file
127  while ( file.good() ) {
128 
129  int id = file.readInteger();
130  if ( !file.good() ) break;
131  int eta = file.readInteger();
132  if ( !file.good() ) break;
133  int num = file.readInteger();
134  if ( !file.good() ) break;
135 
136  vector<short> patternlist;
137  for ( int i = 0; i < num; i++ ) {
138  int pattern = file.readInteger();
139  patternlist.push_back(pattern);
140  }
141 
142  m_lut[make_pair(sp+1,id)] = make_pair(eta,patternlist);
143 
144  if ( !file.good() ) { file.close(); break; }
145 
146  }
147 
148  file.close();
149  }
150 
151  return 0;
152 
153 }
int i
Definition: DBlmapReader.cc:9
T eta() const
long long int num
Definition: procUtils.cc:71
std::string fullPath() const
Definition: FileInPath.cc:171
void L1MuDTQualPatternLut::print ( void  ) const

print look-up tables

Definition at line 159 of file L1MuDTQualPatternLut.cc.

References gather_cfg::cout.

159  {
160 
161  cout << endl;
162  cout << "L1 barrel Track Finder Qual Pattern look-up tables :" << endl;
163  cout << "====================================================" << endl;
164  cout << endl;
165 
166  int spold = 0;
167 
168  LUT::const_iterator iter = m_lut.begin();
169  while ( iter != m_lut.end() ) {
170  int sp = (*iter).first.first;
171  if ( sp != spold ) {
172  cout << endl;
173  cout << "Qualified Patterns for Sector Processor " << setw(1) << sp << " :" << endl;
174  cout << "===========================================" << endl;
175  cout << endl;
176  spold = sp;
177  }
178  cout << setw(2) << (*iter).first.second << " "
179  << setw(3) << (*iter).second.first << " "
180  << setw(5) << (*iter).second.second.size() << " : ";
181  const vector<short>& patternlist = (*iter).second.second;
182  vector<short>::const_iterator it;
183  for ( it = patternlist.begin(); it != patternlist.end(); it++ ) {
184  cout << setw(5) << (*it) << " ";
185  }
186  cout << endl;
187  iter++;
188  }
189 
190  cout << endl;
191 
192 }
tuple cout
Definition: gather_cfg.py:121
void L1MuDTQualPatternLut::reset ( void  )

reset look-up tables

Definition at line 85 of file L1MuDTQualPatternLut.cc.

Referenced by MatrixReader.MatrixReader::__init__(), BeautifulSoup.BeautifulStoneSoup::__init__(), and MatrixReader.MatrixReader::showRaw().

85  {
86 
87  m_lut.clear();
88 
89 }
int L1MuDTQualPatternLut::size ( void  ) const
inline

return number of entries in the LUT

Definition at line 72 of file L1MuDTQualPatternLut.h.

References m_lut.

72 { return m_lut.size(); }

Member Data Documentation

LUT L1MuDTQualPatternLut::m_lut
private

Definition at line 82 of file L1MuDTQualPatternLut.h.

Referenced by begin(), end(), and size().