CMS 3D CMS Logo

L1MuDTEtaPatternLut Class Reference

Look-up table for eta track finder. More...

#include <CondFormats/L1TObjects/interface/L1MuDTEtaPatternLut.h>

List of all members.

Public Types

typedef LUT::iterator ETFLut_Iter
typedef LUT::const_iterator ETFLut_iter
typedef std::map< short,
L1MuDTEtaPattern, std::less
< short > > 
LUT

Public Member Functions

ETFLut_iter begin () const
 return iterator which points to the first entry of the LUT
ETFLut_iter end () const
 return iterator which points to the one-past-last entry of the LUT
L1MuDTEtaPattern getPattern (int id) const
 get pattern with a given ID
 L1MuDTEtaPatternLut ()
 constructor
int load ()
 load pattern look-up table
void print () const
 print pattern look-up table
void reset ()
 reset pattern look-up table
int size () const
 return number of entries in the LUT
virtual ~L1MuDTEtaPatternLut ()
 destructor

Private Attributes

LUT m_lut


Detailed Description

Look-up table for eta track finder.

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

N. Neumeister CERN EP

Definition at line 39 of file L1MuDTEtaPatternLut.h.


Member Typedef Documentation

typedef LUT::iterator L1MuDTEtaPatternLut::ETFLut_Iter

Definition at line 45 of file L1MuDTEtaPatternLut.h.

typedef LUT::const_iterator L1MuDTEtaPatternLut::ETFLut_iter

Definition at line 44 of file L1MuDTEtaPatternLut.h.

typedef std::map<short, L1MuDTEtaPattern, std::less<short> > L1MuDTEtaPatternLut::LUT

Definition at line 43 of file L1MuDTEtaPatternLut.h.


Constructor & Destructor Documentation

L1MuDTEtaPatternLut::L1MuDTEtaPatternLut (  ) 

constructor

Definition at line 48 of file L1MuDTEtaPatternLut.cc.

00048                                          {
00049 
00050   //  if ( load() != 0 ) {
00051   //    cout << "Can not open files to load eta track finder look-up tables for DTTrackFinder!" << endl;
00052   //  }
00053 
00054   //  if ( L1MuDTTFConfig::Debug(6) ) print();
00055 
00056 }

L1MuDTEtaPatternLut::~L1MuDTEtaPatternLut (  )  [virtual]

destructor

Definition at line 63 of file L1MuDTEtaPatternLut.cc.

References m_lut.

00063                                           {
00064 
00065   m_lut.clear();
00066 
00067 }


Member Function Documentation

ETFLut_iter L1MuDTEtaPatternLut::begin (  )  const [inline]

return iterator which points to the first entry of the LUT

Definition at line 69 of file L1MuDTEtaPatternLut.h.

References m_lut.

00069 { return m_lut.begin(); }

ETFLut_iter L1MuDTEtaPatternLut::end (  )  const [inline]

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

Definition at line 72 of file L1MuDTEtaPatternLut.h.

References m_lut.

00072 { return m_lut.end(); }

L1MuDTEtaPattern L1MuDTEtaPatternLut::getPattern ( int  id  )  const

get pattern with a given ID

Definition at line 160 of file L1MuDTEtaPatternLut.cc.

References TestMuL1L2Filter_cff::cerr, lat::endl(), it, and m_lut.

00160                                                              {
00161 
00162   LUT::const_iterator it = m_lut.find(id);
00163   if ( it == m_lut.end() ) {
00164     cerr << "Error: L1MuDTEtaPatternLut: pattern not found : " << id << endl;
00165     //    return 0;
00166   }
00167   return (*it).second;  
00168 
00169 }

int L1MuDTEtaPatternLut::load (  ) 

load pattern look-up table

Definition at line 87 of file L1MuDTEtaPatternLut.cc.

References L1TriggerLutFile::close(), eta, file, edm::FileInPath::fullPath(), L1TriggerLutFile::good(), L1MuDTEtaPattern::id(), L1TriggerLutFile::ignoreLines(), m_lut, L1TriggerLutFile::open(), L1TriggerLutFile::readInteger(), and L1TriggerLutFile::readString().

00087                               {
00088 
00089   // get directory name
00090   string defaultPath = "L1TriggerConfig/DTTrackFinder/parameters/";
00091   string eau_dir = "L1TriggerData/DTTrackFinder/Eau/";
00092 
00093   // assemble file name
00094   edm::FileInPath lut_f = edm::FileInPath(string(defaultPath + eau_dir + "ETFPatternList.lut"));
00095   string etf_file = lut_f.fullPath();
00096 
00097   // open file
00098   L1TriggerLutFile file(etf_file);
00099   if ( file.open() != 0 ) return -1;
00100   //  if ( L1MuDTTFConfig::Debug(1) ) cout << "Reading file : " 
00101   //                                       << file.getName() << endl; 
00102 
00103   // ignore comment lines 
00104   file.ignoreLines(16);
00105  
00106   // read patterns
00107   while ( file.good() ) {
00108 
00109     int id     = file.readInteger();
00110     if ( !file.good() ) break;
00111     string pat = file.readString();
00112     if ( !file.good() ) break;
00113     int qual   = file.readInteger();
00114     if ( !file.good() ) break;
00115     int eta    = file.readInteger();
00116     if ( !file.good() ) break;
00117     L1MuDTEtaPattern pattern(id,pat,eta,qual);
00118       
00119     m_lut[pattern.id()] = pattern;
00120 
00121     if ( !file.good() ) { file.close(); break; }
00122     
00123   }
00124 
00125   file.close();
00126     
00127   return 0;
00128 
00129 }

void L1MuDTEtaPatternLut::print ( void   )  const

print pattern look-up table

Definition at line 135 of file L1MuDTEtaPatternLut.cc.

References GenMuonPlsPt100GeV_cfg::cout, lat::endl(), iter, and m_lut.

00135                                       {
00136 
00137   cout << endl;
00138   cout << "L1 barrel Track Finder ETA Pattern look-up table :" << endl;
00139   cout << "==================================================" << endl;
00140   cout << endl;
00141 
00142   cout << "ETF Patterns : " <<  m_lut.size() << endl;
00143   cout << "======================" << endl;
00144   cout << endl;
00145 
00146   LUT::const_iterator iter = m_lut.begin();
00147   while ( iter != m_lut.end() ) {
00148     cout << (*iter).second << endl;
00149     iter++;
00150   }
00151 
00152   cout << endl;
00153 
00154 }

void L1MuDTEtaPatternLut::reset ( void   ) 

reset pattern look-up table

Definition at line 77 of file L1MuDTEtaPatternLut.cc.

References m_lut.

00077                                 {
00078 
00079   m_lut.clear();
00080 
00081 }

int L1MuDTEtaPatternLut::size ( void   )  const [inline]

return number of entries in the LUT

Definition at line 66 of file L1MuDTEtaPatternLut.h.

References m_lut.

00066 { return m_lut.size(); }


Member Data Documentation

LUT L1MuDTEtaPatternLut::m_lut [private]

Definition at line 76 of file L1MuDTEtaPatternLut.h.

Referenced by begin(), end(), getPattern(), load(), print(), reset(), size(), and ~L1MuDTEtaPatternLut().


The documentation for this class was generated from the following files:
Generated on Tue Jun 9 18:26:48 2009 for CMSSW by  doxygen 1.5.4