Belle II Software  release-08-01-10
TRGCDCJLUT Class Reference

A class to use LUTs for TRGCDC. More...

#include <JLUT.h>

Collaboration diagram for TRGCDCJLUT:

Public Member Functions

 TRGCDCJLUT (const std::string &name="no_name")
 Contructor.
 
 TRGCDCJLUT (const TRGCDCJLUT &in)
 Copy constructor.
 
virtual ~TRGCDCJLUT ()
 Destructor.
 
std::string name (void) const
 Operators. More...
 
std::string version (void) const
 returns version.
 
void setData (int inputBitsize, int outputBitSize, const std::string &filename, bool twoscomplement=0)
 set LookUpTable(LUT) data.
 
void setFunction (std::function< int(int)> function)
 set LUT function directly using int values.
 
int setFloatFunction (std::function< double(double)> function, TRGCDCJSignal const &input, TRGCDCJSignal const &minInv, TRGCDCJSignal const &maxInv, double outputToReal, int lutInputBitwidth, int lutOutputBitwidth)
 set LUT function using JSignals.
 
void setOutputFlag (int outputFlag)
 set output flag.
 
void setBitsize (int inputBitsize, int outputBitsize)
 set input & output bitsize.
 
void setInputBitsize (int inputBitsize)
 set input bitsize.
 
void setOutputBitsize (int outputBitsize)
 set output bitsize.
 
std::string getFileName () const
 get LUT filename
 
int getInputBitsize () const
 get input bitsize
 
int getOutputBitsize () const
 get output bitsize
 
std::function< int(int)> getFunction ()
 get LUT function using int values.
 
std::function< double(double)> getFloatFunction ()
 get LUT function using float values.
 
int getOutputFlag () const
 get output type.
 
int getOutputType () const
 get output type.
 
int getOutput (int) const
 get output using int values.
 
double getFloatOutput (double) const
 get output using float values.
 
void dump ()
 Print variables for LUT.
 
void makeCOE (const std::string &fileName="")
 make COE file.
 
std::string operate (std::string out, std::string in, std::map< std::string, std::map< std::string, double > * > &m_intStorage)
 Operate on LUT. (Will be deprecated.)
 
TRGCDCJSignal const operate (const TRGCDCJSignal &in, TRGCDCJSignal &out)
 Returns LUT value. Out is LUT value + offset. (LUT value + offset do not obey addition bitsize rules.)
 
void operateNoOffset (TRGCDCJSignal const &in, TRGCDCJSignal &out) const
 Output is LUT Out + offset. Input is non offset input.
 
std::string const lutVhdlCode (std::string const &shiftOffsetInput) const
 Creates vhdlCode for lut.
 

Public Attributes

std::vector< double > m_const
 Storage for values used in function.
 

Private Attributes

std::string m_name
 Name.
 
std::vector< int > m_data
 LUT data.
 
std::string m_fileName
 LUT filename.
 
std::function< int(int)> m_function
 LUT function.
 
std::function< double(double)> m_floatFunction
 Float LUT function.
 
int m_outputFlag
 Flag for output. 0 is from function. 1 is from LUT file.
 
int m_inputBitsize
 input bitsize. Number of bits.
 
int m_outputBitsize
 output bitsize. Number of bits.
 
bool m_write
 VHDL write flag for signals. 1: Write is on. 0: Write is off.
 
double m_inputOffset
 Changing float function to int function variables.
 
double m_outputOffset
 The float offset of the output for LUT.
 
double m_outputIntMax
 The integer offset of the output for LUT.
 
double m_inputToReal
 The factor of the input integer to change to float value.
 
double m_toReal
 The factor to change integer to float value.
 
int m_inputShiftBits
 The number of bits to shift to make input the wanted bit width.
 
double m_outputType
 The output type of the LUT. (Will be deprecated.)
 
double m_outputNBitsWithOffset
 The output bit width with offset. (Will be deprecated.)
 
TRGCDCJSignal m_inputMin
 The minimum input signal.
 
TRGCDCJSignal m_inputMax
 The maximum input signal.
 
TRGCDCJSignal m_shiftOutputMin
 The minimum output signal that is bit shifted.
 
TRGCDCJSignal m_shiftOffsetOutputMax
 The maximum output value that is bit shifted.
 
TRGCDCJSignal m_shiftOffsetInput
 The bt shifted offset signal of input.
 

Detailed Description

A class to use LUTs for TRGCDC.

Definition at line 35 of file JLUT.h.


The documentation for this class was generated from the following files: