EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
packet_gl1.h
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file packet_gl1.h
1 #ifndef __PACKET_GL1_H__
2 #define __PACKET_GL1_H__
3 
4 /*
5  GL1 Accepted Event Data -
6 
7  This header file defines a standard structure that can be
8  used to map GL1 accepted event data into something a
9  bit more "useful".
10 
11  The documentation for the GL1 output data packets can be
12  found at:
13 
14  http://www.physics.iastate.edu/~npexp/papers.html
15  (the article you want is "GL1 Update: Monitor and L1DD Data")
16 
17  HISTORY:
18 
19  6/08/99 J.Lajoie - first version
20  6/09/99 J.Lajoie - updated, added multiple GL1, comments
21  7/12/99 J.Lajoie - updated, structure made more reasonable to match data
22  9/12/99 J.Lajoie - updated, removed zero words for GL1-1 and GL1-2
23 
24 */
25 
26 /* Each GL1 will have an output packet in the data stream */
27 
28 #define NUM_GL1_BOARDS 4
29 
30 #define HEADER3 0
31 #define YEAR 1
32 #define MONTH 2
33 #define DATE 3
34 #define DAY 4
35 #define HOUR 5
36 #define MIN 6
37 #define SECGL1 7 // previous SEC collided with /usr/include/sys/time.h
38 #define ALIGNMENT 8
39 #define CROSSCTR 9
40 #define BEAMCTR0 10
41 #define BEAMCTR1 11
42 #define GACCEPT 12
43 #define ACPTORINP 13
44 #define ACPTCTR 14
45 #define GRANCTR 15
46 #define GDISABLE 16
47 #define FACCEPT 17
48 #define HEADER2 18
49 #define PACCEPT 19
50 #define MODEBITS 20
51 #define RBITS0 21
52 #define RBITS1 22
53 #define DCMFULL 23
54 #define FEMUNREL 24
55 #define GBUSY 25
56 #define PXBAR 26
57 #define PBUSY 27
58 #define HEADER1 28
59 #define LUTINPUT 29
60 #define RAWTRIG 30
61 #define TRIGBUSY 31
62 #define LIVETRIG 32
63 #define SCALEDTRIG 33
64 #define TRIGPARXBAR 34
65 
66 /* A structure for the GL1-1 accepted event data */
67 
68 typedef struct{
69 
70  /* GL1 data */
71  unsigned short int gl1_header; /* 0x1aXX, XX=lower 8 bits of accept counter */
72  unsigned int lut_input[8]; /* packed LUT input data */
73  unsigned int lut_output; /* packed LUT output data (raw triggers) */
74  unsigned int trigger_busy; /* bit-coded trigger busies */
75  unsigned int live_trig_out; /* bit-coded live trigger output */
76  unsigned int scaled_trig_out; /* bit-coded scaled trigger output */
77  unsigned int trig_part_xbar_out; /* bit coded output of trig->part XBAR */
78 
79 } GL1_1_DATA;
80 
81 /* A structure for the GL1-2 accepted event data */
82 
83 typedef struct{
84 
85  /* GL2 data */
86  unsigned short int gl2_header; /* 0x2aXX, XX=lower 8 bits of accept counter */
87  unsigned int partition_accept; /* bit-coded partition accept vector */
88  unsigned short int mode_bits; /* GL1 mode bits for this event */
89  unsigned int reduced_bits[2]; /* 64 bit reduced bit input for this event */
90  unsigned int dcm_full_fem_busy; /* bit-coded dcm busy/FEM full vector */
91  unsigned int fem_unreliable; /* bit-coded FEM unreliable vector */
92  unsigned int granule_busy; /* bit-coded granule busy vector */
93  unsigned int part_busy_xbar_out; /* output of partition busy XBAR */
94  unsigned int part_busy_bus; /* partition busy bus for this event */
95 
96 } GL1_2_DATA;
97 
98 typedef struct{
99 
100 /* Time Stamp Structure */
101  unsigned short year;
102  unsigned short month;
103  unsigned short date;
104  unsigned short day;
105  unsigned short hour;
106  unsigned short min;
107  unsigned short sec;
108 
109 } GL1_TIME_STAMP ;
110 /* A structure for the GL1-3 accepted event data */
111 
112 typedef struct{
113 
114  /* GL3 data */
115  unsigned short int gl3_header; /* >0x3aXX, XX=lower 8 bits of accept counter */
116  GL1_TIME_STAMP timestamp; /* BCD coded timestamp */
117  unsigned short int alignment; /* system alignment bits */
118  unsigned int beam_crossing_counter[2]; /* 64-bit beam crossing counter */
119  unsigned short int bunch_crossing_counter; /* bunch crossing counter (reset by fiducial) */
120  unsigned int granule_accept_vector; /* bit-coded granule accept vector */
121  unsigned int accept_or_input; /* bit-coded input to accept OR */
122  unsigned int gl1_accept_counter; /* 32-bit GL1 accept counter */
123  unsigned short int granule_accept[32]; /* 16-bit granule accept counters */
124  unsigned int granule_disables; /* bit-coded granule disables */
125  unsigned int forced_accepts; /* bit-coded forced accepts */
126 
127 } GL1_3_DATA;
128 
129 typedef struct{
130 
135 
137 
138 
139 #include <packet_w124.h>
140 
145 #ifndef __CINT__
147 #else
148 class Packet_gl1 : public Packet_w4 {
149 #endif
150 public:
152  ~Packet_gl1();
153  virtual int iValue(const int channel, const char *what);
154  virtual int iValue(const int channel, const int what);
155  virtual void dump ( OSTREAM& );
156 
157 protected:
158  virtual void demangle ();
159  virtual int *decode (int *);
161 };
162 
163 #endif /* __PACKET_GL1_H__ */
164 
165 
166 
167 
168 
169 
170 
171 
172 
173 
174 
175 
176 
177 
178 
179 
180