6 |
#ifndef trkstruct_h |
#ifndef trkstruct_h |
7 |
#define trkstruct_h |
#define trkstruct_h |
8 |
|
|
9 |
|
#define NPLANE 6 |
10 |
|
|
11 |
|
#define NCLMAX_VIEW 200 //max n.clusters per view |
12 |
|
#define NCLSTR 20 //max n.strip per cluster |
13 |
|
#define NCLMAX (NCLMAX_VIEW*12) //max n.clusters total |
14 |
|
#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 |
#define NTRKMAX 10 |
22 |
#define NSINGMAX 100 |
#define NSINGMAX NCLMAX //100 |
23 |
|
|
24 |
|
|
25 |
|
|
26 |
#include <CalibTrk1Event.h> |
#include <CalibTrk1Event.h> |
27 |
#include <CalibTrk2Event.h> |
#include <CalibTrk2Event.h> |
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[500]; |
int view[NCLMAX]; |
94 |
int ladder[500]; |
int ladder[NCLMAX]; |
95 |
int maxs[500]; |
int maxs[NCLMAX]; |
96 |
int mult[500]; |
int mult[NCLMAX]; |
97 |
float dedx[500]; |
float dedx[NCLMAX]; |
98 |
int indstart[500]; |
int indstart[NCLMAX]; |
99 |
int indmax[500]; |
int indmax[NCLMAX]; |
100 |
int totCLlength; |
int totCLlength; |
101 |
float clsignal[8500]; |
float clsignal[NCLBUFF]; |
102 |
|
float clsigma[NCLBUFF]; |
103 |
|
int cladc[NCLBUFF]; |
104 |
|
int clbad[NCLBUFF]; |
105 |
float cnev[24][12]; |
float cnev[24][12]; |
106 |
float cnevflag[24][12]; |
int cnnev[24][12]; |
107 |
|
float cnrmsev[24][12]; |
108 |
|
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]; |
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]; |
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 |
float bdl[NTRKMAX]; |
int cltrx[NTRKMAX][6]; |
153 |
|
int cltry[NTRKMAX][6]; |
154 |
|
// 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; |
178 |
for(Int_t i=0; i<NTRKMAX ; i++){ |
for(Int_t i=0; i<NTRKMAX ; i++){ |
179 |
image[i] = 0; |
image[i] = 0; |
180 |
chi2_nt[i] = 0; |
chi2_nt[i] = 0; |
181 |
bdl[i] = 0; |
// bdl[i] = 0; |
182 |
|
|
183 |
for(Int_t ii=0; ii<5 ; ii++){ |
for(Int_t ii=0; ii<5 ; ii++){ |
184 |
al_nt[i][ii] = 0; |
al_nt[i][ii] = 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 |
/** |
/** |
222 |
const char *pc = s.Data(); |
const char *pc = s.Data(); |
223 |
for(Int_t i=0; i<=pathlen; i++) path[i] = *pc++; |
for(Int_t i=0; i<=pathlen; i++) path[i] = *pc++; |
224 |
}; |
}; |
225 |
|
|
|
|
|
226 |
}; |
}; |
227 |
|
|
228 |
// ================================================================== |
// ================================================================== |
229 |
/** |
/* /\** */ |
230 |
* \brief Struct to pass magnetic-field file paths to F77 routines |
/* * \brief Struct to pass magnetic-field file paths to F77 routines */ |
231 |
*/ |
/* *\/ */ |
232 |
struct cBPath { |
/* struct cBPath { */ |
233 |
char b_path[80]; |
/* char b_path[256]; */ |
234 |
int b_pathlen; |
/* int b_pathlen; */ |
235 |
int b_error; |
/* int b_error; */ |
236 |
int b_loaded; |
/* int b_loaded; */ |
237 |
/** |
/* /\** */ |
238 |
* Fill the struct variables from a TString object and set |
/* * Fill the struct variables from a TString object and set */ |
239 |
* the load flag to FALSE. |
/* * the load flag to FALSE. */ |
240 |
*/ |
/* *\/ */ |
241 |
void FillWith(TString s){ |
/* void FillWith(TString s){ */ |
242 |
b_loaded = 0; |
/* b_loaded = 0; */ |
243 |
b_pathlen = s.Length(); |
/* b_pathlen = s.Length(); */ |
244 |
const char *pc = s.Data(); |
/* const char *pc = s.Data(); */ |
245 |
for(Int_t i=0; i<=b_pathlen; i++) b_path[i] = *pc++; |
/* for(Int_t i=0; i<=b_pathlen; i++) b_path[i] = *pc++; */ |
246 |
}; |
/* }; */ |
247 |
/** |
/* /\** */ |
248 |
* Fill the struct variables from a TString object |
/* * Fill the struct variables from a TString object */ |
249 |
*/ |
/* *\/ */ |
250 |
int BIsLoaded(){ return b_loaded; }; |
/* int BIsLoaded(){ return b_loaded; }; */ |
251 |
|
|
252 |
}; |
/* }; */ |
253 |
|
|
254 |
// ================================================================== |
// ================================================================== |
255 |
/** |
/** |
267 |
void SetDebug() {debug=1; verbose=1; warning=1;}; |
void SetDebug() {debug=1; verbose=1; warning=1;}; |
268 |
}; |
}; |
269 |
|
|
270 |
|
|
271 |
|
// ================================================================== |
272 |
|
/** |
273 |
|
* \brief Struct to pass mini2 track parameters to F77 routines |
274 |
|
*/ |
275 |
|
struct cMini2track { |
276 |
|
double al[5]; |
277 |
|
double xm[NPLANE],ym[NPLANE],zm[NPLANE]; |
278 |
|
double xm_a[NPLANE],ym_a[NPLANE]; |
279 |
|
double xm_b[NPLANE],ym_b[NPLANE]; |
280 |
|
double resx[NPLANE],resy[NPLANE]; |
281 |
|
double xgood[NPLANE],ygood[NPLANE]; |
282 |
|
double dedxtrk_x[NPLANE]; |
283 |
|
double dedxtrk_y[NPLANE]; |
284 |
|
double zini; |
285 |
|
double pfixed; |
286 |
|
double chi2; |
287 |
|
double xv[NPLANE],yv[NPLANE],zv[NPLANE]; |
288 |
|
double axv[NPLANE],ayv[NPLANE]; |
289 |
|
double cov[5][5]; |
290 |
|
int nstep; |
291 |
|
int idcand; |
292 |
|
}; |
293 |
|
// |
294 |
|
/** |
295 |
|
* \Struct for the hough transform variables |
296 |
|
*/ |
297 |
|
|
298 |
|
struct cTrkHough { |
299 |
|
|
300 |
|
int ndblt_nt; |
301 |
|
float alfayz1_nt[NDBLT_MAX_NT]; |
302 |
|
float alfayz2_nt[NDBLT_MAX_NT]; |
303 |
|
int db_cloud_nt[NDBLT_MAX_NT]; |
304 |
|
int ntrpt_nt; |
305 |
|
float alfaxz1_nt[NTRPT_MAX_NT]; |
306 |
|
float alfaxz2_nt[NTRPT_MAX_NT]; |
307 |
|
float alfaxz3_nt[NTRPT_MAX_NT]; |
308 |
|
int tr_cloud_nt[NTRPT_MAX_NT]; |
309 |
|
int nclouds_yz_nt; |
310 |
|
float alfayz1_av_nt[NCLOYZ_MAX]; |
311 |
|
float alfayz2_av_nt[NCLOYZ_MAX]; |
312 |
|
int ptcloud_yz_nt[NCLOYZ_MAX]; |
313 |
|
int nclouds_xz_nt; |
314 |
|
float alfaxz1_av_nt[NCLOXZ_MAX]; |
315 |
|
float alfaxz2_av_nt[NCLOXZ_MAX]; |
316 |
|
float alfaxz3_av_nt[NCLOXZ_MAX]; |
317 |
|
int ptcloud_xz_nt[NCLOXZ_MAX]; |
318 |
|
int nclstr; |
319 |
|
float totaltime; |
320 |
|
float houghtime; |
321 |
|
float fittime; |
322 |
|
|
323 |
|
|
324 |
|
void InitcTrkHough(){ |
325 |
|
|
326 |
|
ndblt_nt = 0; |
327 |
|
ntrpt_nt = 0; |
328 |
|
nclouds_yz_nt = 0; |
329 |
|
nclouds_xz_nt = 0; |
330 |
|
nclstr = 0; |
331 |
|
totaltime = 0; |
332 |
|
houghtime = 0; |
333 |
|
fittime = 0; |
334 |
|
for(int i=0;i<NDBLT_MAX_NT ;i++){ |
335 |
|
alfayz1_nt[i] = 0; |
336 |
|
alfayz2_nt[i] = 0; |
337 |
|
db_cloud_nt[i] = 0; |
338 |
|
} |
339 |
|
for(int i=0;i<NTRPT_MAX_NT ;i++){ |
340 |
|
alfaxz1_nt[i] = 0; |
341 |
|
alfaxz2_nt[i] = 0; |
342 |
|
alfaxz3_nt[i] = 0; |
343 |
|
tr_cloud_nt[i] = 0; |
344 |
|
} |
345 |
|
for(int i=0;i<NCLOYZ_MAX ;i++){ |
346 |
|
alfayz1_av_nt[i] = 0; |
347 |
|
alfayz2_av_nt[i] = 0; |
348 |
|
ptcloud_yz_nt[i] = 0; |
349 |
|
} |
350 |
|
for(int i=0;i<NCLOXZ_MAX ;i++){ |
351 |
|
ptcloud_xz_nt[i] = 0; |
352 |
|
alfaxz1_av_nt[i] = 0; |
353 |
|
alfaxz2_av_nt[i] = 0; |
354 |
|
alfaxz3_av_nt[i] = 0; |
355 |
|
} |
356 |
|
} |
357 |
|
|
358 |
|
}; |
359 |
|
|
360 |
|
|
361 |
extern "C" { |
extern "C" { |
362 |
extern struct cTrkCalib pedsigbad_; |
|
363 |
extern struct cTrkLevel0 level0event_; |
extern struct cTrkCalib pedsigbad_; |
364 |
extern struct cTrkLevel1 level1event_; |
extern struct cTrkLevel0 level0event_; |
365 |
extern struct cTrkLevel2 level2event_; |
extern struct cTrkLevel1 level1event_; |
366 |
extern struct cPath path_; |
extern struct cTrkLevel2 level2event_; |
367 |
extern struct cBPath bpath_; |
extern struct cPath path_; |
368 |
extern struct cDbg dbg_; |
/* extern struct cBPath bpath_; */ |
369 |
|
extern struct cDbg dbg_; |
370 |
|
extern struct cTrkHough houghevent_; |
371 |
|
extern struct cMini2track track_; |
372 |
|
|
373 |
void fillpedsigfromdefault_(); |
void fillpedsigfromdefault_(); |
374 |
int readmipparam_(); |
int readmipparam_(); |
375 |
int readchargeparam_(); |
int readchargeparam_(); |