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 | Public Attributes | Private Member Functions | Friends
L1MuDTEtaPatternLut Class Reference

#include <L1MuDTEtaPatternLut.h>

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

Public Attributes

LUT m_lut
 

Private Member Functions

template<class Archive >
void serialize (Archive &ar, const unsigned int version)
 

Friends

class boost::serialization::access
 
template<typename CondSerializationT , typename Enabled >
struct cond::serialization::access
 

Detailed Description

Look-up table for eta track finder

Date:
2007/03/30 07:48:02
Revision:
1.1

N. Neumeister CERN EP

Definition at line 41 of file L1MuDTEtaPatternLut.h.

Member Typedef Documentation

typedef LUT::const_iterator L1MuDTEtaPatternLut::ETFLut_iter

Definition at line 46 of file L1MuDTEtaPatternLut.h.

typedef LUT::iterator L1MuDTEtaPatternLut::ETFLut_Iter

Definition at line 47 of file L1MuDTEtaPatternLut.h.

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

Definition at line 45 of file L1MuDTEtaPatternLut.h.

Constructor & Destructor Documentation

L1MuDTEtaPatternLut::L1MuDTEtaPatternLut ( )

constructor

Definition at line 48 of file L1MuDTEtaPatternLut.cc.

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

destructor

Definition at line 63 of file L1MuDTEtaPatternLut.cc.

63  {
64 
65  m_lut.clear();
66 
67 }

Member Function Documentation

ETFLut_iter L1MuDTEtaPatternLut::begin ( void  ) const
inline

return iterator which points to the first entry of the LUT

Definition at line 71 of file L1MuDTEtaPatternLut.h.

References m_lut.

Referenced by L1MuBMEtaProcessor::runEtaTrackFinder().

71 { 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 74 of file L1MuDTEtaPatternLut.h.

References m_lut.

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

74 { 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 ecal_dqm_sourceclient-live_cfg::cerr.

Referenced by L1MuBMEtaProcessor::assign(), L1MuBMEtaProcessor::print(), and L1MuBMEtaProcessor::runEtaMatchingUnit().

160  {
161 
162  LUT::const_iterator it = m_lut.find(id);
163  if ( it == m_lut.end() ) {
164  cerr << "Error: L1MuDTEtaPatternLut: pattern not found : " << id << endl;
165  // return 0;
166  }
167  return (*it).second;
168 
169 }
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().

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

87  {
88 
89  // get directory name
90  string defaultPath = "L1TriggerConfig/DTTrackFinder/parameters/";
91  string eau_dir = "L1TriggerData/DTTrackFinder/Eau/";
92 
93  // assemble file name
94  edm::FileInPath lut_f = edm::FileInPath(string(defaultPath + eau_dir + "ETFPatternList.lut"));
95  string etf_file = lut_f.fullPath();
96 
97  // open file
98  L1TriggerLutFile file(etf_file);
99  if ( file.open() != 0 ) return -1;
100  // if ( L1MuDTTFConfig::Debug(1) ) cout << "Reading file : "
101  // << file.getName() << endl;
102 
103  // ignore comment lines
104  file.ignoreLines(16);
105 
106  // read patterns
107  while ( file.good() ) {
108 
109  int id = file.readInteger();
110  if ( !file.good() ) break;
111  string pat = file.readString();
112  if ( !file.good() ) break;
113  int qual = file.readInteger();
114  if ( !file.good() ) break;
115  int eta = file.readInteger();
116  if ( !file.good() ) break;
117  L1MuDTEtaPattern pattern(id,pat,eta,qual);
118 
119  m_lut[pattern.id()] = pattern;
120 
121  if ( !file.good() ) { file.close(); break; }
122 
123  }
124 
125  file.close();
126 
127  return 0;
128 
129 }
std::string fullPath() const
Definition: FileInPath.cc:184
void L1MuDTEtaPatternLut::print ( void  ) const

print pattern look-up table

Definition at line 135 of file L1MuDTEtaPatternLut.cc.

References gather_cfg::cout.

135  {
136 
137  cout << endl;
138  cout << "L1 barrel Track Finder ETA Pattern look-up table :" << endl;
139  cout << "==================================================" << endl;
140  cout << endl;
141 
142  cout << "ETF Patterns : " << m_lut.size() << endl;
143  cout << "======================" << endl;
144  cout << endl;
145 
146  LUT::const_iterator iter = m_lut.begin();
147  while ( iter != m_lut.end() ) {
148  cout << (*iter).second << endl;
149  iter++;
150  }
151 
152  cout << endl;
153 
154 }
tuple cout
Definition: gather_cfg.py:145
void L1MuDTEtaPatternLut::reset ( void  )

reset pattern look-up table

Definition at line 77 of file L1MuDTEtaPatternLut.cc.

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

77  {
78 
79  m_lut.clear();
80 
81 }
template<class Archive >
void L1MuDTEtaPatternLut::serialize ( Archive &  ar,
const unsigned int  version 
)
private
int L1MuDTEtaPatternLut::size ( void  ) const
inline

return number of entries in the LUT

Definition at line 68 of file L1MuDTEtaPatternLut.h.

References m_lut.

68 { return m_lut.size(); }

Friends And Related Function Documentation

friend class boost::serialization::access
friend

Definition at line 81 of file L1MuDTEtaPatternLut.h.

template<typename CondSerializationT , typename Enabled >
friend struct cond::serialization::access
friend

Definition at line 81 of file L1MuDTEtaPatternLut.h.

Member Data Documentation

LUT L1MuDTEtaPatternLut::m_lut