#ifndef QinvCorrFctn_MomCons_hh
#define QinvCorrFctn_MomCons_hh

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

//_________________
class QinvCorrFctn_MomCons : public StHbtCorrFctn {

 public:
  QinvCorrFctn_MomCons(char* title, const int& nbins, 
		       const float& QinvLo, const float& QinvHi);
  virtual ~QinvCorrFctn_MomCons();

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

  virtual void Finish();

  void SetMass(const float &mass) {mPartMass = mass;}
  StHbt1DHisto* Numerator();
  StHbt1DHisto* Denominator();

  StHbt1DHisto* NumeratorPt1xPt2();
  StHbt1DHisto* NumeratorPt1SqrSumPt2Sqr();

  StHbt1DHisto* NumeratorPz1xPz2();
  StHbt1DHisto* NumeratorPz1SqrSumPz2Sqr();

  StHbt1DHisto* NumeratorE1xE2();
  StHbt1DHisto* NumeratorE1sumE2();

  void WriteOutHistos();

private:

  float mPartMass;
  StHbt1DHisto* mNumerator;
  StHbt1DHisto* mDenominator;

  StHbt1DHisto* mNumeratorPt1xPt2;
  StHbt1DHisto* mNumeratorPt1SqrSumPt2Sqr;
  StHbt1DHisto* mNumeratorPz1xPz2;
  StHbt1DHisto* mNumeratorPz1SqrSumPz2Sqr;

  StHbt1DHisto* mNumeratorE1xE2;
  StHbt1DHisto* mNumeratorE1sumE2;

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

inline StHbt1DHisto* QinvCorrFctn_MomCons::Numerator(){return mNumerator;}
inline StHbt1DHisto* QinvCorrFctn_MomCons::Denominator(){return mDenominator;}
inline StHbt1DHisto* QinvCorrFctn_MomCons::NumeratorPt1xPt2(){return mNumeratorPt1xPt2;}
inline StHbt1DHisto* QinvCorrFctn_MomCons::NumeratorPt1SqrSumPt2Sqr() {
  return mNumeratorPt1SqrSumPt2Sqr; }

inline StHbt1DHisto* QinvCorrFctn_MomCons::NumeratorPz1xPz2(){return mNumeratorPz1xPz2;}
inline StHbt1DHisto* QinvCorrFctn_MomCons::NumeratorPz1SqrSumPz2Sqr() {
  return mNumeratorPz1SqrSumPz2Sqr; }

inline StHbt1DHisto* QinvCorrFctn_MomCons::NumeratorE1xE2(){return mNumeratorE1xE2;}
inline StHbt1DHisto* QinvCorrFctn_MomCons::NumeratorE1sumE2(){return mNumeratorE1sumE2;}

#endif
