CMS 3D CMS Logo

List of all members | Public Types | Public Member Functions | Private Member Functions
L1MuGMTLFCOUDeltaEtaLUT Class Reference

#include <L1MuGMTLFCOUDeltaEtaLUT.h>

Inheritance diagram for L1MuGMTLFCOUDeltaEtaLUT:
L1MuGMTLUT

Public Types

enum  { DTCSC, CSCDT, CSCbRPC, DTfRPC }
 
- Public Types inherited from L1MuGMTLUT
typedef std::pair< std::string, unsigned > port
 

Public Member Functions

 L1MuGMTLFCOUDeltaEtaLUT ()
 constuctor using function-lookup More...
 
virtual unsigned LookupFunctionPacked (int idx, unsigned address) const
 access to lookup function with packed input and output More...
 
unsigned SpecificLookup (int idx, unsigned eta1, unsigned eta2) const
 specific lookup function for entire output field More...
 
unsigned SpecificLookup_delta_eta (int idx, unsigned eta1, unsigned eta2) const
 specific lookup function for delta_eta More...
 
virtual ~L1MuGMTLFCOUDeltaEtaLUT ()
 destructor More...
 
- Public Member Functions inherited from L1MuGMTLUT
 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...
 
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...
 

Private Member Functions

void InitParameters ()
 Initialize scales, configuration parameters, alignment constants, ... More...
 
unsigned TheLookupFunction (int idx, unsigned eta1, unsigned eta2) const
 The lookup function - here the functionality of the LUT is implemented. More...
 

Additional Inherited Members

- Protected Member Functions inherited from L1MuGMTLUT
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 inherited from L1MuGMTLUT
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
 

Detailed Description

LFCOUDeltaEta look-up table

this class was automatically generated by L1MuGMTLUT::MakeSubClass()

Definition at line 40 of file L1MuGMTLFCOUDeltaEtaLUT.h.

Member Enumeration Documentation

anonymous enum

Constructor & Destructor Documentation

L1MuGMTLFCOUDeltaEtaLUT::L1MuGMTLFCOUDeltaEtaLUT ( )
inline

constuctor using function-lookup

Definition at line 46 of file L1MuGMTLFCOUDeltaEtaLUT.h.

References InitParameters().

46  : L1MuGMTLUT("LFCOUDeltaEta",
47  "DTCSC CSCDT CSCbRPC DTfRPC",
48  "eta1(4) eta2(4)",
49  "delta_eta(4)", 8, true) {
51  } ;
void InitParameters()
Initialize scales, configuration parameters, alignment constants, ...
L1MuGMTLUT()
Init and Destruct.
Definition: L1MuGMTLUT.h:83
virtual L1MuGMTLFCOUDeltaEtaLUT::~L1MuGMTLFCOUDeltaEtaLUT ( )
inlinevirtual

destructor

Definition at line 54 of file L1MuGMTLFCOUDeltaEtaLUT.h.

54 {};

Member Function Documentation

void L1MuGMTLFCOUDeltaEtaLUT::InitParameters ( )
private

Initialize scales, configuration parameters, alignment constants, ...

Definition at line 37 of file L1MuGMTLFCOUDeltaEtaLUT.cc.

Referenced by L1MuGMTLFCOUDeltaEtaLUT(), and LookupFunctionPacked().

37  {
38 }
virtual unsigned L1MuGMTLFCOUDeltaEtaLUT::LookupFunctionPacked ( int  idx,
unsigned  address 
) const
inlinevirtual

access to lookup function with packed input and output

Reimplemented from L1MuGMTLUT.

Definition at line 76 of file L1MuGMTLFCOUDeltaEtaLUT.h.

References training_settings::idx, InitParameters(), L1MuGMTLUT::m_Inputs, TheLookupFunction(), and L1MuGMTLUT::u2vec().

76  {
77  std::vector<unsigned> addr = u2vec(address, m_Inputs);
78  return TheLookupFunction(idx ,addr[0] ,addr[1]);
79 
80  };
std::vector< port > m_Inputs
Definition: L1MuGMTLUT.h:201
unsigned TheLookupFunction(int idx, unsigned eta1, unsigned eta2) const
The lookup function - here the functionality of the LUT is implemented.
std::vector< unsigned > u2vec(unsigned value, const std::vector< port > &widths) const
generate composite address or value from compact unsigned
Definition: L1MuGMTLUT.h:239
unsigned L1MuGMTLFCOUDeltaEtaLUT::SpecificLookup ( int  idx,
unsigned  eta1,
unsigned  eta2 
) const
inline

specific lookup function for entire output field

Definition at line 65 of file L1MuGMTLFCOUDeltaEtaLUT.h.

References L1MuGMTLUT::LookupPacked().

65  {
66  std::vector<unsigned> addr(2);
67  addr[0] = eta1;
68  addr[1] = eta2;
69  return LookupPacked(idx, addr);
70  };
unsigned LookupPacked(int idx, unsigned) const
Definition: L1MuGMTLUT.h:260
unsigned L1MuGMTLFCOUDeltaEtaLUT::SpecificLookup_delta_eta ( int  idx,
unsigned  eta1,
unsigned  eta2 
) const
inline

specific lookup function for delta_eta

Definition at line 57 of file L1MuGMTLFCOUDeltaEtaLUT.h.

References L1MuGMTLUT::Lookup().

Referenced by L1MuGMTMatcher::lookup_mq().

57  {
58  std::vector<unsigned> addr(2);
59  addr[0] = eta1;
60  addr[1] = eta2;
61  return Lookup(idx, addr) [0];
62  };
std::vector< unsigned > Lookup(int idx, const std::vector< unsigned > &address) const
additional lookup function (std::vector -> vector)
Definition: L1MuGMTLUT.h:115
unsigned L1MuGMTLFCOUDeltaEtaLUT::TheLookupFunction ( int  idx,
unsigned  eta1,
unsigned  eta2 
) const
private

The lookup function - here the functionality of the LUT is implemented.

Definition at line 52 of file L1MuGMTLFCOUDeltaEtaLUT.cc.

References caloCompatibility_cff::delta_eta, L1MuScale::getCenter(), L1MuGMTScales::getDeltaEtaScale(), L1MuGMTConfig::getGMTScales(), L1MuGMTScales::getOvlEtaScale(), L1MuScale::getPacked(), L1MuScale::getScaleMax(), timeUnitHelper::pack(), and L1MuSignedPacking< Bits >::packedFromIdx().

Referenced by LookupFunctionPacked().

52  {
53  // idx is DTCSC, CSCDT, bRPCCSC, fRPCDT
54  // INPUTS: eta1(4) eta2(4)
55  // OUTPUTS: delta_eta(4)
56 
57  const L1MuGMTScales* theGMTScales = L1MuGMTConfig::getGMTScales();
58 
59  // check out of range in inputs
61  unsigned delta_eta_OOR = pack.packedFromIdx (-8);
62 
63  if (eta1==7 || eta2 ==7) return delta_eta_OOR;
64 
65  int type1=0, type2=0;
66  switch (idx) {
67  case 0: type1 = 0; type2 = 2; break; // DT, CSC
68  case 1: type1 = 2; type2 = 0; break; // CSC, DT
69  case 2: type1 = 1; type2 = 2; break; // bRPC, CSC
70  case 3: type1 = 3; type2 = 0; break; // fRPC, DT
71  }
72 
73  float etaValue1 = theGMTScales->getOvlEtaScale(type1)->getCenter(eta1);
74  float etaValue2 = theGMTScales->getOvlEtaScale(type2)->getCenter(eta2);
75 
76  float delta_eta = etaValue1 - etaValue2;
77 
78  unsigned delta_eta_4bit = 0;
79 
80  // check out of range
81  if (delta_eta < theGMTScales->getDeltaEtaScale(idx+2)->getScaleMin() ||
82  delta_eta > theGMTScales->getDeltaEtaScale(idx+2)->getScaleMax()) {
83  delta_eta_4bit = delta_eta_OOR;
84  }
85  else {
86  delta_eta_4bit = theGMTScales->getDeltaEtaScale(idx+2)->getPacked( delta_eta );
87  }
88 
89  return delta_eta_4bit;
90 }
def pack(high, low)
virtual unsigned packedFromIdx(int idx) const
get the packed notation of a value, check range
Definition: L1MuPacking.h:102
virtual float getCenter(unsigned packed) const =0
get the center of bin represented by packed
static const L1MuGMTScales * getGMTScales()
virtual unsigned getPacked(float value) const =0
pack a value
virtual float getScaleMax() const =0
get the upper edge of the last bin
const L1MuScale * getDeltaEtaScale(int idx) const
get the delta eta scale; idx = 0(DT=RPC), 1(CSC-RPC), 2(DT-CSC), 3(CSC-DT), 4(bRPC-CSC), 5(fRPC-DT)
const L1MuScale * getOvlEtaScale(int isys) const
get the overlap eta scale (4 bits); isys = 0(DT), 1(bRPC), 2(CSC), 3(fwdRPC)