Changes in external/TrackCovariance/TrkUtil.cc [92b8d11:d3165fa] in git
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
external/TrackCovariance/TrkUtil.cc
r92b8d11 rd3165fa 1 1 #include "TrkUtil.h" 2 #include <iostream>3 2 4 3 // Constructor … … 32 31 Double_t cross = x(0) * p(1) - x(1) * p(0); 33 32 Double_t T = sqrt(pt * pt - 2 * a * cross + a * a * r2); 34 Double_t phi0 = atan2((p(1) - a * x(0)) / T, (p(0) + a * x(1)) / T); // Phi033 Double_t phi0 = TMath::ATan2((p(1) - a * x(0)) / T, (p(0) + a * x(1)) / T); // Phi0 35 34 Double_t D; // Impact parameter D 36 35 if (pt < 10.0) D = (T - pt) / a; … … 42 41 //Longitudinal parameters 43 42 Double_t B = C * sqrt(TMath::Max(r2 - D * D, 0.0) / (1 + 2 * C * D)); 44 Double_t st = asin(B) / C;43 Double_t st = TMath::ASin(B) / C; 45 44 Double_t ct = p(2) / pt; 46 45 Double_t z0 = x(2) - ct * st; … … 69 68 // 70 69 TVector3 Xval; 71 Xval(0) = -D * sin(phi0);72 Xval(1) = D * cos(phi0);70 Xval(0) = -D * TMath::Sin(phi0); 71 Xval(1) = D * TMath::Cos(phi0); 73 72 Xval(2) = z0; 74 73 // … … 77 76 // 78 77 TVector3 TrkUtil::ParToP(TVectorD Par) 79 {80 if (fBz == 0.0)81 std::cout << "TrkUtil::ParToP: Warning Bz not set" << std::endl;82 //83 return ParToP(Par,fBz);84 }85 //86 TVector3 TrkUtil::ParToP(TVectorD Par, Double_t Bz)87 78 { 88 79 Double_t C = Par(2); … … 91 82 // 92 83 TVector3 Pval; 93 Double_t pt = Bz * cSpeed() / TMath::Abs(2 * C);94 Pval(0) = pt * cos(phi0);95 Pval(1) = pt * sin(phi0);84 Double_t pt = fBz * cSpeed() / TMath::Abs(2 * C); 85 Pval(0) = pt * TMath::Cos(phi0); 86 Pval(1) = pt * TMath::Sin(phi0); 96 87 Pval(2) = pt * ct; 97 88 // … … 112 103 Double_t b = -cSpeed() * fBz / 2.; 113 104 pACTS(0) = 1000 * Par(0); // D from m to mm 114 pACTS(1) = 1000 * Par(3); 105 pACTS(1) = 1000 * Par(3); // z0 from m to mm 115 106 pACTS(2) = Par(1); // Phi0 is unchanged 116 pACTS(3) = atan2(1.0, Par(4)); // Theta in [0, pi] range107 pACTS(3) = TMath::ATan2(1.0, Par(4)); // Theta in [0, pi] range 117 108 pACTS(4) = Par(2) / (b * sqrt(1 + Par(4) * Par(4))); // q/p in GeV 118 109 pACTS(5) = 0.0; // Time: currently undefined
Note:
See TracChangeset
for help on using the changeset viewer.