00001
00016
00017
00018
00019
00020
00021
00022 #ifndef _SCAN_H
00023 #define _SCAN_H
00024
00025 #include <stdio.h>
00026 #include "iocount.h"
00027
00028
00029
00030
00031
00060 class scan_t {
00061
00062 public:
00064 enum direct {BACK=-1,MERG=0,FORW=+1} ;
00065
00086 void set(int ncnt = 0, double nonlin = -1) ;
00087
00097 scan_t(int ncnt = 0, double nonlin = -1) ;
00098
00105 ~scan_t() {
00106 #ifdef SCANDEBUG
00107 printf("scan_t Destructor \n") ;
00108 #endif
00109 set(0) ; }
00110
00123 void accum(const count_t * scan, direct which) ;
00124
00132 void merge() ;
00133
00141 double * get(direct which = MERG) const ;
00142
00182 void center(double * x1, double * x2, direct which = MERG,
00183 bool fixcenter = false) ;
00184
00206 static void loadconst(double scale, double a = 0, double b = -99,
00207 double x1c = 0, double x2c = 0) ;
00208
00224 double xshift() const { return scale * ((x1+x2)/2 - (x1c+x2c)/2) - yshift()*b ; }
00225
00232 double yshift() const { return ((x2-x1) - (x2c-x1c)) / a ; }
00233
00251 double sharpness (int defrange, direct which = MERG) const ;
00252
00253 private:
00254
00255 int ncnt ;
00256 int maxncnt ;
00258 static double scale ;
00260 static double a ;
00263 static double b ;
00266 static double x1c ;
00268 static double x2c ;
00270 double x1 ;
00271 double x2 ;
00273
00274
00276 double * fscan ;
00278 double * bscan ;
00280 double * mscan ;
00281
00282 int nfscan ;
00283 int nbscan ;
00284 double nonlin ;
00286 } ;
00287
00288 #endif