#ifndef gregsBPLCMSFrame3DCorrFctnKt_hh
#define gregsBPLCMSFrame3DCorrFctnKt_hh

#include "StHbtMaker/Base/StHbtCorrFctn.hh"
#include "StHbtMaker/Base/StHbtPairCut.h"

//_________________
class gregsBPLCMSFrame3DCorrFctnKt : public StHbtCorrFctn {

 public:
  gregsBPLCMSFrame3DCorrFctnKt(char *title, 
			       const int &nbins, const float &Qlo, const float &Qhi,
			       const int& nCFs=10, const float& KtLo=0.05, const float& KtHi=1.05);

  virtual ~gregsBPLCMSFrame3DCorrFctnKt();

  virtual StHbtString Report();
  virtual void AddRealPair(const StHbtPair*);
  virtual void AddMixedPair(const StHbtPair*);

  virtual void Finish();
  void WriteOutHistos();

  StHbt3FHisto* Numerator(int j);
  StHbt3FHisto* Denominator(int j);
  StHbt3FHisto* QinvHisto(int j);

 private:

  StHbt3FHisto *mNumerator;
  StHbt3FHisto *mDenominator;
  StHbt3FHisto *mQinvHisto;

  //for the kt binning:
  int mNumberCFs;
  float mKtMin;
  float mKtMax;

  int* mIndex;
  float mDeltaKt;


#ifdef __ROOT__
  ClassDef(gregsBPLCMSFrame3DCorrFctnKt, 1)
#endif
};

inline StHbt3FHisto *gregsBPLCMSFrame3DCorrFctnKt::Numerator(int j) {
  return &mNumerator[j]; }
inline StHbt3FHisto *gregsBPLCMSFrame3DCorrFctnKt::Denominator(int j) {
  return &mDenominator[j]; }
inline StHbt3FHisto *gregsBPLCMSFrame3DCorrFctnKt::QinvHisto(int j) {
  return &mQinvHisto[j]; }
#endif
