00001 #ifndef _TPX_PED_HH_
00002 #define _TPX_PED_HH_
00003
00004
00005 #include <sys/types.h>
00006
00007 #include "tpxCore.h"
00008
00009
00010
00011
00012
00013
00014 class tpxPed {
00015 public:
00016 tpxPed() ;
00017 ~tpxPed() ;
00018
00019
00020 int clock_source ;
00021 int sector ;
00022 int valid ;
00023
00024 void init(int active_rbs) ;
00025 void accum(char *evbuff, int bytes) ;
00026 void calc() ;
00027
00028 int to_altro(char *buff, int rb, int timebins) ;
00029
00030 int to_evb(char *buff) ;
00031 int from_evb(char *buff, int bytes) ;
00032
00033 int from_cache(char *fname = 0, u_int r_mask = 0x3F) ;
00034 int to_cache(char *fname = 0, u_int run = 0) ;
00035
00036 int special_setup(int run_type, int sub_type) ;
00037 int hlt_debug_setup(int param) ;
00038
00039 void kill_bad(int row, int pad) ;
00040
00041
00042 void smooth() ;
00043 int summarize(FILE *log=0) ;
00044
00045 int max_events ;
00046
00047 int rb_mask ;
00048 private:
00049 struct peds {
00050 double ped[512] ;
00051 double rms[512] ;
00052 u_short cou[512] ;
00053 } *ped_store ;
00054
00055 int smoothed ;
00056
00057
00058
00059 int sizeof_ped ;
00060
00061 u_int evts[6] ;
00062 u_int valid_evts[6] ;
00063
00064
00065 void accum(tpx_altro_struct *a) ;
00066
00067 struct peds *get(int row, int pad) {
00068 return (ped_store + row*183 + pad) ;
00069 }
00070 } ;
00071
00072 #endif