7 |
#define trkstruct_h |
#define trkstruct_h |
8 |
|
|
9 |
#define NPLANE 6 |
#define NPLANE 6 |
10 |
|
#define NVIEW 12 |
11 |
|
#define NVK 24 |
12 |
|
#define NLADDER 3 |
13 |
|
|
14 |
#define NCLMAX_VIEW 200 //max n.clusters per view |
#define NCLMAX_VIEW 200 //max n.clusters per view |
15 |
#define NCLSTR 20 //max n.strip per cluster |
#define NCLSTR 20 //max n.strip per cluster |
24 |
#define NTRKMAX 10 |
#define NTRKMAX 10 |
25 |
#define NSINGMAX NCLMAX //100 |
#define NSINGMAX NCLMAX //100 |
26 |
|
|
27 |
|
#define NANGMAX 21 |
28 |
|
#define NETAVALMAX 500 |
29 |
|
|
30 |
|
#define NTRACKSMAX (NCLOYZ_MAX*NCLOXZ_MAX) |
31 |
|
|
32 |
#include <CalibTrk1Event.h> |
#include <CalibTrk1Event.h> |
33 |
#include <CalibTrk2Event.h> |
#include <CalibTrk2Event.h> |
34 |
|
using namespace pamela; |
35 |
|
//#include <TrkCalib.h> |
36 |
|
|
37 |
#include <TString.h> |
#include <TString.h> |
38 |
#include <TFile.h> |
#include <TFile.h> |
39 |
#include <TTree.h> |
#include <TTree.h> |
40 |
|
|
41 |
|
|
42 |
|
|
43 |
#include <fstream> |
#include <fstream> |
44 |
#include <iostream> |
#include <iostream> |
45 |
/** |
/** |
53 |
float sigma_t[128][24][12]; |
float sigma_t[128][24][12]; |
54 |
int bad[128][24][12]; |
int bad[128][24][12]; |
55 |
|
|
56 |
void FillACalibFrom(TFile* , Int_t , Int_t ); |
void Reset(){ |
57 |
void FillFCalibFrom(TFile* , Int_t , Int_t ); |
for(int is=0; is<128; is++){ |
58 |
void FillTCalibFrom(TFile* , Int_t , Int_t ); |
for(int ivk=0; ivk<24; ivk++){ |
59 |
void FillTCalibFrom(TString); |
for(int iv=0; iv<12; iv++){ |
60 |
|
pedestal[is][ivk][iv]=0.; |
61 |
|
pedestal_t[is][ivk][iv]=0.; |
62 |
|
sigma[is][ivk][iv]=0.; |
63 |
|
sigma_t[is][ivk][iv]=0.; |
64 |
|
bad[is][ivk][iv]=1; |
65 |
|
} |
66 |
|
} |
67 |
|
} |
68 |
|
} |
69 |
|
|
70 |
|
/* void FillACalibFrom(TFile* , Int_t , Int_t ); */ |
71 |
|
/* void FillFCalibFrom(TFile* , Int_t , Int_t ); */ |
72 |
|
/* void FillTCalibFrom(TFile* , Int_t , Int_t ); */ |
73 |
|
/* void FillTCalibFrom(TString); */ |
74 |
|
|
75 |
}; |
}; |
76 |
// ================================================================== |
// ================================================================== |
131 |
float cnrmsev[24][12]; |
float cnrmsev[24][12]; |
132 |
int fshower[12]; |
int fshower[12]; |
133 |
int whichtrack[NCLMAX]; |
int whichtrack[NCLMAX]; |
134 |
|
|
135 |
}; |
}; |
136 |
// ================================================================== |
// ================================================================== |
137 |
/** |
/** |
140 |
struct cTrkLevel2 { |
struct cTrkLevel2 { |
141 |
// int good2; |
// int good2; |
142 |
// int crc[12]; |
// int crc[12]; |
143 |
int good[12]; |
int good[12]; |
144 |
|
int vkflag[24][12]; |
145 |
// ---------------------------- |
// ---------------------------- |
146 |
int nclsx; |
int nclsx; |
147 |
int planex[NSINGMAX]; |
int planex[NSINGMAX]; |
162 |
float zm_nt[NTRKMAX][6]; |
float zm_nt[NTRKMAX][6]; |
163 |
float resx_nt[NTRKMAX][6]; |
float resx_nt[NTRKMAX][6]; |
164 |
float resy_nt[NTRKMAX][6]; |
float resy_nt[NTRKMAX][6]; |
165 |
|
float tailx[NTRKMAX][6]; |
166 |
|
float taily[NTRKMAX][6]; |
167 |
float al_nt[NTRKMAX][5]; |
float al_nt[NTRKMAX][5]; |
168 |
float coval[NTRKMAX][5][5]; |
float coval[NTRKMAX][5][5]; |
169 |
float chi2_nt[NTRKMAX]; |
float chi2_nt[NTRKMAX]; |
170 |
int nstep_nt[NTRKMAX]; |
int nstep_nt[NTRKMAX]; |
171 |
int xgood_nt[NTRKMAX][6]; |
int xgood_nt[NTRKMAX][6]; |
172 |
int ygood_nt[NTRKMAX][6]; |
int ygood_nt[NTRKMAX][6]; |
173 |
|
int ls[NTRKMAX][6]; |
174 |
|
int xbad[NTRKMAX][6]; |
175 |
|
int ybad[NTRKMAX][6]; |
176 |
float xv_nt[NTRKMAX][6]; |
float xv_nt[NTRKMAX][6]; |
177 |
float yv_nt[NTRKMAX][6]; |
float yv_nt[NTRKMAX][6]; |
178 |
float zv_nt[NTRKMAX][6]; |
float zv_nt[NTRKMAX][6]; |
182 |
float dedx_y[NTRKMAX][6]; |
float dedx_y[NTRKMAX][6]; |
183 |
int cltrx[NTRKMAX][6]; |
int cltrx[NTRKMAX][6]; |
184 |
int cltry[NTRKMAX][6]; |
int cltry[NTRKMAX][6]; |
185 |
|
int multmaxx[NTRKMAX][6]; |
186 |
|
int multmaxy[NTRKMAX][6]; |
187 |
|
float seedx[NTRKMAX][6]; |
188 |
|
float seedy[NTRKMAX][6]; |
189 |
|
float xpu[NTRKMAX][6]; |
190 |
|
float ypu[NTRKMAX][6]; |
191 |
// float bdl[NTRKMAX]; |
// float bdl[NTRKMAX]; |
192 |
|
|
193 |
void InitcTrkLevel2(){ |
void InitcTrkLevel2(){ |
194 |
|
|
195 |
// good2 = 0; |
// good2 = 0; |
196 |
for(Int_t i=0; i<12 ; i++) |
for(Int_t i=0; i<12 ; i++){ |
197 |
// crc[i] = 0; |
good[i] = 0; |
198 |
good[i] = 0; |
for(Int_t ii=0; ii<24 ; ii++)vkflag[ii][i]=0; |
199 |
// ---------------------------- |
} |
200 |
nclsx = 0; |
// ---------------------------- |
201 |
nclsy = 0; |
nclsx = 0; |
202 |
for(Int_t i=0; i<NSINGMAX ; i++){ |
nclsy = 0; |
203 |
planex[i] = 0; |
for(Int_t i=0; i<NSINGMAX ; i++){ |
204 |
xs[i][0] = 0; |
planex[i] = 0; |
205 |
xs[i][1] = 0; |
xs[i][0] = 0; |
206 |
signlxs[i] = 0; |
xs[i][1] = 0; |
207 |
planey[i] = 0; |
signlxs[i] = 0; |
208 |
ys[i][0] = 0; |
planey[i] = 0; |
209 |
ys[i][1] = 0; |
ys[i][0] = 0; |
210 |
signlys[i] = 0; |
ys[i][1] = 0; |
211 |
} |
signlys[i] = 0; |
212 |
// ---------------------------- |
} |
213 |
ntrk =0 ; |
// ---------------------------- |
214 |
|
ntrk =0 ; |
215 |
for(Int_t i=0; i<NTRKMAX ; i++){ |
|
216 |
image[i] = 0; |
for(Int_t i=0; i<NTRKMAX ; i++){ |
217 |
chi2_nt[i] = 0; |
image[i] = 0; |
218 |
|
chi2_nt[i] = 0; |
219 |
// bdl[i] = 0; |
// bdl[i] = 0; |
220 |
|
|
221 |
for(Int_t ii=0; ii<5 ; ii++){ |
for(Int_t ii=0; ii<5 ; ii++){ |
222 |
al_nt[i][ii] = 0; |
al_nt[i][ii] = 0; |
223 |
for(Int_t iii=0; iii<5 ; iii++) |
for(Int_t iii=0; iii<5 ; iii++) |
224 |
coval[i][ii][iii] = 0; |
coval[i][ii][iii] = 0; |
225 |
} |
} |
226 |
|
|
227 |
for(Int_t ii=0; ii<6 ; ii++){ |
for(Int_t ii=0; ii<6 ; ii++){ |
228 |
xm_nt[i][ii] = 0; |
xm_nt[i][ii] = 0; |
229 |
ym_nt[i][ii] = 0; |
ym_nt[i][ii] = 0; |
230 |
zm_nt[i][ii] = 0; |
zm_nt[i][ii] = 0; |
231 |
resx_nt[i][ii] = 0; |
resx_nt[i][ii] = 0; |
232 |
resy_nt[i][ii] = 0; |
resy_nt[i][ii] = 0; |
233 |
xgood_nt[i][ii] = 0; |
xgood_nt[i][ii] = 0; |
234 |
ygood_nt[i][ii] = 0; |
ygood_nt[i][ii] = 0; |
235 |
xv_nt[i][ii] = 0; |
xv_nt[i][ii] = 0; |
236 |
yv_nt[i][ii] = 0; |
yv_nt[i][ii] = 0; |
237 |
zv_nt[i][ii] = 0; |
zv_nt[i][ii] = 0; |
238 |
axv_nt[i][ii] = 0; |
axv_nt[i][ii] = 0; |
239 |
ayv_nt[i][ii] = 0; |
ayv_nt[i][ii] = 0; |
240 |
dedx_x[i][ii] = 0; |
dedx_x[i][ii] = 0; |
241 |
dedx_y[i][ii] = 0; |
dedx_y[i][ii] = 0; |
242 |
} |
multmaxx[i][ii] = 0; |
243 |
|
multmaxy[i][ii] = 0; |
244 |
|
seedx[i][ii] = 0; |
245 |
|
seedy[i][ii] = 0; |
246 |
|
xpu[i][ii] = 0; |
247 |
|
ypu[i][ii] = 0; |
248 |
|
} |
249 |
|
} |
250 |
} |
} |
251 |
} |
|
|
|
|
252 |
}; |
}; |
253 |
// ================================================================== |
// ================================================================== |
254 |
/** |
/** |
322 |
double xm_a[NPLANE],ym_a[NPLANE]; |
double xm_a[NPLANE],ym_a[NPLANE]; |
323 |
double xm_b[NPLANE],ym_b[NPLANE]; |
double xm_b[NPLANE],ym_b[NPLANE]; |
324 |
double resx[NPLANE],resy[NPLANE]; |
double resx[NPLANE],resy[NPLANE]; |
325 |
|
double tailx[NPLANE],taily[NPLANE]; |
326 |
double xgood[NPLANE],ygood[NPLANE]; |
double xgood[NPLANE],ygood[NPLANE]; |
327 |
double dedxtrk_x[NPLANE]; |
double dedxtrk_x[NPLANE]; |
328 |
double dedxtrk_y[NPLANE]; |
double dedxtrk_y[NPLANE]; |
332 |
double xv[NPLANE],yv[NPLANE],zv[NPLANE]; |
double xv[NPLANE],yv[NPLANE],zv[NPLANE]; |
333 |
double axv[NPLANE],ayv[NPLANE]; |
double axv[NPLANE],ayv[NPLANE]; |
334 |
double cov[5][5]; |
double cov[5][5]; |
335 |
|
double fact; |
336 |
int nstep; |
int nstep; |
337 |
int idcand; |
int idcand; |
338 |
|
int trackmode; |
339 |
|
int istepmin; |
340 |
|
|
341 |
|
/* cMini2track(){ */ |
342 |
|
/* // -------------------------- */ |
343 |
|
/* // fitting routine parameters */ |
344 |
|
/* // -------------------------- */ |
345 |
|
/* zini = 23.5; */ |
346 |
|
/* trackmode = 0; */ |
347 |
|
/* istepmin = 3; */ |
348 |
|
/* // -------------------------- */ |
349 |
|
/* pfixed = 0.; */ |
350 |
|
/* chi2 = 0; */ |
351 |
|
/* nstep = 0; */ |
352 |
|
/* for(int it1=0;it1<5;it1++){ */ |
353 |
|
/* al[it1] = 0; */ |
354 |
|
/* for(int it2=0;it2<5;it2++)cov[it1][it2] = 0; */ |
355 |
|
/* }; */ |
356 |
|
/* for(int ip=0;ip<6;ip++){ */ |
357 |
|
/* xgood[ip] = 0; */ |
358 |
|
/* ygood[ip] = 0; */ |
359 |
|
/* xm[ip] = 0; */ |
360 |
|
/* ym[ip] = 0; */ |
361 |
|
/* xm_a[ip] = 0; */ |
362 |
|
/* ym_a[ip] = 0; */ |
363 |
|
/* xm_b[ip] = 0; */ |
364 |
|
/* ym_b[ip] = 0; */ |
365 |
|
/* zm[ip] = 0; */ |
366 |
|
/* resx[ip] = 0; */ |
367 |
|
/* resy[ip] = 0; */ |
368 |
|
/* xv[ip] = 0; */ |
369 |
|
/* yv[ip] = 0; */ |
370 |
|
/* zv[ip] = 0; */ |
371 |
|
/* axv[ip] = 0; */ |
372 |
|
/* ayv[ip] = 0; */ |
373 |
|
/* dedxtrk_x[ip] = 0; */ |
374 |
|
/* dedxtrk_y[ip] = 0; */ |
375 |
|
/* }; */ |
376 |
|
|
377 |
|
/* } */ |
378 |
|
|
379 |
|
|
380 |
}; |
}; |
381 |
// |
// |
382 |
/** |
/** |
445 |
|
|
446 |
}; |
}; |
447 |
|
|
448 |
|
/** |
449 |
|
* \Struct for track candidates after hough transform |
450 |
|
*/ |
451 |
|
struct cTrkCandidates { |
452 |
|
int ntracks; |
453 |
|
float al[NTRACKSMAX][5]; |
454 |
|
float xm[NTRACKSMAX][NPLANE]; |
455 |
|
float ym[NTRACKSMAX][NPLANE]; |
456 |
|
float zm[NTRACKSMAX][NPLANE]; |
457 |
|
float resx[NTRACKSMAX][NPLANE]; |
458 |
|
float resy[NTRACKSMAX][NPLANE]; |
459 |
|
float xv[NTRACKSMAX][NPLANE]; |
460 |
|
float yv[NTRACKSMAX][NPLANE]; |
461 |
|
float zv[NTRACKSMAX][NPLANE]; |
462 |
|
float axv[NTRACKSMAX][NPLANE]; |
463 |
|
float ayv[NTRACKSMAX][NPLANE]; |
464 |
|
float xgood[NTRACKSMAX][NPLANE]; |
465 |
|
float ygood[NTRACKSMAX][NPLANE]; |
466 |
|
int cp[NTRACKSMAX][NPLANE]; |
467 |
|
int cls[NTRACKSMAX][NPLANE]; |
468 |
|
int sensor[NTRACKSMAX][NPLANE]; |
469 |
|
int ladder[NTRACKSMAX][NPLANE]; |
470 |
|
float bx[NTRACKSMAX][NPLANE]; |
471 |
|
float by[NTRACKSMAX][NPLANE]; |
472 |
|
float chi2[NTRACKSMAX]; |
473 |
|
|
474 |
|
void Init(){ |
475 |
|
ntracks=0; |
476 |
|
for(int i=0; i<NTRACKSMAX; i++){ |
477 |
|
for(int ii=0; ii<5; ii++)al[i][ii]=0; |
478 |
|
chi2[i]=0; |
479 |
|
for(int ip=0; ip<NPLANE; ip++){ |
480 |
|
xm[i][ip]=0; |
481 |
|
ym[i][ip]=0; |
482 |
|
zm[i][ip]=0; |
483 |
|
resx[i][ip]=0; |
484 |
|
resy[i][ip]=0; |
485 |
|
xv[i][ip]=0; |
486 |
|
yv[i][ip]=0; |
487 |
|
zv[i][ip]=0; |
488 |
|
axv[i][ip]=0; |
489 |
|
ayv[i][ip]=0; |
490 |
|
xgood[i][ip]=0; |
491 |
|
ygood[i][ip]=0; |
492 |
|
cp[i][ip]=0; |
493 |
|
cls[i][ip]=0; |
494 |
|
sensor[i][ip]=0; |
495 |
|
ladder[i][ip]=0; |
496 |
|
bx[i][ip]=0; |
497 |
|
by[i][ip]=0; |
498 |
|
} |
499 |
|
} |
500 |
|
|
501 |
|
}; |
502 |
|
|
503 |
|
|
504 |
|
}; |
505 |
|
|
506 |
|
/** |
507 |
|
* \brief Struct to pass VA1-mask to F77 routines |
508 |
|
*/ |
509 |
|
struct cTrkMask { |
510 |
|
|
511 |
|
int mask_vk[NVK][NVIEW]; |
512 |
|
int mask_vk_run[NVK][NVIEW]; |
513 |
|
|
514 |
|
// void Set(TFile* , Int_t , Int_t ); |
515 |
|
|
516 |
|
void Reset(){ |
517 |
|
for(int ivk=0; ivk<NVK; ivk++){ |
518 |
|
for(int iv=0; iv<NVIEW; iv++){ |
519 |
|
// mask_vk[ivk][iv]=0; |
520 |
|
mask_vk_run[ivk][iv]=0; |
521 |
|
} |
522 |
|
} |
523 |
|
} |
524 |
|
|
525 |
|
void Dump(){ |
526 |
|
} |
527 |
|
|
528 |
|
}; |
529 |
|
|
530 |
|
/** |
531 |
|
* \brief Struct for pfa parameters |
532 |
|
*/ |
533 |
|
struct cTrkETA { |
534 |
|
|
535 |
|
int nangbin; |
536 |
|
float angL[NANGMAX],angR[NANGMAX]; |
537 |
|
int netaval; |
538 |
|
float eta2[NANGMAX][NETAVALMAX]; |
539 |
|
float feta2[NANGMAX][NLADDER][NVIEW][NETAVALMAX]; |
540 |
|
float eta3[NANGMAX][NETAVALMAX]; |
541 |
|
float feta3[NANGMAX][NLADDER][NVIEW][NETAVALMAX]; |
542 |
|
float eta4[NANGMAX][NETAVALMAX]; |
543 |
|
float feta4[NANGMAX][NLADDER][NVIEW][NETAVALMAX]; |
544 |
|
float fcorr[NANGMAX][NLADDER][NVIEW]; |
545 |
|
float e234ax[6];//F77: e2fax,e2tax,e3fax,e3tax,e4fax,e4tax |
546 |
|
float e234ay[6];//F77: e2fay,e2tay,e3fay,e3tay,e4fay,e4tay |
547 |
|
|
548 |
|
}; |
549 |
|
/** |
550 |
|
* \brief Struct to configure data reduction |
551 |
|
*/ |
552 |
|
struct cTrkSW{ |
553 |
|
int pfaid; |
554 |
|
}; |
555 |
|
|
556 |
extern "C" { |
extern "C" { |
557 |
|
|
558 |
extern struct cTrkCalib pedsigbad_; |
extern struct cTrkCalib pedsigbad_; |
559 |
|
extern struct cTrkMask mask_; |
560 |
extern struct cTrkLevel0 level0event_; |
extern struct cTrkLevel0 level0event_; |
561 |
extern struct cTrkLevel1 level1event_; |
extern struct cTrkLevel1 level1event_; |
562 |
extern struct cTrkLevel2 level2event_; |
extern struct cTrkLevel2 level2event_; |
563 |
extern struct cPath path_; |
extern struct cPath path_; |
|
/* extern struct cBPath bpath_; */ |
|
564 |
extern struct cDbg dbg_; |
extern struct cDbg dbg_; |
565 |
extern struct cTrkHough houghevent_; |
extern struct cTrkHough houghevent_; |
566 |
|
extern struct cTrkCandidates trackcandidates_; |
567 |
extern struct cMini2track track_; |
extern struct cMini2track track_; |
568 |
|
extern struct cTrkETA pfa_; |
569 |
|
extern struct cTrkSW sw_; |
570 |
|
|
571 |
void fillpedsigfromdefault_(); |
void fillpedsigfromdefault_(); |
572 |
int readmipparam_(); |
int readmipparam_(); |
576 |
int readetaparam_(); |
int readetaparam_(); |
577 |
void reductionflight_(int*); |
void reductionflight_(int*); |
578 |
int analysisflight_(); |
int analysisflight_(); |
579 |
} |
int readb_(); |
580 |
|
void gufld_(float*, float*); |
581 |
|
void xyzpam_(int*,int*,int*,int*,int*,float*,float*,float*,float*); |
582 |
|
float riseta_(int*,float*); |
583 |
|
|
584 |
|
} |
585 |
|
|
586 |
#endif |
#endif |
|
|
|