CMS 3D CMS Logo

Public Types | Public Member Functions | Private Member Functions | Private Attributes

L1MuGMTLFMatchQualLUT Class Reference

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

                          : L1MuGMTLUT("LFMatchQual", 
                                       "DTRPC CSCRPC DTCSC CSCDT CSCbRPC DTfRPC",
                                       "delta_eta(4) delta_phi(3)",
                                       "mq(6)", 7, true) {
    InitParameters();
  } ;
virtual L1MuGMTLFMatchQualLUT::~L1MuGMTLFMatchQualLUT ( ) [inline, virtual]

destructor

Definition at line 56 of file L1MuGMTLFMatchQualLUT.h.

{};

Member Function Documentation

void L1MuGMTLFMatchQualLUT::InitParameters ( ) [private]
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 L1MuGMTLUT::m_Inputs, TheLookupFunction(), and L1MuGMTLUT::u2vec().

                                                                          {
    std::vector<unsigned> addr = u2vec(address, m_Inputs);
    return TheLookupFunction(idx ,addr[0] ,addr[1]);

  };
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 kinem::delta_eta(), kinem::delta_phi(), and L1MuGMTLUT::LookupPacked().

                                                                                  {
    std::vector<unsigned> addr(2);
    addr[0] = delta_eta;
    addr[1] = delta_phi;
    return LookupPacked(idx, addr);
  };
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 kinem::delta_eta(), kinem::delta_phi(), and L1MuGMTLUT::Lookup().

Referenced by L1MuGMTMatcher::lookup_mq().

                                                                                     {
    std::vector<unsigned> addr(2);
    addr[0] = delta_eta;
    addr[1] = delta_phi;
    return Lookup(idx, addr) [0];
  };
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 mathSSE::sqrt().

Referenced by LookupFunctionPacked().

                                                                                                        {
  // idx is DTRPC, CSCRPC, DTCSC, CSCDT, CSCbRPC, DTfRPC
  // INPUTS:  delta_eta(4) delta_phi(3)
  // OUTPUTS: mq(6) 

  const L1MuGMTScales* theGMTScales = L1MuGMTConfig::getGMTScales();

  float deta = theGMTScales->getDeltaEtaScale(idx)->getCenter( delta_eta );
  float dphi = theGMTScales->getDeltaPhiScale()->getCenter( delta_phi );
      
  // check out-of range code
  L1MuSignedPacking<4> EtaPacking;
  int delta_eta_signed = EtaPacking.idxFromPacked(delta_eta);
  L1MuSignedPacking<3> PhiPacking;
  int delta_phi_signed = PhiPacking.idxFromPacked(delta_phi);

  bool dphi_outofrange = (delta_phi_signed == -4);

  // limit delta-phi even further    **FIXME: make this configurable
  if (delta_phi_signed >=3 || delta_phi_signed <=-3) 
    dphi_outofrange = true;

  // check out-of range code
  bool deta_outofrange = (delta_eta_signed == -8);

  // limit delta-eta even further    **FIXME: make this configurable
  if (delta_eta_signed >=7 || delta_eta_signed <=-7) 
    deta_outofrange = true;

  double delta_etaphi = sqrt(m_EtaWeights[idx]*deta*deta + m_PhiWeights[idx]*dphi*dphi);

//    cout << "MQ LUT       : delta_phi = " << dphi
//         << ", delta_eta = " << deta
//         << ", delta_etaphi = " << delta_etaphi
//         << endl;

      
  int matchqual = 0;
  if ( dphi_outofrange || deta_outofrange ||
       delta_etaphi > m_EtaPhiThresholds[idx] ) {
    matchqual = 0;
  }
  else {
    double mq = 64. * (m_EtaPhiThresholds[idx] - delta_etaphi) / m_EtaPhiThresholds[idx];
    matchqual = static_cast<int>(mq);
  }

  if (matchqual > 63) matchqual = 63;
  return matchqual;  
}

Member Data Documentation

Definition at line 94 of file L1MuGMTLFMatchQualLUT.h.

Referenced by InitParameters(), and TheLookupFunction().

Private data members (LUT parameters);.

Definition at line 92 of file L1MuGMTLFMatchQualLUT.h.

Referenced by InitParameters(), and TheLookupFunction().

Definition at line 93 of file L1MuGMTLFMatchQualLUT.h.

Referenced by InitParameters(), and TheLookupFunction().