L1MuDTQualPatternLut

Macros

Line Code
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84
//-------------------------------------------------
//
/**  \class L1MuDTQualPatternLut
 *
 *   Look-up tables for eta matching unit (EMU)
 *   stores lists of qualified patterns and
 *   coarse eta values 
 *
 *
 *   $Date: 2007/03/30 07:48:02 $
 *   $Revision: 1.1 $
 *
 *   N. Neumeister            CERN EP
 */
//
//--------------------------------------------------
#ifndef L1MUDT_QUALPATTERN_LUT_H
#define L1MUDT_QUALPATTERN_LUT_H

//---------------
// C++ Headers --
//---------------

#include "CondFormats/Serialization/interface/Serializable.h"

#include <vector>
#include <map>

//----------------------
// Base Class Headers --
//----------------------

//------------------------------------
// Collaborating Class Declarations --
//------------------------------------

//              ---------------------
//              -- Class Interface --
//              ---------------------

class L1MuDTQualPatternLut {
public:
  typedef std::pair<short, short> LUTID;
  typedef std::pair<short, std::vector<short> > LUTCONT;
  typedef std::map<LUTID, LUTCONT> LUT;
  typedef LUT::iterator EMULut_iter;

  /// constructor
  L1MuDTQualPatternLut();

  /// destructor
  virtual ~L1MuDTQualPatternLut();

  /// reset look-up tables
  void reset();

  /// load look-up tables
  int load();

  /// print look-up tables
  void print() const;

  /// get coarse eta value for a given sector processor [1-6] and address [1-22]
  int getCoarseEta(int sp, int adr) const;

  /// get list of qualified patterns for a given sector processor [1-6] and address [1-22]
  const std::vector<short>& getQualifiedPatterns(int sp, int adr) const;

  /// return number of entries in the LUT
  inline int size() const { return m_lut.size(); }

  /// return iterator which points to the first entry of the LUT
  inline EMULut_iter begin() { return m_lut.begin(); }

  /// return iterator which points to the one-past-last entry of the LUT
  inline EMULut_iter end() { return m_lut.end(); }

public:
  LUT m_lut;  // coarse eta values and list of qualified patterns

  COND_SERIALIZABLE;
};

#endif