CMS 3D CMS Logo

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 40 of file L1MuDTEtaPatternLut.h.

Member Typedef Documentation

typedef LUT::const_iterator L1MuDTEtaPatternLut::ETFLut_iter

Definition at line 43 of file L1MuDTEtaPatternLut.h.

typedef LUT::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 42 of file L1MuDTEtaPatternLut.h.

Constructor & Destructor Documentation

L1MuDTEtaPatternLut::L1MuDTEtaPatternLut ( )

constructor

Definition at line 48 of file L1MuDTEtaPatternLut.cc.

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

destructor

Definition at line 60 of file L1MuDTEtaPatternLut.cc.

60 { 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 68 of file L1MuDTEtaPatternLut.h.

References m_lut.

Referenced by L1MuDTEtaProcessor::runEtaTrackFinder().

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

References m_lut.

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

71 { return m_lut.end(); }
L1MuDTEtaPattern L1MuDTEtaPatternLut::getPattern ( int  id) const

get pattern with a given ID

Definition at line 147 of file L1MuDTEtaPatternLut.cc.

References beam_dqm_sourceclient-live_cfg::cerr.

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

147  {
148  LUT::const_iterator it = m_lut.find(id);
149  if (it == m_lut.end()) {
150  cerr << "Error: L1MuDTEtaPatternLut: pattern not found : " << id << endl;
151  // return 0;
152  }
153  return (*it).second;
154 }
int L1MuDTEtaPatternLut::load ( )

load pattern look-up table

Definition at line 74 of file L1MuDTEtaPatternLut.cc.

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

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

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

print pattern look-up table

Definition at line 125 of file L1MuDTEtaPatternLut.cc.

References gather_cfg::cout.

Referenced by DTEtaPatternLutTester::analyze().

125  {
126  cout << endl;
127  cout << "L1 barrel Track Finder ETA Pattern look-up table :" << endl;
128  cout << "==================================================" << endl;
129  cout << endl;
130 
131  cout << "ETF Patterns : " << m_lut.size() << endl;
132  cout << "======================" << endl;
133  cout << endl;
134 
135  LUT::const_iterator iter = m_lut.begin();
136  while (iter != m_lut.end()) {
137  cout << (*iter).second << endl;
138  iter++;
139  }
140 
141  cout << endl;
142 }
void L1MuDTEtaPatternLut::reset ( void  )

reset pattern look-up table

Definition at line 69 of file L1MuDTEtaPatternLut.cc.

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

69 { m_lut.clear(); }
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 65 of file L1MuDTEtaPatternLut.h.

References m_lut.

Referenced by ntupleDataFormat._Collection::__iter__(), and ntupleDataFormat._Collection::__len__().

65 { return m_lut.size(); }

Friends And Related Function Documentation

friend class boost::serialization::access
friend

Definition at line 76 of file L1MuDTEtaPatternLut.h.

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

Definition at line 76 of file L1MuDTEtaPatternLut.h.

Member Data Documentation

LUT L1MuDTEtaPatternLut::m_lut

Definition at line 74 of file L1MuDTEtaPatternLut.h.

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