CMS 3D CMS Logo

List of all members | Public Types | Public Member Functions | Public Attributes | Private Member Functions | Friends
L1MuBMTEtaPatternLut Class Reference

#include <L1MuBMTEtaPatternLut.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...
 
int getIgnoredLines (L1TriggerLutFile file) const
 
L1MuDTEtaPattern getPattern (int id) const
 get pattern with a given ID More...
 
 L1MuBMTEtaPatternLut ()
 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 ~L1MuBMTEtaPatternLut ()
 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

Definition at line 41 of file L1MuBMTEtaPatternLut.h.

Member Typedef Documentation

◆ ETFLut_iter

typedef LUT::const_iterator L1MuBMTEtaPatternLut::ETFLut_iter

Definition at line 44 of file L1MuBMTEtaPatternLut.h.

◆ ETFLut_Iter

typedef LUT::iterator L1MuBMTEtaPatternLut::ETFLut_Iter

Definition at line 45 of file L1MuBMTEtaPatternLut.h.

◆ LUT

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

Definition at line 43 of file L1MuBMTEtaPatternLut.h.

Constructor & Destructor Documentation

◆ L1MuBMTEtaPatternLut()

L1MuBMTEtaPatternLut::L1MuBMTEtaPatternLut ( )

constructor

Definition at line 49 of file L1MuBMTEtaPatternLut.cc.

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 }

◆ ~L1MuBMTEtaPatternLut()

L1MuBMTEtaPatternLut::~L1MuBMTEtaPatternLut ( )
virtual

destructor

Definition at line 61 of file L1MuBMTEtaPatternLut.cc.

61 { m_lut.clear(); }

Member Function Documentation

◆ begin()

ETFLut_iter L1MuBMTEtaPatternLut::begin ( void  ) const
inline

return iterator which points to the first entry of the LUT

Definition at line 71 of file L1MuBMTEtaPatternLut.h.

References m_lut.

Referenced by L1MuBMEtaProcessor::runEtaTrackFinder().

71 { return m_lut.begin(); }

◆ end()

ETFLut_iter L1MuBMTEtaPatternLut::end ( void  ) const
inline

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

Definition at line 74 of file L1MuBMTEtaPatternLut.h.

References m_lut.

Referenced by L1MuBMEtaProcessor::runEtaTrackFinder().

74 { return m_lut.end(); }

◆ getIgnoredLines()

int L1MuBMTEtaPatternLut::getIgnoredLines ( L1TriggerLutFile  file) const

Definition at line 158 of file L1MuBMTEtaPatternLut.cc.

References geometryDiff::file, optionsL1T::skip, and str.

158  {
159  if (file.open() != 0)
160  return -1;
161  int skip = 0;
162  while (file.good()) {
163  string str = file.readString();
164  if (str.find('#') == 0)
165  skip += 1;
166  //cout<<"here "<<str<<" found "<<str.find("#")<<endl;
167  if (!file.good()) {
168  file.close();
169  break;
170  }
171  }
172  file.close();
173  return skip;
174 }
#define str(s)

◆ getPattern()

L1MuDTEtaPattern L1MuBMTEtaPatternLut::getPattern ( int  id) const

get pattern with a given ID

Definition at line 149 of file L1MuBMTEtaPatternLut.cc.

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

149  {
150  LUT::const_iterator it = m_lut.find(id);
151  if (it == m_lut.end()) {
152  edm::LogError("L1MuBMTEtaPatternLut: fine eta not found")
153  << "Error: L1MuBMTEtaPatternLut: pattern not found : " << id << endl;
154  }
155  return (*it).second;
156 }
Log< level::Error, false > LogError

◆ load()

int L1MuBMTEtaPatternLut::load ( )

load pattern look-up table

Definition at line 75 of file L1MuBMTEtaPatternLut.cc.

References PVValHelper::eta, geometryDiff::file, edm::FileInPath::fullPath(), topSingleLeptonDQM_PU_cfi::pattern, and l1tGTMenu_lepSeeds_cff::qual.

Referenced by L1TMuonBarrelParamsHelper::configFromPy().

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

◆ print()

void L1MuBMTEtaPatternLut::print ( void  ) const

print pattern look-up table

Definition at line 127 of file L1MuBMTEtaPatternLut.cc.

References gather_cfg::cout.

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

◆ reset()

void L1MuBMTEtaPatternLut::reset ( void  )

reset pattern look-up table

Definition at line 70 of file L1MuBMTEtaPatternLut.cc.

70 { m_lut.clear(); }

◆ serialize()

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

◆ size()

int L1MuBMTEtaPatternLut::size ( void  ) const
inline

return number of entries in the LUT

Definition at line 68 of file L1MuBMTEtaPatternLut.h.

References m_lut.

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

68 { return m_lut.size(); }

Friends And Related Function Documentation

◆ boost::serialization::access

friend class boost::serialization::access
friend

Definition at line 79 of file L1MuBMTEtaPatternLut.h.

◆ cond::serialization::access

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

Definition at line 79 of file L1MuBMTEtaPatternLut.h.

Member Data Documentation

◆ m_lut

LUT L1MuBMTEtaPatternLut::m_lut