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 Reset(){ |
55 |
void FillFCalibFrom(TFile* , Int_t , Int_t ); |
for(int is=0; is<128; is++){ |
56 |
void FillTCalibFrom(TFile* , Int_t , Int_t ); |
for(int ivk=0; ivk<24; ivk++){ |
57 |
void FillTCalibFrom(TString); |
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 |
|
/* 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 |
|
|
73 |
}; |
}; |
74 |
// ================================================================== |
// ================================================================== |
129 |
float cnrmsev[24][12]; |
float cnrmsev[24][12]; |
130 |
int fshower[12]; |
int fshower[12]; |
131 |
int whichtrack[NCLMAX]; |
int whichtrack[NCLMAX]; |
132 |
|
|
133 |
}; |
}; |
134 |
// ================================================================== |
// ================================================================== |
135 |
/** |
/** |
138 |
struct cTrkLevel2 { |
struct cTrkLevel2 { |
139 |
// int good2; |
// int good2; |
140 |
// int crc[12]; |
// int crc[12]; |
141 |
int good[12]; |
int good[12]; |
142 |
|
int vkflag[24][12]; |
143 |
// ---------------------------- |
// ---------------------------- |
144 |
int nclsx; |
int nclsx; |
145 |
int planex[NSINGMAX]; |
int planex[NSINGMAX]; |
160 |
float zm_nt[NTRKMAX][6]; |
float zm_nt[NTRKMAX][6]; |
161 |
float resx_nt[NTRKMAX][6]; |
float resx_nt[NTRKMAX][6]; |
162 |
float resy_nt[NTRKMAX][6]; |
float resy_nt[NTRKMAX][6]; |
163 |
|
float tailx[NTRKMAX][6]; |
164 |
|
float taily[NTRKMAX][6]; |
165 |
float al_nt[NTRKMAX][5]; |
float al_nt[NTRKMAX][5]; |
166 |
float coval[NTRKMAX][5][5]; |
float coval[NTRKMAX][5][5]; |
167 |
float chi2_nt[NTRKMAX]; |
float chi2_nt[NTRKMAX]; |
168 |
int nstep_nt[NTRKMAX]; |
int nstep_nt[NTRKMAX]; |
169 |
int xgood_nt[NTRKMAX][6]; |
int xgood_nt[NTRKMAX][6]; |
170 |
int ygood_nt[NTRKMAX][6]; |
int ygood_nt[NTRKMAX][6]; |
171 |
|
int ls[NTRKMAX][6]; |
172 |
|
int xbad[NTRKMAX][6]; |
173 |
|
int ybad[NTRKMAX][6]; |
174 |
float xv_nt[NTRKMAX][6]; |
float xv_nt[NTRKMAX][6]; |
175 |
float yv_nt[NTRKMAX][6]; |
float yv_nt[NTRKMAX][6]; |
176 |
float zv_nt[NTRKMAX][6]; |
float zv_nt[NTRKMAX][6]; |
180 |
float dedx_y[NTRKMAX][6]; |
float dedx_y[NTRKMAX][6]; |
181 |
int cltrx[NTRKMAX][6]; |
int cltrx[NTRKMAX][6]; |
182 |
int cltry[NTRKMAX][6]; |
int cltry[NTRKMAX][6]; |
183 |
|
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 |
// float bdl[NTRKMAX]; |
// float bdl[NTRKMAX]; |
190 |
|
|
191 |
void InitcTrkLevel2(){ |
void InitcTrkLevel2(){ |
192 |
|
|
193 |
// good2 = 0; |
// good2 = 0; |
194 |
for(Int_t i=0; i<12 ; i++) |
for(Int_t i=0; i<12 ; i++){ |
195 |
// crc[i] = 0; |
good[i] = 0; |
196 |
good[i] = 0; |
for(Int_t ii=0; ii<24 ; ii++)vkflag[ii][i]=0; |
197 |
// ---------------------------- |
} |
198 |
nclsx = 0; |
// ---------------------------- |
199 |
nclsy = 0; |
nclsx = 0; |
200 |
for(Int_t i=0; i<NSINGMAX ; i++){ |
nclsy = 0; |
201 |
planex[i] = 0; |
for(Int_t i=0; i<NSINGMAX ; i++){ |
202 |
xs[i][0] = 0; |
planex[i] = 0; |
203 |
xs[i][1] = 0; |
xs[i][0] = 0; |
204 |
signlxs[i] = 0; |
xs[i][1] = 0; |
205 |
planey[i] = 0; |
signlxs[i] = 0; |
206 |
ys[i][0] = 0; |
planey[i] = 0; |
207 |
ys[i][1] = 0; |
ys[i][0] = 0; |
208 |
signlys[i] = 0; |
ys[i][1] = 0; |
209 |
} |
signlys[i] = 0; |
210 |
// ---------------------------- |
} |
211 |
ntrk =0 ; |
// ---------------------------- |
212 |
|
ntrk =0 ; |
213 |
for(Int_t i=0; i<NTRKMAX ; i++){ |
|
214 |
image[i] = 0; |
for(Int_t i=0; i<NTRKMAX ; i++){ |
215 |
chi2_nt[i] = 0; |
image[i] = 0; |
216 |
|
chi2_nt[i] = 0; |
217 |
// bdl[i] = 0; |
// bdl[i] = 0; |
218 |
|
|
219 |
for(Int_t ii=0; ii<5 ; ii++){ |
for(Int_t ii=0; ii<5 ; ii++){ |
220 |
al_nt[i][ii] = 0; |
al_nt[i][ii] = 0; |
221 |
for(Int_t iii=0; iii<5 ; iii++) |
for(Int_t iii=0; iii<5 ; iii++) |
222 |
coval[i][ii][iii] = 0; |
coval[i][ii][iii] = 0; |
223 |
} |
} |
224 |
|
|
225 |
for(Int_t ii=0; ii<6 ; ii++){ |
for(Int_t ii=0; ii<6 ; ii++){ |
226 |
xm_nt[i][ii] = 0; |
xm_nt[i][ii] = 0; |
227 |
ym_nt[i][ii] = 0; |
ym_nt[i][ii] = 0; |
228 |
zm_nt[i][ii] = 0; |
zm_nt[i][ii] = 0; |
229 |
resx_nt[i][ii] = 0; |
resx_nt[i][ii] = 0; |
230 |
resy_nt[i][ii] = 0; |
resy_nt[i][ii] = 0; |
231 |
xgood_nt[i][ii] = 0; |
xgood_nt[i][ii] = 0; |
232 |
ygood_nt[i][ii] = 0; |
ygood_nt[i][ii] = 0; |
233 |
xv_nt[i][ii] = 0; |
xv_nt[i][ii] = 0; |
234 |
yv_nt[i][ii] = 0; |
yv_nt[i][ii] = 0; |
235 |
zv_nt[i][ii] = 0; |
zv_nt[i][ii] = 0; |
236 |
axv_nt[i][ii] = 0; |
axv_nt[i][ii] = 0; |
237 |
ayv_nt[i][ii] = 0; |
ayv_nt[i][ii] = 0; |
238 |
dedx_x[i][ii] = 0; |
dedx_x[i][ii] = 0; |
239 |
dedx_y[i][ii] = 0; |
dedx_y[i][ii] = 0; |
240 |
} |
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 |
|
} |
247 |
|
} |
248 |
} |
} |
249 |
} |
|
|
|
|
250 |
}; |
}; |
251 |
// ================================================================== |
// ================================================================== |
252 |
/** |
/** |
320 |
double xm_a[NPLANE],ym_a[NPLANE]; |
double xm_a[NPLANE],ym_a[NPLANE]; |
321 |
double xm_b[NPLANE],ym_b[NPLANE]; |
double xm_b[NPLANE],ym_b[NPLANE]; |
322 |
double resx[NPLANE],resy[NPLANE]; |
double resx[NPLANE],resy[NPLANE]; |
323 |
|
double tailx[NPLANE],taily[NPLANE]; |
324 |
double xgood[NPLANE],ygood[NPLANE]; |
double xgood[NPLANE],ygood[NPLANE]; |
325 |
double dedxtrk_x[NPLANE]; |
double dedxtrk_x[NPLANE]; |
326 |
double dedxtrk_y[NPLANE]; |
double dedxtrk_y[NPLANE]; |
330 |
double xv[NPLANE],yv[NPLANE],zv[NPLANE]; |
double xv[NPLANE],yv[NPLANE],zv[NPLANE]; |
331 |
double axv[NPLANE],ayv[NPLANE]; |
double axv[NPLANE],ayv[NPLANE]; |
332 |
double cov[5][5]; |
double cov[5][5]; |
333 |
|
double fact; |
334 |
int nstep; |
int nstep; |
335 |
int idcand; |
int idcand; |
336 |
|
int trackmode; |
337 |
|
int istepmin; |
338 |
|
|
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 |
}; |
}; |
379 |
// |
// |
443 |
|
|
444 |
}; |
}; |
445 |
|
|
446 |
|
/** |
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 |
|
// void Set(TFile* , Int_t , Int_t ); |
455 |
|
|
456 |
|
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 |
|
void Dump(){ |
466 |
|
} |
467 |
|
|
468 |
|
}; |
469 |
|
|
470 |
|
/** |
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 |
|
float fcorr[NANGMAX][NLADDER][NVIEW]; |
485 |
|
float e234ax[6];//F77: e2fax,e2tax,e3fax,e3tax,e4fax,e4tax |
486 |
|
float e234ay[6];//F77: e2fay,e2tay,e3fay,e3tay,e4fay,e4tay |
487 |
|
|
488 |
|
}; |
489 |
|
/** |
490 |
|
* \brief Struct to configure data reduction |
491 |
|
*/ |
492 |
|
struct cTrkSW{ |
493 |
|
int pfaid; |
494 |
|
}; |
495 |
|
|
496 |
extern "C" { |
extern "C" { |
497 |
|
|
498 |
extern struct cTrkCalib pedsigbad_; |
extern struct cTrkCalib pedsigbad_; |
499 |
|
extern struct cTrkMask mask_; |
500 |
extern struct cTrkLevel0 level0event_; |
extern struct cTrkLevel0 level0event_; |
501 |
extern struct cTrkLevel1 level1event_; |
extern struct cTrkLevel1 level1event_; |
502 |
extern struct cTrkLevel2 level2event_; |
extern struct cTrkLevel2 level2event_; |
503 |
extern struct cPath path_; |
extern struct cPath path_; |
|
/* extern struct cBPath bpath_; */ |
|
504 |
extern struct cDbg dbg_; |
extern struct cDbg dbg_; |
505 |
extern struct cTrkHough houghevent_; |
extern struct cTrkHough houghevent_; |
506 |
extern struct cMini2track track_; |
extern struct cMini2track track_; |
507 |
|
extern struct cTrkETA pfa_; |
508 |
|
extern struct cTrkSW sw_; |
509 |
|
|
510 |
void fillpedsigfromdefault_(); |
void fillpedsigfromdefault_(); |
511 |
int readmipparam_(); |
int readmipparam_(); |
515 |
int readetaparam_(); |
int readetaparam_(); |
516 |
void reductionflight_(int*); |
void reductionflight_(int*); |
517 |
int analysisflight_(); |
int analysisflight_(); |
518 |
} |
int readb_(); |
519 |
|
void gufld_(float*, float*); |
520 |
|
void xyzpam_(int*,int*,int*,int*,int*,float*,float*,float*,float*); |
521 |
|
float riseta_(int*,float*); |
522 |
|
|
523 |
|
} |
524 |
|
|
525 |
#endif |
#endif |
|
|
|