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