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

Member Enumeration Documentation

anonymous enum

Constructor & Destructor Documentation

L1MuGMTMIAUPhiPro2LUT::L1MuGMTMIAUPhiPro2LUT ( )
inline

constuctor using function-lookup

Definition at line 47 of file L1MuGMTMIAUPhiPro2LUT.h.

References InitParameters().

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

destructor

Definition at line 55 of file L1MuGMTMIAUPhiPro2LUT.h.

55 {};

Member Function Documentation

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().

33  {
35 }
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 81 of file L1MuGMTMIAUPhiPro2LUT.h.

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

81  {
82  std::vector<unsigned> addr = u2vec(address, m_Inputs);
83  return TheLookupFunction(idx ,addr[0] ,addr[1] ,addr[2] ,addr[3]);
84 
85  };
std::vector< port > m_Inputs
Definition: L1MuGMTLUT.h:201
tuple idx
DEBUGGING if hasattr(process,&quot;trackMonIterativeTracking2012&quot;): print &quot;trackMonIterativeTracking2012 D...
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 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 68 of file L1MuGMTMIAUPhiPro2LUT.h.

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

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  };
tuple idx
DEBUGGING if hasattr(process,&quot;trackMonIterativeTracking2012&quot;): print &quot;trackMonIterativeTracking2012 D...
unsigned LookupPacked(int idx, unsigned) const
Definition: L1MuGMTLUT.h:260
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 58 of file L1MuGMTMIAUPhiPro2LUT.h.

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

Referenced by L1MuGMTPhiProjectionUnit::run().

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  };
std::vector< unsigned > Lookup(int idx, const std::vector< unsigned > &address) const
additional lookup function (std::vector -&gt; vector)
Definition: L1MuGMTLUT.h:115
tuple idx
DEBUGGING if hasattr(process,&quot;trackMonIterativeTracking2012&quot;): print &quot;trackMonIterativeTracking2012 D...
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 49 of file L1MuGMTMIAUPhiPro2LUT.cc.

References i, m_IsolationCellSizePhi, and hltrates_dqm_sourceclient-live_cfg::offset.

Referenced by LookupFunctionPacked().

49  {
50  // idx is MIP_DT, MIP_BRPC, ISO_DT, ISO_BRPC, MIP_CSC, MIP_FRPC, ISO_CSC, ISO_FRPC
51  // INPUTS: cphi_start(5) cphi_fine(1) cphi_ofs(3) charge(1)
52  // OUTPUTS: phi_sel(18)
53 
54  // this LUT generates the 18 phi-select bits for the 18 Calo regions
55  if (cphi_start > 17) 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 ) imax++;
74  else imin--;
75  }
76 
77  for (int i=imin; i<=imax; i++ )
78  phi_select_word |= 1 << ( (i+18) % 18 );
79  }
80 
81  return phi_select_word;
82 }
int i
Definition: DBlmapReader.cc:9
int m_IsolationCellSizePhi
Private data members (LUT parameters);.
tuple idx
DEBUGGING if hasattr(process,&quot;trackMonIterativeTracking2012&quot;): print &quot;trackMonIterativeTracking2012 D...

Member Data Documentation

int L1MuGMTMIAUPhiPro2LUT::m_IsolationCellSizePhi
private

Private data members (LUT parameters);.

Definition at line 95 of file L1MuGMTMIAUPhiPro2LUT.h.

Referenced by InitParameters(), and TheLookupFunction().