#ifndef _H2D_H_
 
#define _H2D_H_
 
 
 
#ifdef __CINT__
 
#define HALIGN 41
 
#else
 
#define HALIGN 40
 
#endif
 
 
 
 
 
/* 2d histogramming */
 
#define H2D_ID 0x10
 
#pragma pack(4)
 
typedef struct {
 
  unsigned int id,len;
 
  unsigned int nx;
 
  unsigned int ny;
 
  int nentries;
 
  unsigned int size;   // 6*4
 
  double min;
 
  double max;
 
  double minx;
 
  double miny;
 
  double stepx;
 
  double stepy;  // 6*8
 
  char name[20];
 
  char title[100];
 
  char titlex[40];
 
  char titley[HALIGN]; // 196
 
  double *data;
 
} H2D;
 
#pragma pack()
 
 
 
double H2DGetYBinCenter(int h2d,int ybin);
 
double H2DGetYBinCenter(int h2d,int xbin);
 
 
 
int H2DClear(int h2d);
 
int H2DPrint(int h2d);
 
int H2DExist(int h2d);
 
int H2DCalculateBin(int h2d, int axis, double value);
 
int H2DGetBin(int h2d,int x, int y);
 
int H2DFill(int h2d,double x, double y, double val);
 
int H2DFillBin(int h2d,int x, int y, double val);
 
double H2DGetBinContent(int h2d,int atx, int aty);
 
int H2DInit(int h2d,const char *name,const char *title,int nx, double minx, double stepx, int ny, double miny, double stepy);
 
int H2DWrite(int h2d,const char *fname,const char*opt);
 
int H2DWrite2File(int h2d,FILE *fp);
 
int H2DSetTitle(int h2d,const char *title);
 
int H2DSetTitleX(int h2d,const char *title);
 
int H2DSetTitleY(int h2d,const char *title);
 
int H2DSetName(int h2d,const char *title);
 
 
 
int H2DGetNbinsY(int h);
 
int H2DGetNbinsX(int h);
 
double H2DGetMinY(int h);
 
double H2DGetMinX(int h);
 
double H2DGetStepY(int h);
 
double H2DGetStepX(int h);
 
double H2DGetMin(int h);
 
double H2DGetMax(int h);
 
double * H2DGetData(int h);
 
 
 
#endif /* _H2D_H_ */