#ifndef MARS_MHCalibrationTestCam
#define MARS_MHCalibrationTestCam

#ifndef MARS_MHCalibrationCam
#include "MHCalibrationCam.h"
#endif
#ifndef ROOT_TArrayF
#include "TArrayF.h"
#endif
#ifndef ROOT_TArrayI
#include "TArrayI.h"
#endif

class MGeomCam;
class MHCalibrationTestCam : public MHCalibrationCam
{

private:

  TArrayF fMeanMeanPhotPerArea;
  TArrayF fRmsMeanPhotPerArea   ;
  TArrayF fMeanSigmaPhotPerArea;
  TArrayF fRmsSigmaPhotPerArea   ;

  TArrayI fNotInterpolateablePixels;
  
  Bool_t ReInitHists(MParList *pList);
  Bool_t FillHists(const MParContainer *par, const Stat_t w=1);
  Bool_t FinalizeHists();
  
public:

  MHCalibrationTestCam(const char *name=NULL, const char *title=NULL);
  ~MHCalibrationTestCam() {}

  Bool_t GetPixelContent(Double_t &val, Int_t idx, const MGeomCam &cam, Int_t type=0) const;
  void DrawPixelContent(Int_t idx) const;

  const Float_t  GetMeanMeanPhotPerArea  ( const Int_t aidx ) const { return fMeanMeanPhotPerArea  [aidx]; }
  const Float_t  GetMeanSigmaPhotPerArea ( const Int_t aidx ) const { return fMeanSigmaPhotPerArea [aidx]; }
  const Float_t  GetRmsMeanPhotPerArea   ( const Int_t aidx ) const { return fRmsMeanPhotPerArea   [aidx]; }
  const Float_t  GetRmsSigmaPhotPerArea  ( const Int_t aidx ) const { return fRmsSigmaPhotPerArea  [aidx]; }

  const TArrayI &GetNotInterpolateablePixels ()               const { return fNotInterpolateablePixels;    }
  
  void CalcAverageSigma();
  
  ClassDef(MHCalibrationTestCam, 1)	// Histogram class for Relative Time Camera Calibration
};

#endif

