CMS 3D CMS Logo

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

#include <L1MuGMTMIAUPhiPro2LUT.h>

Inheritance diagram for L1MuGMTMIAUPhiPro2LUT:
L1MuGMTLUT

Public Types

enum  {
  MIP_DT, MIP_BRPC, ISO_DT, ISO_BRPC,
  MIP_CSC, MIP_FRPC, ISO_CSC, ISO_FRPC
}
 
- Public Types inherited from L1MuGMTLUT
typedef std::pair< std::string,
unsigned > 
port
 

Public Member Functions

 L1MuGMTMIAUPhiPro2LUT ()
 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 cphi_start, unsigned cphi_fine, unsigned cphi_ofs, unsigned charge) const
 specific lookup function for entire output field More...
 
unsigned SpecificLookup_phi_sel (int idx, unsigned cphi_start, unsigned cphi_fine, unsigned cphi_ofs, unsigned charge) const
 specific lookup function for phi_sel More...
 
virtual ~L1MuGMTMIAUPhiPro2LUT ()
 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 cphi_start, unsigned cphi_fine, unsigned cphi_ofs, unsigned charge) const
 The lookup function - here the functionality of the LUT is implemented. More...
 

Private Attributes

int m_IsolationCellSizePhi
 Private data members (LUT parameters);. 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
 
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

MIAUPhiPro2 look-up table

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

Definition at line 43 of file L1MuGMTMIAUPhiPro2LUT.h.

Member Enumeration Documentation

anonymous enum

Constructor & Destructor Documentation

L1MuGMTMIAUPhiPro2LUT::L1MuGMTMIAUPhiPro2LUT ( )
inline

constuctor using function-lookup

Definition at line 49 of file L1MuGMTMIAUPhiPro2LUT.h.

References InitParameters().

49  : L1MuGMTLUT("MIAUPhiPro2",
50  "MIP_DT MIP_BRPC ISO_DT ISO_BRPC MIP_CSC MIP_FRPC ISO_CSC ISO_FRPC",
51  "cphi_start(5) cphi_fine(1) cphi_ofs(3) charge(1)",
52  "phi_sel(18)", 11, false) {
54  } ;
L1MuGMTLUT()
Init and Destruct.
Definition: L1MuGMTLUT.h:85
void InitParameters()
Initialize scales, configuration parameters, alignment constants, ...
virtual L1MuGMTMIAUPhiPro2LUT::~L1MuGMTMIAUPhiPro2LUT ( )
inlinevirtual

destructor

Definition at line 57 of file L1MuGMTMIAUPhiPro2LUT.h.

57 {};

Member Function Documentation

void L1MuGMTMIAUPhiPro2LUT::InitParameters ( )
private

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

Definition at line 35 of file L1MuGMTMIAUPhiPro2LUT.cc.

References L1MuGMTConfig::getIsolationCellSizePhi(), and m_IsolationCellSizePhi.

Referenced by L1MuGMTMIAUPhiPro2LUT().

35  {
37 }
int m_IsolationCellSizePhi
Private data members (LUT parameters);.
static int getIsolationCellSizePhi()
virtual unsigned L1MuGMTMIAUPhiPro2LUT::LookupFunctionPacked ( int  idx,
unsigned  address 
) const
inlinevirtual

access to lookup function with packed input and output

Reimplemented from L1MuGMTLUT.

Definition at line 83 of file L1MuGMTMIAUPhiPro2LUT.h.

References L1MuGMTLUT::m_Inputs, TheLookupFunction(), and L1MuGMTLUT::u2vec().

83  {
84  std::vector<unsigned> addr = u2vec(address, m_Inputs);
85  return TheLookupFunction(idx ,addr[0] ,addr[1] ,addr[2] ,addr[3]);
86 
87  };
char * address
Definition: mlp_lapack.h:14
std::vector< port > m_Inputs
Definition: L1MuGMTLUT.h:203
std::vector< unsigned > u2vec(unsigned value, const std::vector< port > &widths) const
generate composite address or value from compact unsigned
Definition: L1MuGMTLUT.h:240
unsigned TheLookupFunction(int idx, unsigned cphi_start, unsigned cphi_fine, unsigned cphi_ofs, unsigned charge) const
The lookup function - here the functionality of the LUT is implemented.
unsigned L1MuGMTMIAUPhiPro2LUT::SpecificLookup ( int  idx,
unsigned  cphi_start,
unsigned  cphi_fine,
unsigned  cphi_ofs,
unsigned  charge 
) const
inline

specific lookup function for entire output field

Definition at line 70 of file L1MuGMTMIAUPhiPro2LUT.h.

References DeDxDiscriminatorTools::charge(), and L1MuGMTLUT::LookupPacked().

70  {
71  std::vector<unsigned> addr(4);
72  addr[0] = cphi_start;
73  addr[1] = cphi_fine;
74  addr[2] = cphi_ofs;
75  addr[3] = charge;
76  return LookupPacked(idx, addr);
77  };
double charge(const std::vector< uint8_t > &Ampls)
unsigned LookupPacked(int idx, unsigned) const
Definition: L1MuGMTLUT.h:261
unsigned L1MuGMTMIAUPhiPro2LUT::SpecificLookup_phi_sel ( int  idx,
unsigned  cphi_start,
unsigned  cphi_fine,
unsigned  cphi_ofs,
unsigned  charge 
) const
inline

specific lookup function for phi_sel

Definition at line 60 of file L1MuGMTMIAUPhiPro2LUT.h.

References DeDxDiscriminatorTools::charge(), and L1MuGMTLUT::Lookup().

Referenced by L1MuGMTPhiProjectionUnit::run().

60  {
61  std::vector<unsigned> addr(4);
62  addr[0] = cphi_start;
63  addr[1] = cphi_fine;
64  addr[2] = cphi_ofs;
65  addr[3] = charge;
66  return Lookup(idx, addr) [0];
67  };
std::vector< unsigned > Lookup(int idx, const std::vector< unsigned > &address) const
additional lookup function (std::vector -&gt; vector)
Definition: L1MuGMTLUT.h:117
double charge(const std::vector< uint8_t > &Ampls)
unsigned L1MuGMTMIAUPhiPro2LUT::TheLookupFunction ( int  idx,
unsigned  cphi_start,
unsigned  cphi_fine,
unsigned  cphi_ofs,
unsigned  charge 
) const
private

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

Definition at line 51 of file L1MuGMTMIAUPhiPro2LUT.cc.

References i, m_IsolationCellSizePhi, and evf::evtn::offset().

Referenced by LookupFunctionPacked().

51  {
52  // idx is MIP_DT, MIP_BRPC, ISO_DT, ISO_BRPC, MIP_CSC, MIP_FRPC, ISO_CSC, ISO_FRPC
53  // INPUTS: cphi_start(5) cphi_fine(1) cphi_ofs(3) charge(1)
54  // OUTPUTS: phi_sel(18)
55 
56  // this LUT generates the 18 phi-select bits for the 18 Calo regions
57  if (cphi_start > 17) return 0;
58 
59  int isISO = (idx / 2) % 2;
60 
61  int offset = ( int(cphi_ofs) - 1 ) * ( (charge==0) ? 1 : -1 );
62 
63  int center_region = ( 18 + int(cphi_start) + offset ) % 18;
64 
65  // for MIP bit assignment, only one region is selected
66  unsigned phi_select_word = 1 << center_region;
67 
68  // for ISOlation bit assignment, multiple regions can be selected according to the IsolationCellSize
69  if (isISO) {
70  int imin = center_region - ( m_IsolationCellSizePhi-1 ) / 2;
71  int imax = center_region + ( m_IsolationCellSizePhi-1 ) / 2;
72 
73  // for even number of isolation cells check the fine grain info
74  if (m_IsolationCellSizePhi%2 == 0) {
75  if ( cphi_fine==1 ) imax++;
76  else imin--;
77  }
78 
79  for (int i=imin; i<=imax; i++ )
80  phi_select_word |= 1 << ( (i+18) % 18 );
81  }
82 
83  return phi_select_word;
84 }
int i
Definition: DBlmapReader.cc:9
int m_IsolationCellSizePhi
Private data members (LUT parameters);.
double charge(const std::vector< uint8_t > &Ampls)
unsigned int offset(bool)

Member Data Documentation

int L1MuGMTMIAUPhiPro2LUT::m_IsolationCellSizePhi
private

Private data members (LUT parameters);.

Definition at line 97 of file L1MuGMTMIAUPhiPro2LUT.h.

Referenced by InitParameters(), and TheLookupFunction().