StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
stgcPed.h
1 #ifndef _STGC_PED_HH_
2 #define _STGC_PED_HH_
3 
4 
5 #include <sys/types.h>
6 
7 #include <DAQ_TPX/tpxCore.h>
8 
9 
10 /*
11  Operates on ONE sector only!
12 */
13 
14 class stgcPed {
15 public:
16  stgcPed() ;
17  ~stgcPed() ;
18 
19 
20 
21  int valid ; // when calced or loaded
22 
23  void init(int sec, int active_rbs) ; // mallocs (if nece) and clears ped_store
24  void clear() ; // zaps storage
25 
26  void accum(char *evbuff, int bytes) ;
27  void calc() ; // calculates mean/rms into ped_store
28 
29  int to_altro(char *buff, int rb, int timebins) ;// to ALTRO format from ped_store
30 
31  int to_evb(char *buff) ; // to EVB format from ped_store
32 
33  int from_cache(char *fname = 0, u_int r_mask = 0x3F) ; // from cached file to ped_store
34  int to_cache(char *fname = 0, u_int run = 0) ; // to cached file from ped_store
35 
36 
37 
38  int kill_bad(int r0_logical,int altro, int ch) ; // kills this specific pad in ped_store
39 
40  void smooth() ;
41 
42  int max_events ; // max events allowed in the calculation
43 
44 
45 private:
46 
47  int sector ;
48  int rb_mask ;
49 
50  int evts[6] ;
51  int valid_evts[6] ;
52  int altro_found[256] ;
53 
54  struct peds {
55  double ped[512] ;
56  double rms[512] ;
57  u_short cou[512] ;
58  } peds[256][16] ; // ALTRO:ch
59 
60 
61  void accum(tpx_altro_struct *a) ;
62 
63 } ;
64 
65 #endif
Definition: rb.hh:21