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
L1MuGMTLFSortRankEtaQLUT Class Reference

#include <L1MuGMTLFSortRankEtaQLUT.h>

Inheritance diagram for L1MuGMTLFSortRankEtaQLUT:
L1MuGMTLUT

Public Types

enum  { DT, BRPC, CSC, FRPC }
 
- Public Types inherited from L1MuGMTLUT
typedef std::pair< std::string,
unsigned > 
port
 

Public Member Functions

 L1MuGMTLFSortRankEtaQLUT ()
 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 eta, unsigned q) const
 specific lookup function for entire output field More...
 
unsigned SpecificLookup_rank_etaq (int idx, unsigned eta, unsigned q) const
 specific lookup function for rank_etaq More...
 
unsigned SpecificLookup_vlq (int idx, unsigned eta, unsigned q) const
 specific lookup function for vlq More...
 
virtual ~L1MuGMTLFSortRankEtaQLUT ()
 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 eta, unsigned q) const
 The lookup function - here the functionality of the LUT is implemented. More...
 

Private Attributes

unsigned m_version
 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

LFSortRankEtaQ look-up table

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

Definition at line 42 of file L1MuGMTLFSortRankEtaQLUT.h.

Member Enumeration Documentation

anonymous enum

Constructor & Destructor Documentation

L1MuGMTLFSortRankEtaQLUT::L1MuGMTLFSortRankEtaQLUT ( )
inline

constuctor using function-lookup

Definition at line 48 of file L1MuGMTLFSortRankEtaQLUT.h.

References InitParameters().

48  : L1MuGMTLUT("LFSortRankEtaQ",
49  "DT BRPC CSC FRPC",
50  "eta(6) q(3)",
51  "vlq(2) rank_etaq(2)", 7, false) {
53  } ;
L1MuGMTLUT()
Init and Destruct.
Definition: L1MuGMTLUT.h:85
void InitParameters()
Initialize scales, configuration parameters, alignment constants, ...
virtual L1MuGMTLFSortRankEtaQLUT::~L1MuGMTLFSortRankEtaQLUT ( )
inlinevirtual

destructor

Definition at line 56 of file L1MuGMTLFSortRankEtaQLUT.h.

56 {};

Member Function Documentation

void L1MuGMTLFSortRankEtaQLUT::InitParameters ( )
private

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

Definition at line 37 of file L1MuGMTLFSortRankEtaQLUT.cc.

References L1MuGMTConfig::getVersionSortRankEtaQLUT(), and m_version.

Referenced by L1MuGMTLFSortRankEtaQLUT().

37  {
39 }
unsigned m_version
Private data members (LUT parameters);.
static unsigned getVersionSortRankEtaQLUT()
virtual unsigned L1MuGMTLFSortRankEtaQLUT::LookupFunctionPacked ( int  idx,
unsigned  address 
) const
inlinevirtual

access to lookup function with packed input and output

Reimplemented from L1MuGMTLUT.

Definition at line 86 of file L1MuGMTLFSortRankEtaQLUT.h.

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

86  {
87  std::vector<unsigned> addr = u2vec(address, m_Inputs);
88  return TheLookupFunction(idx ,addr[0] ,addr[1]);
89 
90  };
char * address
Definition: mlp_lapack.h:14
unsigned TheLookupFunction(int idx, unsigned eta, unsigned q) const
The lookup function - here the functionality of the LUT is implemented.
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 L1MuGMTLFSortRankEtaQLUT::SpecificLookup ( int  idx,
unsigned  eta,
unsigned  q 
) const
inline

specific lookup function for entire output field

Definition at line 75 of file L1MuGMTLFSortRankEtaQLUT.h.

References eta(), L1MuGMTLUT::LookupPacked(), and lumiQueryAPI::q.

75  {
76  std::vector<unsigned> addr(2);
77  addr[0] = eta;
78  addr[1] = q;
79  return LookupPacked(idx, addr);
80  };
T eta() const
unsigned LookupPacked(int idx, unsigned) const
Definition: L1MuGMTLUT.h:261
unsigned L1MuGMTLFSortRankEtaQLUT::SpecificLookup_rank_etaq ( int  idx,
unsigned  eta,
unsigned  q 
) const
inline

specific lookup function for rank_etaq

Definition at line 67 of file L1MuGMTLFSortRankEtaQLUT.h.

References eta(), L1MuGMTLUT::Lookup(), and lumiQueryAPI::q.

Referenced by L1MuGMTSortRankUnit::sort_rank().

67  {
68  std::vector<unsigned> addr(2);
69  addr[0] = eta;
70  addr[1] = q;
71  return Lookup(idx, addr) [1];
72  };
T eta() const
std::vector< unsigned > Lookup(int idx, const std::vector< unsigned > &address) const
additional lookup function (std::vector -&gt; vector)
Definition: L1MuGMTLUT.h:117
unsigned L1MuGMTLFSortRankEtaQLUT::SpecificLookup_vlq ( int  idx,
unsigned  eta,
unsigned  q 
) const
inline

specific lookup function for vlq

Definition at line 59 of file L1MuGMTLFSortRankEtaQLUT.h.

References eta(), L1MuGMTLUT::Lookup(), and lumiQueryAPI::q.

Referenced by L1MuGMTSortRankUnit::getVeryLowQualityLevel().

59  {
60  std::vector<unsigned> addr(2);
61  addr[0] = eta;
62  addr[1] = q;
63  return Lookup(idx, addr) [0];
64  };
T eta() const
std::vector< unsigned > Lookup(int idx, const std::vector< unsigned > &address) const
additional lookup function (std::vector -&gt; vector)
Definition: L1MuGMTLUT.h:117
unsigned L1MuGMTLFSortRankEtaQLUT::TheLookupFunction ( int  idx,
unsigned  eta,
unsigned  q 
) const
private

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

Definition at line 81 of file L1MuGMTLFSortRankEtaQLUT.cc.

References L1MuScale::getCenter(), L1MuGMTConfig::getDoOvlRpcAnd(), L1MuTriggerScales::getRegionalEtaScale(), L1MuGMTConfig::getTriggerScales(), and m_version.

Referenced by LookupFunctionPacked().

81  {
82  // idx is DT, BRPC, CSC, FRPC
83  // INPUTS: eta(6) q(3)
84  // OUTPUTS: vlq(2) rank_etaq(2)
85 
86  const L1MuTriggerScales* theTriggerScales = L1MuGMTConfig::getTriggerScales();
87 
88  int isRPC = idx % 2;
89  // int isFWD = idx / 2;
90 
91  float etaValue = fabs ( theTriggerScales->getRegionalEtaScale(idx)->getCenter( eta ) );
92 
93  //
94  // very-low-quality flags
95  //
96  // 0 .. no VLQ set
97  // 1 .. output muon will be quality 2 (disable in single and di-muon trigger)
98  // 2 .. output muon will be quality 3 (disable in single-muon trigger only)
99  // 3 .. output muon will be quality 4 (disable in di-muon trigger only)
100 
101  unsigned vlq = 0;
102 
103  int vCSC2 = (m_version) & 0xf;
104  int vCSC1 = (m_version>>4) & 0xf;
105  int vRPC = (m_version>>8) & 0xf;
106 
107  // RPC selection
108  if (isRPC) {
109  if(vRPC == 0) {
110  if ( ( q == 0 && ( ( etaValue > 1.04 && etaValue < 1.24 ) || // Q0, high rate, high noise
111  ( etaValue > 1.48 ) ) ) || // Q0, high rate, high noise
112  ( q == 1 && ( ( etaValue > 0.83 && etaValue < 1.04 ) || // Q1, high rate
113  ( etaValue > 1.14 && etaValue < 1.24 ) || // Q1, high noise
114  ( etaValue > 1.36 ) ) ) || // Q1, high rate
115  ( q == 2 && ( etaValue > 0.83 && etaValue < 0.93 ) ) ) // Q2, high rate
116  vlq = 1;
117  }
118  }
119 
120  // CSC selection
121  if ( idx == 2 ) { // CSC
122  if (q == 2) {
123  if(vCSC2 == 1) vlq = 2;
124  if(vCSC2 == 2) {
125  if(etaValue < 1.5 || etaValue > 1.8) vlq = 2; // disable in single-muon trigger only
126  }
127  if(vCSC2 == 3) {
128  if( (etaValue > 1.2 && etaValue < 1.5) || etaValue > 1.8) vlq = 2; // disable in single-muon trigger only
129  }
130  }
131 
132  if (q == 1) {
133  if(vCSC1 == 0) {
134  if(etaValue > 1.2) vlq = 2; // disable in single-muon trigger only
135  }
136  if(vCSC1 == 1) {
137  if(etaValue > 1.3) vlq = 2; // disable in single-muon trigger only
138  }
139  }
140  }
141 
143  if ( idx == 0 ) { // DT
144  if ( etaValue > 0.91 ) vlq = 1;
145  }
146  if ( idx == 2 ) { // CSC
147  if ( etaValue < 1.06 ) vlq = 1;
148  }
149  }
150 
151  //
152  // Rank contribution from eta and quality
153  //
154 
155  // by default return maximum
156  // LUT can later be used to reduce the sort rank of certain regions
157  unsigned rank_etaq = 3;
158 
159  return (vlq << 2) | rank_etaq;
160 }
T eta() const
virtual float getCenter(unsigned packed) const =0
get the center of bin represented by packed
unsigned m_version
Private data members (LUT parameters);.
static bool getDoOvlRpcAnd()
require DT/CSC candidates to be confirmed by the RPC in the overlap region
static const L1MuTriggerScales * getTriggerScales()
const L1MuScale * getRegionalEtaScale(int isys) const
get the regioanl muon trigger eta scale, isys = 0(DT), 1(bRPC), 2(CSC), 3(fwdRPC) ...

Member Data Documentation

unsigned L1MuGMTLFSortRankEtaQLUT::m_version
private

Private data members (LUT parameters);.

Definition at line 100 of file L1MuGMTLFSortRankEtaQLUT.h.

Referenced by InitParameters(), and TheLookupFunction().