13#ifndef TRGCDCJLUT_FLAG_
14#define TRGCDCJLUT_FLAG_
22#ifdef TRGCDC_SHORT_NAMES
23#define JLUT TRGCDCJLUT
54 std::string
name(
void)
const;
57 std::string
version(
void)
const;
60 void setData(
int inputBitsize,
int outputBitSize,
const std::string& filename,
bool twoscomplement = 0);
69 int lutInputBitwidth,
int lutOutputBitwidth);
75 void setBitsize(
int inputBitsize,
int outputBitsize);
114 void makeCOE(
const std::string& fileName =
"");
120 std::string
operate(std::string out, std::string in, std::map<std::string, std::map<std::string, double>* >& m_intStorage);
129 std::string
const lutVhdlCode(std::string
const& shiftOffsetInput)
const;
A class to use LUTs for TRGCDC.
double m_outputIntMax
The integer offset of the output for LUT.
bool m_write
VHDL write flag for signals. 1: Write is on. 0: Write is off.
int m_outputFlag
Flag for output. 0 is from function. 1 is from LUT file.
TRGCDCJSignal m_shiftOffsetOutputMax
The maximum output value that is bit shifted.
double m_toReal
The factor to change integer to float value.
TRGCDCJSignal m_shiftOutputMin
The minimum output signal that is bit shifted.
void operateNoOffset(TRGCDCJSignal const &in, TRGCDCJSignal &out) const
Output is LUT Out + offset. Input is non offset input.
std::function< int(int)> m_function
LUT function.
double m_outputOffset
The float offset of the output for LUT.
int m_inputShiftBits
The number of bits to shift to make input the wanted bit width.
TRGCDCJSignal m_inputMin
The minimum input signal.
std::string m_fileName
LUT filename.
double m_outputType
The output type of the LUT. (Will be deprecated.)
int m_inputBitsize
input bitsize. Number of bits.
std::vector< int > m_data
LUT data.
TRGCDCJSignal m_shiftOffsetInput
The bt shifted offset signal of input.
int m_outputBitsize
output bitsize. Number of bits.
std::function< double(double)> m_floatFunction
Float LUT function.
double m_inputOffset
Changing float function to int function variables.
std::vector< double > m_const
Storage for values used in function.
TRGCDCJSignal m_inputMax
The maximum input signal.
double m_inputToReal
The factor of the input integer to change to float value.
double m_outputNBitsWithOffset
The output bit width with offset. (Will be deprecated.)
A class to use Signals for TRGCDC 3D tracker.
virtual ~TRGCDCJLUT()
Destructor.
void setData(int inputBitsize, int outputBitSize, const std::string &filename, bool twoscomplement=0)
set LookUpTable(LUT) data.
void setOutputBitsize(int outputBitsize)
set output bitsize.
std::string version(void) const
returns version.
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.
double getFloatOutput(double) const
get output using float values.
void setBitsize(int inputBitsize, int outputBitsize)
set input & output bitsize.
std::function< int(int)> getFunction()
get LUT function using int values.
std::string getFileName() const
get LUT filename
void makeCOE(const std::string &fileName="")
make COE file.
void setFunction(std::function< int(int)> function)
set LUT function directly using int values.
int getInputBitsize() const
get input bitsize
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.)
int getOutputType() const
get output type.
std::string name(void) const
Operators.
int getOutput(int) const
get output using int values.
std::function< double(double)> getFloatFunction()
get LUT function using float values.
void dump()
Print variables for LUT.
void setOutputFlag(int outputFlag)
set output flag.
int getOutputBitsize() const
get output bitsize
std::string const lutVhdlCode(std::string const &shiftOffsetInput) const
Creates vhdlCode for lut.
void setInputBitsize(int inputBitsize)
set input bitsize.
int getOutputFlag() const
get output type.
Abstract base class for different kinds of events.