10 |
#define NVIEW 12 |
#define NVIEW 12 |
11 |
#define NVK 24 |
#define NVK 24 |
12 |
#define NLADDER 3 |
#define NLADDER 3 |
13 |
|
#define NSENSOR 2 |
14 |
|
#define NSTRIPVK 128 |
15 |
|
#define NSTRIP NSTRIPVK*NVK |
16 |
|
|
17 |
#define NCLMAX_VIEW 200 //max n.clusters per view |
#define NCLMAX_VIEW 200 //max n.clusters per view |
18 |
#define NCLSTR 20 //max n.strip per cluster |
#define NCLSTR 20 //max n.strip per cluster |
30 |
#define NANGMAX 21 |
#define NANGMAX 21 |
31 |
#define NETAVALMAX 500 |
#define NETAVALMAX 500 |
32 |
|
|
33 |
|
#define NTRACKSMAX (NCLOYZ_MAX*NCLOXZ_MAX) |
34 |
|
|
35 |
#include <CalibTrk1Event.h> |
#include <CalibTrk1Event.h> |
36 |
#include <CalibTrk2Event.h> |
#include <CalibTrk2Event.h> |
42 |
#include <TTree.h> |
#include <TTree.h> |
43 |
|
|
44 |
|
|
45 |
|
|
46 |
#include <fstream> |
#include <fstream> |
47 |
#include <iostream> |
#include <iostream> |
48 |
/** |
/** |
151 |
float xs[NSINGMAX][2]; |
float xs[NSINGMAX][2]; |
152 |
float signlxs[NSINGMAX]; |
float signlxs[NSINGMAX]; |
153 |
int clsx[NSINGMAX]; |
int clsx[NSINGMAX]; |
154 |
|
int sxbad[NSINGMAX]; |
155 |
|
int multmaxsx[NSINGMAX]; |
156 |
// ---------------------------- |
// ---------------------------- |
157 |
int nclsy; |
int nclsy; |
158 |
int planey[NSINGMAX]; |
int planey[NSINGMAX]; |
159 |
float ys[NSINGMAX][2]; |
float ys[NSINGMAX][2]; |
160 |
float signlys[NSINGMAX]; |
float signlys[NSINGMAX]; |
161 |
int clsy[NSINGMAX]; |
int clsy[NSINGMAX]; |
162 |
|
int sybad[NSINGMAX]; |
163 |
|
int multmaxsy[NSINGMAX]; |
164 |
// ---------------------------- |
// ---------------------------- |
165 |
int ntrk; |
int ntrk; |
166 |
int image[NTRKMAX]; |
int image[NTRKMAX]; |
212 |
xs[i][0] = 0; |
xs[i][0] = 0; |
213 |
xs[i][1] = 0; |
xs[i][1] = 0; |
214 |
signlxs[i] = 0; |
signlxs[i] = 0; |
215 |
|
clsx[i] = 0; |
216 |
|
sxbad[i] = 0; |
217 |
planey[i] = 0; |
planey[i] = 0; |
218 |
ys[i][0] = 0; |
ys[i][0] = 0; |
219 |
ys[i][1] = 0; |
ys[i][1] = 0; |
220 |
signlys[i] = 0; |
signlys[i] = 0; |
221 |
|
clsy[i] = 0; |
222 |
|
sybad[i] = 0; |
223 |
} |
} |
224 |
// ---------------------------- |
// ---------------------------- |
225 |
ntrk =0 ; |
ntrk =0 ; |
330 |
struct cMini2track { |
struct cMini2track { |
331 |
double al[5]; |
double al[5]; |
332 |
double xm[NPLANE],ym[NPLANE],zm[NPLANE]; |
double xm[NPLANE],ym[NPLANE],zm[NPLANE]; |
333 |
double xm_a[NPLANE],ym_a[NPLANE]; |
double xm_a[NPLANE],ym_a[NPLANE],zm_a[NPLANE]; |
334 |
double xm_b[NPLANE],ym_b[NPLANE]; |
double xm_b[NPLANE],ym_b[NPLANE],zm_b[NPLANE]; |
335 |
double resx[NPLANE],resy[NPLANE]; |
double resx[NPLANE],resy[NPLANE]; |
336 |
double tailx[NPLANE],taily[NPLANE]; |
double tailx[NPLANE],taily[NPLANE]; |
337 |
double xgood[NPLANE],ygood[NPLANE]; |
double xgood[NPLANE],ygood[NPLANE]; |
349 |
int trackmode; |
int trackmode; |
350 |
int istepmin; |
int istepmin; |
351 |
|
|
352 |
/* cMini2track(){ */ |
}; |
|
/* // -------------------------- */ |
|
|
/* // fitting routine parameters */ |
|
|
/* // -------------------------- */ |
|
|
/* zini = 23.5; */ |
|
|
/* trackmode = 0; */ |
|
|
/* istepmin = 3; */ |
|
|
/* // -------------------------- */ |
|
|
/* pfixed = 0.; */ |
|
|
/* chi2 = 0; */ |
|
|
/* nstep = 0; */ |
|
|
/* for(int it1=0;it1<5;it1++){ */ |
|
|
/* al[it1] = 0; */ |
|
|
/* for(int it2=0;it2<5;it2++)cov[it1][it2] = 0; */ |
|
|
/* }; */ |
|
|
/* for(int ip=0;ip<6;ip++){ */ |
|
|
/* xgood[ip] = 0; */ |
|
|
/* ygood[ip] = 0; */ |
|
|
/* xm[ip] = 0; */ |
|
|
/* ym[ip] = 0; */ |
|
|
/* xm_a[ip] = 0; */ |
|
|
/* ym_a[ip] = 0; */ |
|
|
/* xm_b[ip] = 0; */ |
|
|
/* ym_b[ip] = 0; */ |
|
|
/* zm[ip] = 0; */ |
|
|
/* resx[ip] = 0; */ |
|
|
/* resy[ip] = 0; */ |
|
|
/* xv[ip] = 0; */ |
|
|
/* yv[ip] = 0; */ |
|
|
/* zv[ip] = 0; */ |
|
|
/* axv[ip] = 0; */ |
|
|
/* ayv[ip] = 0; */ |
|
|
/* dedxtrk_x[ip] = 0; */ |
|
|
/* dedxtrk_y[ip] = 0; */ |
|
|
/* }; */ |
|
|
|
|
|
/* } */ |
|
|
|
|
353 |
|
|
354 |
|
// ================================================================== |
355 |
|
/** |
356 |
|
* \brief Struct to pass DELTAB parameters to F77 routines |
357 |
|
*/ |
358 |
|
struct cDeltaB { |
359 |
|
double delta0; |
360 |
|
double delta1; |
361 |
|
double dlt; |
362 |
}; |
}; |
363 |
|
|
364 |
// |
// |
365 |
/** |
/** |
366 |
* \Struct for the hough transform variables |
* \Struct for the hough transform variables |
429 |
}; |
}; |
430 |
|
|
431 |
/** |
/** |
432 |
|
* \Struct for track candidates after hough transform |
433 |
|
*/ |
434 |
|
struct cTrkCandidates { |
435 |
|
int ntracks; |
436 |
|
float al[NTRACKSMAX][5]; |
437 |
|
float xm[NTRACKSMAX][NPLANE]; |
438 |
|
float ym[NTRACKSMAX][NPLANE]; |
439 |
|
float zm[NTRACKSMAX][NPLANE]; |
440 |
|
float resx[NTRACKSMAX][NPLANE]; |
441 |
|
float resy[NTRACKSMAX][NPLANE]; |
442 |
|
float xv[NTRACKSMAX][NPLANE]; |
443 |
|
float yv[NTRACKSMAX][NPLANE]; |
444 |
|
float zv[NTRACKSMAX][NPLANE]; |
445 |
|
float axv[NTRACKSMAX][NPLANE]; |
446 |
|
float ayv[NTRACKSMAX][NPLANE]; |
447 |
|
float xgood[NTRACKSMAX][NPLANE]; |
448 |
|
float ygood[NTRACKSMAX][NPLANE]; |
449 |
|
int cp[NTRACKSMAX][NPLANE]; |
450 |
|
int cls[NTRACKSMAX][NPLANE]; |
451 |
|
int sensor[NTRACKSMAX][NPLANE]; |
452 |
|
int ladder[NTRACKSMAX][NPLANE]; |
453 |
|
float bx[NTRACKSMAX][NPLANE]; |
454 |
|
float by[NTRACKSMAX][NPLANE]; |
455 |
|
float chi2[NTRACKSMAX]; |
456 |
|
|
457 |
|
void Init(){ |
458 |
|
ntracks=0; |
459 |
|
for(int i=0; i<NTRACKSMAX; i++){ |
460 |
|
for(int ii=0; ii<5; ii++)al[i][ii]=0; |
461 |
|
chi2[i]=0; |
462 |
|
for(int ip=0; ip<NPLANE; ip++){ |
463 |
|
xm[i][ip]=0; |
464 |
|
ym[i][ip]=0; |
465 |
|
zm[i][ip]=0; |
466 |
|
resx[i][ip]=0; |
467 |
|
resy[i][ip]=0; |
468 |
|
xv[i][ip]=0; |
469 |
|
yv[i][ip]=0; |
470 |
|
zv[i][ip]=0; |
471 |
|
axv[i][ip]=0; |
472 |
|
ayv[i][ip]=0; |
473 |
|
xgood[i][ip]=0; |
474 |
|
ygood[i][ip]=0; |
475 |
|
cp[i][ip]=0; |
476 |
|
cls[i][ip]=0; |
477 |
|
sensor[i][ip]=0; |
478 |
|
ladder[i][ip]=0; |
479 |
|
bx[i][ip]=0; |
480 |
|
by[i][ip]=0; |
481 |
|
} |
482 |
|
} |
483 |
|
|
484 |
|
}; |
485 |
|
|
486 |
|
|
487 |
|
}; |
488 |
|
|
489 |
|
/** |
490 |
* \brief Struct to pass VA1-mask to F77 routines |
* \brief Struct to pass VA1-mask to F77 routines |
491 |
*/ |
*/ |
492 |
struct cTrkMask { |
struct cTrkMask { |
535 |
struct cTrkSW{ |
struct cTrkSW{ |
536 |
int pfaid; |
int pfaid; |
537 |
}; |
}; |
538 |
|
/** |
539 |
|
* \brief Struct to read alignment parameters |
540 |
|
*/ |
541 |
|
struct cTrkAlign { |
542 |
|
|
543 |
|
double omega[NSENSOR][NLADDER][NPLANE]; |
544 |
|
double beta[NSENSOR][NLADDER][NPLANE]; |
545 |
|
double gamma[NSENSOR][NLADDER][NPLANE]; |
546 |
|
double dx[NSENSOR][NLADDER][NPLANE]; |
547 |
|
double dy[NSENSOR][NLADDER][NPLANE]; |
548 |
|
double dz[NSENSOR][NLADDER][NPLANE]; |
549 |
|
|
550 |
|
}; |
551 |
|
|
552 |
|
/** |
553 |
|
* \brief Struct to check reduction procedure: CN evaluation |
554 |
|
*/ |
555 |
|
struct cTrkCN { |
556 |
|
|
557 |
|
float cn[NVK][NVIEW]; |
558 |
|
float cnrms[NVK][NVIEW]; |
559 |
|
int cnn[NVK][NVIEW]; |
560 |
|
int clstr[NSTRIPVK][NVK][NVIEW]; |
561 |
|
int strange[NSTRIPVK][NVK][NVIEW]; |
562 |
|
|
563 |
|
}; |
564 |
|
/** |
565 |
|
* \brief Struct to check reduction procedure: pedestal subtraction |
566 |
|
*/ |
567 |
|
struct cTrkEvent { |
568 |
|
float value[NSTRIP]; |
569 |
|
}; |
570 |
|
|
571 |
|
/** |
572 |
|
* \brief Struct to check reduction procedure: pedestal subtraction |
573 |
|
*/ |
574 |
|
struct cTrkMIP { |
575 |
|
float mip[NLADDER][NVIEW]; |
576 |
|
}; |
577 |
|
|
578 |
extern "C" { |
extern "C" { |
579 |
|
|
580 |
|
extern struct cTrkMIP adc2mip_; |
581 |
extern struct cTrkCalib pedsigbad_; |
extern struct cTrkCalib pedsigbad_; |
582 |
extern struct cTrkMask mask_; |
extern struct cTrkMask mask_; |
583 |
extern struct cTrkLevel0 level0event_; |
extern struct cTrkLevel0 level0event_; |
586 |
extern struct cPath path_; |
extern struct cPath path_; |
587 |
extern struct cDbg dbg_; |
extern struct cDbg dbg_; |
588 |
extern struct cTrkHough houghevent_; |
extern struct cTrkHough houghevent_; |
589 |
|
extern struct cTrkCandidates trackcandidates_; |
590 |
extern struct cMini2track track_; |
extern struct cMini2track track_; |
591 |
extern struct cTrkETA pfa_; |
extern struct cTrkETA pfa_; |
592 |
extern struct cTrkSW sw_; |
extern struct cTrkSW sw_; |
593 |
|
extern struct cDeltaB deltab_; |
594 |
|
extern struct cTrkAlign alignparameters_; |
595 |
|
extern struct cTrkEvent calibratedsignal_; |
596 |
|
|
597 |
void fillpedsigfromdefault_(); |
void fillpedsigfromdefault_(); |
598 |
int readmipparam_(); |
int readmipparam_(); |
606 |
void gufld_(float*, float*); |
void gufld_(float*, float*); |
607 |
void xyzpam_(int*,int*,int*,int*,int*,float*,float*,float*,float*); |
void xyzpam_(int*,int*,int*,int*,int*,float*,float*,float*,float*); |
608 |
float riseta_(int*,float*); |
float riseta_(int*,float*); |
609 |
|
void chisq_(int*, int*); |
610 |
|
|
611 |
|
}; |
612 |
|
|
|
} |
|
613 |
|
|
614 |
#endif |
#endif |