CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Classes | Public Types | Public Member Functions | Protected Member Functions | Protected Attributes | Friends
L1MuGMTLUT Class Reference

#include <L1MuGMTLUT.h>

Inheritance diagram for L1MuGMTLUT:
L1MuGMTLFCOUDeltaEtaLUT L1MuGMTLFDeltaEtaLUT L1MuGMTLFDisableHotLUT L1MuGMTLFEtaConvLUT L1MuGMTLFMatchQualLUT L1MuGMTLFMergeRankCombineLUT L1MuGMTLFMergeRankEtaPhiLUT L1MuGMTLFMergeRankEtaQLUT L1MuGMTLFMergeRankPtQLUT L1MuGMTLFOvlEtaConvLUT L1MuGMTLFPhiProEtaConvLUT L1MuGMTLFPhiProLUT L1MuGMTLFPtMixLUT L1MuGMTLFSortRankCombineLUT L1MuGMTLFSortRankEtaPhiLUT L1MuGMTLFSortRankEtaQLUT L1MuGMTLFSortRankPtQLUT L1MuGMTMIAUEtaConvLUT L1MuGMTMIAUEtaProLUT L1MuGMTMIAUPhiPro1LUT L1MuGMTMIAUPhiPro2LUT

Classes

class  PortDecoder
 

Public Types

typedef std::pair< std::string,
unsigned > 
port
 

Public Member Functions

 L1MuGMTLUT ()
 Init and Destruct. More...
 
 L1MuGMTLUT (const char *name, const std::vector< std::string > &instances, const std::vector< port > &in_widths, const std::vector< port > &out_widths, unsigned vme_addr_width=0, bool distrRAM=false)
 constructor with init More...
 
 L1MuGMTLUT (const char *name, const std::string &instances, const std::string &inputs, const std::string &outputs, unsigned vme_addr_width=0, bool distrRAM=false)
 
void Load (const char *path)
 I/O functions. More...
 
std::vector< unsigned > Lookup (int idx, const std::vector< unsigned > &address) const
 additional lookup function (std::vector -> vector) More...
 
std::vector< unsigned > Lookup (int idx, unsigned address) const
 additional lookup function (unsigned -> std::vector) More...
 
virtual unsigned LookupFunctionPacked (int idx, unsigned address) const
 
unsigned LookupPacked (int idx, unsigned) const
 
unsigned LookupPacked (int idx, const std::vector< unsigned > &address) const
 additional lookup function (std::vector -> unisgned) More...
 
void MakeSubClass (const char *fname="", const char *template_file_h="../interface/L1MuGMTLUT_SubClass.h_template", const char *template_file_cc="../interface/L1MuGMTLUT_SubClass.cc_template")
 Add Generate SubClass method. More...
 
std::string Name ()
 
int numberOfInstances ()
 get the number of Instances More...
 
void Save (const char *path)
 save to LUT file More...
 
virtual ~L1MuGMTLUT ()
 destructor More...
 

Protected Member Functions

void Init (const char *name, const std::vector< std::string > &instances, const std::vector< port > &in_widths, const std::vector< port > &out_widths, unsigned vme_addr_width=0, bool distrRAM=false)
 Initialize the LUT. More...
 
void Set (int idx, unsigned address, unsigned value)
 set with single address and value More...
 
std::vector< unsigned > u2vec (unsigned value, const std::vector< port > &widths) const
 generate composite address or value from compact unsigned More...
 
unsigned vec2u (const std::vector< unsigned > &vec, const std::vector< port > &widths) const
 generate address or value from composite address or value More...
 

Protected Attributes

std::vector< std::vector
< unsigned > > 
m_Contents
 
bool m_distrRAM
 
unsigned m_GeneralLUTVersion
 
bool m_initialized
 
std::vector< portm_Inputs
 
std::vector< std::string > m_InstNames
 
std::string m_name
 
int m_NLUTS
 
std::vector< portm_Outputs
 
bool m_saveFlag
 
unsigned m_TotalInWidth
 
unsigned m_TotalOutWidth
 
bool m_UseLookupFunction
 
unsigned m_vme_addr_width
 

Friends

class L1MuGMTLUTConverter
 

Detailed Description

Description: A general-purpose Look-Up-Table Class

Base class for all LUTs in the Global Muon Trigger Simulation

INPUTS OUTPUTS


| | | |– Y(1) eta(6) –| | 1 8..13 | | phi(8) –| | 0..7 | |– X(1)

| | 0

std::vector<unsigned> inp; inp [0] = phi inp [1] = eta

std::vector<unsigned> out = MyLUT.Lookup (lutidx, inp); X = out[0]; Y = out[1];

Definition at line 75 of file L1MuGMTLUT.h.

Member Typedef Documentation

typedef std::pair<std::string, unsigned> L1MuGMTLUT::port

Definition at line 78 of file L1MuGMTLUT.h.

Constructor & Destructor Documentation

L1MuGMTLUT::L1MuGMTLUT ( )
inline

Init and Destruct.

default constructor w/o init

Definition at line 83 of file L1MuGMTLUT.h.

L1MuGMTLUT::L1MuGMTLUT ( const char *  name,
const std::vector< std::string > &  instances,
const std::vector< port > &  in_widths,
const std::vector< port > &  out_widths,
unsigned  vme_addr_width = 0,
bool  distrRAM = false 
)
inline

constructor with init

Definition at line 86 of file L1MuGMTLUT.h.

L1MuGMTLUT::L1MuGMTLUT ( const char *  name,
const std::string &  instances,
const std::string &  inputs,
const std::string &  outputs,
unsigned  vme_addr_width = 0,
bool  distrRAM = false 
)
inline

Definition at line 94 of file L1MuGMTLUT.h.

L1MuGMTLUT::~L1MuGMTLUT ( )
virtual

destructor

Definition at line 35 of file L1MuGMTLUT.cc.

Member Function Documentation

void L1MuGMTLUT::Init ( const char *  name,
const std::vector< std::string > &  instances,
const std::vector< port > &  in_widths,
const std::vector< port > &  out_widths,
unsigned  vme_addr_width = 0,
bool  distrRAM = false 
)
protected

Initialize the LUT.

Definition at line 47 of file L1MuGMTLUT.cc.

void L1MuGMTLUT::Load ( const char *  path)

I/O functions.

load from LUT file

Definition at line 194 of file L1MuGMTLUT.cc.

std::vector<unsigned> L1MuGMTLUT::Lookup ( int  idx,
const std::vector< unsigned > &  address 
) const
inline
std::vector<unsigned> L1MuGMTLUT::Lookup ( int  idx,
unsigned  address 
) const
inline

additional lookup function (unsigned -> std::vector)

Definition at line 119 of file L1MuGMTLUT.h.

virtual unsigned L1MuGMTLUT::LookupFunctionPacked ( int  idx,
unsigned  address 
) const
inlinevirtual
unsigned L1MuGMTLUT::LookupPacked ( int  idx,
unsigned  address 
) const
inline
unsigned L1MuGMTLUT::LookupPacked ( int  idx,
const std::vector< unsigned > &  address 
) const
inline

additional lookup function (std::vector -> unisgned)

Definition at line 111 of file L1MuGMTLUT.h.

void L1MuGMTLUT::MakeSubClass ( const char *  fname = "",
const char *  template_file_h = "../interface/L1MuGMTLUT_SubClass.h_template",
const char *  template_file_cc = "../interface/L1MuGMTLUT_SubClass.cc_template" 
)

Add Generate SubClass method.

Definition at line 326 of file L1MuGMTLUT.cc.

std::string L1MuGMTLUT::Name ( )
inline

Definition at line 140 of file L1MuGMTLUT.h.

int L1MuGMTLUT::numberOfInstances ( )
inline

get the number of Instances

Definition at line 145 of file L1MuGMTLUT.h.

void L1MuGMTLUT::Save ( const char *  path)

save to LUT file

Definition at line 77 of file L1MuGMTLUT.cc.

void L1MuGMTLUT::Set ( int  idx,
unsigned  address,
unsigned  value 
)
protected

set with single address and value

Definition at line 171 of file L1MuGMTLUT.cc.

std::vector< unsigned > L1MuGMTLUT::u2vec ( unsigned  value,
const std::vector< port > &  widths 
) const
inlineprotected
unsigned L1MuGMTLUT::vec2u ( const std::vector< unsigned > &  vec,
const std::vector< port > &  widths 
) const
inlineprotected

generate address or value from composite address or value

Definition at line 214 of file L1MuGMTLUT.h.

Friends And Related Function Documentation

friend class L1MuGMTLUTConverter
friend

Definition at line 140 of file L1MuGMTLUT.h.

Member Data Documentation

std::vector<std::vector <unsigned> > L1MuGMTLUT::m_Contents
protected

Definition at line 200 of file L1MuGMTLUT.h.

bool L1MuGMTLUT::m_distrRAM
protected

Definition at line 206 of file L1MuGMTLUT.h.

unsigned L1MuGMTLUT::m_GeneralLUTVersion
protected

Definition at line 209 of file L1MuGMTLUT.h.

Referenced by L1MuGMTLFMergeRankEtaQLUT::TheLookupFunction().

bool L1MuGMTLUT::m_initialized
protected

Definition at line 196 of file L1MuGMTLUT.h.

std::vector<port> L1MuGMTLUT::m_Inputs
protected
std::vector<std::string> L1MuGMTLUT::m_InstNames
protected

Definition at line 199 of file L1MuGMTLUT.h.

std::string L1MuGMTLUT::m_name
protected

Definition at line 207 of file L1MuGMTLUT.h.

int L1MuGMTLUT::m_NLUTS
protected

Definition at line 197 of file L1MuGMTLUT.h.

std::vector<port> L1MuGMTLUT::m_Outputs
protected

Definition at line 202 of file L1MuGMTLUT.h.

bool L1MuGMTLUT::m_saveFlag
protected
unsigned L1MuGMTLUT::m_TotalInWidth
protected

Definition at line 203 of file L1MuGMTLUT.h.

unsigned L1MuGMTLUT::m_TotalOutWidth
protected

Definition at line 204 of file L1MuGMTLUT.h.

bool L1MuGMTLUT::m_UseLookupFunction
protected

Definition at line 198 of file L1MuGMTLUT.h.

unsigned L1MuGMTLUT::m_vme_addr_width
protected

Definition at line 205 of file L1MuGMTLUT.h.