// $Header: LCDLookUp2d.h $
// one dimensional lookup table
// 7-Jan-1999 Richard creation

#ifndef LCDLOOKUP2D_H
#define LCDLOOKUP2D_H

#include "TObject.h"
#include "TString.h"

class LCDLookUp2d : public TObject {

public:
  LCDLookUp2d(TString name, Double_t* key1, Double_t* key2, Double_t* matrix, 
	      Int_t numBins1, Int_t numBins2); // constructor
  ~LCDLookUp2d(); // destructor

  Double_t interpolateVal(Double_t val1, Double_t val2, Int_t* rc); 
  // do the interpolation
  TString* GetTableName() {return &m_name;} // Get name of table

  Double_t* GetKey1() { return m_key1; }
  Double_t* GetKey2() { return m_key2; }
  Double_t* GetMatrix() { return m_matrix; }

private:
  TString   m_name; // name of table
  Double_t *m_key1; //  coordinates of table in first dim
  Double_t *m_key2; //  coordinates of table in second dim
  Double_t *m_matrix; // values of table at gridpoints
  Int_t     m_numBins1; // number of bins in first dimension
  Int_t     m_numBins2; // number of bins in second dimension

public:
  ClassDef(LCDLookUp2d,0)    //  Class for a single 2-d lookup table
};

#endif
