6 |
#ifndef trkstruct_h |
#ifndef trkstruct_h |
7 |
#define trkstruct_h |
#define trkstruct_h |
8 |
|
|
9 |
|
#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 |
15 |
|
#define NCLSTR 20 //max n.strip per cluster |
16 |
|
#define NCLMAX (NCLMAX_VIEW*12) //max n.clusters total |
17 |
|
#define NCLBUFF (NCLMAX*NCLSTR) |
18 |
|
|
19 |
|
#define NDBLT_MAX_NT 1000 // 0.2*ndblt_max |
20 |
|
#define NTRPT_MAX_NT 10000 // 0.2*ntrpt_max |
21 |
|
#define NCLOYZ_MAX 200 |
22 |
|
#define NCLOXZ_MAX 200 |
23 |
|
|
24 |
#define NTRKMAX 10 |
#define NTRKMAX 10 |
25 |
#define NSINGMAX 100 |
#define NSINGMAX NCLMAX //100 |
26 |
|
|
27 |
#define NCLMAX_VIEW 200 |
#define NANGMAX 21 |
28 |
#define NCLSTR 19 |
#define NETAVALMAX 150 |
|
#define NCLMAX (NCLMAX_VIEW*12) |
|
|
#define NCLBUFF (NCLMAX*NCLSTR) |
|
29 |
|
|
30 |
#include <CalibTrk1Event.h> |
|
31 |
#include <CalibTrk2Event.h> |
//#include <CalibTrk1Event.h> |
32 |
|
//#include <CalibTrk2Event.h> |
33 |
|
#include <TrkCalib.h> |
34 |
|
|
35 |
#include <TString.h> |
#include <TString.h> |
36 |
#include <TFile.h> |
#include <TFile.h> |
93 |
* \brief Struct to pass tracker LEVEL1 data to F77 routines |
* \brief Struct to pass tracker LEVEL1 data to F77 routines |
94 |
*/ |
*/ |
95 |
struct cTrkLevel1 { |
struct cTrkLevel1 { |
96 |
int good1; |
// int good1; |
97 |
|
int good[12]; |
98 |
int nclstr1; |
int nclstr1; |
99 |
int view[NCLMAX]; |
int view[NCLMAX]; |
100 |
int ladder[NCLMAX]; |
int ladder[NCLMAX]; |
101 |
int maxs[NCLMAX]; |
int maxs[NCLMAX]; |
102 |
int mult[NCLMAX]; |
int mult[NCLMAX]; |
103 |
float dedx[NCLMAX]; |
float dedx[NCLMAX]; |
104 |
int indstart[NCLMAX]; |
int indstart[NCLMAX]; |
105 |
int indmax[NCLMAX]; |
int indmax[NCLMAX]; |
106 |
int totCLlength; |
int totCLlength; |
107 |
float clsignal[NCLBUFF]; |
float clsignal[NCLBUFF]; |
108 |
float clsigma[NCLBUFF]; |
float clsigma[NCLBUFF]; |
109 |
int cladc[NCLBUFF]; |
int cladc[NCLBUFF]; |
110 |
int clbad[NCLBUFF]; |
int clbad[NCLBUFF]; |
111 |
float cnev[24][12]; |
float cnev[24][12]; |
112 |
int cnnev[24][12]; |
int cnnev[24][12]; |
113 |
int fshower[12]; |
float cnrmsev[24][12]; |
114 |
int whichtrack[NCLMAX]; |
int fshower[12]; |
115 |
|
int whichtrack[NCLMAX]; |
116 |
}; |
}; |
117 |
// ================================================================== |
// ================================================================== |
118 |
/** |
/** |
119 |
* \brief Struct to pass tracker LEVEL2 data to F77 routines |
* \brief Struct to pass tracker LEVEL2 data to F77 routines |
120 |
*/ |
*/ |
121 |
struct cTrkLevel2 { |
struct cTrkLevel2 { |
122 |
int good2; |
// int good2; |
123 |
int crc[12]; |
// int crc[12]; |
124 |
|
int good[12]; |
125 |
// ---------------------------- |
// ---------------------------- |
126 |
int nclsx; |
int nclsx; |
127 |
int planex[NSINGMAX]; |
int planex[NSINGMAX]; |
128 |
float xs[NSINGMAX][2]; |
float xs[NSINGMAX][2]; |
129 |
float signlxs[NSINGMAX]; |
float signlxs[NSINGMAX]; |
130 |
int clsx[NSINGMAX]; |
int clsx[NSINGMAX]; |
131 |
// ---------------------------- |
// ---------------------------- |
132 |
int nclsy; |
int nclsy; |
133 |
int planey[NSINGMAX]; |
int planey[NSINGMAX]; |
134 |
float ys[NSINGMAX][2]; |
float ys[NSINGMAX][2]; |
135 |
float signlys[NSINGMAX]; |
float signlys[NSINGMAX]; |
136 |
int clsy[NSINGMAX]; |
int clsy[NSINGMAX]; |
137 |
// ---------------------------- |
// ---------------------------- |
138 |
int ntrk; |
int ntrk; |
139 |
int image[NTRKMAX]; |
int image[NTRKMAX]; |
145 |
float al_nt[NTRKMAX][5]; |
float al_nt[NTRKMAX][5]; |
146 |
float coval[NTRKMAX][5][5]; |
float coval[NTRKMAX][5][5]; |
147 |
float chi2_nt[NTRKMAX]; |
float chi2_nt[NTRKMAX]; |
148 |
|
int nstep_nt[NTRKMAX]; |
149 |
int xgood_nt[NTRKMAX][6]; |
int xgood_nt[NTRKMAX][6]; |
150 |
int ygood_nt[NTRKMAX][6]; |
int ygood_nt[NTRKMAX][6]; |
151 |
float xv_nt[NTRKMAX][6]; |
float xv_nt[NTRKMAX][6]; |
155 |
float ayv_nt[NTRKMAX][6]; |
float ayv_nt[NTRKMAX][6]; |
156 |
float dedx_x[NTRKMAX][6]; |
float dedx_x[NTRKMAX][6]; |
157 |
float dedx_y[NTRKMAX][6]; |
float dedx_y[NTRKMAX][6]; |
158 |
int cltrx[NTRKMAX][6]; |
int cltrx[NTRKMAX][6]; |
159 |
int cltry[NTRKMAX][6]; |
int cltry[NTRKMAX][6]; |
160 |
// float bdl[NTRKMAX]; |
// float bdl[NTRKMAX]; |
161 |
|
|
162 |
void InitcTrkLevel2(){ |
void InitcTrkLevel2(){ |
163 |
|
|
164 |
good2 = 0; |
// good2 = 0; |
165 |
for(Int_t i=0; i<12 ; i++) |
for(Int_t i=0; i<12 ; i++) |
166 |
crc[i] = 0; |
// crc[i] = 0; |
167 |
|
good[i] = 0; |
168 |
// ---------------------------- |
// ---------------------------- |
169 |
nclsx = 0; |
nclsx = 0; |
170 |
nclsy = 0; |
nclsy = 0; |
217 |
* \brief Struct to pass calibration/parameter file paths to F77 routines |
* \brief Struct to pass calibration/parameter file paths to F77 routines |
218 |
*/ |
*/ |
219 |
struct cPath { |
struct cPath { |
220 |
char path[80]; |
char path[256]; |
221 |
int pathlen; |
int pathlen; |
222 |
int error; |
int error; |
223 |
/** |
/** |
228 |
const char *pc = s.Data(); |
const char *pc = s.Data(); |
229 |
for(Int_t i=0; i<=pathlen; i++) path[i] = *pc++; |
for(Int_t i=0; i<=pathlen; i++) path[i] = *pc++; |
230 |
}; |
}; |
231 |
|
|
|
|
|
232 |
}; |
}; |
233 |
|
|
234 |
// ================================================================== |
// ================================================================== |
235 |
/** |
/* /\** */ |
236 |
* \brief Struct to pass magnetic-field file paths to F77 routines |
/* * \brief Struct to pass magnetic-field file paths to F77 routines */ |
237 |
*/ |
/* *\/ */ |
238 |
struct cBPath { |
/* struct cBPath { */ |
239 |
char b_path[80]; |
/* char b_path[256]; */ |
240 |
int b_pathlen; |
/* int b_pathlen; */ |
241 |
int b_error; |
/* int b_error; */ |
242 |
int b_loaded; |
/* int b_loaded; */ |
243 |
/** |
/* /\** */ |
244 |
* Fill the struct variables from a TString object and set |
/* * Fill the struct variables from a TString object and set */ |
245 |
* the load flag to FALSE. |
/* * the load flag to FALSE. */ |
246 |
*/ |
/* *\/ */ |
247 |
void FillWith(TString s){ |
/* void FillWith(TString s){ */ |
248 |
b_loaded = 0; |
/* b_loaded = 0; */ |
249 |
b_pathlen = s.Length(); |
/* b_pathlen = s.Length(); */ |
250 |
const char *pc = s.Data(); |
/* const char *pc = s.Data(); */ |
251 |
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++; */ |
252 |
}; |
/* }; */ |
253 |
/** |
/* /\** */ |
254 |
* Fill the struct variables from a TString object |
/* * Fill the struct variables from a TString object */ |
255 |
*/ |
/* *\/ */ |
256 |
int BIsLoaded(){ return b_loaded; }; |
/* int BIsLoaded(){ return b_loaded; }; */ |
257 |
|
|
258 |
}; |
/* }; */ |
259 |
|
|
260 |
// ================================================================== |
// ================================================================== |
261 |
/** |
/** |
273 |
void SetDebug() {debug=1; verbose=1; warning=1;}; |
void SetDebug() {debug=1; verbose=1; warning=1;}; |
274 |
}; |
}; |
275 |
|
|
276 |
|
|
277 |
|
// ================================================================== |
278 |
|
/** |
279 |
|
* \brief Struct to pass mini2 track parameters to F77 routines |
280 |
|
*/ |
281 |
|
struct cMini2track { |
282 |
|
double al[5]; |
283 |
|
double xm[NPLANE],ym[NPLANE],zm[NPLANE]; |
284 |
|
double xm_a[NPLANE],ym_a[NPLANE]; |
285 |
|
double xm_b[NPLANE],ym_b[NPLANE]; |
286 |
|
double resx[NPLANE],resy[NPLANE]; |
287 |
|
double xgood[NPLANE],ygood[NPLANE]; |
288 |
|
double dedxtrk_x[NPLANE]; |
289 |
|
double dedxtrk_y[NPLANE]; |
290 |
|
double zini; |
291 |
|
double pfixed; |
292 |
|
double chi2; |
293 |
|
double xv[NPLANE],yv[NPLANE],zv[NPLANE]; |
294 |
|
double axv[NPLANE],ayv[NPLANE]; |
295 |
|
double cov[5][5]; |
296 |
|
int nstep; |
297 |
|
int idcand; |
298 |
|
|
299 |
|
}; |
300 |
|
// |
301 |
|
/** |
302 |
|
* \Struct for the hough transform variables |
303 |
|
*/ |
304 |
|
|
305 |
|
struct cTrkHough { |
306 |
|
|
307 |
|
int ndblt_nt; |
308 |
|
float alfayz1_nt[NDBLT_MAX_NT]; |
309 |
|
float alfayz2_nt[NDBLT_MAX_NT]; |
310 |
|
int db_cloud_nt[NDBLT_MAX_NT]; |
311 |
|
int ntrpt_nt; |
312 |
|
float alfaxz1_nt[NTRPT_MAX_NT]; |
313 |
|
float alfaxz2_nt[NTRPT_MAX_NT]; |
314 |
|
float alfaxz3_nt[NTRPT_MAX_NT]; |
315 |
|
int tr_cloud_nt[NTRPT_MAX_NT]; |
316 |
|
int nclouds_yz_nt; |
317 |
|
float alfayz1_av_nt[NCLOYZ_MAX]; |
318 |
|
float alfayz2_av_nt[NCLOYZ_MAX]; |
319 |
|
int ptcloud_yz_nt[NCLOYZ_MAX]; |
320 |
|
int nclouds_xz_nt; |
321 |
|
float alfaxz1_av_nt[NCLOXZ_MAX]; |
322 |
|
float alfaxz2_av_nt[NCLOXZ_MAX]; |
323 |
|
float alfaxz3_av_nt[NCLOXZ_MAX]; |
324 |
|
int ptcloud_xz_nt[NCLOXZ_MAX]; |
325 |
|
int nclstr; |
326 |
|
float totaltime; |
327 |
|
float houghtime; |
328 |
|
float fittime; |
329 |
|
|
330 |
|
|
331 |
|
void InitcTrkHough(){ |
332 |
|
|
333 |
|
ndblt_nt = 0; |
334 |
|
ntrpt_nt = 0; |
335 |
|
nclouds_yz_nt = 0; |
336 |
|
nclouds_xz_nt = 0; |
337 |
|
nclstr = 0; |
338 |
|
totaltime = 0; |
339 |
|
houghtime = 0; |
340 |
|
fittime = 0; |
341 |
|
for(int i=0;i<NDBLT_MAX_NT ;i++){ |
342 |
|
alfayz1_nt[i] = 0; |
343 |
|
alfayz2_nt[i] = 0; |
344 |
|
db_cloud_nt[i] = 0; |
345 |
|
} |
346 |
|
for(int i=0;i<NTRPT_MAX_NT ;i++){ |
347 |
|
alfaxz1_nt[i] = 0; |
348 |
|
alfaxz2_nt[i] = 0; |
349 |
|
alfaxz3_nt[i] = 0; |
350 |
|
tr_cloud_nt[i] = 0; |
351 |
|
} |
352 |
|
for(int i=0;i<NCLOYZ_MAX ;i++){ |
353 |
|
alfayz1_av_nt[i] = 0; |
354 |
|
alfayz2_av_nt[i] = 0; |
355 |
|
ptcloud_yz_nt[i] = 0; |
356 |
|
} |
357 |
|
for(int i=0;i<NCLOXZ_MAX ;i++){ |
358 |
|
ptcloud_xz_nt[i] = 0; |
359 |
|
alfaxz1_av_nt[i] = 0; |
360 |
|
alfaxz2_av_nt[i] = 0; |
361 |
|
alfaxz3_av_nt[i] = 0; |
362 |
|
} |
363 |
|
} |
364 |
|
|
365 |
|
}; |
366 |
|
|
367 |
|
/** |
368 |
|
* \brief Struct to pass VA1-mask to F77 routines |
369 |
|
*/ |
370 |
|
struct cTrkMask { |
371 |
|
|
372 |
|
int mask_vk[NVK][NVIEW]; |
373 |
|
int mask_vk_run[NVK][NVIEW]; |
374 |
|
|
375 |
|
void Set(TFile* , Int_t , Int_t ); |
376 |
|
|
377 |
|
}; |
378 |
|
|
379 |
|
/** |
380 |
|
* \brief Struct for pfa parameters |
381 |
|
*/ |
382 |
|
struct cTrkETA { |
383 |
|
|
384 |
|
int nangbin; |
385 |
|
float angL[NANGMAX],angR[NANGMAX]; |
386 |
|
int netaval; |
387 |
|
float eta2[NANGMAX][NETAVALMAX]; |
388 |
|
float feta2[NANGMAX][NLADDER][NVIEW][NETAVALMAX]; |
389 |
|
float eta3[NANGMAX][NETAVALMAX]; |
390 |
|
float feta3[NANGMAX][NLADDER][NVIEW][NETAVALMAX]; |
391 |
|
float eta4[NANGMAX][NETAVALMAX]; |
392 |
|
float feta4[NANGMAX][NLADDER][NVIEW][NETAVALMAX]; |
393 |
|
|
394 |
|
}; |
395 |
|
|
396 |
extern "C" { |
extern "C" { |
397 |
extern struct cTrkCalib pedsigbad_; |
|
398 |
extern struct cTrkLevel0 level0event_; |
extern struct cTrkCalib pedsigbad_; |
399 |
extern struct cTrkLevel1 level1event_; |
extern struct cTrkLevel0 level0event_; |
400 |
extern struct cTrkLevel2 level2event_; |
extern struct cTrkLevel1 level1event_; |
401 |
extern struct cPath path_; |
extern struct cTrkLevel2 level2event_; |
402 |
extern struct cBPath bpath_; |
extern struct cPath path_; |
403 |
extern struct cDbg dbg_; |
/* extern struct cBPath bpath_; */ |
404 |
|
extern struct cDbg dbg_; |
405 |
|
extern struct cTrkHough houghevent_; |
406 |
|
extern struct cMini2track track_; |
407 |
|
extern struct cTrkMask mask_; |
408 |
|
extern struct cTrkETA pfa_; |
409 |
|
|
410 |
void fillpedsigfromdefault_(); |
void fillpedsigfromdefault_(); |
411 |
int readmipparam_(); |
int readmipparam_(); |
412 |
int readchargeparam_(); |
int readchargeparam_(); |