StRoot
1
Main Page
Related Pages
Modules
Namespaces
Classes
Files
Examples
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Groups
Pages
RTS
src
DAQ_ITPC
itpcCore.h
1
#ifndef _ITPC_CORE_H_
2
#define _ITPC_CORE_H_
3
4
#include <DAQ_READER/daq_dta_structs.h>
5
6
7
//per sector
8
struct
itpc_ped_t
{
9
double
mean[64][64][512] ;
//fee,ch,timebin
10
double
rms[64][64][512] ;
11
int
cou[64][64][512] ;
12
13
double
g_mean[64][64] ;
//fee,ch
14
double
g_rms[64][64] ;
15
int
g_cou[64][64] ;
16
} ;
17
18
class
itpc_data_c
{
19
public
:
20
itpc_data_c
() { rdo_p = 0 ; next_word = 0 ;} ;
21
~
itpc_data_c
() {
22
if
(rdo_p) free(rdo_p) ;
23
rdo_p = 0 ;
24
}
25
26
//per FEE
27
struct
fee_ch_t
{
28
u_char port ;
//0..15
29
u_char fee ;
//0..63; padplane id
30
u_char ch ;
//0..63
31
u_char err ;
32
33
u_short words ;
34
} ;
35
36
//per RDO, per event
37
struct
rdo_t
{
38
u_char sector ;
39
u_char rdo ;
40
u_char
rb
;
41
u_char reserved ;
42
43
u_short token ;
44
45
u_char trg_cmd ;
46
u_char daq_cmd ;
47
48
49
50
fee_ch_t
*fee_ch[64*64] ;
//64 FEEs with 64ch
51
int
fee_ch_cou ;
52
} ;
53
54
rdo_t
*rdo_p ;
55
56
57
//start of RDO event
58
void
rdo_start(
int
sector,
int
irdo,
int
rb
) {
59
next_word = 0 ;
60
61
if
(rdo_p) {
62
//LOG(ERR,"rdo_p not free!") ;
63
}
64
else
{
65
rdo_p = (rdo_t *)malloc(
sizeof
(rdo_t)) ;
66
}
67
68
rdo_p->sector = sector ;
69
rdo_p->rdo = irdo ;
70
rdo_p->rb = rb ;
71
rdo_p->reserved = 0 ;
//just in case
72
73
rdo_p->fee_ch_cou = 0 ;
74
75
}
76
77
static
void
rdo_zap(
void
*rdo_p) ;
78
79
void
data_accum(fee_ch_t *fee_p,
int
tb,
int
adc) ;
80
81
int
fee_scan(u_short *d16,
int
shorts) ;
82
83
84
static
itpc_ped_t
*ped_p ;
85
static
int
ped_run ;
86
static
void
ped_start() ;
87
static
void
ped_stop() ;
88
89
u_int format_version ;
90
91
int
sector ;
92
93
int
port_id ;
//via RDO
94
95
int
fee_id ;
96
int
fee_ch ;
97
int
fee_err ;
98
99
int
sampa_id ;
100
int
sampa_ch ;
101
int
words ;
102
103
int
sampa_bx ;
104
int
sampa_type ;
105
106
int
tb_cou ;
107
daq_adc_tb
at[512] ;
108
109
private
:
110
int
next_word ;
111
int
hdr_cou[8] ;
112
113
int
start(u_short *d16) ;
114
};
115
116
117
extern
void
itpc_sampa_to_rowpad(
int
id
,
int
sampa,
int
ch,
int
&row,
int
&pad) ;
118
119
extern
void
itpc_ifee_to_rowpad(
int
fee_id,
int
ch,
int
&row,
int
&pad) ;
120
void
itpc_rowpad_to_ifee(
int
row,
int
pad,
int
&fee_id,
int
&fee_ch);
121
122
extern
void
itpc_rowpad_to_id(
int
row,
int
pad,
int
&
id
,
int
&pin) ;
123
extern
int
itpc_altro_to_ifee(
int
altro) ;
124
extern
void
itpc_altro_to_rowpad(
int
altro,
int
ch,
int
odd,
int
&row,
int
&pad) ;
125
126
#endif
daq_adc_tb
Definition:
daq_dta_structs.h:20
itpc_data_c::rdo_t
Definition:
itpcCore.h:37
rb
Definition:
rb.hh:21
itpc_ped_t
Definition:
itpcCore.h:8
itpc_data_c
Definition:
itpcCore.h:18
itpc_data_c::fee_ch_t
Definition:
itpcCore.h:27
Generated by
1.8.5