L1MuDTExtLut

LUT

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 85 86
//-------------------------------------------------
//
/**  \class L1MuDTExtLut
 *
 *   Look-up tables for extrapolation
 *
 *
 *   $Date: 2008/04/09 15:22:31 $
 *   $Revision: 1.4 $
 *
 *   N. Neumeister            CERN EP
 */
//
//--------------------------------------------------
#ifndef L1MUDT_EXT_LUT_H
#define L1MUDT_EXT_LUT_H

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

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

#include <vector>
#include <map>

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

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

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

class L1MuDTExtLut {
public:
  /// helper class for look-up tables
  class LUT {
  public:
    typedef std::map<short, short, std::less<short> > LUTmap;

    LUTmap low;
    LUTmap high;

    COND_SERIALIZABLE;
  };

  /// constructor
  L1MuDTExtLut();

  /// destructor
  virtual ~L1MuDTExtLut();

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

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

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

  /// get low_value for a given address
  int getLow(int ext_ind, int address) const;

  /// get high_value for a given address
  int getHigh(int ext_ind, int address) const;

private:
  /// set precision for look-up tables
  void setPrecision();

private:
  std::vector<LUT> ext_lut;

  unsigned short int nbit_phi;
  unsigned short int nbit_phib;

  COND_SERIALIZABLE;
};

#endif