CMS 3D CMS Logo

Public Types | Public Member Functions | Private Attributes

L1MuDTEtaPatternLut Class Reference

#include <L1MuDTEtaPatternLut.h>

List of all members.

Public Types

typedef LUT::const_iterator ETFLut_iter
typedef LUT::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::const_iterator L1MuDTEtaPatternLut::ETFLut_iter

Definition at line 44 of file L1MuDTEtaPatternLut.h.

typedef LUT::iterator L1MuDTEtaPatternLut::ETFLut_Iter

Definition at line 45 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.

                                         {

  //  if ( load() != 0 ) {
  //    cout << "Can not open files to load eta track finder look-up tables for DTTrackFinder!" << endl;
  //  }

  //  if ( L1MuDTTFConfig::Debug(6) ) print();

}
L1MuDTEtaPatternLut::~L1MuDTEtaPatternLut ( ) [virtual]

destructor

Definition at line 63 of file L1MuDTEtaPatternLut.cc.

                                          {

  m_lut.clear();

}

Member Function Documentation

ETFLut_iter L1MuDTEtaPatternLut::begin ( void  ) const [inline]

return iterator which points to the first entry of the LUT

Definition at line 69 of file L1MuDTEtaPatternLut.h.

References m_lut.

{ return m_lut.begin(); }
ETFLut_iter L1MuDTEtaPatternLut::end ( void  ) 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.

{ 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 benchmark_cfg::cerr.

                                                             {

  LUT::const_iterator it = m_lut.find(id);
  if ( it == m_lut.end() ) {
    cerr << "Error: L1MuDTEtaPatternLut: pattern not found : " << id << endl;
    //    return 0;
  }
  return (*it).second;  

}
int L1MuDTEtaPatternLut::load ( )

load pattern look-up table

Definition at line 87 of file L1MuDTEtaPatternLut.cc.

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

                              {

  // get directory name
  string defaultPath = "L1TriggerConfig/DTTrackFinder/parameters/";
  string eau_dir = "L1TriggerData/DTTrackFinder/Eau/";

  // assemble file name
  edm::FileInPath lut_f = edm::FileInPath(string(defaultPath + eau_dir + "ETFPatternList.lut"));
  string etf_file = lut_f.fullPath();

  // open file
  L1TriggerLutFile file(etf_file);
  if ( file.open() != 0 ) return -1;
  //  if ( L1MuDTTFConfig::Debug(1) ) cout << "Reading file : " 
  //                                       << file.getName() << endl; 

  // ignore comment lines 
  file.ignoreLines(16);
 
  // read patterns
  while ( file.good() ) {

    int id     = file.readInteger();
    if ( !file.good() ) break;
    string pat = file.readString();
    if ( !file.good() ) break;
    int qual   = file.readInteger();
    if ( !file.good() ) break;
    int eta    = file.readInteger();
    if ( !file.good() ) break;
    L1MuDTEtaPattern pattern(id,pat,eta,qual);
      
    m_lut[pattern.id()] = pattern;

    if ( !file.good() ) { file.close(); break; }
    
  }

  file.close();
    
  return 0;

}
void L1MuDTEtaPatternLut::print ( void  ) const

print pattern look-up table

Definition at line 135 of file L1MuDTEtaPatternLut.cc.

References gather_cfg::cout.

                                      {

  cout << endl;
  cout << "L1 barrel Track Finder ETA Pattern look-up table :" << endl;
  cout << "==================================================" << endl;
  cout << endl;

  cout << "ETF Patterns : " <<  m_lut.size() << endl;
  cout << "======================" << endl;
  cout << endl;

  LUT::const_iterator iter = m_lut.begin();
  while ( iter != m_lut.end() ) {
    cout << (*iter).second << endl;
    iter++;
  }

  cout << endl;

}
void L1MuDTEtaPatternLut::reset ( void  )

reset pattern look-up table

Definition at line 77 of file L1MuDTEtaPatternLut.cc.

                                {

  m_lut.clear();

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

return number of entries in the LUT

Definition at line 66 of file L1MuDTEtaPatternLut.h.

References m_lut.

{ return m_lut.size(); }

Member Data Documentation

Definition at line 76 of file L1MuDTEtaPatternLut.h.

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