StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
SVTV1P0.Banks.hh
1 /***************************************************************************
2  *
3  * $Id: SVTV1P0.Banks.hh,v 1.6 2009/09/23 16:13:03 fine Exp $
4  *
5  * Author: Marcelo Munhoz, J. Schambach
6  ***************************************************************************
7  *
8  * Description: Record Formats for Version 2.0
9  *
10  ***************************************************************************
11  *
12  * $Log: SVTV1P0.Banks.hh,v $
13  * Revision 1.6 2009/09/23 16:13:03 fine
14  * fix pointer arithmetics and cpu type
15  *
16  * Revision 1.5 2004/03/01 18:05:47 fisyak
17  * Account for new place for rts.h, add osf
18  *
19  * Revision 1.4 2003/10/28 20:58:30 perev
20  * Linux ==> __linux__
21  *
22  * Revision 1.3 2001/04/18 19:47:25 ward
23  * StDaqLib/SVT stuff from Jo Schambach.
24  *
25  * Revision 1.2 2000/09/30 16:14:31 fisyak
26  * Add hp
27  *
28  * Revision 1.1 2000/06/06 18:08:31 jml
29  * Initial version of SVT Readers (author: marcello munholz, helen caines)
30  *
31  *
32  **************************************************************************/
33 
34 #ifndef SVTV1P0BANKS_HH
35 #define SVTV1P0BANKS_HH
36 
37 #define SVT_HYPERSECTORS 4
38 #define SVT_WAFERS 216
39 #define SVT_TOTALHYBRIDS 432
40 #define SVT_HYBRIDS 2
41 #define SVT_MZHYBRIDS 6
42 #define SVT_ANODES 240
43 #define SVT_MZANODES 256
44 #define SVT_MXSEQUENCE 8
45 
46 #define classname(x) x ## V1P0 //embed version number in bank name
47 
48 #include <sys/types.h>
49 #include "StDaqLib/GENERIC/RecHeaderFormats.hh"
50 
51 /* Used for variable length array declarations to get pointer type correct */
52 #define VARLENGTH 1
53 
54 // default swap
55 struct classname(Bank_SVTP): public Bank
56 {
57  Pointer HyperSector[4]; // Hypersectors = 1 -> Rcv Boards 1-6 (VME crate = 1)
58  // 2 -> Rcv Boards 7-12(VME crate = 1)
59  // 3 -> Rcv Boards 1-6 (VME crate = 2)
60  // 4 -> Rcv Boards 7-12(VME crate = 2)
61 };
62 
63 // default swap
64 struct classname(Bank_SVTSECP) : public Bank
65 {
66  Pointer RcvBoard[12];
67 };
68 
69 // override swap
70 struct classname(Bank_SVTRBP) : public Bank
71 {
72  Pointer Mz[3]; // [0]=mz a, [1]=mz b, [2]=mz c
73  char FiberHeader[64];
74 
75  int swap();
76 };
77 
78 // Default swap
79 struct classname(Bank_SVTMZP) : public Bank
80 {
81  Pointer SVTADCD;
82  Pointer SVTSEQD;
83  Pointer SVTADCX;
85  Pointer SVTCPPR;
86  Pointer SVTADCR;
87  Pointer SVTMZCLD;
89  Pointer SVTPEDR;
90  Pointer SVTRMSR;
93 };
94 
95 // SVTADCD - currently no compressed data. This structure
96 // only works with uncompressed data.
97 //
98 // override swap
99 struct classname(Bank_SVTADCD) : public Bank // zero suppressed data
100 {
101  char ADC[VARLENGTH];
102  int swap();
103 };
104 
105 // override swap
106 struct classname(Bank_SVTADCR) : public Bank // Mezzanine ADC Raw
107 {
108  char ADC[VARLENGTH];
109  int swap();
110 };
111 
112 // from this bank on, the SVT banks were not defined yet
113 // they were left here to be modfied
114 
116 {
117 #if defined (sparc) || defined (__hpux)
118  u_char barrel;
119  u_char ladder;
120  u_char waferID; // 4:hybrid, 4:wafer
121  u_char hybridID; // 1:not used, 2:transition board, 3:wafer, 2:hybrid
122 #elif defined(__i386__) || defined(__osf__) || defined(__x86_64__)
123  u_char hybridID; // 1:not used, 2:transition board, 3:wafer, 2:hybrid
124  u_char waferID; // 4:hybrid, 4:wafer
125  u_char ladder;
126  u_char barrel;
127 #else
128 #error "Unknown machine type"
129 #endif
130 };
131 
132 // override swap
133 struct classname(Bank_SVTANODK) : public Bank
134 {
135  INT32 bpADC;
136  INT32 bpCPP;
137  INT32 bpPED;
138  INT32 bpRMS;
139  INT32 bpCFG;
140  INT32 bpGAIN;
141  SVTCoordinates index[6];
142 
143  int swap();
144 };
145 
147 {
148  INT32 hybrid;
149  INT32 SVTADCD_offset; // offset to hybrid in SVTADCD
150  INT32 SVTSEQD_offset; // offset to hybrid in SVTSEQD
151 };
152 
153 // default swap
154 struct classname(Bank_SVTADCX) : public Bank // Mezzanine Index Bank
155 {
156  SVTADCX_entry entry[VARLENGTH]; // up to 4 repeats
157 };
158 
159 
161 {
162  INT16 start_time_bin;
163  INT16 stop_time_bin;
164 };
165 
166 // override swap
167 struct classname(Bank_SVTCPPR) : public Bank
168 {
169  ASIC_params asic_params;
170  SVTCPPR_entry entry[12288];
171 
172  int swap();
173 };
174 
175 
176 // override swap
177 struct classname(Bank_SVTSEQD) : public Bank
178 {
179  INT16 sequence[VARLENGTH];
180 
181  int swap();
182 };
183 
184 // override swap
185 struct classname(Bank_SVTCFGR) : public Bank
186 {
187  char FEE_id[6];
188 
189  int swap();
190 };
191 
193 {
194  u_char hybrid;
195  u_char anode;
196 };
197 
198 // override swap
199 struct classname(Bank_SVTBADR) : public Bank
200 {
201  SVTBADR_entry badChannel[VARLENGTH];
202  int swap();
203 };
204 
205 struct classname(Bank_SVTPEDR) : public Bank
206 {
207  INT32 NumEvents;
208  char pedestal[196608]; // 6 hybrids/mez * 256 anodes * 128 timebins
209 
210  int swap();
211 };
212 
213 struct classname(Bank_SVTRMSR) : public Bank
214 {
215  INT32 NumEvents;
216  char pedRMSt16[196608]; // pedRMS * 16
217 
218  int swap();
219 };
220 
222 {
223  INT16 t0t16; // t0 * 16
224  char t0_RMSt16; // t0_RMS * 16
225  char rel_gaint64; // rel gain ~n 1 * 64
226 };
227 
228 struct classname(Bank_SVTGAINR) : public Bank
229 {
230  INT32 NumEvents;
231  INT32 MeanGain;
232  SVTGAINR_entry Gain[6];
233 
234  int swap();
235 };
236 
237 // override swap
238 struct classname(Bank_SVTMZCLD) : public Bank
239 {
240  INT32 NumHybrids;
241  INT32 stuff[10]; // placeholder for actual bank contents
242  int swap();
243 };
244 
245 #endif
246 
247 
248