CMS 3D CMS Logo

CSCLUTReader.h
Go to the documentation of this file.
1 #ifndef L1Trigger_CSCTriggerPrimitives_CSCLUTReader
2 #define L1Trigger_CSCTriggerPrimitives_CSCLUTReader
3 
4 #include <fstream>
5 #include <sstream>
6 #include <bitset>
7 #include <iostream>
8 #include <vector>
9 #include <limits>
10 
13 
14 class CSCLUTReader {
15 public:
16  enum ReadCodes {
17  SUCCESS = 0,
23  };
24 
25  /* CSCLUTReader(); */
26  explicit CSCLUTReader(const std::string&);
28 
29  float lookup(int code) const;
30  float lookupPacked(const int input) const;
31 
32  // populates the map.
33  void initialize();
34 
35  unsigned checkedInput(unsigned in, unsigned maxWidth) const;
36 
37  // I/O functions
38  void save(std::ofstream& output);
39  int load(const std::string& inFileName);
40 
41  float data(unsigned int address) const;
42  int read(std::istream& stream);
43  void write(std::ostream& stream) const;
44 
45  unsigned int nrBitsAddress() const { return nrBitsAddress_; }
46  unsigned int nrBitsData() const { return nrBitsData_; }
47  //following the convention of vector::size()
48  unsigned int maxSize() const;
49  bool empty() const { return data_.empty(); }
50 
51 private:
53  int readHeader(std::istream&);
54 
55  unsigned int nrBitsAddress_; //technically redundant with addressMask
56  unsigned int nrBitsData_; //technically redundant with dataMask
57  unsigned int addressMask_;
58  unsigned int dataMask_;
59 
60  std::vector<float> data_;
61 
63  unsigned m_outWidth;
65 };
66 
67 #endif
input
static const std::string input
Definition: EdmProvDump.cc:48
CSCLUTReader::lookupPacked
float lookupPacked(const int input) const
Definition: CSCLUTReader.cc:52
CSCLUTReader::maxSize
unsigned int maxSize() const
Definition: CSCLUTReader.cc:142
CSCLUTReader::save
void save(std::ofstream &output)
Definition: CSCLUTReader.cc:22
convertSQLitetoXML_cfg.output
output
Definition: convertSQLitetoXML_cfg.py:72
CSCLUTReader::addressMask_
unsigned int addressMask_
Definition: CSCLUTReader.h:57
CSCLUTReader::initialize
void initialize()
Definition: CSCLUTReader.cc:61
CSCLUTReader::write
void write(std::ostream &stream) const
Definition: CSCLUTReader.cc:135
cms::cuda::stream
uint32_t const T *__restrict__ const uint32_t *__restrict__ int32_t int Histo::index_type cudaStream_t stream
Definition: HistoContainer.h:51
CSCLUTReader
Definition: CSCLUTReader.h:14
CSCLUTReader::data_
std::vector< float > data_
Definition: CSCLUTReader.h:60
CSCLUTReader::MISS_ENTRIES
Definition: CSCLUTReader.h:20
CSCLUTReader::readHeader
int readHeader(std::istream &)
Definition: CSCLUTReader.cc:146
CSCLUTReader::data
float data(unsigned int address) const
Definition: CSCLUTReader.cc:24
CSCLUTReader::MAX_ADDRESS_OUTOFRANGE
Definition: CSCLUTReader.h:21
CSCLUTReader::ReadCodes
ReadCodes
Definition: CSCLUTReader.h:16
CSCLUTReader::CSCLUTReader
CSCLUTReader(const std::string &)
Definition: CSCLUTReader.cc:5
CSCLUTReader::dataMask_
unsigned int dataMask_
Definition: CSCLUTReader.h:58
CSCLUTReader::m_initialized
bool m_initialized
Definition: CSCLUTReader.h:64
CSCLUTReader::DUP_ENTRIES
Definition: CSCLUTReader.h:19
CSCLUTReader::~CSCLUTReader
~CSCLUTReader()
Definition: CSCLUTReader.h:27
CSCLUTReader::lookup
float lookup(int code) const
Definition: CSCLUTReader.cc:43
CSCLUTReader::nrBitsAddress_
unsigned int nrBitsAddress_
Definition: CSCLUTReader.h:55
recoMuon::in
Definition: RecoMuonEnumerators.h:6
CSCLUTReader::read
int read(std::istream &stream)
Definition: CSCLUTReader.cc:79
CSCLUTReader::SUCCESS
Definition: CSCLUTReader.h:17
AlCaHLTBitMon_QueryRunRegistry.string
string string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
CSCLUTReader::m_outWidth
unsigned m_outWidth
Definition: CSCLUTReader.h:63
CSCLUTReader::nrBitsData
unsigned int nrBitsData() const
Definition: CSCLUTReader.h:46
CSCLUTReader::checkedInput
unsigned checkedInput(unsigned in, unsigned maxWidth) const
Definition: CSCLUTReader.cc:74
CSCLUTReader::NO_ENTRIES
Definition: CSCLUTReader.h:18
Frameworkfwd.h
CSCLUTReader::fname_
std::string fname_
Definition: CSCLUTReader.h:52
CSCLUTReader::nrBitsData_
unsigned int nrBitsData_
Definition: CSCLUTReader.h:56
SiStripMonitorCluster_cfi.maxWidth
maxWidth
Definition: SiStripMonitorCluster_cfi.py:143
CSCLUTReader::nrBitsAddress
unsigned int nrBitsAddress() const
Definition: CSCLUTReader.h:45
ParameterSet.h
CSCLUTReader::m_codeInWidth
int m_codeInWidth
Definition: CSCLUTReader.h:62
CSCLUTReader::NO_HEADER
Definition: CSCLUTReader.h:22
CSCLUTReader::load
int load(const std::string &inFileName)
Definition: CSCLUTReader.cc:28
CSCLUTReader::empty
bool empty() const
Definition: CSCLUTReader.h:49