/[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.23 - (hide annotations) (download)
Thu May 24 16:45:47 2007 UTC (17 years, 6 months ago) by pam-fi
Branch: MAIN
Changes since 1.22: +23 -0 lines
File MIME type: text/plain
several upgrades

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.5 // float bdl[NTRKMAX];
184 pam-fi 1.3
185 pam-fi 1.19 void InitcTrkLevel2(){
186    
187 pam-fi 1.6 // good2 = 0;
188 pam-fi 1.19 for(Int_t i=0; i<12 ; i++){
189     good[i] = 0;
190     for(Int_t ii=0; ii<24 ; ii++)vkflag[ii][i]=0;
191     }
192     // ----------------------------
193     nclsx = 0;
194     nclsy = 0;
195     for(Int_t i=0; i<NSINGMAX ; i++){
196     planex[i] = 0;
197     xs[i][0] = 0;
198     xs[i][1] = 0;
199     signlxs[i] = 0;
200     planey[i] = 0;
201     ys[i][0] = 0;
202     ys[i][1] = 0;
203     signlys[i] = 0;
204     }
205     // ----------------------------
206     ntrk =0 ;
207    
208     for(Int_t i=0; i<NTRKMAX ; i++){
209     image[i] = 0;
210     chi2_nt[i] = 0;
211     // bdl[i] = 0;
212    
213     for(Int_t ii=0; ii<5 ; ii++){
214     al_nt[i][ii] = 0;
215     for(Int_t iii=0; iii<5 ; iii++)
216     coval[i][ii][iii] = 0;
217     }
218    
219     for(Int_t ii=0; ii<6 ; ii++){
220     xm_nt[i][ii] = 0;
221     ym_nt[i][ii] = 0;
222     zm_nt[i][ii] = 0;
223     resx_nt[i][ii] = 0;
224     resy_nt[i][ii] = 0;
225     xgood_nt[i][ii] = 0;
226     ygood_nt[i][ii] = 0;
227     xv_nt[i][ii] = 0;
228     yv_nt[i][ii] = 0;
229     zv_nt[i][ii] = 0;
230     axv_nt[i][ii] = 0;
231     ayv_nt[i][ii] = 0;
232     dedx_x[i][ii] = 0;
233     dedx_y[i][ii] = 0;
234     }
235     }
236 pam-fi 1.3 }
237    
238 mocchiut 1.1 };
239     // ==================================================================
240     /**
241     * \brief Struct to pass calibration/parameter file paths to F77 routines
242     */
243     struct cPath {
244 pam-fi 1.8 char path[256];
245 mocchiut 1.1 int pathlen;
246 pam-fi 1.2 int error;
247 mocchiut 1.1 /**
248     * Fill the struct variables from a TString object
249     */
250     void FillWith(TString s){
251 pam-fi 1.2 pathlen = s.Length();
252     const char *pc = s.Data();
253     for(Int_t i=0; i<=pathlen; i++) path[i] = *pc++;
254 mocchiut 1.1 };
255 pam-fi 1.11
256 mocchiut 1.1 };
257    
258     // ==================================================================
259 pam-fi 1.11 /* /\** */
260     /* * \brief Struct to pass magnetic-field file paths to F77 routines */
261     /* *\/ */
262     /* struct cBPath { */
263     /* char b_path[256]; */
264     /* int b_pathlen; */
265     /* int b_error; */
266     /* int b_loaded; */
267     /* /\** */
268     /* * Fill the struct variables from a TString object and set */
269     /* * the load flag to FALSE. */
270     /* *\/ */
271     /* void FillWith(TString s){ */
272     /* b_loaded = 0; */
273     /* b_pathlen = s.Length(); */
274     /* const char *pc = s.Data(); */
275     /* for(Int_t i=0; i<=b_pathlen; i++) b_path[i] = *pc++; */
276     /* }; */
277     /* /\** */
278     /* * Fill the struct variables from a TString object */
279     /* *\/ */
280     /* int BIsLoaded(){ return b_loaded; }; */
281 mocchiut 1.1
282 pam-fi 1.11 /* }; */
283 mocchiut 1.1
284 pam-fi 1.2 // ==================================================================
285     /**
286     * \brief Struct to set debug mode in F77 routines
287     */
288     struct cDbg {
289     int debug;
290     int verbose;
291     int warning;
292     // bool debug;
293     // bool verbose;
294     void SetNone() {debug=0; verbose=0; warning=0;};
295     void SetWarning(){debug=0; verbose=0; warning=1;};
296     void SetVerbose(){debug=0; verbose=1; warning=1;};
297     void SetDebug() {debug=1; verbose=1; warning=1;};
298     };
299    
300 pam-fi 1.8
301     // ==================================================================
302     /**
303     * \brief Struct to pass mini2 track parameters to F77 routines
304     */
305     struct cMini2track {
306     double al[5];
307     double xm[NPLANE],ym[NPLANE],zm[NPLANE];
308     double xm_a[NPLANE],ym_a[NPLANE];
309     double xm_b[NPLANE],ym_b[NPLANE];
310     double resx[NPLANE],resy[NPLANE];
311 pam-fi 1.22 double tailx[NPLANE],taily[NPLANE];
312 pam-fi 1.8 double xgood[NPLANE],ygood[NPLANE];
313     double dedxtrk_x[NPLANE];
314     double dedxtrk_y[NPLANE];
315     double zini;
316     double pfixed;
317     double chi2;
318     double xv[NPLANE],yv[NPLANE],zv[NPLANE];
319     double axv[NPLANE],ayv[NPLANE];
320     double cov[5][5];
321 pam-fi 1.18 double fact;
322 pam-fi 1.8 int nstep;
323     int idcand;
324 pam-fi 1.17 int trackmode;
325 pam-fi 1.18 int istepmin;
326 pam-fi 1.20
327     /* cMini2track(){ */
328     /* // -------------------------- */
329     /* // fitting routine parameters */
330     /* // -------------------------- */
331     /* zini = 23.5; */
332     /* trackmode = 0; */
333     /* istepmin = 3; */
334     /* // -------------------------- */
335     /* pfixed = 0.; */
336     /* chi2 = 0; */
337     /* nstep = 0; */
338     /* for(int it1=0;it1<5;it1++){ */
339     /* al[it1] = 0; */
340     /* for(int it2=0;it2<5;it2++)cov[it1][it2] = 0; */
341     /* }; */
342     /* for(int ip=0;ip<6;ip++){ */
343     /* xgood[ip] = 0; */
344     /* ygood[ip] = 0; */
345     /* xm[ip] = 0; */
346     /* ym[ip] = 0; */
347     /* xm_a[ip] = 0; */
348     /* ym_a[ip] = 0; */
349     /* xm_b[ip] = 0; */
350     /* ym_b[ip] = 0; */
351     /* zm[ip] = 0; */
352     /* resx[ip] = 0; */
353     /* resy[ip] = 0; */
354     /* xv[ip] = 0; */
355     /* yv[ip] = 0; */
356     /* zv[ip] = 0; */
357     /* axv[ip] = 0; */
358     /* ayv[ip] = 0; */
359     /* dedxtrk_x[ip] = 0; */
360     /* dedxtrk_y[ip] = 0; */
361     /* }; */
362    
363     /* } */
364    
365    
366 pam-fi 1.8 };
367     //
368 pam-fi 1.9 /**
369     * \Struct for the hough transform variables
370     */
371    
372     struct cTrkHough {
373    
374 pam-fi 1.12 int ndblt_nt;
375     float alfayz1_nt[NDBLT_MAX_NT];
376     float alfayz2_nt[NDBLT_MAX_NT];
377     int db_cloud_nt[NDBLT_MAX_NT];
378     int ntrpt_nt;
379     float alfaxz1_nt[NTRPT_MAX_NT];
380     float alfaxz2_nt[NTRPT_MAX_NT];
381     float alfaxz3_nt[NTRPT_MAX_NT];
382     int tr_cloud_nt[NTRPT_MAX_NT];
383     int nclouds_yz_nt;
384     float alfayz1_av_nt[NCLOYZ_MAX];
385     float alfayz2_av_nt[NCLOYZ_MAX];
386     int ptcloud_yz_nt[NCLOYZ_MAX];
387     int nclouds_xz_nt;
388     float alfaxz1_av_nt[NCLOXZ_MAX];
389     float alfaxz2_av_nt[NCLOXZ_MAX];
390     float alfaxz3_av_nt[NCLOXZ_MAX];
391     int ptcloud_xz_nt[NCLOXZ_MAX];
392 pam-fi 1.9 int nclstr;
393     float totaltime;
394     float houghtime;
395     float fittime;
396    
397    
398     void InitcTrkHough(){
399    
400 pam-fi 1.12 ndblt_nt = 0;
401     ntrpt_nt = 0;
402     nclouds_yz_nt = 0;
403     nclouds_xz_nt = 0;
404 pam-fi 1.9 nclstr = 0;
405     totaltime = 0;
406     houghtime = 0;
407     fittime = 0;
408     for(int i=0;i<NDBLT_MAX_NT ;i++){
409 pam-fi 1.12 alfayz1_nt[i] = 0;
410     alfayz2_nt[i] = 0;
411     db_cloud_nt[i] = 0;
412 pam-fi 1.9 }
413     for(int i=0;i<NTRPT_MAX_NT ;i++){
414 pam-fi 1.12 alfaxz1_nt[i] = 0;
415     alfaxz2_nt[i] = 0;
416     alfaxz3_nt[i] = 0;
417     tr_cloud_nt[i] = 0;
418 pam-fi 1.9 }
419     for(int i=0;i<NCLOYZ_MAX ;i++){
420 pam-fi 1.12 alfayz1_av_nt[i] = 0;
421     alfayz2_av_nt[i] = 0;
422     ptcloud_yz_nt[i] = 0;
423 pam-fi 1.9 }
424     for(int i=0;i<NCLOXZ_MAX ;i++){
425 pam-fi 1.12 ptcloud_xz_nt[i] = 0;
426     alfaxz1_av_nt[i] = 0;
427     alfaxz2_av_nt[i] = 0;
428     alfaxz3_av_nt[i] = 0;
429 pam-fi 1.9 }
430     }
431    
432     };
433 pam-fi 1.8
434 pam-fi 1.14 /**
435     * \brief Struct to pass VA1-mask to F77 routines
436     */
437     struct cTrkMask {
438    
439     int mask_vk[NVK][NVIEW];
440     int mask_vk_run[NVK][NVIEW];
441    
442 pam-fi 1.16 // void Set(TFile* , Int_t , Int_t );
443 pam-fi 1.14
444 pam-fi 1.23 void Reset(){
445     for(int ivk=0; ivk<NVK; ivk++){
446     for(int iv=0; iv<NVIEW; iv++){
447     // mask_vk[ivk][iv]=0;
448     mask_vk_run[ivk][iv]=0;
449     }
450     }
451     }
452    
453 pam-fi 1.14 };
454 pam-fi 1.8
455 pam-fi 1.15 /**
456     * \brief Struct for pfa parameters
457     */
458     struct cTrkETA {
459    
460     int nangbin;
461     float angL[NANGMAX],angR[NANGMAX];
462     int netaval;
463     float eta2[NANGMAX][NETAVALMAX];
464     float feta2[NANGMAX][NLADDER][NVIEW][NETAVALMAX];
465     float eta3[NANGMAX][NETAVALMAX];
466     float feta3[NANGMAX][NLADDER][NVIEW][NETAVALMAX];
467     float eta4[NANGMAX][NETAVALMAX];
468     float feta4[NANGMAX][NLADDER][NVIEW][NETAVALMAX];
469    
470     };
471 pam-fi 1.20 /**
472     * \brief Struct to configure data reduction
473     */
474     struct cTrkSW{
475     int pfaid;
476     };
477 pam-fi 1.15
478 pam-fi 1.2 extern "C" {
479 pam-fi 1.8
480 pam-fi 1.9 extern struct cTrkCalib pedsigbad_;
481 pam-fi 1.16 extern struct cTrkMask mask_;
482 pam-fi 1.9 extern struct cTrkLevel0 level0event_;
483     extern struct cTrkLevel1 level1event_;
484     extern struct cTrkLevel2 level2event_;
485     extern struct cPath path_;
486     extern struct cDbg dbg_;
487 pam-fi 1.12 extern struct cTrkHough houghevent_;
488 pam-fi 1.8 extern struct cMini2track track_;
489 pam-fi 1.15 extern struct cTrkETA pfa_;
490 pam-fi 1.20 extern struct cTrkSW sw_;
491 pam-fi 1.7
492 pam-fi 1.2 void fillpedsigfromdefault_();
493     int readmipparam_();
494     int readchargeparam_();
495     int readvkmask_();
496     int readalignparam_();
497     int readetaparam_();
498     void reductionflight_(int*);
499 pam-fi 1.20 int analysisflight_();
500 pam-fi 1.16 int readb_();
501 pam-fi 1.20 void gufld_(float*, float*);
502     void xyzpam_(int*,int*,int*,int*,int*,float*,float*,float*,float*);
503 pam-fi 1.21 float riseta_(int*,float*);
504 pam-fi 1.16
505 pam-fi 1.2 }
506    
507 mocchiut 1.1 #endif

  ViewVC Help
Powered by ViewVC 1.1.23