Fork me on GitHub

Ignore:
Timestamp:
May 1, 2021, 2:15:02 PM (4 years ago)
Author:
Franco BEDESCHI <bed@…>
Branches:
master
Children:
46d3442
Parents:
53f4746
Message:

Fixed issue with backward generated tracks

File:
1 edited

Legend:

Unmodified
Added
Removed
  • external/TrackCovariance/TrkUtil.cc

    r53f4746 ra47edcc  
    4646        Double_t C = a / (2 * pt);                      // Half curvature
    4747        //std::cout << "ObsTrk::XPtoPar: fB = " << fB << ", a = " << a << ", pt = " << pt << ", C = " << C << std::endl;
    48         Double_t r2 = x.Perp2();
     48        Double_t r2 = x(0) * x(0) + x(1) * x(1);
    4949        Double_t cross = x(0) * p(1) - x(1) * p(0);
    5050        Double_t T = sqrt(pt * pt - 2 * a * cross + a * a * r2);
     
    6161        Double_t st = asin(B) / C;
    6262        Double_t ct = p(2) / pt;
    63         Double_t z0 = x(2) - ct * st;
     63        Double_t z0;
     64        Double_t dot = x(0) * p(0) + x(1) * p(1);
     65        if (dot > 0.0) z0 = x(2) - ct * st;
     66        else z0 = x(2) + ct * st;
    6467        //
    6568        Par(3) = z0;            // Store z0
     
    443446        TSpline3* sp3 = new TSpline3("sp3", bg, ncl, Npt);
    444447        if (begam > bg[0] && begam < bg[Npt - 1]) interp = sp3->Eval(begam);
    445         if(begam < bg[0]) interp = bg[0];
    446         if(begam > bg[Npt-1]) interp = bg[Npt-1];
    447448        return 100 * interp;
    448449}
Note: See TracChangeset for help on using the changeset viewer.