#ifndef _H3D_H_
#define _H3D_H_
/* 2d histogramming */
#define H3D_ID 0x12
#pragma pack(4)
typedef struct
{
unsigned int id,len;
unsigned int nx;
unsigned int ny;
unsigned int nz;
int nentries;
unsigned int size;
double min;
double max;
double minx;
double miny;
double minz;
double stepx;
double stepy;
double stepz;
char name[20];
char title[100];
char titlex[40];
char titley[40];
char titlez[40];
double *data;
}H3D;
#pragma pack()
double H3DGetYBinCenter(int h3d,int ybin);
double H3DGetYBinCenter(int h3d,int xbin);
int H3DClear(int h3d);
int H3DPrint(int h3d);
int H3DExist(int h3d);
int H3DCalculateBin(int h3d, int axis, double value);
int H3DGetBin(int h3d,int x, int y, int z);
int H3DFill(int h3d,double x, double y, double z, double val);
int H3DFillBin(int h3d,int x, int y, int z, double val);
double H3DGetBinContent(int h3d,int atx, int aty, int atz);
int H3DInit(int h3d,char *name, char *title,int nx, double minx, double stepx, int ny, double miny, double stepy,int nz, double minz, double stepz);
int H3DWrite(int h3d,const char *fname,const char*opt);
int H3DWrite2File(int h3d,FILE *fp);
int H3DSetTitle(int h3d,char *title);
int H3DSetTitleX(int h3d,char *title);
int H3DSetTitleY(int h3d,char *title);
int H3DSetTitleZ(int h3d,char *title);
int H3DSetName(int h3d,char *title);
int H3DGetNbinsY(int h);
int H3DGetNbinsX(int h);
int H3DGetNbinsZ(int h);
double H3DGetMinX(int h);
double H3DGetMinY(int h);
double H3DGetMinZ(int h);
double H3DGetStepX(int h);
double H3DGetStepY(int h);
double H3DGetStepZ(int h);
double H3DGetMin(int h);
double H3DGetMax(int h);
double * H3DGetSliceXYData(int h, int slice);
double * H3DGetData(int h);
#endif