#ifndef HistoCollector1D_h
#define HistoCollector1D_h

#include <TFile.h>
#include <TSystem.h>
#include <TH1.h>
#include <TString.h>
#include <TAttMarker.h>
#include <iostream>
#include <vector>

using namespace std;

//_________________
class HistoCollector1D {

 public:
  HistoCollector1D();
  ~HistoCollector1D();
  
  void SetQinvBins(int qInvBins, double qInvLo, double qInvHi) {mQinvBins=qInvBins;mQinvLo=qInvLo;mQinvHi=qInvHi;}
  void SetPartType(int type) {mPartType=type;}
  void SetCentBins(int bins) {mCentBins=bins;}
  void SetKtBins(int bins) {mKtBins=bins;}
  void SetFileName(const char *name) {mFileName = name;}
  void LoadData();
  TH1F *BuildCentCF(int charge, int binLo, int binHi);
  TH1F *BuildCentKtCF(int charge, int centBinLo, int centBinHi,
		      int ktBinLo, int ktBinHi);
  TH1F *BuildNumerCentKtCF(int charge, int centBinLo, int centBinHi,
			   int ktBinLo, int ktBinHi);
  TH1F *BuildDenomCentKtCF(int charge, int centBinLo, int centBinHi,
			   int ktBinLo, int ktBinHi);

 private:

  void OpenFile();
  void ReadHistograms();
  void SetHistoStyle(TH1* h, int charge);
  void MakeCorrFctn1D(TH1* rat, TH1* num, TH1* den);
  void NormalizeQinv(TH1* h);

  TFile *mFile;

  int mCentBins;
  int mKtBins;

  const char *mFileName;
  int    mQinvBins;
  double mQinvLo;
  double mQinvHi;

  int mPartType;

  Int_t mCorrFctnColor;
  Int_t mCorrFctnLineWidth;
  Int_t mCorrFctnMarkerStyle;
  Double_t mCorrFctnMarkerSize;

  std::vector<TH1F *> hQinvNum;
  std::vector<TH1F *> hQinvDen;
};

#endif
