| 508 |  |  | 
| 509 | }; | }; | 
| 510 |  |  | 
| 511 |  | // wm jun 08 | 
| 512 |  | Int_t ToFLevel2::GetPaddleIdOfTrack(Float_t xtr, Float_t ytr, Int_t plane){ | 
| 513 |  | return GetPaddleIdOfTrack(xtr ,ytr ,plane, 0.4); | 
| 514 |  | } | 
| 515 |  |  | 
| 516 | // gf Apr 07 | // gf Apr 07 | 
| 517 | Int_t ToFLevel2::GetPaddleIdOfTrack(Float_t xtr, Float_t ytr, Int_t plane){ | // wm jun 08  introduced a margin as input parameter | 
| 518 |  | Int_t ToFLevel2::GetPaddleIdOfTrack(Float_t xtr, Float_t ytr, Int_t plane, Float_t margin){ | 
| 519 |  |  | 
| 520 | Double_t xt,yt,xl,xh,yl,yh; | Double_t xt,yt,xl,xh,yl,yh; | 
| 521 |  |  | 
| 546 | yh =  33.0/2. ; | yh =  33.0/2. ; | 
| 547 | if ((yt>yl)&&(yt<yh)) { | if ((yt>yl)&&(yt<yh)) { | 
| 548 | for (Int_t i1=0; i1<8;i1++){ | for (Int_t i1=0; i1<8;i1++){ | 
| 549 | xl = tof11_x[i1] - (5.1-0.4)/2. ; | xl = tof11_x[i1] - (5.1-margin)/2. ; | 
| 550 | xh = tof11_x[i1] + (5.1-0.4)/2. ; | xh = tof11_x[i1] + (5.1-margin)/2. ; | 
| 551 | if ((xt>xl)&&(xt<xh))  paddleidoftrack=i1; | if ((xt>xl)&&(xt<xh))  paddleidoftrack=i1; | 
| 552 | } | } | 
| 553 | } | } | 
| 564 |  |  | 
| 565 | if ((xt>xl)&&(xt<xh)) { | if ((xt>xl)&&(xt<xh)) { | 
| 566 | for (Int_t i1=0; i1<6;i1++){ | for (Int_t i1=0; i1<6;i1++){ | 
| 567 | yl = tof12_y[i1] - (5.5-0.4)/2. ; | yl = tof12_y[i1] - (5.5-margin)/2. ; | 
| 568 | yh = tof12_y[i1] + (5.5-0.4)/2. ; | yh = tof12_y[i1] + (5.5-margin)/2. ; | 
| 569 | if ((yt>yl)&&(yt<yh))  paddleidoftrack=i1; | if ((yt>yl)&&(yt<yh))  paddleidoftrack=i1; | 
| 570 | } | } | 
| 571 | } | } | 
| 582 |  |  | 
| 583 | if ((xt>xl)&&(xt<xh)) { | if ((xt>xl)&&(xt<xh)) { | 
| 584 | for (Int_t i1=0; i1<2;i1++){ | for (Int_t i1=0; i1<2;i1++){ | 
| 585 | yl = tof21_y[i1] - (7.5-0.4)/2. ; | yl = tof21_y[i1] - (7.5-margin)/2. ; | 
| 586 | yh = tof21_y[i1] + (7.5-0.4)/2. ; | yh = tof21_y[i1] + (7.5-margin)/2. ; | 
| 587 | if ((yt>yl)&&(yt<yh))  paddleidoftrack=i1; | if ((yt>yl)&&(yt<yh))  paddleidoftrack=i1; | 
| 588 | } | } | 
| 589 | } | } | 
| 599 |  |  | 
| 600 | if ((yt>yl)&&(yt<yh)) { | if ((yt>yl)&&(yt<yh)) { | 
| 601 | for (Int_t i1=0; i1<2;i1++){ | for (Int_t i1=0; i1<2;i1++){ | 
| 602 | xl = tof22_x[i1] - (9.0-0.4)/2. ; | xl = tof22_x[i1] - (9.0-margin)/2. ; | 
| 603 | xh = tof22_x[i1] + (9.0-0.4)/2. ; | xh = tof22_x[i1] + (9.0-margin)/2. ; | 
| 604 | if ((xt>xl)&&(xt<xh))  paddleidoftrack=i1; | if ((xt>xl)&&(xt<xh))  paddleidoftrack=i1; | 
| 605 | } | } | 
| 606 | } | } | 
| 616 |  |  | 
| 617 | if ((yt>yl)&&(yt<yh)) { | if ((yt>yl)&&(yt<yh)) { | 
| 618 | for (Int_t i1=0; i1<3;i1++){ | for (Int_t i1=0; i1<3;i1++){ | 
| 619 | xl = tof31_x[i1] - (6.0-0.4)/2. ; | xl = tof31_x[i1] - (6.0-margin)/2. ; | 
| 620 | xh = tof31_x[i1] + (6.0-0.4)/2. ; | xh = tof31_x[i1] + (6.0-margin)/2. ; | 
| 621 | if ((xt>xl)&&(xt<xh))  paddleidoftrack=i1; | if ((xt>xl)&&(xt<xh))  paddleidoftrack=i1; | 
| 622 | } | } | 
| 623 | } | } | 
| 633 |  |  | 
| 634 | if ((xt>xl)&&(xt<xh)) { | if ((xt>xl)&&(xt<xh)) { | 
| 635 | for (Int_t i1=0; i1<3;i1++){ | for (Int_t i1=0; i1<3;i1++){ | 
| 636 | yl = tof32_y[i1] - (5.0-0.4)/2. ; | yl = tof32_y[i1] - (5.0-margin)/2. ; | 
| 637 | yh = tof32_y[i1] + (5.0-0.4)/2. ; | yh = tof32_y[i1] + (5.0-margin)/2. ; | 
| 638 | if ((yt>yl)&&(yt<yh)) paddleidoftrack=i1; | if ((yt>yl)&&(yt<yh)) paddleidoftrack=i1; | 
| 639 | } | } | 
| 640 | } | } |