test
CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
MicroGMTLUT.h
Go to the documentation of this file.
1 #ifndef __l1microgmtlut_h
2 #define __l1microgmtlut_h
3 
4 #include <iostream>
5 #include <fstream>
6 #include <sstream>
7 #include <bitset>
8 #include <vector>
9 
10 #include "../interface/MicroGMTConfiguration.h"
11 
12 namespace l1t {
13  class MicroGMTLUT {
14  public:
16  virtual ~MicroGMTLUT() {};
17 
18  // should be implemented in each daughter!
19  // This function is the minimum that should be provided
20  virtual int lookupPacked(int input) const;
21 
22  // populates the m_contents map.
23  void initialize();
24 
25  int checkedInput(unsigned in, unsigned maxWidth) const;
26 
27  // I/O functions
28  void save(std::ofstream& output);
29  void load(const std::string& inFileName);
30  // content to file
31  void contentsToStream(std::stringstream& stream);
32  void headerToStream(std::stringstream& stream) const;
33 
34  protected:
35  unsigned m_totalInWidth;
36  unsigned m_outWidth;
37  std::vector<MicroGMTConfiguration::input_t> m_inputs;
38  std::map<int, int> m_contents;
41  };
42 }
43 
44 #endif /* defined(__l1microgmtlut_h) */
unsigned m_totalInWidth
Definition: MicroGMTLUT.h:35
void contentsToStream(std::stringstream &stream)
Definition: MicroGMTLUT.cc:77
std::map< int, int > m_contents
Definition: MicroGMTLUT.h:38
virtual int lookupPacked(int input) const
Definition: MicroGMTLUT.cc:49
int checkedInput(unsigned in, unsigned maxWidth) const
Definition: MicroGMTLUT.cc:70
virtual ~MicroGMTLUT()
Definition: MicroGMTLUT.h:16
std::vector< MicroGMTConfiguration::input_t > m_inputs
Definition: MicroGMTLUT.h:37
static std::string const input
Definition: EdmProvDump.cc:43
std::string m_fname
Definition: MicroGMTLUT.h:39
void headerToStream(std::stringstream &stream) const
Definition: MicroGMTLUT.cc:92
void load(const std::string &inFileName)
Definition: MicroGMTLUT.cc:18
unsigned m_outWidth
Definition: MicroGMTLUT.h:36
void save(std::ofstream &output)
Definition: MicroGMTLUT.cc:8
volatile std::atomic< bool > shutdown_flag false