StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
bsmdPed.h
1 #ifndef _BSMD_PED_HH_
2 #define _BSMD_PED_HH_
3 
4 
5 #include <sys/types.h>
6 
7 
8 
9 /*
10  Operates on ONE sector only!
11 */
12 
13 class bsmdPed {
14 public:
15  bsmdPed() ;
16  ~bsmdPed() ;
17 
18 
19  int sector ; // if fee is overriden...
20  int valid ; // when calced or loaded
21 
22  void init(int active_rbs) ; // mallocs (if nece) and clears ped_store
23  void accum(char *evbuff, int bytes, int rdo) ;
24  void calc() ; // calculates mean/rms into ped_store
25  void do_thresh(double n_sm, double n_pre) ;
26  int do_zs(char *src, int in_bytes, char *dst, int rdo1, u_int *adc_sum=0) ;
27  int to_evb(char *buff) ; // to EVB format from ped_store
28 
29  int from_cache(const char *fname = 0) ; // from cached file to ped_store
30  int to_cache(const char *fname = 0, u_int run = 0) ; // to cached file from ped_store
31 
32  int special_setup(int run_type, int sub_type) ;
33 
34 
35 
36 private:
37  struct peds {
38  double ped[128][4800] ;
39  double rms[128][4800] ;
40  u_short thr[128][4800] ;
41  u_short cou[128] ;
42 
43  } *ped_store ;
44 
45 
46  int sizeof_ped ;
47 
48  u_int evts[6] ; // RDOs count from 0 here!
49  u_int valid_evts[6] ;
50  int rb_mask ;
51 
52 } ;
53 
54 #endif