StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
L3Formats.h
1 /* Written 11/23/99 cle
2  * changes:
3  * 11/24/99 cle: renamed some variables
4  * 12/06/99 ppy: add xLastHit, yLastHit to type1_track
5  * 01/31/00 ppy: add innerMostRow and outerMostRow to type1_track
6  * 03/29/00 cle: added global_track, L3_GTD, L3_SECCD.
7  * added offlen sl3clusterp to L3_SECP.
8  * added offlen tracks to L3_P.
9  * 04/06/00 cle: implement pablos suggestion to divide L3_SECCD into
10  * L3_SECCD and L3_CLUSTER, named it l3_cluster
11  * added L3_LTD and local_track (pablos modified
12  * type3_track).
13  * format_number in L3_SECTP->bh defines the use of
14  * L3_SECTP->banks. 0: banks[0-2] = type1-3 track
15  * 1: banks[0] = local_track (L3_LTD)
16  * 08/18/00 cle: put L3 summary data and L3 summary into L3_P
17  * 03/07/01 cle: add svt/FTPC banks to L3_P
18  * 06/21/01 cle: changed L3_P->seq to L3_P->gl3Id for recontruction of counters
19  * 080801 cle: got rid of type1/2/3 tracks, change vertex to floats in gtd
20  * 082701 cle: format number is now 5, due to addition of trigger data offlen
21  *
22  */
23 
24 /******************* NOTE ********************************************
25  * This file should never be included directly. It is included from *
26  * /DAQ/include/daqFormats.h after the necessary structs are defined *
27  *********************************************************************/
28 
29 #ifndef _L3_FORMATS_H
30 #define _L3_FORMATS_H
31 
32 
33 #define CHAR_L3_P "L3_P "
34 #define CHAR_L3_SECP "L3_SECP "
35 #define CHAR_L3_SECTP "L3_SECTP"
36 #define CHAR_L3_LTD "L3_LTD "
37 #define CHAR_L3_GTD "L3_GTD "
38 #define CHAR_L3_SECCD "L3_SECCD"
39 #define CHAR_L3_SUMD "L3_SUMD "
40 
41 // structure for the 4 l3 summary words
42 //struct L3_summary{
43 // char quality[8];
44 // int nrTracks;
45 // unsigned int decision;
46 //};
47 
48 
49 struct L3_summary{
50  unsigned int accept;
51  unsigned int build;
52  unsigned int on;
53  unsigned int nTracks;
54 };
55 
56 struct algorithm_data{
57  int algId; // unique algorithm identifier (for non-humans)
58  char on; // 1 if this alg. was running on this event, 0 if not.
59  char accept;
60  char build;
61  char blub; // padding
62  unsigned int nProcessed; // events processed by that algorithm so far
63  unsigned int nAccept; // events that fullfilled alg. so far
64  unsigned int nBuild; // events that were flagged to be built
65  float data[10];
66 };
67 
68 struct L3_SUMD {
69  bankHeader bh;
70  unsigned int nProcessed; // all events looked at
71  unsigned int nReconstructed; // nProcessed that didn't crash
72  int nAlg; // nr of registered algorithms
73  struct algorithm_data alg[1]; // array of size nAlg
74 };
75 
76 struct algorithm_counter{
77  int id; // algorithm Id
78  unsigned int nProcessed;
79  unsigned int nAccept;
80  unsigned int nBuild;
81 };
82 
83 struct L3_counter{
84  unsigned int nProcessed;
85  unsigned int nRecontructed;
86  struct algorithm_counter alg[32];
87 };
88 
89 
90 
91 struct local_track {
92  short id; /* track id */
93  char nHits; /* Number of hits assigned to the track */
94  char ndedx; /* Number of points used for dedx */
95  short innerMostRow ; /* Inner most row track expands */
96  short outerMostRow ; /* Outer most row track expands */
97  short xy_chisq; /* xy & sz chi2 packed in 16 bits each */
98  short sz_chisq; /* same as with track type II, divide by 10 for
99  real result*/
100  float dedx; /* dE/dx information */
101  float pt ; /* pt time charge */
102  float psi; /* azimuthal angle of the momentum at (r,.. */
103  float tanl; /* tg of the dip angle at (r,phi,z) */
104  float z0; /* z coordinate of the first point */
105  float r0; /* r coordinate of the first point */
106  float phi0; /* phi coordinate of the first point */
107  float trackLength;
108  unsigned short dpt ;
109  unsigned short dpsi ;
110  unsigned short dtanl ;
111  unsigned short dz0 ;
112 }; // 13 dwords
113 
114 
115 struct L3_LTD {
116  struct bankHeader bh;
117  struct local_track track[1];
118 }; // 10 (+13) dwords
119 
120 // pointer bank for all track data pointing to L3_STK[1-3]D banks
121 // if format number in bankHeader == 0 : banks point to type1-3 tracks
122 // if format_number == 1 : banks[0] point to local_track (L3_LTD struct)
123 
124 struct L3_SECTP {
125  struct bankHeader bh;
126  // words:
127  unsigned int nHits; // Nr of space points
128  unsigned int nTracks; // Nr of Tracks
129  unsigned int cpuTime; // CPU time in microseconds
130  unsigned int realTime; // real time in microseconds
131  int xVert; // x vertex position in 10**-6 cm
132  int yVert; // y vertex position
133  int zVert; //z vertex postion
134  int para; // parameter set used
135  struct offlen banks[3]; // offset and length in 4 byte words for the
136  // track type I, II and III in this order
137  // if len = 0 for type x there will be no L3_STKxD
138  // bank
139 };
140 
141 
142 
143 // cluster data produced on sl3:
144 
145 struct l3_cluster{
146  unsigned short pad; // in 1/64 pads
147  unsigned short time; // in 1/64 time bins
148  unsigned short charge;
149  unsigned short flags;
150  unsigned short trackId;
151  char padrow ;
152  unsigned char RB_MZ; // RB*16 | MZ, meaning upper 4 bits are RB,
153  // lower 4 bits are MZ
154 };
155 
156 
157 // cluster data produced on sl3:
158 
159 struct L3_SECCD{
160  struct bankHeader bh;
161  unsigned int nrClusters_in_sector;
162  struct l3_cluster cluster[1];
163 } ;
164 
165 
166 
167 
168 // Top level L3 pointer bank. Pointing to TPCSECLP (Cluster data) and
169 // to L3_SECTP (track data).
170 
171 struct L3_SECP {
172  bankHeader bh;
173  unsigned int len; // length of the entire sector contribution
174  unsigned int time; // time when the event is put together in unix format
175  unsigned int seq; // sequence nr. hopefully unique inside one run ;)
176  unsigned int trg_word; // for the future
177  unsigned int trg_in_word; // also future... don't even know what that
178  // means....
179  struct offlen clusterp; // offset/length to/of TPCSECLP
180  struct offlen trackp; // offset/length to/of L3_SECTP
181  struct offlen sl3clusterp; // offlen for sl3 produced cluster data
182  // if length = 0 Bank is not present.
183 }; // L3_SECP is almost the same as DATAP, variables all have the same meaning
184 
185 
186 
187 // Global tracks:
188 
189 struct global_track {
190  int id ; //primary key
191  unsigned short flag ; // Primaries flag=1, Secondaries flag=0
192  char innerMostRow ;
193  char outerMostRow ;
194  unsigned char nHits ; // Number of points assigned to that track
195  char reserved ;
196  unsigned char ndedx; // nr of clusters contributing to the dedx value
197  char q ; // charge
198  float chi2[2]; // chi squared of the momentum fit
199  float dedx; // dE/dx information
200  float pt ; // pt (transverse momentum) at (r,phi,z)
201  float phi0; // azimuthal angle of the first point
202  float psi ; // azimuthal angle of the momentum at (r,..
203  float r0 ; // r (in cyl. coord.) for the first point
204  float tanl; // tg of the dip angle at (r,phi,z)
205  float z0 ; // z coordinate of the first point
206  float length ;
207  float dpt ;
208  float dpsi;
209  float dz0 ;
210  float dtanl ;
211 }; //16 dwords
212 
213 // Bank which actually has the global tracks in it:
214 // compared to the sector level tracks this merges the pointer and data bank
215 // into one Bank.
216 
217 struct L3_GTD {
218  struct bankHeader bh;
219  unsigned int nHits; // Nr of space points
220  unsigned int nTracks; // Nr of Tracks
221  float xVert; // x vertex position in cm
222  float yVert; // y vertex position
223  float zVert; //z vertex postion
224  struct global_track track[1];
225 };
226 
227 
228 
229 struct L3_P {
230  bankHeader bh;
231  unsigned int len; // lenght of the entire L3 contribution
232  unsigned int time; // time when bank is produced
233  unsigned int gl3Id; // node Id of the gl3 who produced that event
234  unsigned int trg_word;
235  unsigned int trg_in_word;
236  struct offlen sector[24]; // sector contributions, offset and length
237  struct offlen tracks; // pointer and length to/of L3_GTD
238  struct offlen summary_data;
239  unsigned int L3_summary[4];
240  struct offlen svt[5]; // 4 svt 'sectors' + 1 ssd
241  struct offlen ftpc[2];
242  struct offlen emc;
243  struct offlen trig; //trigger summary+data
244 
245 } ; // almost the same as L3_SECP
246 // 70 dwords
247 
248 #endif