6 |
#ifndef trkstruct_h |
#ifndef trkstruct_h |
7 |
#define trkstruct_h |
#define trkstruct_h |
8 |
|
|
9 |
#define NTRKMAX 10 |
#define NPLANE 6 |
|
#define NSINGMAX 100 |
|
10 |
|
|
11 |
#define NCLMAX_VIEW 200 |
#define NCLMAX_VIEW 200 //max n.clusters per view |
12 |
#define NCLSTR 19 |
#define NCLSTR 20 //max n.strip per cluster |
13 |
#define NCLMAX (NCLMAX_VIEW*12) |
#define NCLMAX (NCLMAX_VIEW*12) //max n.clusters total |
14 |
#define NCLBUFF (NCLMAX*NCLSTR) |
#define NCLBUFF (NCLMAX*NCLSTR) |
15 |
|
|
16 |
|
#define NDBLT_MAX_NT 1000 // 0.2*ndblt_max |
17 |
|
#define NTRPT_MAX_NT 10000 // 0.2*ntrpt_max |
18 |
|
#define NCLOYZ_MAX 200 |
19 |
|
#define NCLOXZ_MAX 200 |
20 |
|
|
21 |
|
#define NTRKMAX 10 |
22 |
|
#define NSINGMAX NCLMAX //100 |
23 |
|
|
24 |
|
|
25 |
|
|
26 |
#include <CalibTrk1Event.h> |
#include <CalibTrk1Event.h> |
27 |
#include <CalibTrk2Event.h> |
#include <CalibTrk2Event.h> |
28 |
|
|
87 |
* \brief Struct to pass tracker LEVEL1 data to F77 routines |
* \brief Struct to pass tracker LEVEL1 data to F77 routines |
88 |
*/ |
*/ |
89 |
struct cTrkLevel1 { |
struct cTrkLevel1 { |
90 |
int good1; |
// int good1; |
91 |
|
int good[12]; |
92 |
int nclstr1; |
int nclstr1; |
93 |
int view[NCLMAX]; |
int view[NCLMAX]; |
94 |
int ladder[NCLMAX]; |
int ladder[NCLMAX]; |
95 |
int maxs[NCLMAX]; |
int maxs[NCLMAX]; |
96 |
int mult[NCLMAX]; |
int mult[NCLMAX]; |
97 |
float dedx[NCLMAX]; |
float dedx[NCLMAX]; |
98 |
int indstart[NCLMAX]; |
int indstart[NCLMAX]; |
99 |
int indmax[NCLMAX]; |
int indmax[NCLMAX]; |
100 |
int totCLlength; |
int totCLlength; |
101 |
float clsignal[NCLBUFF]; |
float clsignal[NCLBUFF]; |
102 |
float clsigma[NCLBUFF]; |
float clsigma[NCLBUFF]; |
103 |
int cladc[NCLBUFF]; |
int cladc[NCLBUFF]; |
104 |
int clbad[NCLBUFF]; |
int clbad[NCLBUFF]; |
105 |
float cnev[24][12]; |
float cnev[24][12]; |
106 |
int cnnev[24][12]; |
int cnnev[24][12]; |
107 |
int fshower[12]; |
float cnrmsev[24][12]; |
108 |
int whichtrack[NCLMAX]; |
int fshower[12]; |
109 |
|
int whichtrack[NCLMAX]; |
110 |
}; |
}; |
111 |
// ================================================================== |
// ================================================================== |
112 |
/** |
/** |
113 |
* \brief Struct to pass tracker LEVEL2 data to F77 routines |
* \brief Struct to pass tracker LEVEL2 data to F77 routines |
114 |
*/ |
*/ |
115 |
struct cTrkLevel2 { |
struct cTrkLevel2 { |
116 |
int good2; |
// int good2; |
117 |
int crc[12]; |
// int crc[12]; |
118 |
|
int good[12]; |
119 |
// ---------------------------- |
// ---------------------------- |
120 |
int nclsx; |
int nclsx; |
121 |
int planex[NSINGMAX]; |
int planex[NSINGMAX]; |
122 |
float xs[NSINGMAX][2]; |
float xs[NSINGMAX][2]; |
123 |
float signlxs[NSINGMAX]; |
float signlxs[NSINGMAX]; |
124 |
int clsx[NSINGMAX]; |
int clsx[NSINGMAX]; |
125 |
// ---------------------------- |
// ---------------------------- |
126 |
int nclsy; |
int nclsy; |
127 |
int planey[NSINGMAX]; |
int planey[NSINGMAX]; |
128 |
float ys[NSINGMAX][2]; |
float ys[NSINGMAX][2]; |
129 |
float signlys[NSINGMAX]; |
float signlys[NSINGMAX]; |
130 |
int clsy[NSINGMAX]; |
int clsy[NSINGMAX]; |
131 |
// ---------------------------- |
// ---------------------------- |
132 |
int ntrk; |
int ntrk; |
133 |
int image[NTRKMAX]; |
int image[NTRKMAX]; |
139 |
float al_nt[NTRKMAX][5]; |
float al_nt[NTRKMAX][5]; |
140 |
float coval[NTRKMAX][5][5]; |
float coval[NTRKMAX][5][5]; |
141 |
float chi2_nt[NTRKMAX]; |
float chi2_nt[NTRKMAX]; |
142 |
|
int nstep_nt[NTRKMAX]; |
143 |
int xgood_nt[NTRKMAX][6]; |
int xgood_nt[NTRKMAX][6]; |
144 |
int ygood_nt[NTRKMAX][6]; |
int ygood_nt[NTRKMAX][6]; |
145 |
float xv_nt[NTRKMAX][6]; |
float xv_nt[NTRKMAX][6]; |
149 |
float ayv_nt[NTRKMAX][6]; |
float ayv_nt[NTRKMAX][6]; |
150 |
float dedx_x[NTRKMAX][6]; |
float dedx_x[NTRKMAX][6]; |
151 |
float dedx_y[NTRKMAX][6]; |
float dedx_y[NTRKMAX][6]; |
152 |
int cltrx[NTRKMAX][6]; |
int cltrx[NTRKMAX][6]; |
153 |
int cltry[NTRKMAX][6]; |
int cltry[NTRKMAX][6]; |
154 |
// float bdl[NTRKMAX]; |
// float bdl[NTRKMAX]; |
155 |
|
|
156 |
void InitcTrkLevel2(){ |
void InitcTrkLevel2(){ |
157 |
|
|
158 |
good2 = 0; |
// good2 = 0; |
159 |
for(Int_t i=0; i<12 ; i++) |
for(Int_t i=0; i<12 ; i++) |
160 |
crc[i] = 0; |
// crc[i] = 0; |
161 |
|
good[i] = 0; |
162 |
// ---------------------------- |
// ---------------------------- |
163 |
nclsx = 0; |
nclsx = 0; |
164 |
nclsy = 0; |
nclsy = 0; |
211 |
* \brief Struct to pass calibration/parameter file paths to F77 routines |
* \brief Struct to pass calibration/parameter file paths to F77 routines |
212 |
*/ |
*/ |
213 |
struct cPath { |
struct cPath { |
214 |
char path[80]; |
char path[256]; |
215 |
int pathlen; |
int pathlen; |
216 |
int error; |
int error; |
217 |
/** |
/** |
231 |
* \brief Struct to pass magnetic-field file paths to F77 routines |
* \brief Struct to pass magnetic-field file paths to F77 routines |
232 |
*/ |
*/ |
233 |
struct cBPath { |
struct cBPath { |
234 |
char b_path[80]; |
char b_path[256]; |
235 |
int b_pathlen; |
int b_pathlen; |
236 |
int b_error; |
int b_error; |
237 |
int b_loaded; |
int b_loaded; |
268 |
void SetDebug() {debug=1; verbose=1; warning=1;}; |
void SetDebug() {debug=1; verbose=1; warning=1;}; |
269 |
}; |
}; |
270 |
|
|
271 |
|
|
272 |
|
// ================================================================== |
273 |
|
/** |
274 |
|
* \brief Struct to pass mini2 track parameters to F77 routines |
275 |
|
*/ |
276 |
|
struct cMini2track { |
277 |
|
double al[5]; |
278 |
|
double xm[NPLANE],ym[NPLANE],zm[NPLANE]; |
279 |
|
double xm_a[NPLANE],ym_a[NPLANE]; |
280 |
|
double xm_b[NPLANE],ym_b[NPLANE]; |
281 |
|
double resx[NPLANE],resy[NPLANE]; |
282 |
|
double xgood[NPLANE],ygood[NPLANE]; |
283 |
|
double dedxtrk_x[NPLANE]; |
284 |
|
double dedxtrk_y[NPLANE]; |
285 |
|
double zini; |
286 |
|
double pfixed; |
287 |
|
double chi2; |
288 |
|
double xv[NPLANE],yv[NPLANE],zv[NPLANE]; |
289 |
|
double axv[NPLANE],ayv[NPLANE]; |
290 |
|
double cov[5][5]; |
291 |
|
int nstep; |
292 |
|
int idcand; |
293 |
|
}; |
294 |
|
// |
295 |
|
/** |
296 |
|
* \Struct for the hough transform variables |
297 |
|
*/ |
298 |
|
|
299 |
|
struct cTrkHough { |
300 |
|
|
301 |
|
int ndblt; |
302 |
|
float alfayz1[NDBLT_MAX_NT]; |
303 |
|
float alfayz2[NDBLT_MAX_NT]; |
304 |
|
int db_cloud[NDBLT_MAX_NT]; |
305 |
|
int ntrpt; |
306 |
|
float alfaxz1[NTRPT_MAX_NT]; |
307 |
|
float alfaxz2[NTRPT_MAX_NT]; |
308 |
|
float alfaxz3[NTRPT_MAX_NT]; |
309 |
|
int tr_cloud[NTRPT_MAX_NT]; |
310 |
|
int nclouds_yz; |
311 |
|
float alfayz1_av[NCLOYZ_MAX]; |
312 |
|
float alfayz2_av[NCLOYZ_MAX]; |
313 |
|
int ptcloud_yz[NCLOYZ_MAX]; |
314 |
|
int nclouds_xz; |
315 |
|
float alfaxz1_av[NCLOXZ_MAX]; |
316 |
|
float alfaxz2_av[NCLOXZ_MAX]; |
317 |
|
float alfaxz3_av[NCLOXZ_MAX]; |
318 |
|
int ptcloud_xz[NCLOXZ_MAX]; |
319 |
|
int nclstr; |
320 |
|
float totaltime; |
321 |
|
float houghtime; |
322 |
|
float fittime; |
323 |
|
|
324 |
|
|
325 |
|
void InitcTrkHough(){ |
326 |
|
|
327 |
|
ndblt = 0; |
328 |
|
ntrpt = 0; |
329 |
|
nclouds_yz = 0; |
330 |
|
nclouds_xz = 0; |
331 |
|
nclstr = 0; |
332 |
|
totaltime = 0; |
333 |
|
houghtime = 0; |
334 |
|
fittime = 0; |
335 |
|
for(int i=0;i<NDBLT_MAX_NT ;i++){ |
336 |
|
alfayz1[i] = 0; |
337 |
|
alfayz2[i] = 0; |
338 |
|
db_cloud[i] = 0; |
339 |
|
} |
340 |
|
for(int i=0;i<NTRPT_MAX_NT ;i++){ |
341 |
|
alfaxz1[i] = 0; |
342 |
|
alfaxz2[i] = 0; |
343 |
|
alfaxz3[i] = 0; |
344 |
|
tr_cloud[i] = 0; |
345 |
|
} |
346 |
|
for(int i=0;i<NCLOYZ_MAX ;i++){ |
347 |
|
alfayz1_av[i] = 0; |
348 |
|
alfayz2_av[i] = 0; |
349 |
|
ptcloud_yz[i] = 0; |
350 |
|
} |
351 |
|
for(int i=0;i<NCLOXZ_MAX ;i++){ |
352 |
|
ptcloud_xz[i] = 0; |
353 |
|
alfaxz1_av[i] = 0; |
354 |
|
alfaxz2_av[i] = 0; |
355 |
|
alfaxz3_av[i] = 0; |
356 |
|
} |
357 |
|
} |
358 |
|
|
359 |
|
}; |
360 |
|
|
361 |
|
|
362 |
extern "C" { |
extern "C" { |
363 |
extern struct cTrkCalib pedsigbad_; |
|
364 |
extern struct cTrkLevel0 level0event_; |
extern struct cTrkCalib pedsigbad_; |
365 |
extern struct cTrkLevel1 level1event_; |
extern struct cTrkLevel0 level0event_; |
366 |
extern struct cTrkLevel2 level2event_; |
extern struct cTrkLevel1 level1event_; |
367 |
extern struct cPath path_; |
extern struct cTrkLevel2 level2event_; |
368 |
extern struct cBPath bpath_; |
extern struct cPath path_; |
369 |
extern struct cDbg dbg_; |
extern struct cBPath bpath_; |
370 |
|
extern struct cDbg dbg_; |
371 |
|
extern struct cMini2track track_; |
372 |
|
extern struct cTrkHough hough_; |
373 |
|
|
374 |
void fillpedsigfromdefault_(); |
void fillpedsigfromdefault_(); |
375 |
int readmipparam_(); |
int readmipparam_(); |
376 |
int readchargeparam_(); |
int readchargeparam_(); |