Belle II Software  release-05-01-25
LUT.h
1 //-----------------------------------------------------------------------------
2 // $Id$
3 //-----------------------------------------------------------------------------
4 // Filename : LUT.h
5 // Section : TRG CDC
6 // Owner : KyungTae KIM (K.U.)
7 // Email : ktkim@hep.korea.ac.kr
8 //-----------------------------------------------------------------------------
9 // Description : A class to use LUTs for TRGCDC
10 //-----------------------------------------------------------------------------
11 // $Log$
12 //-----------------------------------------------------------------------------
13 
14 #ifndef TRGCDCLUT_FLAG_
15 #define TRGCDCLUT_FLAG_
16 
17 #include <string>
18 #include <vector>
19 #include <map>
20 
21 #ifdef TRGCDC_SHORT_NAMES
22 #define TCLUT TRGCDCLUT
23 #endif
24 
25 namespace Belle2 {
31  class TRGCDCLUT {
33 
34  public:
35 
37  TRGCDCLUT();
38 
40  virtual ~TRGCDCLUT();
41 
42  public:
43 
45  std::string name(void) const;
46 
48  std::string version(void) const;
49 
51  void setDataFile(const std::string& filename, int);
52 
54  int getValue(unsigned) const;
55 
57  static std::map<std::string, TRGCDCLUT> dictionary;
58 
60  static TRGCDCLUT* getLUT(const std::string& filename, int);
61 
62  private:
63 
65  std::vector<int> m_data;
66 
68  int m_bitsize;
69 
71  std::string m_name;
72 
73  };
74 
75 //-----------------------------------------------------------------------------
76 
77  inline
78  std::string
79  TRGCDCLUT::name(void)const
80  {
81  return m_name;
82  }
83 
85 } // namespace Belle2
86 
87 #endif /* TRGCDCLUT_FLAG_ */
Belle2::TRGCDCLUT::m_data
std::vector< int > m_data
LUT data.
Definition: LUT.h:65
Belle2::TRGCDCLUT::~TRGCDCLUT
virtual ~TRGCDCLUT()
Destructor.
Definition: LUT.cc:44
Belle2::TRGCDCLUT::name
std::string name(void) const
returns name.
Definition: LUT.h:79
Belle2::TRGCDCLUT
A class to use LUTs for TRGCDC.
Definition: LUT.h:32
Belle2::TRGCDCLUT::getValue
int getValue(unsigned) const
get LUT Values
Definition: LUT.cc:48
Belle2::TRGCDCLUT::version
std::string version(void) const
returns version.
Definition: LUT.cc:34
Belle2::TRGCDCLUT::m_name
std::string m_name
LUT name.
Definition: LUT.h:71
Belle2
Abstract base class for different kinds of events.
Definition: MillepedeAlgorithm.h:19
Belle2::TRGCDCLUT::dictionary
static std::map< std::string, TRGCDCLUT > dictionary
list of LUTs, to avoid reading LUT data 2336 times
Definition: LUT.h:57
Belle2::TRGCDCLUT::TRGCDCLUT
TRGCDCLUT()
Contructor.
Definition: LUT.cc:39
Belle2::TRGCDCLUT::m_bitsize
int m_bitsize
Input bit size.
Definition: LUT.h:68
Belle2::TRGCDCLUT::setDataFile
void setDataFile(const std::string &filename, int)
set LUT data.
Definition: LUT.cc:58
Belle2::TRGCDCLUT::getLUT
static TRGCDCLUT * getLUT(const std::string &filename, int)
get LUT from dictionary, load new LUT if it doesn't exist
Definition: LUT.cc:84