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 |
|
|
31 |
#include <CalibTrk1Event.h> |
#include <CalibTrk1Event.h> |
32 |
#include <CalibTrk2Event.h> |
#include <CalibTrk2Event.h> |
33 |
|
using namespace pamela; |
34 |
|
//#include <TrkCalib.h> |
35 |
|
|
36 |
#include <TString.h> |
#include <TString.h> |
37 |
#include <TFile.h> |
#include <TFile.h> |
38 |
#include <TTree.h> |
#include <TTree.h> |
39 |
|
|
40 |
|
|
41 |
#include <fstream> |
#include <fstream> |
42 |
#include <iostream> |
#include <iostream> |
43 |
/** |
/** |
51 |
float sigma_t[128][24][12]; |
float sigma_t[128][24][12]; |
52 |
int bad[128][24][12]; |
int bad[128][24][12]; |
53 |
|
|
54 |
void FillACalibFrom(TFile* , Int_t , Int_t ); |
/* void FillACalibFrom(TFile* , Int_t , Int_t ); */ |
55 |
void FillFCalibFrom(TFile* , Int_t , Int_t ); |
/* void FillFCalibFrom(TFile* , Int_t , Int_t ); */ |
56 |
void FillTCalibFrom(TFile* , Int_t , Int_t ); |
/* void FillTCalibFrom(TFile* , Int_t , Int_t ); */ |
57 |
void FillTCalibFrom(TString); |
/* void FillTCalibFrom(TString); */ |
58 |
|
|
59 |
}; |
}; |
60 |
// ================================================================== |
// ================================================================== |
115 |
float cnrmsev[24][12]; |
float cnrmsev[24][12]; |
116 |
int fshower[12]; |
int fshower[12]; |
117 |
int whichtrack[NCLMAX]; |
int whichtrack[NCLMAX]; |
118 |
|
|
119 |
}; |
}; |
120 |
// ================================================================== |
// ================================================================== |
121 |
/** |
/** |
124 |
struct cTrkLevel2 { |
struct cTrkLevel2 { |
125 |
// int good2; |
// int good2; |
126 |
// int crc[12]; |
// int crc[12]; |
127 |
int good[12]; |
int good[12]; |
128 |
|
int vkflag[24][12]; |
129 |
// ---------------------------- |
// ---------------------------- |
130 |
int nclsx; |
int nclsx; |
131 |
int planex[NSINGMAX]; |
int planex[NSINGMAX]; |
146 |
float zm_nt[NTRKMAX][6]; |
float zm_nt[NTRKMAX][6]; |
147 |
float resx_nt[NTRKMAX][6]; |
float resx_nt[NTRKMAX][6]; |
148 |
float resy_nt[NTRKMAX][6]; |
float resy_nt[NTRKMAX][6]; |
149 |
|
float tailx[NTRKMAX][6]; |
150 |
|
float taily[NTRKMAX][6]; |
151 |
float al_nt[NTRKMAX][5]; |
float al_nt[NTRKMAX][5]; |
152 |
float coval[NTRKMAX][5][5]; |
float coval[NTRKMAX][5][5]; |
153 |
float chi2_nt[NTRKMAX]; |
float chi2_nt[NTRKMAX]; |
154 |
int nstep_nt[NTRKMAX]; |
int nstep_nt[NTRKMAX]; |
155 |
int xgood_nt[NTRKMAX][6]; |
int xgood_nt[NTRKMAX][6]; |
156 |
int ygood_nt[NTRKMAX][6]; |
int ygood_nt[NTRKMAX][6]; |
157 |
|
int ls[NTRKMAX][6]; |
158 |
|
int xbad[NTRKMAX][6]; |
159 |
|
int ybad[NTRKMAX][6]; |
160 |
float xv_nt[NTRKMAX][6]; |
float xv_nt[NTRKMAX][6]; |
161 |
float yv_nt[NTRKMAX][6]; |
float yv_nt[NTRKMAX][6]; |
162 |
float zv_nt[NTRKMAX][6]; |
float zv_nt[NTRKMAX][6]; |
168 |
int cltry[NTRKMAX][6]; |
int cltry[NTRKMAX][6]; |
169 |
// float bdl[NTRKMAX]; |
// float bdl[NTRKMAX]; |
170 |
|
|
171 |
void InitcTrkLevel2(){ |
void InitcTrkLevel2(){ |
172 |
|
|
173 |
// good2 = 0; |
// good2 = 0; |
174 |
for(Int_t i=0; i<12 ; i++) |
for(Int_t i=0; i<12 ; i++){ |
175 |
// crc[i] = 0; |
good[i] = 0; |
176 |
good[i] = 0; |
for(Int_t ii=0; ii<24 ; ii++)vkflag[ii][i]=0; |
177 |
// ---------------------------- |
} |
178 |
nclsx = 0; |
// ---------------------------- |
179 |
nclsy = 0; |
nclsx = 0; |
180 |
for(Int_t i=0; i<NSINGMAX ; i++){ |
nclsy = 0; |
181 |
planex[i] = 0; |
for(Int_t i=0; i<NSINGMAX ; i++){ |
182 |
xs[i][0] = 0; |
planex[i] = 0; |
183 |
xs[i][1] = 0; |
xs[i][0] = 0; |
184 |
signlxs[i] = 0; |
xs[i][1] = 0; |
185 |
planey[i] = 0; |
signlxs[i] = 0; |
186 |
ys[i][0] = 0; |
planey[i] = 0; |
187 |
ys[i][1] = 0; |
ys[i][0] = 0; |
188 |
signlys[i] = 0; |
ys[i][1] = 0; |
189 |
} |
signlys[i] = 0; |
190 |
// ---------------------------- |
} |
191 |
ntrk =0 ; |
// ---------------------------- |
192 |
|
ntrk =0 ; |
193 |
for(Int_t i=0; i<NTRKMAX ; i++){ |
|
194 |
image[i] = 0; |
for(Int_t i=0; i<NTRKMAX ; i++){ |
195 |
chi2_nt[i] = 0; |
image[i] = 0; |
196 |
|
chi2_nt[i] = 0; |
197 |
// bdl[i] = 0; |
// bdl[i] = 0; |
198 |
|
|
199 |
for(Int_t ii=0; ii<5 ; ii++){ |
for(Int_t ii=0; ii<5 ; ii++){ |
200 |
al_nt[i][ii] = 0; |
al_nt[i][ii] = 0; |
201 |
for(Int_t iii=0; iii<5 ; iii++) |
for(Int_t iii=0; iii<5 ; iii++) |
202 |
coval[i][ii][iii] = 0; |
coval[i][ii][iii] = 0; |
203 |
} |
} |
204 |
|
|
205 |
for(Int_t ii=0; ii<6 ; ii++){ |
for(Int_t ii=0; ii<6 ; ii++){ |
206 |
xm_nt[i][ii] = 0; |
xm_nt[i][ii] = 0; |
207 |
ym_nt[i][ii] = 0; |
ym_nt[i][ii] = 0; |
208 |
zm_nt[i][ii] = 0; |
zm_nt[i][ii] = 0; |
209 |
resx_nt[i][ii] = 0; |
resx_nt[i][ii] = 0; |
210 |
resy_nt[i][ii] = 0; |
resy_nt[i][ii] = 0; |
211 |
xgood_nt[i][ii] = 0; |
xgood_nt[i][ii] = 0; |
212 |
ygood_nt[i][ii] = 0; |
ygood_nt[i][ii] = 0; |
213 |
xv_nt[i][ii] = 0; |
xv_nt[i][ii] = 0; |
214 |
yv_nt[i][ii] = 0; |
yv_nt[i][ii] = 0; |
215 |
zv_nt[i][ii] = 0; |
zv_nt[i][ii] = 0; |
216 |
axv_nt[i][ii] = 0; |
axv_nt[i][ii] = 0; |
217 |
ayv_nt[i][ii] = 0; |
ayv_nt[i][ii] = 0; |
218 |
dedx_x[i][ii] = 0; |
dedx_x[i][ii] = 0; |
219 |
dedx_y[i][ii] = 0; |
dedx_y[i][ii] = 0; |
220 |
} |
} |
221 |
|
} |
222 |
} |
} |
223 |
} |
|
|
|
|
224 |
}; |
}; |
225 |
// ================================================================== |
// ================================================================== |
226 |
/** |
/** |
294 |
double xm_a[NPLANE],ym_a[NPLANE]; |
double xm_a[NPLANE],ym_a[NPLANE]; |
295 |
double xm_b[NPLANE],ym_b[NPLANE]; |
double xm_b[NPLANE],ym_b[NPLANE]; |
296 |
double resx[NPLANE],resy[NPLANE]; |
double resx[NPLANE],resy[NPLANE]; |
297 |
|
double tailx[NPLANE],taily[NPLANE]; |
298 |
double xgood[NPLANE],ygood[NPLANE]; |
double xgood[NPLANE],ygood[NPLANE]; |
299 |
double dedxtrk_x[NPLANE]; |
double dedxtrk_x[NPLANE]; |
300 |
double dedxtrk_y[NPLANE]; |
double dedxtrk_y[NPLANE]; |
304 |
double xv[NPLANE],yv[NPLANE],zv[NPLANE]; |
double xv[NPLANE],yv[NPLANE],zv[NPLANE]; |
305 |
double axv[NPLANE],ayv[NPLANE]; |
double axv[NPLANE],ayv[NPLANE]; |
306 |
double cov[5][5]; |
double cov[5][5]; |
307 |
|
double fact; |
308 |
int nstep; |
int nstep; |
309 |
int idcand; |
int idcand; |
310 |
|
int trackmode; |
311 |
|
int istepmin; |
312 |
|
|
313 |
|
/* cMini2track(){ */ |
314 |
|
/* // -------------------------- */ |
315 |
|
/* // fitting routine parameters */ |
316 |
|
/* // -------------------------- */ |
317 |
|
/* zini = 23.5; */ |
318 |
|
/* trackmode = 0; */ |
319 |
|
/* istepmin = 3; */ |
320 |
|
/* // -------------------------- */ |
321 |
|
/* pfixed = 0.; */ |
322 |
|
/* chi2 = 0; */ |
323 |
|
/* nstep = 0; */ |
324 |
|
/* for(int it1=0;it1<5;it1++){ */ |
325 |
|
/* al[it1] = 0; */ |
326 |
|
/* for(int it2=0;it2<5;it2++)cov[it1][it2] = 0; */ |
327 |
|
/* }; */ |
328 |
|
/* for(int ip=0;ip<6;ip++){ */ |
329 |
|
/* xgood[ip] = 0; */ |
330 |
|
/* ygood[ip] = 0; */ |
331 |
|
/* xm[ip] = 0; */ |
332 |
|
/* ym[ip] = 0; */ |
333 |
|
/* xm_a[ip] = 0; */ |
334 |
|
/* ym_a[ip] = 0; */ |
335 |
|
/* xm_b[ip] = 0; */ |
336 |
|
/* ym_b[ip] = 0; */ |
337 |
|
/* zm[ip] = 0; */ |
338 |
|
/* resx[ip] = 0; */ |
339 |
|
/* resy[ip] = 0; */ |
340 |
|
/* xv[ip] = 0; */ |
341 |
|
/* yv[ip] = 0; */ |
342 |
|
/* zv[ip] = 0; */ |
343 |
|
/* axv[ip] = 0; */ |
344 |
|
/* ayv[ip] = 0; */ |
345 |
|
/* dedxtrk_x[ip] = 0; */ |
346 |
|
/* dedxtrk_y[ip] = 0; */ |
347 |
|
/* }; */ |
348 |
|
|
349 |
|
/* } */ |
350 |
|
|
351 |
|
|
352 |
}; |
}; |
353 |
// |
// |
354 |
/** |
/** |
357 |
|
|
358 |
struct cTrkHough { |
struct cTrkHough { |
359 |
|
|
360 |
int ndblt; |
int ndblt_nt; |
361 |
float alfayz1[NDBLT_MAX_NT]; |
float alfayz1_nt[NDBLT_MAX_NT]; |
362 |
float alfayz2[NDBLT_MAX_NT]; |
float alfayz2_nt[NDBLT_MAX_NT]; |
363 |
int db_cloud[NDBLT_MAX_NT]; |
int db_cloud_nt[NDBLT_MAX_NT]; |
364 |
int ntrpt; |
int ntrpt_nt; |
365 |
float alfaxz1[NTRPT_MAX_NT]; |
float alfaxz1_nt[NTRPT_MAX_NT]; |
366 |
float alfaxz2[NTRPT_MAX_NT]; |
float alfaxz2_nt[NTRPT_MAX_NT]; |
367 |
float alfaxz3[NTRPT_MAX_NT]; |
float alfaxz3_nt[NTRPT_MAX_NT]; |
368 |
int tr_cloud[NTRPT_MAX_NT]; |
int tr_cloud_nt[NTRPT_MAX_NT]; |
369 |
int nclouds_yz; |
int nclouds_yz_nt; |
370 |
float alfayz1_av[NCLOYZ_MAX]; |
float alfayz1_av_nt[NCLOYZ_MAX]; |
371 |
float alfayz2_av[NCLOYZ_MAX]; |
float alfayz2_av_nt[NCLOYZ_MAX]; |
372 |
int ptcloud_yz[NCLOYZ_MAX]; |
int ptcloud_yz_nt[NCLOYZ_MAX]; |
373 |
int nclouds_xz; |
int nclouds_xz_nt; |
374 |
float alfaxz1_av[NCLOXZ_MAX]; |
float alfaxz1_av_nt[NCLOXZ_MAX]; |
375 |
float alfaxz2_av[NCLOXZ_MAX]; |
float alfaxz2_av_nt[NCLOXZ_MAX]; |
376 |
float alfaxz3_av[NCLOXZ_MAX]; |
float alfaxz3_av_nt[NCLOXZ_MAX]; |
377 |
int ptcloud_xz[NCLOXZ_MAX]; |
int ptcloud_xz_nt[NCLOXZ_MAX]; |
378 |
int nclstr; |
int nclstr; |
379 |
float totaltime; |
float totaltime; |
380 |
float houghtime; |
float houghtime; |
383 |
|
|
384 |
void InitcTrkHough(){ |
void InitcTrkHough(){ |
385 |
|
|
386 |
ndblt = 0; |
ndblt_nt = 0; |
387 |
ntrpt = 0; |
ntrpt_nt = 0; |
388 |
nclouds_yz = 0; |
nclouds_yz_nt = 0; |
389 |
nclouds_xz = 0; |
nclouds_xz_nt = 0; |
390 |
nclstr = 0; |
nclstr = 0; |
391 |
totaltime = 0; |
totaltime = 0; |
392 |
houghtime = 0; |
houghtime = 0; |
393 |
fittime = 0; |
fittime = 0; |
394 |
for(int i=0;i<NDBLT_MAX_NT ;i++){ |
for(int i=0;i<NDBLT_MAX_NT ;i++){ |
395 |
alfayz1[i] = 0; |
alfayz1_nt[i] = 0; |
396 |
alfayz2[i] = 0; |
alfayz2_nt[i] = 0; |
397 |
db_cloud[i] = 0; |
db_cloud_nt[i] = 0; |
398 |
} |
} |
399 |
for(int i=0;i<NTRPT_MAX_NT ;i++){ |
for(int i=0;i<NTRPT_MAX_NT ;i++){ |
400 |
alfaxz1[i] = 0; |
alfaxz1_nt[i] = 0; |
401 |
alfaxz2[i] = 0; |
alfaxz2_nt[i] = 0; |
402 |
alfaxz3[i] = 0; |
alfaxz3_nt[i] = 0; |
403 |
tr_cloud[i] = 0; |
tr_cloud_nt[i] = 0; |
404 |
} |
} |
405 |
for(int i=0;i<NCLOYZ_MAX ;i++){ |
for(int i=0;i<NCLOYZ_MAX ;i++){ |
406 |
alfayz1_av[i] = 0; |
alfayz1_av_nt[i] = 0; |
407 |
alfayz2_av[i] = 0; |
alfayz2_av_nt[i] = 0; |
408 |
ptcloud_yz[i] = 0; |
ptcloud_yz_nt[i] = 0; |
409 |
} |
} |
410 |
for(int i=0;i<NCLOXZ_MAX ;i++){ |
for(int i=0;i<NCLOXZ_MAX ;i++){ |
411 |
ptcloud_xz[i] = 0; |
ptcloud_xz_nt[i] = 0; |
412 |
alfaxz1_av[i] = 0; |
alfaxz1_av_nt[i] = 0; |
413 |
alfaxz2_av[i] = 0; |
alfaxz2_av_nt[i] = 0; |
414 |
alfaxz3_av[i] = 0; |
alfaxz3_av_nt[i] = 0; |
415 |
} |
} |
416 |
} |
} |
417 |
|
|
418 |
}; |
}; |
419 |
|
|
420 |
|
/** |
421 |
|
* \brief Struct to pass VA1-mask to F77 routines |
422 |
|
*/ |
423 |
|
struct cTrkMask { |
424 |
|
|
425 |
|
int mask_vk[NVK][NVIEW]; |
426 |
|
int mask_vk_run[NVK][NVIEW]; |
427 |
|
|
428 |
|
// void Set(TFile* , Int_t , Int_t ); |
429 |
|
|
430 |
|
}; |
431 |
|
|
432 |
|
/** |
433 |
|
* \brief Struct for pfa parameters |
434 |
|
*/ |
435 |
|
struct cTrkETA { |
436 |
|
|
437 |
|
int nangbin; |
438 |
|
float angL[NANGMAX],angR[NANGMAX]; |
439 |
|
int netaval; |
440 |
|
float eta2[NANGMAX][NETAVALMAX]; |
441 |
|
float feta2[NANGMAX][NLADDER][NVIEW][NETAVALMAX]; |
442 |
|
float eta3[NANGMAX][NETAVALMAX]; |
443 |
|
float feta3[NANGMAX][NLADDER][NVIEW][NETAVALMAX]; |
444 |
|
float eta4[NANGMAX][NETAVALMAX]; |
445 |
|
float feta4[NANGMAX][NLADDER][NVIEW][NETAVALMAX]; |
446 |
|
|
447 |
|
}; |
448 |
|
/** |
449 |
|
* \brief Struct to configure data reduction |
450 |
|
*/ |
451 |
|
struct cTrkSW{ |
452 |
|
int pfaid; |
453 |
|
}; |
454 |
|
|
455 |
extern "C" { |
extern "C" { |
456 |
|
|
457 |
extern struct cTrkCalib pedsigbad_; |
extern struct cTrkCalib pedsigbad_; |
458 |
|
extern struct cTrkMask mask_; |
459 |
extern struct cTrkLevel0 level0event_; |
extern struct cTrkLevel0 level0event_; |
460 |
extern struct cTrkLevel1 level1event_; |
extern struct cTrkLevel1 level1event_; |
461 |
extern struct cTrkLevel2 level2event_; |
extern struct cTrkLevel2 level2event_; |
462 |
extern struct cPath path_; |
extern struct cPath path_; |
|
/* extern struct cBPath bpath_; */ |
|
463 |
extern struct cDbg dbg_; |
extern struct cDbg dbg_; |
464 |
|
extern struct cTrkHough houghevent_; |
465 |
extern struct cMini2track track_; |
extern struct cMini2track track_; |
466 |
extern struct cTrkHough hough_; |
extern struct cTrkETA pfa_; |
467 |
|
extern struct cTrkSW sw_; |
468 |
|
|
469 |
void fillpedsigfromdefault_(); |
void fillpedsigfromdefault_(); |
470 |
int readmipparam_(); |
int readmipparam_(); |
474 |
int readetaparam_(); |
int readetaparam_(); |
475 |
void reductionflight_(int*); |
void reductionflight_(int*); |
476 |
int analysisflight_(); |
int analysisflight_(); |
477 |
} |
int readb_(); |
478 |
|
void gufld_(float*, float*); |
479 |
|
void xyzpam_(int*,int*,int*,int*,int*,float*,float*,float*,float*); |
480 |
|
float riseta_(int*,float*); |
481 |
|
|
482 |
|
} |
483 |
|
|
484 |
#endif |
#endif |
|
|
|