Rev 261 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
| Rev 261 | Rev 264 | ||
|---|---|---|---|
| Line 9... | Line 9... | ||
| 9 | # include <string.h> |
9 | # include <string.h> |
| 10 | #endif _CVI_ |
10 | #endif _CVI_ |
| 11 | 11 | ||
| 12 | #include "H1D.h" |
12 | #include "H1D.h" |
| 13 | 13 | ||
| 14 | #define H1DMAX 500 |
- | |
| - | 14 | ||
| 15 | H1D *h1[H1DMAX]; |
15 | H1D *h1[H1DMAX]; |
| 16 | //int Printf(char *format, ...); |
16 | //int Printf(char *format, ...); |
| 17 | 17 | ||
| 18 | int _VI_FUNC H1D_Clear(int h1d) { |
18 | int _VI_FUNC H1D_Clear(int h1d) { |
| 19 | if (!h1[h1d]) return -1; |
19 | if (!h1[h1d]) return -1; |
| Line 77... | Line 77... | ||
| 77 | //Printf("FillH1D_ error h1d is not initialized\n"); |
77 | //Printf("FillH1D_ error h1d is not initialized\n"); |
| 78 | return -1; |
78 | return -1; |
| 79 | } |
79 | } |
| 80 | 80 | ||
| 81 | h1[h1d]->data[x]+=val; |
81 | h1[h1d]->data[x]+=val; |
| 82 | //Printf("%d %d data %f %f\n",x,y,val, h1[h1d]->data[idx]); |
82 | //Printf("%d %d data %f %f\n",x,y,val, h1[h1d]->data[idx]); |
| 83 | if (h1[h1d]->data[x]>h1[h1d]->max) h1[h1d]->max= h1[h1d]->data[x]; |
83 | if (h1[h1d]->data[x]>h1[h1d]->max) h1[h1d]->max= h1[h1d]->data[x]; |
| 84 | if (h1[h1d]->data[x]<h1[h1d]->min) h1[h1d]->min= h1[h1d]->data[x]; |
84 | if (h1[h1d]->data[x]<h1[h1d]->min) h1[h1d]->min= h1[h1d]->data[x]; |
| 85 | h1[h1d]->nentries++; |
85 | h1[h1d]->nentries++; |
| 86 | return 0; |
86 | return 0; |
| 87 | } |
87 | } |
| Line 144... | Line 144... | ||
| 144 | h1[h1d]->data = (double *) malloc(h1[h1d]->size); |
144 | h1[h1d]->data = (double *) malloc(h1[h1d]->size); |
| 145 | h1[h1d]->len=sizeof(H1D)-sizeof(double *)+h1[h1d]->size; |
145 | h1[h1d]->len=sizeof(H1D)-sizeof(double *)+h1[h1d]->size; |
| 146 | H1D_Clear(h1d); |
146 | H1D_Clear(h1d); |
| 147 | H1D_Print(h1d); |
147 | H1D_Print(h1d); |
| 148 | //Printf("InitH1D 0x%x\n", h1d ); |
148 | //Printf("InitH1D 0x%x\n", h1d ); |
| 149 | return |
149 | return h1d; |
| 150 | 150 | ||
| 151 | } |
151 | } |
| 152 | 152 | ||
| 153 | 153 | ||
| 154 | double _VI_FUNC H1D_GetXBinCenter(int h1d,int xbin) { |
154 | double _VI_FUNC H1D_GetXBinCenter(int h1d,int xbin) { |