StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
iccp2k.h
1 #ifndef _ICCP2K_H_
2 #define _ICCP2K_H_
3 
4 #include <sys/types.h>
5 #include <daqFormats.h>
6 // Event Flag Definition
7 
8 typedef unsigned int u_int;
9 typedef unsigned short u_short;
10 typedef unsigned char u_char;
11 typedef unsigned long long int UINT64;
12 
13 #define CMD2_PING 0x01
14 #define CMD2_DATA 0x02
15 #define CMD2_RELEASE 0x03
16 #define CMD2_RUN_DONE 0x04
17 #define CMD2_LOG 0x05
18 #define CMD2_L3_RELEASE 0x06
19 #define CMD2_FUTURE_DATA 0x07
20 #define CMD2_FUTURE_RELEASE 0x08
21 #define CMD2_EMULATE_EVENT 0x09
22 #define CMD2_L4_DATA 0x10
23 #define CMD2_STREAMING_TRIGGER 0x11
24 
25 // set by daq100decision
26 #define EVBFLAG_RAW_DATA (1<<0)
27 #define EVBFLAG_FCF_DATA (1<<1)
28 #define EVBFLAG_HLT (1<<2)
29 
30 // Used in EVB
31 #define EVBFLAG_DET_RELEASE (1<<5) // Released by DET
32 #define EVBFLAG_TIMEOUT (1<<6) // Timedout by EVB
33 #define EVBFLAG_BADBUILD (1<<7)
34 #define EVBFLAG_FUTURE_RELEASE (1<<8)
35 #define EVBFLAG_L4_PROCESSED (1<<9)
36 
37 // Appended by prepare_gb_payload
38 #define EVBFLAG_L1ABORT (1<<11)
39 #define EVBFLAG_L25ABORT (1<<12)
40 #define EVBFLAG_L25TIMEOUT (1<<13)
41 #define EVBFLAG_L3ABORT (1<<14)
42 
43 #pragma pack(1)
44 
45 //#ifdef RTS_LITTLE_ENDIAN
46 struct iccp2k {
47  u_int words; // words of the bank to follow (not including this header)
48  u_short srcNode; // source node
49  u_short dstNode; // destination node
50  u_char srcTask;
51  u_char dstTask;
52  u_short token;
53  u_char cmd;
54  u_char pad1;
55  u_short payload_words; // normally 0. Number of words of payload.
56 };
57 /* #else */
58 /* struct iccp2k { */
59 /* u_int words; // words of the bank to follow (not including this header) */
60 /* //----- */
61 /* u_short dstNode; */
62 /* u_short srcNode; */
63 /* //---- */
64 /* u_short token; */
65 /* u_char dstTask; */
66 /* u_char srcTask; */
67 /* //---- */
68 /* u_char pad3; */
69 /* u_char pad2; */
70 /* u_char pad1; */
71 /* u_char cmd; */
72 /* }; */
73 /* #endif */
74 
75 
76 // Versioning for gbPayload:
77 //
78 // if (GB_PAYLOAD_VERSION & 0xff000000) != 0xDA000000
79 // then version = gbPayload_0x01
80 // else
81 // version = gbPayloadVersion...
82 
83 
84 #define GB_PAYLOAD_VERSION 0xDA000003
85 // 2019 run, expand the rtsDetMask
86 struct gbPayload {
87  u_int gbPayloadVersion;
88 
89  union {
90  EvtDescData EventDescriptor ; // take from data! // big endian
91  u_int eventDesc[sizeof(EvtDescData)/4];
92  };
93 
94  // The rest is all little endian...
95  u_int L3summary[4] ;
96  u_int L2summary[2];
97  u_int L1summary[2];
98  UINT64 rtsDetMask;
99  u_int eventNumber;
100  u_int sec;
101  u_int usec;
102  u_int flags; // bit 0 set, tpc raw data inside
103  u_int evp;
104  u_int token;
105 };
106 
107 // #define GB_PAYLOAD_VERSION 0xDA000002
108 // 2008 run, pre-new TCU: gbPayloadVersion=0xDA000002, TrgDataFmtVer=0x40
110  u_int gbPayloadVersion;
111 
112  union {
113  EvtDescData EventDescriptor ; // take from data! // big endian
114  u_int eventDesc[sizeof(EvtDescData)/4];
115  };
116 
117  // The rest is all little endian...
118  u_int L3summary[4] ;
119  u_int L2summary[2];
120  u_int L1summary[2];
121  u_int rtsDetMask;
122  u_int eventNumber;
123  u_int sec;
124  u_int usec;
125  u_int flags; // bit 0 set, tpc raw data inside
126  u_int evp;
127  u_int token;
128 };
129 
130 // 2008 run, pre-new TCU: gbPayloadVersion=0xDA000002, TrgDataFmtVer=0x40
132  u_int gbPayloadVersion;
133 
134  union {
135  EventDescriptor2008a EventDescriptor ; // take from data! // big endian
136  u_int eventDesc[sizeof(EventDescriptor2008a)/4];
137  };
138 
139  // The rest is all little endian...
140  u_int L3summary[4] ;
141  u_int L2summary[2];
142  u_int L1summary[2];
143  u_int rtsDetMask;
144  u_int eventNumber;
145  u_int sec;
146  u_int usec;
147  u_int flags; // bit 0 set, tpc raw data inside
148  u_int evp;
149  u_int token;
150 };
151 
152 
154 
155 // 2008 run, before adding format but after TrgDataFmtVer-->0x40
157  // big endian
158  union {
159  EventDescriptor2008a EventDescriptor ; // take from data!
160  u_int eventDesc[sizeof(EventDescriptor2008a)/4];
161  };
162 
163  // The rest is all little endian...
164  u_int L3summary[4] ;
165  u_int L2summary[2];
166  u_int L1summary[2];
167  u_int rtsDetMask;
168  u_int eventNumber;
169  u_int sec;
170  u_int usec;
171  u_int flags; // bit 0 set, tpc raw data inside
172  u_int evp;
173  u_int token;
174 };
175 
176 // TrgDataFmtVer<0x40
177 struct gbPayload_0x01 { // for 2007 run
178  // big endian
179  union {
180  EventDescriptor2007 EventDescriptor ; // take from data!
181  u_int eventDesc[sizeof(EventDescriptor2007)/4];
182  };
183 
184  // The rest is all little endian...
185  u_int L3summary[4] ;
186  u_int L2summary[2];
187  u_int L1summary[2];
188  u_int rtsDetMask;
189  u_int eventNumber;
190  u_int sec;
191  u_int usec;
192  u_int flags; // bit 0 set, tpc raw data inside
193  u_int evp;
194  u_int token;
195 };
196 
197 
198 
199 
201 
202 
203 
204 struct evpPayload {
205  u_int run;
206  u_int type;
207  u_int seq;
208 };
209 
210 struct tapeMsg {
211  int cmd;
212  int tevt;
213  int stream;
214 };
215 
216 // network byte order...
217 struct evtDoneMsg {
218  u_short token;
219  u_short status;
220 };
221 
222 #define EVB_SUMMARY_VERSION 3
223 
225  u_int version;
226  u_int sz;
227  UINT64 detectorsInRun;
228  float triggerFrequency;
229  u_int runNumber;
230 };
231 
233  u_int version;
234  u_int sz;
235  UINT64 detectorsInRun;
236 };
237 
239  u_int version; // version
240  u_int sz; // size of structure
241  u_int detectorsInRun;
242 };
243 
244 typedef EvbSummary_v3 EvbSummary;
245 
246 #pragma pack()
247 
248 #endif
Definition: iccp2k.h:46