CMS 3D CMS Logo

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...
 
unsigned LookupFunctionPacked (int idx, unsigned address) const override
 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...
 
 ~L1MuGMTMIAUPhiPro2LUT () override
 destructor More...
 
- Public Member Functions inherited from L1MuGMTLUT
 L1MuGMTLUT ()
 Init and Destruct. 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)
 
 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...
 
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, const std::vector< unsigned > &address) const
 additional lookup function (std::vector -> unisgned) More...
 
unsigned LookupPacked (int idx, unsigned) const
 
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
 
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

MIAUPhiPro2 look-up table

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

Definition at line 38 of file L1MuGMTMIAUPhiPro2LUT.h.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
Enumerator
MIP_DT 
MIP_BRPC 
ISO_DT 
ISO_BRPC 
MIP_CSC 
MIP_FRPC 
ISO_CSC 
ISO_FRPC 

Definition at line 40 of file L1MuGMTMIAUPhiPro2LUT.h.

Constructor & Destructor Documentation

◆ L1MuGMTMIAUPhiPro2LUT()

L1MuGMTMIAUPhiPro2LUT::L1MuGMTMIAUPhiPro2LUT ( )
inline

constuctor using function-lookup

Definition at line 43 of file L1MuGMTMIAUPhiPro2LUT.h.

44  : L1MuGMTLUT("MIAUPhiPro2",
45  "MIP_DT MIP_BRPC ISO_DT ISO_BRPC MIP_CSC MIP_FRPC ISO_CSC ISO_FRPC",
46  "cphi_start(5) cphi_fine(1) cphi_ofs(3) charge(1)",
47  "phi_sel(18)",
48  11,
49  false) {
51  };

References InitParameters().

◆ ~L1MuGMTMIAUPhiPro2LUT()

L1MuGMTMIAUPhiPro2LUT::~L1MuGMTMIAUPhiPro2LUT ( )
inlineoverride

destructor

Definition at line 54 of file L1MuGMTMIAUPhiPro2LUT.h.

54 {};

Member Function Documentation

◆ InitParameters()

void L1MuGMTMIAUPhiPro2LUT::InitParameters ( )
private

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

Definition at line 33 of file L1MuGMTMIAUPhiPro2LUT.cc.

References L1MuGMTConfig::getIsolationCellSizePhi(), and m_IsolationCellSizePhi.

Referenced by L1MuGMTMIAUPhiPro2LUT().

◆ LookupFunctionPacked()

unsigned L1MuGMTMIAUPhiPro2LUT::LookupFunctionPacked ( int  idx,
unsigned  address 
) const
inlineoverridevirtual

access to lookup function with packed input and output

Reimplemented from L1MuGMTLUT.

Definition at line 79 of file L1MuGMTMIAUPhiPro2LUT.h.

79  {
80  std::vector<unsigned> addr = u2vec(address, m_Inputs);
81  return TheLookupFunction(idx, addr[0], addr[1], addr[2], addr[3]);
82  };

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

◆ SpecificLookup()

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 68 of file L1MuGMTMIAUPhiPro2LUT.h.

68  {
69  std::vector<unsigned> addr(4);
70  addr[0] = cphi_start;
71  addr[1] = cphi_fine;
72  addr[2] = cphi_ofs;
73  addr[3] = charge;
74  return LookupPacked(idx, addr);
75  };

References generateTowerEtThresholdLUT::addr, ALCARECOTkAlJpsiMuMu_cff::charge, training_settings::idx, and L1MuGMTLUT::LookupPacked().

◆ SpecificLookup_phi_sel()

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 57 of file L1MuGMTMIAUPhiPro2LUT.h.

58  {
59  std::vector<unsigned> addr(4);
60  addr[0] = cphi_start;
61  addr[1] = cphi_fine;
62  addr[2] = cphi_ofs;
63  addr[3] = charge;
64  return Lookup(idx, addr)[0];
65  };

References generateTowerEtThresholdLUT::addr, ALCARECOTkAlJpsiMuMu_cff::charge, training_settings::idx, and L1MuGMTLUT::Lookup().

Referenced by L1MuGMTPhiProjectionUnit::run().

◆ TheLookupFunction()

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 47 of file L1MuGMTMIAUPhiPro2LUT.cc.

48  {
49  // idx is MIP_DT, MIP_BRPC, ISO_DT, ISO_BRPC, MIP_CSC, MIP_FRPC, ISO_CSC, ISO_FRPC
50  // INPUTS: cphi_start(5) cphi_fine(1) cphi_ofs(3) charge(1)
51  // OUTPUTS: phi_sel(18)
52 
53  // this LUT generates the 18 phi-select bits for the 18 Calo regions
54  if (cphi_start > 17)
55  return 0;
56 
57  int isISO = (idx / 2) % 2;
58 
59  int offset = (int(cphi_ofs) - 1) * ((charge == 0) ? 1 : -1);
60 
61  int center_region = (18 + int(cphi_start) + offset) % 18;
62 
63  // for MIP bit assignment, only one region is selected
64  unsigned phi_select_word = 1 << center_region;
65 
66  // for ISOlation bit assignment, multiple regions can be selected according to the IsolationCellSize
67  if (isISO) {
68  int imin = center_region - (m_IsolationCellSizePhi - 1) / 2;
69  int imax = center_region + (m_IsolationCellSizePhi - 1) / 2;
70 
71  // for even number of isolation cells check the fine grain info
72  if (m_IsolationCellSizePhi % 2 == 0) {
73  if (cphi_fine == 1)
74  imax++;
75  else
76  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 }

References ALCARECOTkAlJpsiMuMu_cff::charge, mps_fire::i, training_settings::idx, createfilelist::int, m_IsolationCellSizePhi, and hltrates_dqm_sourceclient-live_cfg::offset.

Referenced by LookupFunctionPacked().

Member Data Documentation

◆ m_IsolationCellSizePhi

int L1MuGMTMIAUPhiPro2LUT::m_IsolationCellSizePhi
private

Private data members (LUT parameters);.

Definition at line 92 of file L1MuGMTMIAUPhiPro2LUT.h.

Referenced by InitParameters(), and TheLookupFunction().

L1MuGMTMIAUPhiPro2LUT::ISO_BRPC
Definition: L1MuGMTMIAUPhiPro2LUT.h:40
mps_fire.i
i
Definition: mps_fire.py:355
L1MuGMTMIAUPhiPro2LUT::ISO_DT
Definition: L1MuGMTMIAUPhiPro2LUT.h:40
L1MuGMTLUT::m_Inputs
std::vector< port > m_Inputs
Definition: L1MuGMTLUT.h:214
L1MuGMTMIAUPhiPro2LUT::ISO_CSC
Definition: L1MuGMTMIAUPhiPro2LUT.h:40
L1MuGMTMIAUPhiPro2LUT::TheLookupFunction
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.
Definition: L1MuGMTMIAUPhiPro2LUT.cc:47
training_settings.idx
idx
Definition: training_settings.py:16
L1MuGMTMIAUPhiPro2LUT::ISO_FRPC
Definition: L1MuGMTMIAUPhiPro2LUT.h:40
generateTowerEtThresholdLUT.addr
addr
Definition: generateTowerEtThresholdLUT.py:57
L1MuGMTConfig::getIsolationCellSizePhi
static int getIsolationCellSizePhi()
Definition: L1MuGMTConfig.h:125
L1MuGMTMIAUPhiPro2LUT::MIP_BRPC
Definition: L1MuGMTMIAUPhiPro2LUT.h:40
ALCARECOTkAlJpsiMuMu_cff.charge
charge
Definition: ALCARECOTkAlJpsiMuMu_cff.py:47
L1MuGMTMIAUPhiPro2LUT::m_IsolationCellSizePhi
int m_IsolationCellSizePhi
Private data members (LUT parameters);.
Definition: L1MuGMTMIAUPhiPro2LUT.h:92
createfilelist.int
int
Definition: createfilelist.py:10
L1MuGMTLUT::LookupPacked
unsigned LookupPacked(int idx, unsigned) const
Definition: L1MuGMTLUT.h:272
L1MuGMTMIAUPhiPro2LUT::MIP_DT
Definition: L1MuGMTMIAUPhiPro2LUT.h:40
L1MuGMTLUT::u2vec
std::vector< unsigned > u2vec(unsigned value, const std::vector< port > &widths) const
generate composite address or value from compact unsigned
Definition: L1MuGMTLUT.h:251
L1MuGMTMIAUPhiPro2LUT::MIP_FRPC
Definition: L1MuGMTMIAUPhiPro2LUT.h:40
L1MuGMTMIAUPhiPro2LUT::MIP_CSC
Definition: L1MuGMTMIAUPhiPro2LUT.h:40
L1MuGMTLUT::L1MuGMTLUT
L1MuGMTLUT()
Init and Destruct.
Definition: L1MuGMTLUT.h:80
hltrates_dqm_sourceclient-live_cfg.offset
offset
Definition: hltrates_dqm_sourceclient-live_cfg.py:78
L1MuGMTLUT::Lookup
std::vector< unsigned > Lookup(int idx, const std::vector< unsigned > &address) const
additional lookup function (std::vector -> vector)
Definition: L1MuGMTLUT.h:121
L1MuGMTMIAUPhiPro2LUT::InitParameters
void InitParameters()
Initialize scales, configuration parameters, alignment constants, ...
Definition: L1MuGMTMIAUPhiPro2LUT.cc:33