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]; |
189 |
float dedx_y[NTRKMAX][6]; |
float dedx_y[NTRKMAX][6]; |
190 |
int cltrx[NTRKMAX][6]; |
int cltrx[NTRKMAX][6]; |
191 |
int cltry[NTRKMAX][6]; |
int cltry[NTRKMAX][6]; |
192 |
|
int multmaxx[NTRKMAX][6]; |
193 |
|
int multmaxy[NTRKMAX][6]; |
194 |
|
float seedx[NTRKMAX][6]; |
195 |
|
float seedy[NTRKMAX][6]; |
196 |
|
float xpu[NTRKMAX][6]; |
197 |
|
float ypu[NTRKMAX][6]; |
198 |
// float bdl[NTRKMAX]; |
// float bdl[NTRKMAX]; |
199 |
|
|
200 |
void InitcTrkLevel2(){ |
void InitcTrkLevel2(){ |
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 ; |
250 |
ayv_nt[i][ii] = 0; |
ayv_nt[i][ii] = 0; |
251 |
dedx_x[i][ii] = 0; |
dedx_x[i][ii] = 0; |
252 |
dedx_y[i][ii] = 0; |
dedx_y[i][ii] = 0; |
253 |
|
multmaxx[i][ii] = 0; |
254 |
|
multmaxy[i][ii] = 0; |
255 |
|
seedx[i][ii] = 0; |
256 |
|
seedy[i][ii] = 0; |
257 |
|
xpu[i][ii] = 0; |
258 |
|
ypu[i][ii] = 0; |
259 |
} |
} |
260 |
} |
} |
261 |
} |
} |
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]; |
389 |
|
|
390 |
|
|
391 |
}; |
}; |
392 |
|
|
393 |
|
// ================================================================== |
394 |
|
/** |
395 |
|
* \brief Struct to pass DELTAB parameters to F77 routines |
396 |
|
*/ |
397 |
|
struct cDeltaB { |
398 |
|
double delta0; |
399 |
|
double delta1; |
400 |
|
double dlt; |
401 |
|
}; |
402 |
|
|
403 |
// |
// |
404 |
/** |
/** |
405 |
* \Struct for the hough transform variables |
* \Struct for the hough transform variables |
468 |
}; |
}; |
469 |
|
|
470 |
/** |
/** |
471 |
|
* \Struct for track candidates after hough transform |
472 |
|
*/ |
473 |
|
struct cTrkCandidates { |
474 |
|
int ntracks; |
475 |
|
float al[NTRACKSMAX][5]; |
476 |
|
float xm[NTRACKSMAX][NPLANE]; |
477 |
|
float ym[NTRACKSMAX][NPLANE]; |
478 |
|
float zm[NTRACKSMAX][NPLANE]; |
479 |
|
float resx[NTRACKSMAX][NPLANE]; |
480 |
|
float resy[NTRACKSMAX][NPLANE]; |
481 |
|
float xv[NTRACKSMAX][NPLANE]; |
482 |
|
float yv[NTRACKSMAX][NPLANE]; |
483 |
|
float zv[NTRACKSMAX][NPLANE]; |
484 |
|
float axv[NTRACKSMAX][NPLANE]; |
485 |
|
float ayv[NTRACKSMAX][NPLANE]; |
486 |
|
float xgood[NTRACKSMAX][NPLANE]; |
487 |
|
float ygood[NTRACKSMAX][NPLANE]; |
488 |
|
int cp[NTRACKSMAX][NPLANE]; |
489 |
|
int cls[NTRACKSMAX][NPLANE]; |
490 |
|
int sensor[NTRACKSMAX][NPLANE]; |
491 |
|
int ladder[NTRACKSMAX][NPLANE]; |
492 |
|
float bx[NTRACKSMAX][NPLANE]; |
493 |
|
float by[NTRACKSMAX][NPLANE]; |
494 |
|
float chi2[NTRACKSMAX]; |
495 |
|
|
496 |
|
void Init(){ |
497 |
|
ntracks=0; |
498 |
|
for(int i=0; i<NTRACKSMAX; i++){ |
499 |
|
for(int ii=0; ii<5; ii++)al[i][ii]=0; |
500 |
|
chi2[i]=0; |
501 |
|
for(int ip=0; ip<NPLANE; ip++){ |
502 |
|
xm[i][ip]=0; |
503 |
|
ym[i][ip]=0; |
504 |
|
zm[i][ip]=0; |
505 |
|
resx[i][ip]=0; |
506 |
|
resy[i][ip]=0; |
507 |
|
xv[i][ip]=0; |
508 |
|
yv[i][ip]=0; |
509 |
|
zv[i][ip]=0; |
510 |
|
axv[i][ip]=0; |
511 |
|
ayv[i][ip]=0; |
512 |
|
xgood[i][ip]=0; |
513 |
|
ygood[i][ip]=0; |
514 |
|
cp[i][ip]=0; |
515 |
|
cls[i][ip]=0; |
516 |
|
sensor[i][ip]=0; |
517 |
|
ladder[i][ip]=0; |
518 |
|
bx[i][ip]=0; |
519 |
|
by[i][ip]=0; |
520 |
|
} |
521 |
|
} |
522 |
|
|
523 |
|
}; |
524 |
|
|
525 |
|
|
526 |
|
}; |
527 |
|
|
528 |
|
/** |
529 |
* \brief Struct to pass VA1-mask to F77 routines |
* \brief Struct to pass VA1-mask to F77 routines |
530 |
*/ |
*/ |
531 |
struct cTrkMask { |
struct cTrkMask { |
563 |
float feta3[NANGMAX][NLADDER][NVIEW][NETAVALMAX]; |
float feta3[NANGMAX][NLADDER][NVIEW][NETAVALMAX]; |
564 |
float eta4[NANGMAX][NETAVALMAX]; |
float eta4[NANGMAX][NETAVALMAX]; |
565 |
float feta4[NANGMAX][NLADDER][NVIEW][NETAVALMAX]; |
float feta4[NANGMAX][NLADDER][NVIEW][NETAVALMAX]; |
566 |
|
float fcorr[NANGMAX][NLADDER][NVIEW]; |
567 |
|
float e234ax[6];//F77: e2fax,e2tax,e3fax,e3tax,e4fax,e4tax |
568 |
|
float e234ay[6];//F77: e2fay,e2tay,e3fay,e3tay,e4fay,e4tay |
569 |
|
|
570 |
}; |
}; |
571 |
/** |
/** |
574 |
struct cTrkSW{ |
struct cTrkSW{ |
575 |
int pfaid; |
int pfaid; |
576 |
}; |
}; |
577 |
|
/** |
578 |
|
* \brief Struct to read alignment parameters |
579 |
|
*/ |
580 |
|
struct cTrkAlign { |
581 |
|
|
582 |
|
double omega[NSENSOR][NLADDER][NPLANE]; |
583 |
|
double beta[NSENSOR][NLADDER][NPLANE]; |
584 |
|
double gamma[NSENSOR][NLADDER][NPLANE]; |
585 |
|
double dx[NSENSOR][NLADDER][NPLANE]; |
586 |
|
double dy[NSENSOR][NLADDER][NPLANE]; |
587 |
|
double dz[NSENSOR][NLADDER][NPLANE]; |
588 |
|
|
589 |
|
}; |
590 |
|
|
591 |
|
/** |
592 |
|
* \brief Struct to check reduction procedure: CN evaluation |
593 |
|
*/ |
594 |
|
struct cTrkCN { |
595 |
|
|
596 |
|
float cn[NVK][NVIEW]; |
597 |
|
float cnrms[NVK][NVIEW]; |
598 |
|
int cnn[NVK][NVIEW]; |
599 |
|
int clstr[NSTRIPVK][NVK][NVIEW]; |
600 |
|
int strange[NSTRIPVK][NVK][NVIEW]; |
601 |
|
|
602 |
|
}; |
603 |
|
/** |
604 |
|
* \brief Struct to check reduction procedure: pedestal subtraction |
605 |
|
*/ |
606 |
|
struct cTrkEvent { |
607 |
|
float value[NSTRIP]; |
608 |
|
}; |
609 |
|
|
610 |
|
/** |
611 |
|
* \brief Struct to check reduction procedure: pedestal subtraction |
612 |
|
*/ |
613 |
|
struct cTrkMIP { |
614 |
|
float mip[NLADDER][NVIEW]; |
615 |
|
}; |
616 |
|
|
617 |
extern "C" { |
extern "C" { |
618 |
|
|
619 |
|
extern struct cTrkMIP adc2mip_; |
620 |
extern struct cTrkCalib pedsigbad_; |
extern struct cTrkCalib pedsigbad_; |
621 |
extern struct cTrkMask mask_; |
extern struct cTrkMask mask_; |
622 |
extern struct cTrkLevel0 level0event_; |
extern struct cTrkLevel0 level0event_; |
625 |
extern struct cPath path_; |
extern struct cPath path_; |
626 |
extern struct cDbg dbg_; |
extern struct cDbg dbg_; |
627 |
extern struct cTrkHough houghevent_; |
extern struct cTrkHough houghevent_; |
628 |
|
extern struct cTrkCandidates trackcandidates_; |
629 |
extern struct cMini2track track_; |
extern struct cMini2track track_; |
630 |
extern struct cTrkETA pfa_; |
extern struct cTrkETA pfa_; |
631 |
extern struct cTrkSW sw_; |
extern struct cTrkSW sw_; |
632 |
|
extern struct cDeltaB deltab_; |
633 |
|
extern struct cTrkAlign alignparameters_; |
634 |
|
extern struct cTrkEvent calibratedsignal_; |
635 |
|
|
636 |
void fillpedsigfromdefault_(); |
void fillpedsigfromdefault_(); |
637 |
int readmipparam_(); |
int readmipparam_(); |
645 |
void gufld_(float*, float*); |
void gufld_(float*, float*); |
646 |
void xyzpam_(int*,int*,int*,int*,int*,float*,float*,float*,float*); |
void xyzpam_(int*,int*,int*,int*,int*,float*,float*,float*,float*); |
647 |
float riseta_(int*,float*); |
float riseta_(int*,float*); |
648 |
|
void chisq_(int*, int*); |
649 |
|
|
650 |
|
}; |
651 |
|
|
|
} |
|
652 |
|
|
653 |
#endif |
#endif |