CMS 3D CMS Logo

List of all members | Public Types | Public Member Functions | Public Attributes | Private Member Functions | Friends
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...
 

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 tables for eta matching unit (EMU) stores lists of qualified patterns and coarse eta values

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

N. Neumeister CERN EP

Definition at line 41 of file L1MuDTQualPatternLut.h.

Member Typedef Documentation

◆ EMULut_iter

typedef LUT::iterator L1MuDTQualPatternLut::EMULut_iter

Definition at line 46 of file L1MuDTQualPatternLut.h.

◆ LUT

Definition at line 45 of file L1MuDTQualPatternLut.h.

◆ LUTCONT

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

Definition at line 44 of file L1MuDTQualPatternLut.h.

◆ LUTID

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

Definition at line 43 of file L1MuDTQualPatternLut.h.

Constructor & Destructor Documentation

◆ L1MuDTQualPatternLut()

L1MuDTQualPatternLut::L1MuDTQualPatternLut ( )

constructor

Definition at line 50 of file L1MuDTQualPatternLut.cc.

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

◆ ~L1MuDTQualPatternLut()

L1MuDTQualPatternLut::~L1MuDTQualPatternLut ( )
virtual

destructor

Definition at line 62 of file L1MuDTQualPatternLut.cc.

62  {
63  LUT::iterator iter = m_lut.begin();
64  while (iter != m_lut.end()) {
65  (*iter).second.second.clear();
66  iter++;
67  }
68 
69  m_lut.clear();
70 }

Member Function Documentation

◆ begin()

EMULut_iter L1MuDTQualPatternLut::begin ( void  )
inline

return iterator which points to the first entry of the LUT

Definition at line 73 of file L1MuDTQualPatternLut.h.

References m_lut.

73 { return m_lut.begin(); }

◆ end()

EMULut_iter L1MuDTQualPatternLut::end ( void  )
inline

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

Definition at line 76 of file L1MuDTQualPatternLut.h.

References m_lut.

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

76 { return m_lut.end(); }

◆ getCoarseEta()

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 203 of file L1MuDTQualPatternLut.cc.

References DMR_cfg::cerr, and ALPAKA_ACCELERATOR_NAMESPACE::vertexFinder::it.

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

203  {
204  LUT::const_iterator it = m_lut.find(make_pair(sp, adr));
205  if (it == m_lut.end()) {
206  cerr << "Error: L1MuDTQualPatternLut: no coarse eta found for address " << adr << endl;
207  return 0;
208  }
209  return (*it).second.first;
210 }

◆ getQualifiedPatterns()

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 215 of file L1MuDTQualPatternLut.cc.

References DMR_cfg::cerr, and ALPAKA_ACCELERATOR_NAMESPACE::vertexFinder::it.

Referenced by L1MuDTEtaProcessor::runEtaMatchingUnit().

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

◆ load()

int L1MuDTQualPatternLut::load ( )

load look-up tables

Definition at line 84 of file L1MuDTQualPatternLut.cc.

References PVValHelper::eta, geometryDiff::file, edm::FileInPath::fullPath(), mps_fire::i, EgammaValidation_cff::num, and topSingleLeptonDQM_PU_cfi::pattern.

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

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

◆ print()

void L1MuDTQualPatternLut::print ( void  ) const

print look-up tables

Definition at line 168 of file L1MuDTQualPatternLut.cc.

References gather_cfg::cout, and ALPAKA_ACCELERATOR_NAMESPACE::vertexFinder::it.

168  {
169  cout << endl;
170  cout << "L1 barrel Track Finder Qual Pattern look-up tables :" << endl;
171  cout << "====================================================" << endl;
172  cout << endl;
173 
174  int spold = 0;
175 
176  LUT::const_iterator iter = m_lut.begin();
177  while (iter != m_lut.end()) {
178  int sp = (*iter).first.first;
179  if (sp != spold) {
180  cout << endl;
181  cout << "Qualified Patterns for Sector Processor " << setw(1) << sp << " :" << endl;
182  cout << "===========================================" << endl;
183  cout << endl;
184  spold = sp;
185  }
186  cout << setw(2) << (*iter).first.second << " " << setw(3) << (*iter).second.first << " " << setw(5)
187  << (*iter).second.second.size() << " : ";
188  const vector<short>& patternlist = (*iter).second.second;
189  vector<short>::const_iterator it;
190  for (it = patternlist.begin(); it != patternlist.end(); it++) {
191  cout << setw(5) << (*it) << " ";
192  }
193  cout << endl;
194  iter++;
195  }
196 
197  cout << endl;
198 }

◆ reset()

void L1MuDTQualPatternLut::reset ( void  )

reset look-up tables

Definition at line 79 of file L1MuDTQualPatternLut.cc.

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

79 { m_lut.clear(); }

◆ serialize()

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

◆ size()

int L1MuDTQualPatternLut::size ( void  ) const
inline

return number of entries in the LUT

Definition at line 70 of file L1MuDTQualPatternLut.h.

References m_lut.

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

70 { return m_lut.size(); }

Friends And Related Function Documentation

◆ boost::serialization::access

friend class boost::serialization::access
friend

Definition at line 81 of file L1MuDTQualPatternLut.h.

◆ cond::serialization::access

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

Definition at line 81 of file L1MuDTQualPatternLut.h.

Member Data Documentation

◆ m_lut

LUT L1MuDTQualPatternLut::m_lut

Definition at line 79 of file L1MuDTQualPatternLut.h.

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