| 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 |  |  | 
| 15 | #define NCLMAX_VIEW 200         //max n.clusters per view | #define NCLMAX_VIEW 200         //max n.clusters per view | 
| 16 | #define NCLSTR 20               //max n.strip per cluster | #define NCLSTR 20               //max n.strip per cluster | 
| 28 | #define NANGMAX 21 | #define NANGMAX 21 | 
| 29 | #define NETAVALMAX 500 | #define NETAVALMAX 500 | 
| 30 |  |  | 
| 31 |  | #define NTRACKSMAX (NCLOYZ_MAX*NCLOXZ_MAX) | 
| 32 |  |  | 
| 33 | #include <CalibTrk1Event.h> | #include <CalibTrk1Event.h> | 
| 34 | #include <CalibTrk2Event.h> | #include <CalibTrk2Event.h> | 
| 40 | #include <TTree.h> | #include <TTree.h> | 
| 41 |  |  | 
| 42 |  |  | 
| 43 |  |  | 
| 44 | #include <fstream> | #include <fstream> | 
| 45 | #include <iostream> | #include <iostream> | 
| 46 | /** | /** | 
| 54 | float sigma_t[128][24][12]; | float sigma_t[128][24][12]; | 
| 55 | int bad[128][24][12]; | int bad[128][24][12]; | 
| 56 |  |  | 
| 57 |  | void Reset(){ | 
| 58 |  | for(int is=0; is<128; is++){ | 
| 59 |  | for(int ivk=0; ivk<24; ivk++){ | 
| 60 |  | for(int iv=0; iv<12; iv++){ | 
| 61 |  | pedestal[is][ivk][iv]=0.; | 
| 62 |  | pedestal_t[is][ivk][iv]=0.; | 
| 63 |  | sigma[is][ivk][iv]=0.; | 
| 64 |  | sigma_t[is][ivk][iv]=0.; | 
| 65 |  | bad[is][ivk][iv]=1; | 
| 66 |  | } | 
| 67 |  | } | 
| 68 |  | } | 
| 69 |  | } | 
| 70 |  |  | 
| 71 | /*     void FillACalibFrom(TFile* , Int_t , Int_t ); */ | /*     void FillACalibFrom(TFile* , Int_t , Int_t ); */ | 
| 72 | /*     void FillFCalibFrom(TFile* , Int_t , Int_t ); */ | /*     void FillFCalibFrom(TFile* , Int_t , Int_t ); */ | 
| 73 | /*     void FillTCalibFrom(TFile* , Int_t , Int_t ); */ | /*     void FillTCalibFrom(TFile* , Int_t , Int_t ); */ | 
| 149 | float xs[NSINGMAX][2]; | float xs[NSINGMAX][2]; | 
| 150 | float signlxs[NSINGMAX]; | float signlxs[NSINGMAX]; | 
| 151 | int clsx[NSINGMAX]; | int clsx[NSINGMAX]; | 
| 152 |  | int sxbad[NSINGMAX]; | 
| 153 |  | int multmaxsx[NSINGMAX]; | 
| 154 | //  ---------------------------- | //  ---------------------------- | 
| 155 | int nclsy; | int nclsy; | 
| 156 | int planey[NSINGMAX]; | int planey[NSINGMAX]; | 
| 157 | float ys[NSINGMAX][2]; | float ys[NSINGMAX][2]; | 
| 158 | float signlys[NSINGMAX]; | float signlys[NSINGMAX]; | 
| 159 | int clsy[NSINGMAX]; | int clsy[NSINGMAX]; | 
| 160 |  | int sybad[NSINGMAX]; | 
| 161 |  | int multmaxsy[NSINGMAX]; | 
| 162 | //  ---------------------------- | //  ---------------------------- | 
| 163 | int ntrk; | int ntrk; | 
| 164 | int image[NTRKMAX]; | int image[NTRKMAX]; | 
| 187 | float dedx_y[NTRKMAX][6]; | float dedx_y[NTRKMAX][6]; | 
| 188 | int cltrx[NTRKMAX][6]; | int cltrx[NTRKMAX][6]; | 
| 189 | int cltry[NTRKMAX][6]; | int cltry[NTRKMAX][6]; | 
| 190 |  | int   multmaxx[NTRKMAX][6]; | 
| 191 |  | int   multmaxy[NTRKMAX][6]; | 
| 192 |  | float seedx[NTRKMAX][6]; | 
| 193 |  | float seedy[NTRKMAX][6]; | 
| 194 |  | float xpu[NTRKMAX][6]; | 
| 195 |  | float ypu[NTRKMAX][6]; | 
| 196 | //      float bdl[NTRKMAX]; | //      float bdl[NTRKMAX]; | 
| 197 |  |  | 
| 198 | void InitcTrkLevel2(){ | void InitcTrkLevel2(){ | 
| 210 | xs[i][0]   = 0; | xs[i][0]   = 0; | 
| 211 | xs[i][1]   = 0; | xs[i][1]   = 0; | 
| 212 | signlxs[i] = 0; | signlxs[i] = 0; | 
| 213 |  | clsx[i]    = 0; | 
| 214 |  | sxbad[i]   = 0; | 
| 215 | planey[i]  = 0; | planey[i]  = 0; | 
| 216 | ys[i][0]   = 0; | ys[i][0]   = 0; | 
| 217 | ys[i][1]   = 0; | ys[i][1]   = 0; | 
| 218 | signlys[i] = 0; | signlys[i] = 0; | 
| 219 |  | clsy[i]    = 0; | 
| 220 |  | sybad[i]   = 0; | 
| 221 | } | } | 
| 222 | //  ---------------------------- | //  ---------------------------- | 
| 223 | ntrk =0 ; | ntrk =0 ; | 
| 248 | ayv_nt[i][ii]   = 0; | ayv_nt[i][ii]   = 0; | 
| 249 | dedx_x[i][ii]   = 0; | dedx_x[i][ii]   = 0; | 
| 250 | dedx_y[i][ii]   = 0; | dedx_y[i][ii]   = 0; | 
| 251 |  | multmaxx[i][ii] = 0; | 
| 252 |  | multmaxy[i][ii] = 0; | 
| 253 |  | seedx[i][ii]  = 0; | 
| 254 |  | seedy[i][ii]  = 0; | 
| 255 |  | xpu[i][ii]    = 0; | 
| 256 |  | ypu[i][ii]    = 0; | 
| 257 | } | } | 
| 258 | } | } | 
| 259 | } | } | 
| 328 | struct cMini2track { | struct cMini2track { | 
| 329 | double al[5]; | double al[5]; | 
| 330 | double xm[NPLANE],ym[NPLANE],zm[NPLANE]; | double xm[NPLANE],ym[NPLANE],zm[NPLANE]; | 
| 331 | double xm_a[NPLANE],ym_a[NPLANE]; | double xm_a[NPLANE],ym_a[NPLANE],zm_a[NPLANE]; | 
| 332 | double xm_b[NPLANE],ym_b[NPLANE]; | double xm_b[NPLANE],ym_b[NPLANE],zm_b[NPLANE]; | 
| 333 | double resx[NPLANE],resy[NPLANE]; | double resx[NPLANE],resy[NPLANE]; | 
| 334 |  | double tailx[NPLANE],taily[NPLANE]; | 
| 335 | double xgood[NPLANE],ygood[NPLANE]; | double xgood[NPLANE],ygood[NPLANE]; | 
| 336 | double dedxtrk_x[NPLANE]; | double dedxtrk_x[NPLANE]; | 
| 337 | double dedxtrk_y[NPLANE]; | double dedxtrk_y[NPLANE]; | 
| 387 |  |  | 
| 388 |  |  | 
| 389 | }; | }; | 
| 390 |  |  | 
| 391 |  | // ================================================================== | 
| 392 |  | /** | 
| 393 |  | * \brief Struct to pass DELTAB parameters to F77 routines | 
| 394 |  | */ | 
| 395 |  | struct cDeltaB { | 
| 396 |  | double delta0; | 
| 397 |  | double delta1; | 
| 398 |  | double dlt; | 
| 399 |  | }; | 
| 400 |  |  | 
| 401 | // | // | 
| 402 | /** | /** | 
| 403 | * \Struct for the hough transform variables | * \Struct for the hough transform variables | 
| 466 | }; | }; | 
| 467 |  |  | 
| 468 | /** | /** | 
| 469 |  | * \Struct for track candidates after hough transform | 
| 470 |  | */ | 
| 471 |  | struct cTrkCandidates { | 
| 472 |  | int ntracks; | 
| 473 |  | float al[NTRACKSMAX][5]; | 
| 474 |  | float xm[NTRACKSMAX][NPLANE]; | 
| 475 |  | float ym[NTRACKSMAX][NPLANE]; | 
| 476 |  | float zm[NTRACKSMAX][NPLANE]; | 
| 477 |  | float resx[NTRACKSMAX][NPLANE]; | 
| 478 |  | float resy[NTRACKSMAX][NPLANE]; | 
| 479 |  | float xv[NTRACKSMAX][NPLANE]; | 
| 480 |  | float yv[NTRACKSMAX][NPLANE]; | 
| 481 |  | float zv[NTRACKSMAX][NPLANE]; | 
| 482 |  | float axv[NTRACKSMAX][NPLANE]; | 
| 483 |  | float ayv[NTRACKSMAX][NPLANE]; | 
| 484 |  | float xgood[NTRACKSMAX][NPLANE]; | 
| 485 |  | float ygood[NTRACKSMAX][NPLANE]; | 
| 486 |  | int cp[NTRACKSMAX][NPLANE]; | 
| 487 |  | int cls[NTRACKSMAX][NPLANE]; | 
| 488 |  | int sensor[NTRACKSMAX][NPLANE]; | 
| 489 |  | int ladder[NTRACKSMAX][NPLANE]; | 
| 490 |  | float bx[NTRACKSMAX][NPLANE]; | 
| 491 |  | float by[NTRACKSMAX][NPLANE]; | 
| 492 |  | float chi2[NTRACKSMAX]; | 
| 493 |  |  | 
| 494 |  | void Init(){ | 
| 495 |  | ntracks=0; | 
| 496 |  | for(int i=0; i<NTRACKSMAX; i++){ | 
| 497 |  | for(int ii=0; ii<5; ii++)al[i][ii]=0; | 
| 498 |  | chi2[i]=0; | 
| 499 |  | for(int ip=0; ip<NPLANE; ip++){ | 
| 500 |  | xm[i][ip]=0; | 
| 501 |  | ym[i][ip]=0; | 
| 502 |  | zm[i][ip]=0; | 
| 503 |  | resx[i][ip]=0; | 
| 504 |  | resy[i][ip]=0; | 
| 505 |  | xv[i][ip]=0; | 
| 506 |  | yv[i][ip]=0; | 
| 507 |  | zv[i][ip]=0; | 
| 508 |  | axv[i][ip]=0; | 
| 509 |  | ayv[i][ip]=0; | 
| 510 |  | xgood[i][ip]=0; | 
| 511 |  | ygood[i][ip]=0; | 
| 512 |  | cp[i][ip]=0; | 
| 513 |  | cls[i][ip]=0; | 
| 514 |  | sensor[i][ip]=0; | 
| 515 |  | ladder[i][ip]=0; | 
| 516 |  | bx[i][ip]=0; | 
| 517 |  | by[i][ip]=0; | 
| 518 |  | } | 
| 519 |  | } | 
| 520 |  |  | 
| 521 |  | }; | 
| 522 |  |  | 
| 523 |  |  | 
| 524 |  | }; | 
| 525 |  |  | 
| 526 |  | /** | 
| 527 | * \brief Struct to pass VA1-mask to F77 routines | * \brief Struct to pass VA1-mask to F77 routines | 
| 528 | */ | */ | 
| 529 | struct cTrkMask { | struct cTrkMask { | 
| 533 |  |  | 
| 534 | //    void Set(TFile* , Int_t , Int_t ); | //    void Set(TFile* , Int_t , Int_t ); | 
| 535 |  |  | 
| 536 |  | void Reset(){ | 
| 537 |  | for(int ivk=0; ivk<NVK; ivk++){ | 
| 538 |  | for(int iv=0; iv<NVIEW; iv++){ | 
| 539 |  | //              mask_vk[ivk][iv]=0; | 
| 540 |  | mask_vk_run[ivk][iv]=0; | 
| 541 |  | } | 
| 542 |  | } | 
| 543 |  | } | 
| 544 |  |  | 
| 545 |  | void Dump(){ | 
| 546 |  | } | 
| 547 |  |  | 
| 548 | }; | }; | 
| 549 |  |  | 
| 550 | /** | /** | 
| 561 | float feta3[NANGMAX][NLADDER][NVIEW][NETAVALMAX]; | float feta3[NANGMAX][NLADDER][NVIEW][NETAVALMAX]; | 
| 562 | float eta4[NANGMAX][NETAVALMAX]; | float eta4[NANGMAX][NETAVALMAX]; | 
| 563 | float feta4[NANGMAX][NLADDER][NVIEW][NETAVALMAX]; | float feta4[NANGMAX][NLADDER][NVIEW][NETAVALMAX]; | 
| 564 |  | float fcorr[NANGMAX][NLADDER][NVIEW]; | 
| 565 |  | float e234ax[6];//F77: e2fax,e2tax,e3fax,e3tax,e4fax,e4tax | 
| 566 |  | float e234ay[6];//F77: e2fay,e2tay,e3fay,e3tay,e4fay,e4tay | 
| 567 |  |  | 
| 568 | }; | }; | 
| 569 | /** | /** | 
| 572 | struct cTrkSW{ | struct cTrkSW{ | 
| 573 | int pfaid; | int pfaid; | 
| 574 | }; | }; | 
| 575 |  | /** | 
| 576 |  | * \brief Struct to read alignment parameters | 
| 577 |  | */ | 
| 578 |  | struct cTrkAlign { | 
| 579 |  |  | 
| 580 |  | double omega[NSENSOR][NLADDER][NPLANE]; | 
| 581 |  | double beta[NSENSOR][NLADDER][NPLANE]; | 
| 582 |  | double gamma[NSENSOR][NLADDER][NPLANE]; | 
| 583 |  | double dx[NSENSOR][NLADDER][NPLANE]; | 
| 584 |  | double dy[NSENSOR][NLADDER][NPLANE]; | 
| 585 |  | double dz[NSENSOR][NLADDER][NPLANE]; | 
| 586 |  |  | 
| 587 |  | }; | 
| 588 |  |  | 
| 589 | extern "C" { | extern "C" { | 
| 590 |  |  | 
| 596 | extern struct cPath       path_; | extern struct cPath       path_; | 
| 597 | extern struct cDbg        dbg_; | extern struct cDbg        dbg_; | 
| 598 | extern struct cTrkHough   houghevent_; | extern struct cTrkHough   houghevent_; | 
| 599 |  | extern struct cTrkCandidates trackcandidates_; | 
| 600 | extern struct cMini2track track_; | extern struct cMini2track track_; | 
| 601 | extern struct cTrkETA     pfa_; | extern struct cTrkETA     pfa_; | 
| 602 | extern struct cTrkSW      sw_; | extern struct cTrkSW      sw_; | 
| 603 |  | extern struct cDeltaB     deltab_; | 
| 604 |  | extern struct cTrkAlign   alignparameters_; | 
| 605 |  |  | 
| 606 | void fillpedsigfromdefault_(); | void fillpedsigfromdefault_(); | 
| 607 | int readmipparam_(); | int readmipparam_(); | 
| 615 | void gufld_(float*, float*); | void gufld_(float*, float*); | 
| 616 | void xyzpam_(int*,int*,int*,int*,int*,float*,float*,float*,float*); | void xyzpam_(int*,int*,int*,int*,int*,float*,float*,float*,float*); | 
| 617 | float riseta_(int*,float*); | float riseta_(int*,float*); | 
| 618 |  | void chisq_(int*, int*); | 
| 619 |  |  | 
| 620 | } | }; | 
| 621 |  |  | 
| 622 | #endif | #endif |