/[PAMELA software]/DarthVader/TrackerLevel2/inc/TrkStruct.h
ViewVC logotype

Contents of /DarthVader/TrackerLevel2/inc/TrkStruct.h

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.11 - (show annotations) (download)
Wed Nov 8 16:42:27 2006 UTC (18 years, 1 month ago) by pam-fi
Branch: MAIN
Changes since 1.10: +25 -25 lines
File MIME type: text/plain
fixed bug in readB

1 /**
2 * \file TrkStruct.h
3 * \author Elena Vannuccini
4 * \date
5 */
6 #ifndef trkstruct_h
7 #define trkstruct_h
8
9 #define NPLANE 6
10
11 #define NCLMAX_VIEW 200 //max n.clusters per view
12 #define NCLSTR 20 //max n.strip per cluster
13 #define NCLMAX (NCLMAX_VIEW*12) //max n.clusters total
14 #define NCLBUFF (NCLMAX*NCLSTR)
15
16 #define NDBLT_MAX_NT 1000 // 0.2*ndblt_max
17 #define NTRPT_MAX_NT 10000 // 0.2*ntrpt_max
18 #define NCLOYZ_MAX 200
19 #define NCLOXZ_MAX 200
20
21 #define NTRKMAX 10
22 #define NSINGMAX NCLMAX //100
23
24
25
26 #include <CalibTrk1Event.h>
27 #include <CalibTrk2Event.h>
28
29 #include <TString.h>
30 #include <TFile.h>
31 #include <TTree.h>
32
33 #include <fstream>
34 #include <iostream>
35 /**
36 * \brief Struct to pass calibration parameters to F77 routines
37 */
38 struct cTrkCalib {
39
40 float pedestal[128][24][12];
41 float pedestal_t[128][24][12];
42 float sigma[128][24][12];
43 float sigma_t[128][24][12];
44 int bad[128][24][12];
45
46 void FillACalibFrom(TFile* , Int_t , Int_t );
47 void FillFCalibFrom(TFile* , Int_t , Int_t );
48 void FillTCalibFrom(TFile* , Int_t , Int_t );
49 void FillTCalibFrom(TString);
50
51 };
52 // ==================================================================
53 /**
54 * \brief Struct to pass tracker LEVEL0 data to F77 routines
55 */
56 struct cTrkLevel0 {
57 int DAQmode[12];
58 int DSPnumber[12];
59 int DATAlength[12];
60 int eventn[12];
61 int nclust[12];
62 int cutc[12];
63 int cutcl[12];
64 int addrcluster[3][12];
65 int signcluster[3][12];
66 int fc[12];
67 int compressiontime[12];
68 int fl5[12];
69 int fl4[12];
70 int fl3[12];
71 int fl2[12];
72 int fl1[12];
73 int fl6[12];
74 int checksum[12];
75 int TOTDATAlength;
76 int datatracker[49152];
77 int pnum[12];
78 int cmdnum[12];
79 int bid[12];
80 int alarm[12];
81 int aswr[12];
82 int good0;
83 int crc[12];
84 };
85 // ==================================================================
86 /**
87 * \brief Struct to pass tracker LEVEL1 data to F77 routines
88 */
89 struct cTrkLevel1 {
90 // int good1;
91 int good[12];
92 int nclstr1;
93 int view[NCLMAX];
94 int ladder[NCLMAX];
95 int maxs[NCLMAX];
96 int mult[NCLMAX];
97 float dedx[NCLMAX];
98 int indstart[NCLMAX];
99 int indmax[NCLMAX];
100 int totCLlength;
101 float clsignal[NCLBUFF];
102 float clsigma[NCLBUFF];
103 int cladc[NCLBUFF];
104 int clbad[NCLBUFF];
105 float cnev[24][12];
106 int cnnev[24][12];
107 float cnrmsev[24][12];
108 int fshower[12];
109 int whichtrack[NCLMAX];
110 };
111 // ==================================================================
112 /**
113 * \brief Struct to pass tracker LEVEL2 data to F77 routines
114 */
115 struct cTrkLevel2 {
116 // int good2;
117 // int crc[12];
118 int good[12];
119 // ----------------------------
120 int nclsx;
121 int planex[NSINGMAX];
122 float xs[NSINGMAX][2];
123 float signlxs[NSINGMAX];
124 int clsx[NSINGMAX];
125 // ----------------------------
126 int nclsy;
127 int planey[NSINGMAX];
128 float ys[NSINGMAX][2];
129 float signlys[NSINGMAX];
130 int clsy[NSINGMAX];
131 // ----------------------------
132 int ntrk;
133 int image[NTRKMAX];
134 float xm_nt[NTRKMAX][6];
135 float ym_nt[NTRKMAX][6];
136 float zm_nt[NTRKMAX][6];
137 float resx_nt[NTRKMAX][6];
138 float resy_nt[NTRKMAX][6];
139 float al_nt[NTRKMAX][5];
140 float coval[NTRKMAX][5][5];
141 float chi2_nt[NTRKMAX];
142 int nstep_nt[NTRKMAX];
143 int xgood_nt[NTRKMAX][6];
144 int ygood_nt[NTRKMAX][6];
145 float xv_nt[NTRKMAX][6];
146 float yv_nt[NTRKMAX][6];
147 float zv_nt[NTRKMAX][6];
148 float axv_nt[NTRKMAX][6];
149 float ayv_nt[NTRKMAX][6];
150 float dedx_x[NTRKMAX][6];
151 float dedx_y[NTRKMAX][6];
152 int cltrx[NTRKMAX][6];
153 int cltry[NTRKMAX][6];
154 // float bdl[NTRKMAX];
155
156 void InitcTrkLevel2(){
157
158 // good2 = 0;
159 for(Int_t i=0; i<12 ; i++)
160 // crc[i] = 0;
161 good[i] = 0;
162 // ----------------------------
163 nclsx = 0;
164 nclsy = 0;
165 for(Int_t i=0; i<NSINGMAX ; i++){
166 planex[i] = 0;
167 xs[i][0] = 0;
168 xs[i][1] = 0;
169 signlxs[i] = 0;
170 planey[i] = 0;
171 ys[i][0] = 0;
172 ys[i][1] = 0;
173 signlys[i] = 0;
174 }
175 // ----------------------------
176 ntrk =0 ;
177
178 for(Int_t i=0; i<NTRKMAX ; i++){
179 image[i] = 0;
180 chi2_nt[i] = 0;
181 // bdl[i] = 0;
182
183 for(Int_t ii=0; ii<5 ; ii++){
184 al_nt[i][ii] = 0;
185 for(Int_t iii=0; iii<5 ; iii++)
186 coval[i][ii][iii] = 0;
187 }
188
189 for(Int_t ii=0; ii<6 ; ii++){
190 xm_nt[i][ii] = 0;
191 ym_nt[i][ii] = 0;
192 zm_nt[i][ii] = 0;
193 resx_nt[i][ii] = 0;
194 resy_nt[i][ii] = 0;
195 xgood_nt[i][ii] = 0;
196 ygood_nt[i][ii] = 0;
197 xv_nt[i][ii] = 0;
198 yv_nt[i][ii] = 0;
199 zv_nt[i][ii] = 0;
200 axv_nt[i][ii] = 0;
201 ayv_nt[i][ii] = 0;
202 dedx_x[i][ii] = 0;
203 dedx_y[i][ii] = 0;
204 }
205 }
206 }
207
208 };
209 // ==================================================================
210 /**
211 * \brief Struct to pass calibration/parameter file paths to F77 routines
212 */
213 struct cPath {
214 char path[256];
215 int pathlen;
216 int error;
217 /**
218 * Fill the struct variables from a TString object
219 */
220 void FillWith(TString s){
221 pathlen = s.Length();
222 const char *pc = s.Data();
223 for(Int_t i=0; i<=pathlen; i++) path[i] = *pc++;
224 };
225
226 };
227
228 // ==================================================================
229 /* /\** */
230 /* * \brief Struct to pass magnetic-field file paths to F77 routines */
231 /* *\/ */
232 /* struct cBPath { */
233 /* char b_path[256]; */
234 /* int b_pathlen; */
235 /* int b_error; */
236 /* int b_loaded; */
237 /* /\** */
238 /* * Fill the struct variables from a TString object and set */
239 /* * the load flag to FALSE. */
240 /* *\/ */
241 /* void FillWith(TString s){ */
242 /* b_loaded = 0; */
243 /* b_pathlen = s.Length(); */
244 /* const char *pc = s.Data(); */
245 /* for(Int_t i=0; i<=b_pathlen; i++) b_path[i] = *pc++; */
246 /* }; */
247 /* /\** */
248 /* * Fill the struct variables from a TString object */
249 /* *\/ */
250 /* int BIsLoaded(){ return b_loaded; }; */
251
252 /* }; */
253
254 // ==================================================================
255 /**
256 * \brief Struct to set debug mode in F77 routines
257 */
258 struct cDbg {
259 int debug;
260 int verbose;
261 int warning;
262 // bool debug;
263 // bool verbose;
264 void SetNone() {debug=0; verbose=0; warning=0;};
265 void SetWarning(){debug=0; verbose=0; warning=1;};
266 void SetVerbose(){debug=0; verbose=1; warning=1;};
267 void SetDebug() {debug=1; verbose=1; warning=1;};
268 };
269
270
271 // ==================================================================
272 /**
273 * \brief Struct to pass mini2 track parameters to F77 routines
274 */
275 struct cMini2track {
276 double al[5];
277 double xm[NPLANE],ym[NPLANE],zm[NPLANE];
278 double xm_a[NPLANE],ym_a[NPLANE];
279 double xm_b[NPLANE],ym_b[NPLANE];
280 double resx[NPLANE],resy[NPLANE];
281 double xgood[NPLANE],ygood[NPLANE];
282 double dedxtrk_x[NPLANE];
283 double dedxtrk_y[NPLANE];
284 double zini;
285 double pfixed;
286 double chi2;
287 double xv[NPLANE],yv[NPLANE],zv[NPLANE];
288 double axv[NPLANE],ayv[NPLANE];
289 double cov[5][5];
290 int nstep;
291 int idcand;
292 };
293 //
294 /**
295 * \Struct for the hough transform variables
296 */
297
298 struct cTrkHough {
299
300 int ndblt;
301 float alfayz1[NDBLT_MAX_NT];
302 float alfayz2[NDBLT_MAX_NT];
303 int db_cloud[NDBLT_MAX_NT];
304 int ntrpt;
305 float alfaxz1[NTRPT_MAX_NT];
306 float alfaxz2[NTRPT_MAX_NT];
307 float alfaxz3[NTRPT_MAX_NT];
308 int tr_cloud[NTRPT_MAX_NT];
309 int nclouds_yz;
310 float alfayz1_av[NCLOYZ_MAX];
311 float alfayz2_av[NCLOYZ_MAX];
312 int ptcloud_yz[NCLOYZ_MAX];
313 int nclouds_xz;
314 float alfaxz1_av[NCLOXZ_MAX];
315 float alfaxz2_av[NCLOXZ_MAX];
316 float alfaxz3_av[NCLOXZ_MAX];
317 int ptcloud_xz[NCLOXZ_MAX];
318 int nclstr;
319 float totaltime;
320 float houghtime;
321 float fittime;
322
323
324 void InitcTrkHough(){
325
326 ndblt = 0;
327 ntrpt = 0;
328 nclouds_yz = 0;
329 nclouds_xz = 0;
330 nclstr = 0;
331 totaltime = 0;
332 houghtime = 0;
333 fittime = 0;
334 for(int i=0;i<NDBLT_MAX_NT ;i++){
335 alfayz1[i] = 0;
336 alfayz2[i] = 0;
337 db_cloud[i] = 0;
338 }
339 for(int i=0;i<NTRPT_MAX_NT ;i++){
340 alfaxz1[i] = 0;
341 alfaxz2[i] = 0;
342 alfaxz3[i] = 0;
343 tr_cloud[i] = 0;
344 }
345 for(int i=0;i<NCLOYZ_MAX ;i++){
346 alfayz1_av[i] = 0;
347 alfayz2_av[i] = 0;
348 ptcloud_yz[i] = 0;
349 }
350 for(int i=0;i<NCLOXZ_MAX ;i++){
351 ptcloud_xz[i] = 0;
352 alfaxz1_av[i] = 0;
353 alfaxz2_av[i] = 0;
354 alfaxz3_av[i] = 0;
355 }
356 }
357
358 };
359
360
361 extern "C" {
362
363 extern struct cTrkCalib pedsigbad_;
364 extern struct cTrkLevel0 level0event_;
365 extern struct cTrkLevel1 level1event_;
366 extern struct cTrkLevel2 level2event_;
367 extern struct cPath path_;
368 /* extern struct cBPath bpath_; */
369 extern struct cDbg dbg_;
370 extern struct cMini2track track_;
371 extern struct cTrkHough hough_;
372
373 void fillpedsigfromdefault_();
374 int readmipparam_();
375 int readchargeparam_();
376 int readvkmask_();
377 int readalignparam_();
378 int readetaparam_();
379 void reductionflight_(int*);
380 int analysisflight_();
381 }
382
383
384 #endif
385

  ViewVC Help
Powered by ViewVC 1.1.23