CMS 3D CMS Logo

L1MuGMTLFMatchQualLUT Class Reference

LFMatchQual look-up table. More...

#include <L1Trigger/GlobalMuonTrigger/src/L1MuGMTLFMatchQualLUT.h>

Inheritance diagram for L1MuGMTLFMatchQualLUT:

L1MuGMTLUT

List of all members.

Public Types

enum  {
  DTRPC, CSCRPC, DTCSC, CSCDT,
  CSCbRPC, DTfRPC
}

Public Member Functions

 L1MuGMTLFMatchQualLUT ()
 constuctor using function-lookup
virtual unsigned LookupFunctionPacked (int idx, unsigned address) const
 access to lookup function with packed input and output
unsigned SpecificLookup (int idx, unsigned delta_eta, unsigned delta_phi) const
 specific lookup function for entire output field
unsigned SpecificLookup_mq (int idx, unsigned delta_eta, unsigned delta_phi) const
 specific lookup function for mq
virtual ~L1MuGMTLFMatchQualLUT ()
 destructor

Private Member Functions

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

Private Attributes

float m_EtaPhiThresholds [6]
float m_EtaWeights [6]
 Private data members (LUT parameters);.
float m_PhiWeights [6]


Detailed Description

LFMatchQual look-up table.

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

Definition at line 42 of file L1MuGMTLFMatchQualLUT.h.


Member Enumeration Documentation

anonymous enum

Enumerator:
DTRPC 
CSCRPC 
DTCSC 
CSCDT 
CSCbRPC 
DTfRPC 

Definition at line 45 of file L1MuGMTLFMatchQualLUT.h.


Constructor & Destructor Documentation

L1MuGMTLFMatchQualLUT::L1MuGMTLFMatchQualLUT (  )  [inline]

constuctor using function-lookup

Definition at line 48 of file L1MuGMTLFMatchQualLUT.h.

References InitParameters().

00048                           : L1MuGMTLUT("LFMatchQual", 
00049                                        "DTRPC CSCRPC DTCSC CSCDT CSCbRPC DTfRPC",
00050                                        "delta_eta(4) delta_phi(3)",
00051                                        "mq(6)", 7, true) {
00052     InitParameters();
00053   } ;

virtual L1MuGMTLFMatchQualLUT::~L1MuGMTLFMatchQualLUT (  )  [inline, virtual]

destructor

Definition at line 56 of file L1MuGMTLFMatchQualLUT.h.

00056 {};


Member Function Documentation

void L1MuGMTLFMatchQualLUT::InitParameters (  )  [private]

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

Definition at line 39 of file L1MuGMTLFMatchQualLUT.cc.

References L1MuGMTConfig::getEtaPhiThresholdBarrel(), L1MuGMTConfig::getEtaPhiThresholdCOU(), L1MuGMTConfig::getEtaPhiThresholdEndcap(), L1MuGMTConfig::getEtaWeightBarrel(), L1MuGMTConfig::getEtaWeightCOU(), L1MuGMTConfig::getEtaWeightEndcap(), L1MuGMTConfig::getPhiWeightBarrel(), L1MuGMTConfig::getPhiWeightCOU(), L1MuGMTConfig::getPhiWeightEndcap(), i, m_EtaPhiThresholds, m_EtaWeights, and m_PhiWeights.

Referenced by L1MuGMTLFMatchQualLUT().

virtual unsigned L1MuGMTLFMatchQualLUT::LookupFunctionPacked ( int  idx,
unsigned  address 
) const [inline, virtual]

access to lookup function with packed input and output

Reimplemented from L1MuGMTLUT.

Definition at line 78 of file L1MuGMTLFMatchQualLUT.h.

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

00078                                                                           {
00079     std::vector<unsigned> addr = u2vec(address, m_Inputs);
00080     return TheLookupFunction(idx ,addr[0] ,addr[1]);
00081 
00082   };

unsigned L1MuGMTLFMatchQualLUT::SpecificLookup ( int  idx,
unsigned  delta_eta,
unsigned  delta_phi 
) const [inline]

specific lookup function for entire output field

Definition at line 67 of file L1MuGMTLFMatchQualLUT.h.

References addr, and L1MuGMTLUT::LookupPacked().

00067                                                                                   {
00068     std::vector<unsigned> addr(2);
00069     addr[0] = delta_eta;
00070     addr[1] = delta_phi;
00071     return LookupPacked(idx, addr);
00072   };

unsigned L1MuGMTLFMatchQualLUT::SpecificLookup_mq ( int  idx,
unsigned  delta_eta,
unsigned  delta_phi 
) const [inline]

specific lookup function for mq

Definition at line 59 of file L1MuGMTLFMatchQualLUT.h.

References addr, and L1MuGMTLUT::Lookup().

Referenced by L1MuGMTMatcher::lookup_mq().

00059                                                                                      {
00060     std::vector<unsigned> addr(2);
00061     addr[0] = delta_eta;
00062     addr[1] = delta_phi;
00063     return Lookup(idx, addr) [0];
00064   };

unsigned L1MuGMTLFMatchQualLUT::TheLookupFunction ( int  idx,
unsigned  delta_eta,
unsigned  delta_phi 
) const [private]

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

Definition at line 60 of file L1MuGMTLFMatchQualLUT.cc.

References L1MuScale::getCenter(), L1MuGMTScales::getDeltaEtaScale(), L1MuGMTScales::getDeltaPhiScale(), L1MuGMTConfig::getGMTScales(), L1MuSignedPacking< Bits >::idxFromPacked(), m_EtaPhiThresholds, m_EtaWeights, m_PhiWeights, and funct::sqrt().

Referenced by LookupFunctionPacked().

00060                                                                                                         {
00061   // idx is DTRPC, CSCRPC, DTCSC, CSCDT, CSCbRPC, DTfRPC
00062   // INPUTS:  delta_eta(4) delta_phi(3)
00063   // OUTPUTS: mq(6) 
00064 
00065   const L1MuGMTScales* theGMTScales = L1MuGMTConfig::getGMTScales();
00066 
00067   float deta = theGMTScales->getDeltaEtaScale(idx)->getCenter( delta_eta );
00068   float dphi = theGMTScales->getDeltaPhiScale()->getCenter( delta_phi );
00069       
00070   // check out-of range code
00071   L1MuSignedPacking<4> EtaPacking;
00072   int delta_eta_signed = EtaPacking.idxFromPacked(delta_eta);
00073   L1MuSignedPacking<3> PhiPacking;
00074   int delta_phi_signed = PhiPacking.idxFromPacked(delta_phi);
00075 
00076   bool dphi_outofrange = (delta_phi_signed == -4);
00077 
00078   // limit delta-phi even further    **FIXME: make this configurable
00079   if (delta_phi_signed >=3 || delta_phi_signed <=-3) 
00080     dphi_outofrange = true;
00081 
00082   // check out-of range code
00083   bool deta_outofrange = (delta_eta_signed == -8);
00084 
00085   // limit delta-eta even further    **FIXME: make this configurable
00086   if (delta_eta_signed >=7 || delta_eta_signed <=-7) 
00087     deta_outofrange = true;
00088 
00089   double delta_etaphi = sqrt(m_EtaWeights[idx]*deta*deta + m_PhiWeights[idx]*dphi*dphi);
00090 
00091 //    cout << "MQ LUT       : delta_phi = " << dphi
00092 //         << ", delta_eta = " << deta
00093 //         << ", delta_etaphi = " << delta_etaphi
00094 //         << endl;
00095 
00096       
00097   int matchqual = 0;
00098   if ( dphi_outofrange || deta_outofrange ||
00099        delta_etaphi > m_EtaPhiThresholds[idx] ) {
00100     matchqual = 0;
00101   }
00102   else {
00103     double mq = 64. * (m_EtaPhiThresholds[idx] - delta_etaphi) / m_EtaPhiThresholds[idx];
00104     matchqual = static_cast<int>(mq);
00105   }
00106 
00107   if (matchqual > 63) matchqual = 63;
00108   return matchqual;  
00109 }


Member Data Documentation

float L1MuGMTLFMatchQualLUT::m_EtaPhiThresholds[6] [private]

Definition at line 94 of file L1MuGMTLFMatchQualLUT.h.

Referenced by InitParameters(), and TheLookupFunction().

float L1MuGMTLFMatchQualLUT::m_EtaWeights[6] [private]

Private data members (LUT parameters);.

Definition at line 92 of file L1MuGMTLFMatchQualLUT.h.

Referenced by InitParameters(), and TheLookupFunction().

float L1MuGMTLFMatchQualLUT::m_PhiWeights[6] [private]

Definition at line 93 of file L1MuGMTLFMatchQualLUT.h.

Referenced by InitParameters(), and TheLookupFunction().


The documentation for this class was generated from the following files:
Generated on Tue Jun 9 18:26:54 2009 for CMSSW by  doxygen 1.5.4