L1MuDTPhiLut

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
//-------------------------------------------------
//
/**  \class L1MuDTPhiLut
 *
 *   Look-up tables for phi-assignment
 *
 *
 *   $Date: 2007/03/30 07:48:02 $
 *   $Revision: 1.1 $
 *
 *   N. Neumeister            CERN EP
 */
//
//--------------------------------------------------
#ifndef L1MUDT_PHI_LUT_H
#define L1MUDT_PHI_LUT_H

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

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

#include <vector>
#include <map>
#include <utility>

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

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

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

class L1MuDTPhiLut {
public:
  /// constructor
  L1MuDTPhiLut();

  /// destructor
  virtual ~L1MuDTPhiLut();

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

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

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

  /// get delta-phi for a given address (bend-angle)
  int getDeltaPhi(int idx, int address) const;

  /// get precision for look-up tables
  std::pair<unsigned short, unsigned short> getPrecision() const;

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

private:
  typedef std::map<short, short, std::less<short> > LUT;

  std::vector<LUT> phi_lut;

  unsigned short int nbit_phi;
  unsigned short int nbit_phib;

  COND_SERIALIZABLE;
};

#endif