StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
tpxFCF_2D.h
1 #ifndef _TPX_FCF_2D_H_
2 #define _TPX_FCF_2D_H_
3 
4 
5 #include <stdlib.h>
6 
7 #include <DAQ_TPX/tpxFCF.h>
8 
9 
10 // remove DO_SIMULATION if running in DAQ PC (aka real-time)
11 #ifdef TPX_REALTIME
12  #ifdef DO_DBG
13  #undef DO_DBG
14  #endif
15 
16  #ifdef DO_SIMULATION
17  #undef DO_SIMULATION
18  #endif
19 
20 #else
21  #define DO_SIMULATION
22 #endif
23 
24 
25 class tpxFCF_2D : public tpxFCF
26 {
27 public:
28  tpxFCF_2D() ;
29 
30  ~tpxFCF_2D() {
31  if(data_raw) {
32  free(data_raw) ;
33  data_raw = 0 ;
34  }
35  }
36 
37 
38  static const int MAX_BLOB_COUNT = 400 ;
39  static const int MAX_SEQ_PER_BLOB = 256 ; // was 64 ;
40  static const int MAX_PEAKS_PER_BLOB = 30 ; // was 10 ;
41  static const int MAX_LATE_MERGE = 64 ;
42  static const int MAX_PADS_PER_RDO = 1152 ;
43 
44  void output(void *data, int count) ;
45 
46 
47  int stage_2d(u_int *outbuff, int max_bytes) ;
48  int do_pad_2d(tpx_altro_struct *a, daq_sim_adc_tb *sim_adc=0) ;
49 
50  void start_evt_2d(int sec1, int rdo1) {
51 
52  sector = sec1 ;
53  rdo = rdo1 ;
54 
55  data_raw_p = data_raw ;
56 
57  event++ ; // for debugging
58  cluster_id = 1 ; // start of cluster ids : for track id Offline stuff
59 
60  memset(p_row_pad,0,sizeof(p_row_pad)) ;
61  }
62 
63  int row ; // for debugging mostly
64  int event ; // for debugging too
65  int cluster_id ; // for track id Offline stuff
66 
67  int do_dump(int ix, u_int *obuff) ;
68 
69  int do_print(int row) ;
70 
71 
72  int data_raw_shorts ;
73 
74  short *data_raw ; // row, pad, tb_cou, tb_start, adc, adc, adc...
75  short *data_raw_p ;
76 
77  short *p_row_pad[100][183] ;
78 
79  struct blob_seq_t {
80  short *s ;
81 
82  short pad ;
83  short dummy ; // for alignment
84  } ;
85 
86  struct blob_t {
87  short cou ;
88  short flags ;
89 
90  struct blob_seq_t seq[MAX_SEQ_PER_BLOB] ;
91 
92  } blobs[MAX_BLOB_COUNT] ;
93 
94  struct blob_common_t {
95  short p1, p2 ;
96  short t1, t2 ;
97  short dp, dt ;
98  short dt_2 ;
99  short flags ;
100  } blob_c ;
101 
102  struct {
103  double f_charge ;
104  double f_p_ave ;
105  double f_t_ave ;
106 
107  short p1, p2 ;
108  short t1, t2 ;
109 
110  short i, j ;
111  short flags ;
112 
113 
114  short pix_cou ;
115 
116  short aux_flags ;
117 #ifdef DO_SIMULATION
118  u_short cluster_id ;
119  short quality ;
120  u_short track_id ;
121 #endif
122 
123  } peaks[MAX_PEAKS_PER_BLOB] ;
124 
125  int do_peaks(int peaks_cou) ;
126  void do_track_id(int peaks_cou) ;
127 
128  short dta[64*1024] ;
129  short *dta_s ; // for the filtered data...
130 
131 #ifdef DO_SIMULATION
132  u_short dta_t[32*1024] ; // for the track ids
133  u_short dta_id[32*1024] ; // for the cluster ids
134 #endif
135 } ;
136 
137 extern u_int *tpxFCF_2D_scan_to_next(tpxFCF_2D *fcf, u_int *end, u_int *start,tpx_altro_struct *a) ;
138 
139 
140 
141 #endif
Definition: tpxFCF.h:87