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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.27 - (hide annotations) (download)
Fri Aug 31 14:56:50 2007 UTC (17 years, 3 months ago) by pam-fi
Branch: MAIN
CVS Tags: v4r00
Changes since 1.26: +12 -0 lines
File MIME type: text/plain
new variables added to TrkTrack + other changes

1 mocchiut 1.1 /**
2     * \file TrkStruct.h
3     * \author Elena Vannuccini
4     * \date
5     */
6     #ifndef trkstruct_h
7     #define trkstruct_h
8    
9 pam-fi 1.9 #define NPLANE 6
10 pam-fi 1.14 #define NVIEW 12
11     #define NVK 24
12 pam-fi 1.15 #define NLADDER 3
13 pam-fi 1.9
14     #define NCLMAX_VIEW 200 //max n.clusters per view
15     #define NCLSTR 20 //max n.strip per cluster
16     #define NCLMAX (NCLMAX_VIEW*12) //max n.clusters total
17     #define NCLBUFF (NCLMAX*NCLSTR)
18    
19     #define NDBLT_MAX_NT 1000 // 0.2*ndblt_max
20     #define NTRPT_MAX_NT 10000 // 0.2*ntrpt_max
21     #define NCLOYZ_MAX 200
22     #define NCLOXZ_MAX 200
23    
24 mocchiut 1.1 #define NTRKMAX 10
25 pam-fi 1.9 #define NSINGMAX NCLMAX //100
26 mocchiut 1.1
27 pam-fi 1.15 #define NANGMAX 21
28 pam-fi 1.16 #define NETAVALMAX 500
29 pam-fi 1.5
30 pam-fi 1.8
31 pam-fi 1.16 #include <CalibTrk1Event.h>
32     #include <CalibTrk2Event.h>
33     using namespace pamela;
34     //#include <TrkCalib.h>
35 pam-fi 1.2
36 mocchiut 1.1 #include <TString.h>
37     #include <TFile.h>
38 pam-fi 1.2 #include <TTree.h>
39 mocchiut 1.1
40 pam-fi 1.16
41 pam-fi 1.2 #include <fstream>
42     #include <iostream>
43 mocchiut 1.1 /**
44 pam-fi 1.2 * \brief Struct to pass calibration parameters to F77 routines
45 mocchiut 1.1 */
46 pam-fi 1.2 struct cTrkCalib {
47    
48 mocchiut 1.1 float pedestal[128][24][12];
49     float pedestal_t[128][24][12];
50     float sigma[128][24][12];
51     float sigma_t[128][24][12];
52     int bad[128][24][12];
53 pam-fi 1.2
54 pam-fi 1.23 void Reset(){
55     for(int is=0; is<128; is++){
56     for(int ivk=0; ivk<24; ivk++){
57     for(int iv=0; iv<12; iv++){
58     pedestal[is][ivk][iv]=0.;
59     pedestal_t[is][ivk][iv]=0.;
60     sigma[is][ivk][iv]=0.;
61     sigma_t[is][ivk][iv]=0.;
62     bad[is][ivk][iv]=1;
63     }
64     }
65     }
66     }
67    
68 pam-fi 1.16 /* void FillACalibFrom(TFile* , Int_t , Int_t ); */
69     /* void FillFCalibFrom(TFile* , Int_t , Int_t ); */
70     /* void FillTCalibFrom(TFile* , Int_t , Int_t ); */
71     /* void FillTCalibFrom(TString); */
72 pam-fi 1.2
73 mocchiut 1.1 };
74     // ==================================================================
75     /**
76     * \brief Struct to pass tracker LEVEL0 data to F77 routines
77     */
78     struct cTrkLevel0 {
79     int DAQmode[12];
80     int DSPnumber[12];
81     int DATAlength[12];
82     int eventn[12];
83     int nclust[12];
84     int cutc[12];
85     int cutcl[12];
86     int addrcluster[3][12];
87     int signcluster[3][12];
88     int fc[12];
89     int compressiontime[12];
90     int fl5[12];
91     int fl4[12];
92     int fl3[12];
93     int fl2[12];
94     int fl1[12];
95     int fl6[12];
96     int checksum[12];
97     int TOTDATAlength;
98     int datatracker[49152];
99     int pnum[12];
100     int cmdnum[12];
101     int bid[12];
102     int alarm[12];
103     int aswr[12];
104     int good0;
105     int crc[12];
106     };
107     // ==================================================================
108     /**
109     * \brief Struct to pass tracker LEVEL1 data to F77 routines
110     */
111     struct cTrkLevel1 {
112 pam-fi 1.6 // int good1;
113 pam-fi 1.8 int good[12];
114 mocchiut 1.1 int nclstr1;
115 pam-fi 1.8 int view[NCLMAX];
116     int ladder[NCLMAX];
117     int maxs[NCLMAX];
118     int mult[NCLMAX];
119     float dedx[NCLMAX];
120     int indstart[NCLMAX];
121     int indmax[NCLMAX];
122 mocchiut 1.1 int totCLlength;
123 pam-fi 1.8 float clsignal[NCLBUFF];
124     float clsigma[NCLBUFF];
125     int cladc[NCLBUFF];
126     int clbad[NCLBUFF];
127     float cnev[24][12];
128     int cnnev[24][12];
129     float cnrmsev[24][12];
130     int fshower[12];
131     int whichtrack[NCLMAX];
132 pam-fi 1.16
133 mocchiut 1.1 };
134     // ==================================================================
135     /**
136     * \brief Struct to pass tracker LEVEL2 data to F77 routines
137     */
138     struct cTrkLevel2 {
139 pam-fi 1.6 // int good2;
140     // int crc[12];
141 pam-fi 1.19 int good[12];
142     int vkflag[24][12];
143 mocchiut 1.1 // ----------------------------
144     int nclsx;
145     int planex[NSINGMAX];
146     float xs[NSINGMAX][2];
147     float signlxs[NSINGMAX];
148 pam-fi 1.8 int clsx[NSINGMAX];
149 mocchiut 1.1 // ----------------------------
150     int nclsy;
151     int planey[NSINGMAX];
152     float ys[NSINGMAX][2];
153     float signlys[NSINGMAX];
154 pam-fi 1.8 int clsy[NSINGMAX];
155 mocchiut 1.1 // ----------------------------
156     int ntrk;
157     int image[NTRKMAX];
158     float xm_nt[NTRKMAX][6];
159     float ym_nt[NTRKMAX][6];
160     float zm_nt[NTRKMAX][6];
161     float resx_nt[NTRKMAX][6];
162     float resy_nt[NTRKMAX][6];
163 pam-fi 1.19 float tailx[NTRKMAX][6];
164     float taily[NTRKMAX][6];
165 mocchiut 1.1 float al_nt[NTRKMAX][5];
166     float coval[NTRKMAX][5][5];
167     float chi2_nt[NTRKMAX];
168 pam-fi 1.8 int nstep_nt[NTRKMAX];
169     int xgood_nt[NTRKMAX][6];
170 mocchiut 1.1 int ygood_nt[NTRKMAX][6];
171 pam-fi 1.19 int ls[NTRKMAX][6];
172     int xbad[NTRKMAX][6];
173     int ybad[NTRKMAX][6];
174 mocchiut 1.1 float xv_nt[NTRKMAX][6];
175     float yv_nt[NTRKMAX][6];
176     float zv_nt[NTRKMAX][6];
177     float axv_nt[NTRKMAX][6];
178     float ayv_nt[NTRKMAX][6];
179     float dedx_x[NTRKMAX][6];
180     float dedx_y[NTRKMAX][6];
181 pam-fi 1.8 int cltrx[NTRKMAX][6];
182     int cltry[NTRKMAX][6];
183 pam-fi 1.27 int multmaxx[NTRKMAX][6];
184     int multmaxy[NTRKMAX][6];
185     float seedx[NTRKMAX][6];
186     float seedy[NTRKMAX][6];
187     float xpu[NTRKMAX][6];
188     float ypu[NTRKMAX][6];
189 pam-fi 1.5 // float bdl[NTRKMAX];
190 pam-fi 1.3
191 pam-fi 1.19 void InitcTrkLevel2(){
192    
193 pam-fi 1.6 // good2 = 0;
194 pam-fi 1.19 for(Int_t i=0; i<12 ; i++){
195     good[i] = 0;
196     for(Int_t ii=0; ii<24 ; ii++)vkflag[ii][i]=0;
197     }
198     // ----------------------------
199     nclsx = 0;
200     nclsy = 0;
201     for(Int_t i=0; i<NSINGMAX ; i++){
202     planex[i] = 0;
203     xs[i][0] = 0;
204     xs[i][1] = 0;
205     signlxs[i] = 0;
206     planey[i] = 0;
207     ys[i][0] = 0;
208     ys[i][1] = 0;
209     signlys[i] = 0;
210     }
211     // ----------------------------
212     ntrk =0 ;
213    
214     for(Int_t i=0; i<NTRKMAX ; i++){
215     image[i] = 0;
216     chi2_nt[i] = 0;
217     // bdl[i] = 0;
218    
219     for(Int_t ii=0; ii<5 ; ii++){
220     al_nt[i][ii] = 0;
221     for(Int_t iii=0; iii<5 ; iii++)
222     coval[i][ii][iii] = 0;
223     }
224    
225     for(Int_t ii=0; ii<6 ; ii++){
226     xm_nt[i][ii] = 0;
227     ym_nt[i][ii] = 0;
228     zm_nt[i][ii] = 0;
229     resx_nt[i][ii] = 0;
230     resy_nt[i][ii] = 0;
231     xgood_nt[i][ii] = 0;
232     ygood_nt[i][ii] = 0;
233     xv_nt[i][ii] = 0;
234     yv_nt[i][ii] = 0;
235     zv_nt[i][ii] = 0;
236     axv_nt[i][ii] = 0;
237     ayv_nt[i][ii] = 0;
238     dedx_x[i][ii] = 0;
239     dedx_y[i][ii] = 0;
240 pam-fi 1.27 multmaxx[i][ii] = 0;
241     multmaxy[i][ii] = 0;
242     seedx[i][ii] = 0;
243     seedy[i][ii] = 0;
244     xpu[i][ii] = 0;
245     ypu[i][ii] = 0;
246 pam-fi 1.19 }
247     }
248 pam-fi 1.3 }
249    
250 mocchiut 1.1 };
251     // ==================================================================
252     /**
253     * \brief Struct to pass calibration/parameter file paths to F77 routines
254     */
255     struct cPath {
256 pam-fi 1.8 char path[256];
257 mocchiut 1.1 int pathlen;
258 pam-fi 1.2 int error;
259 mocchiut 1.1 /**
260     * Fill the struct variables from a TString object
261     */
262     void FillWith(TString s){
263 pam-fi 1.2 pathlen = s.Length();
264     const char *pc = s.Data();
265     for(Int_t i=0; i<=pathlen; i++) path[i] = *pc++;
266 mocchiut 1.1 };
267 pam-fi 1.11
268 mocchiut 1.1 };
269    
270     // ==================================================================
271 pam-fi 1.11 /* /\** */
272     /* * \brief Struct to pass magnetic-field file paths to F77 routines */
273     /* *\/ */
274     /* struct cBPath { */
275     /* char b_path[256]; */
276     /* int b_pathlen; */
277     /* int b_error; */
278     /* int b_loaded; */
279     /* /\** */
280     /* * Fill the struct variables from a TString object and set */
281     /* * the load flag to FALSE. */
282     /* *\/ */
283     /* void FillWith(TString s){ */
284     /* b_loaded = 0; */
285     /* b_pathlen = s.Length(); */
286     /* const char *pc = s.Data(); */
287     /* for(Int_t i=0; i<=b_pathlen; i++) b_path[i] = *pc++; */
288     /* }; */
289     /* /\** */
290     /* * Fill the struct variables from a TString object */
291     /* *\/ */
292     /* int BIsLoaded(){ return b_loaded; }; */
293 mocchiut 1.1
294 pam-fi 1.11 /* }; */
295 mocchiut 1.1
296 pam-fi 1.2 // ==================================================================
297     /**
298     * \brief Struct to set debug mode in F77 routines
299     */
300     struct cDbg {
301     int debug;
302     int verbose;
303     int warning;
304     // bool debug;
305     // bool verbose;
306     void SetNone() {debug=0; verbose=0; warning=0;};
307     void SetWarning(){debug=0; verbose=0; warning=1;};
308     void SetVerbose(){debug=0; verbose=1; warning=1;};
309     void SetDebug() {debug=1; verbose=1; warning=1;};
310     };
311    
312 pam-fi 1.8
313     // ==================================================================
314     /**
315     * \brief Struct to pass mini2 track parameters to F77 routines
316     */
317     struct cMini2track {
318     double al[5];
319     double xm[NPLANE],ym[NPLANE],zm[NPLANE];
320     double xm_a[NPLANE],ym_a[NPLANE];
321     double xm_b[NPLANE],ym_b[NPLANE];
322     double resx[NPLANE],resy[NPLANE];
323 pam-fi 1.22 double tailx[NPLANE],taily[NPLANE];
324 pam-fi 1.8 double xgood[NPLANE],ygood[NPLANE];
325     double dedxtrk_x[NPLANE];
326     double dedxtrk_y[NPLANE];
327     double zini;
328     double pfixed;
329     double chi2;
330     double xv[NPLANE],yv[NPLANE],zv[NPLANE];
331     double axv[NPLANE],ayv[NPLANE];
332     double cov[5][5];
333 pam-fi 1.18 double fact;
334 pam-fi 1.8 int nstep;
335     int idcand;
336 pam-fi 1.17 int trackmode;
337 pam-fi 1.18 int istepmin;
338 pam-fi 1.20
339     /* cMini2track(){ */
340     /* // -------------------------- */
341     /* // fitting routine parameters */
342     /* // -------------------------- */
343     /* zini = 23.5; */
344     /* trackmode = 0; */
345     /* istepmin = 3; */
346     /* // -------------------------- */
347     /* pfixed = 0.; */
348     /* chi2 = 0; */
349     /* nstep = 0; */
350     /* for(int it1=0;it1<5;it1++){ */
351     /* al[it1] = 0; */
352     /* for(int it2=0;it2<5;it2++)cov[it1][it2] = 0; */
353     /* }; */
354     /* for(int ip=0;ip<6;ip++){ */
355     /* xgood[ip] = 0; */
356     /* ygood[ip] = 0; */
357     /* xm[ip] = 0; */
358     /* ym[ip] = 0; */
359     /* xm_a[ip] = 0; */
360     /* ym_a[ip] = 0; */
361     /* xm_b[ip] = 0; */
362     /* ym_b[ip] = 0; */
363     /* zm[ip] = 0; */
364     /* resx[ip] = 0; */
365     /* resy[ip] = 0; */
366     /* xv[ip] = 0; */
367     /* yv[ip] = 0; */
368     /* zv[ip] = 0; */
369     /* axv[ip] = 0; */
370     /* ayv[ip] = 0; */
371     /* dedxtrk_x[ip] = 0; */
372     /* dedxtrk_y[ip] = 0; */
373     /* }; */
374    
375     /* } */
376    
377    
378 pam-fi 1.8 };
379     //
380 pam-fi 1.9 /**
381     * \Struct for the hough transform variables
382     */
383    
384     struct cTrkHough {
385    
386 pam-fi 1.12 int ndblt_nt;
387     float alfayz1_nt[NDBLT_MAX_NT];
388     float alfayz2_nt[NDBLT_MAX_NT];
389     int db_cloud_nt[NDBLT_MAX_NT];
390     int ntrpt_nt;
391     float alfaxz1_nt[NTRPT_MAX_NT];
392     float alfaxz2_nt[NTRPT_MAX_NT];
393     float alfaxz3_nt[NTRPT_MAX_NT];
394     int tr_cloud_nt[NTRPT_MAX_NT];
395     int nclouds_yz_nt;
396     float alfayz1_av_nt[NCLOYZ_MAX];
397     float alfayz2_av_nt[NCLOYZ_MAX];
398     int ptcloud_yz_nt[NCLOYZ_MAX];
399     int nclouds_xz_nt;
400     float alfaxz1_av_nt[NCLOXZ_MAX];
401     float alfaxz2_av_nt[NCLOXZ_MAX];
402     float alfaxz3_av_nt[NCLOXZ_MAX];
403     int ptcloud_xz_nt[NCLOXZ_MAX];
404 pam-fi 1.9 int nclstr;
405     float totaltime;
406     float houghtime;
407     float fittime;
408    
409    
410     void InitcTrkHough(){
411    
412 pam-fi 1.12 ndblt_nt = 0;
413     ntrpt_nt = 0;
414     nclouds_yz_nt = 0;
415     nclouds_xz_nt = 0;
416 pam-fi 1.9 nclstr = 0;
417     totaltime = 0;
418     houghtime = 0;
419     fittime = 0;
420     for(int i=0;i<NDBLT_MAX_NT ;i++){
421 pam-fi 1.12 alfayz1_nt[i] = 0;
422     alfayz2_nt[i] = 0;
423     db_cloud_nt[i] = 0;
424 pam-fi 1.9 }
425     for(int i=0;i<NTRPT_MAX_NT ;i++){
426 pam-fi 1.12 alfaxz1_nt[i] = 0;
427     alfaxz2_nt[i] = 0;
428     alfaxz3_nt[i] = 0;
429     tr_cloud_nt[i] = 0;
430 pam-fi 1.9 }
431     for(int i=0;i<NCLOYZ_MAX ;i++){
432 pam-fi 1.12 alfayz1_av_nt[i] = 0;
433     alfayz2_av_nt[i] = 0;
434     ptcloud_yz_nt[i] = 0;
435 pam-fi 1.9 }
436     for(int i=0;i<NCLOXZ_MAX ;i++){
437 pam-fi 1.12 ptcloud_xz_nt[i] = 0;
438     alfaxz1_av_nt[i] = 0;
439     alfaxz2_av_nt[i] = 0;
440     alfaxz3_av_nt[i] = 0;
441 pam-fi 1.9 }
442     }
443    
444     };
445 pam-fi 1.8
446 pam-fi 1.14 /**
447     * \brief Struct to pass VA1-mask to F77 routines
448     */
449     struct cTrkMask {
450    
451     int mask_vk[NVK][NVIEW];
452     int mask_vk_run[NVK][NVIEW];
453    
454 pam-fi 1.16 // void Set(TFile* , Int_t , Int_t );
455 pam-fi 1.14
456 pam-fi 1.23 void Reset(){
457     for(int ivk=0; ivk<NVK; ivk++){
458     for(int iv=0; iv<NVIEW; iv++){
459     // mask_vk[ivk][iv]=0;
460     mask_vk_run[ivk][iv]=0;
461     }
462     }
463     }
464    
465 pam-fi 1.24 void Dump(){
466     }
467    
468 pam-fi 1.14 };
469 pam-fi 1.8
470 pam-fi 1.15 /**
471     * \brief Struct for pfa parameters
472     */
473     struct cTrkETA {
474    
475     int nangbin;
476     float angL[NANGMAX],angR[NANGMAX];
477     int netaval;
478     float eta2[NANGMAX][NETAVALMAX];
479     float feta2[NANGMAX][NLADDER][NVIEW][NETAVALMAX];
480     float eta3[NANGMAX][NETAVALMAX];
481     float feta3[NANGMAX][NLADDER][NVIEW][NETAVALMAX];
482     float eta4[NANGMAX][NETAVALMAX];
483     float feta4[NANGMAX][NLADDER][NVIEW][NETAVALMAX];
484 pam-fi 1.25 float fcorr[NANGMAX][NLADDER][NVIEW];
485 pam-fi 1.26 float e234ax[6];//F77: e2fax,e2tax,e3fax,e3tax,e4fax,e4tax
486     float e234ay[6];//F77: e2fay,e2tay,e3fay,e3tay,e4fay,e4tay
487 pam-fi 1.15
488     };
489 pam-fi 1.20 /**
490     * \brief Struct to configure data reduction
491     */
492     struct cTrkSW{
493     int pfaid;
494     };
495 pam-fi 1.15
496 pam-fi 1.2 extern "C" {
497 pam-fi 1.8
498 pam-fi 1.9 extern struct cTrkCalib pedsigbad_;
499 pam-fi 1.16 extern struct cTrkMask mask_;
500 pam-fi 1.9 extern struct cTrkLevel0 level0event_;
501     extern struct cTrkLevel1 level1event_;
502     extern struct cTrkLevel2 level2event_;
503     extern struct cPath path_;
504     extern struct cDbg dbg_;
505 pam-fi 1.12 extern struct cTrkHough houghevent_;
506 pam-fi 1.8 extern struct cMini2track track_;
507 pam-fi 1.15 extern struct cTrkETA pfa_;
508 pam-fi 1.20 extern struct cTrkSW sw_;
509 pam-fi 1.7
510 pam-fi 1.2 void fillpedsigfromdefault_();
511     int readmipparam_();
512     int readchargeparam_();
513     int readvkmask_();
514     int readalignparam_();
515     int readetaparam_();
516     void reductionflight_(int*);
517 pam-fi 1.20 int analysisflight_();
518 pam-fi 1.16 int readb_();
519 pam-fi 1.20 void gufld_(float*, float*);
520     void xyzpam_(int*,int*,int*,int*,int*,float*,float*,float*,float*);
521 pam-fi 1.21 float riseta_(int*,float*);
522 pam-fi 1.16
523 pam-fi 1.2 }
524    
525 mocchiut 1.1 #endif

  ViewVC Help
Powered by ViewVC 1.1.23