StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
L3_Banks.hh
1 /***************************************************************************
2  *
3  * $Id: L3_Banks.hh,v 1.4 2001/09/24 21:42:56 struck Exp $
4  *
5  * Author: Christof Struck, struck@star.physics.yale.edu
6  ***************************************************************************
7  *
8  * Description: L3 raw data banks
9  *
10  *
11  *
12  * change log:
13  * 06 Jun 00 CS initial version
14  * 24 Jul 00 CS added i960 cluster banks
15  * 09 Sep 00 CS added l3_summary and summary_data in L3_P
16  *
17  ***************************************************************************
18  *
19  * $Log: L3_Banks.hh,v $
20  * Revision 1.4 2001/09/24 21:42:56 struck
21  * cs: changed vertex info to float (unit [cm]) in Bank_L3_GTD
22  *
23  * Revision 1.3 2001/08/20 05:37:45 struck
24  * removed naming conflicts with 'Stl3Utils/foreign/L3Formats.h'
25  *
26  * Revision 1.2 2001/07/17 19:16:11 struck
27  * update to 2001 data format (backwards compatible)Z
28  *
29  * Revision 1.1 2001/06/21 19:19:15 struck
30  * Should have been ...
31  *
32  * Revision 1.4 2000/09/11 16:25:20 struck
33  * added L3_summary and summary_data to L3_P
34  *
35  * Revision 1.3 2000/07/26 02:12:27 struck
36  * added i960 cluster reader
37  *
38  * Revision 1.2 2000/07/06 18:16:00 ward
39  * Install L3 code from Christof Struck.
40  *
41  *
42  **************************************************************************/
43 #ifndef L3_BANKS_HH
44 #define L3_BANKS_HH
45 
46 
48 #include "StDaqLib/GENERIC/RecHeaderFormats.hh"
49 #include "StDaqLib/GENERIC/swaps.hh"
51 
52 #define CHAR_L3_P "L3_P "
53 #define CHAR_L3_SECP "L3_SECP "
54 #define CHAR_L3_SECTP "L3_SECTP"
55 #define CHAR_L3_STK1D "L3_STK1D"
56 #define CHAR_L3_STK2D "L3_STK2D"
57 #define CHAR_L3_STK3D "L3_STK3D"
58 #define CHAR_L3_LTD "L3_LTD "
59 #define CHAR_L3_GTD "L3_GTD "
60 #define CHAR_L3_SECCD "L3_SECCD"
61 #define CHAR_L3_SUMD "L3_SUMD "
62 // i960 cluster banks
63 #define CHAR_TPCSECLP "TPCSECLP"
64 #define CHAR_TPCRBCLP "TPCRBCLP"
65 #define CHAR_TPCMZCLD "TPCMZCLD"
66 
67 
68 
69 // Top-level pointer bank
70 struct Bank_L3_P: public Bank
71 {
72  unsigned int len; // lenght of the entire L3 contribution
73  unsigned int time; // time when bank is produced
74  unsigned int gl3Id; // node Id of the gl3 who produced that event (was 'seq' before)
75  unsigned int trg_word;
76  unsigned int trg_in_word;
77  Pointer sector[24];
78  Pointer tracks; // offset/length to/of L3_GTD
79  Pointer summary_data; // offset/length to/of L3_SUMD
80  unsigned int L3_Summary[4]; // struct L3_summary
81  // following in format verion 4 _only_!!!
82  Pointer svt[5]; // 4 svt 'sectors' + 1 ssd
83  Pointer ftpc[2];
84  Pointer emc;
85 };
86 
87 
88 struct L3_Summary
89 {
90  unsigned int accept;
91  unsigned int build;
92  unsigned int on;
93  unsigned int nTracks;
94 };
95 
96 
98 {
99  int algId; // unique algorithm identifier (for non-humans)
100  char on; // 1 if this alg. was running on this event, 0 if not.
101  char accept;
102  char build;
103  char blub; // padding
104  unsigned int nProcessed; // number of events processed by that algorithm so far
105  unsigned int nAccept; // number of events that fullfilled alg. so far
106  unsigned int nBuild; // number of events that were flagged to be built
107  float data[10];
108 };
109 
110 
111 struct Bank_L3_SUMD: public Bank {
112  unsigned int nProcessed; // all events looked at
113  unsigned int nReconstructed; // nProcessed that didn't crash
114  int nAlg; // nr of registered algorithms
115  struct Algorithm_Data alg[1]; // array of size nAlg
116 
117  int swap();
118 };
119 
120 
121 
122 struct Bank_L3_SECP: public Bank
123 {
124  unsigned int len; // length of the entire sector contribution
125  unsigned int time; // time when the event is put together in unix format
126  unsigned int seq; // sequence nr. hopefully unique inside one run ;)
127  unsigned int trg_word; // for the future
128  unsigned int trg_in_word; // also future... don't even know what that means...
129  Pointer clusterp; // offset/length to/of TPCSECLP
130  Pointer trackp; // offset/length to/of L3_SECTP
131  Pointer sl3clusterp; // offlen for sl3 produced cluster data
132  // if length = 0 Bank is not present.
133 };
134 
135 
136 // only tracktype produced on sl3 beginning 04/06/00
138 {
139  short id; // track id
140  char nHits; // Number of hits assigned to the track
141  char ndedx; // Number of points used for dedx
142  short innerMostRow ; // Inner most row track expands
143  short outerMostRow ; // Outer most row track expands
144  short xy_chisq; // xy & sz chi2 packed in 16 bits each
145  short sz_chisq; // same as with track type II, divide by 10 for
146  // real result
147  float dedx; // dE/dx information
148  float pt; // pt time charge
149  float psi; // azimuthal angle of the momentum at (r,..
150  float tanl; // tg of the dip angle at (r,phi,z)
151  float z0; // z coordinate of the first point
152  float r0; // r coordinate of the first point
153  float phi0; // phi coordinate of the first point
154  float trackLength;
155  unsigned short dpt;
156  unsigned short dpsi;
157  unsigned short dtanl;
158  unsigned short dz0;
159 };
160 
161 
162 // Global tracks
164 {
165  int id; //primary key
166  unsigned short flag; // Primaries flag=1, Secondaries flag=0
167  char innerMostRow;
168  char outerMostRow;
169  unsigned char nHits; // Number of points assigned to that track
170  char reserved;
171  unsigned char ndedx; // nr of clusters contributing to the dedx value
172  char q; // charge
173  float chi2[2]; // chi squared of the momentum fit
174  float dedx; // dE/dx information
175  float pt; // pt (transverse momentum) at (r,phi,z)
176  float phi0; // azimuthal angle of the first point
177  float psi; // azimuthal angle of the momentum at (r,..
178  float r0; // r (in cyl. coord.) for the first point
179  float tanl; // tg of the dip angle at (r,phi,z)
180  float z0; // z coordinate of the first point
181  float length;
182  float dpt;
183  float dpsi;
184  float dz0;
185  float dtanl;
186 };
187 
188 
189 // cluster data produced on sl3:
191 {
192  unsigned short pad; // in 1/64 pads
193  unsigned short time; // in 1/64 time bins
194  unsigned short charge;
195  unsigned short flags;
196  unsigned short trackId;
197  char padrow;
198  unsigned char RB_MZ; // RB*16 | MZ, meaning upper 4 bits are RB,
199  // lower 4 bits are MZ
200 };
201 
202 
203 // Bank which actually has the global tracks in it:
204 // compared to the sector level tracks this merges the pointer and data bank
205 // into one Bank.
206 struct Bank_L3_GTD: public Bank
207 {
208  unsigned int nHits; // Nr of space points
209  unsigned int nTracks; // Nr of Tracks
210  float xVert; // x vertex position in [cm], !! unusable before !!
211  float yVert; // y vertex position
212  float zVert; // z vertex postion
213  globalTrack track[1];
214 
215  int swap();
216 };
217 
218 
219 struct Bank_L3_LTD: public Bank
220 {
221  localTrack track[1];
222 
223  int swap();
224 };
225 
226 // pointer bank for all sl3 track data
227 // here implemented: banks[0] points to local_track (L3_LTD struct)
228 struct Bank_L3_SECTP: public Bank
229 {
230  unsigned int nHits; // Nr of space points
231  unsigned int nTracks; // Nr of Tracks
232  unsigned int cpuTime; // CPU time in microseconds
233  unsigned int realTime; // real time in microseconds
234  int xVert; // x vertex position in 10**-6 cm
235  int yVert; // y vertex position
236  int zVert; //z vertex postion
237  int para; // parameter set used
238  Pointer banks[3]; // offset and length in 4 byte words for the
239 };
240 
241 
242 // cluster data produced on sl3:
243 struct Bank_L3_SECCD: public Bank
244 {
245  unsigned int nrClusters_in_sector;
246  L3_Cluster cluster[1];
247 
248  int swap();
249 };
250 
251 
252 
253 
254 
255 // Vertex
256 struct vertex {
257  float x;
258  float y;
259  float z;
260 };
261 
262 
263 // i960 cluster banks
264 // exported by SL3
265 struct Bank_TPCSECLP: public Bank
266 {
267  Pointer receiverBoard[12]; // year one: rb 1-6 odd sector, rb 7-12 even sector
268 };
269 
270 
271 struct Bank_TPCRBCLP: public Bank
272 {
273  Pointer mezzBoard[3];
274  int fiberHeader[12];
275 };
276 
277 
278 // already defined in TPCV2PO.Banks.hh
279 // defined here for consistency, since bank is normally
280 // exported by SL3
281 struct Bank_TPCMZCLD: public Bank
282 {
283  int numberOfRows;
284  int stuff[10]; // place holder for cluster data
285 
286  int swap();
287 };
288 
289 
290 // Swap short
291 int l3Swap_short (short* data, short size);
292 
293 #endif