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